dengjie commit : 代码完善
This commit is contained in:
@@ -56,7 +56,6 @@
|
||||
</view>
|
||||
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -83,16 +82,20 @@
|
||||
//获取详情信息
|
||||
getProductDetail() {
|
||||
this.$apiServe.getProductDetail(this.id).then(res => {
|
||||
console.log('详情页', res.data.data)
|
||||
// console.log('产品详情页', res.data.data)
|
||||
if (res.data.data.thumb) {
|
||||
this.isThumb = true
|
||||
}
|
||||
let detail = res.data.data
|
||||
detail.pub_time = dateFormatDetail(detail.pub_time)
|
||||
let tag = detail.tags
|
||||
this.tagsArray = tag.split(',')
|
||||
detail.tags = this.tagsArray
|
||||
this.detailList = res.data.data
|
||||
if (res.data.data) {
|
||||
let detail = res.data.data
|
||||
detail.pub_time = dateFormatDetail(detail.pub_time)
|
||||
let tag = detail.tags
|
||||
this.tagsArray = tag.split(',')
|
||||
detail.tags = this.tagsArray
|
||||
this.detailList = res.data.data
|
||||
} else {
|
||||
this.$toast.warn('没有更多详情了')
|
||||
}
|
||||
}).finally(_ => {})
|
||||
},
|
||||
//收藏按钮
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
<!-- 分类模块 -->
|
||||
<view class="classify">
|
||||
<u-grid :border="false" col="5">
|
||||
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="toClassify(listItem.id)">
|
||||
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex"
|
||||
@click="toClassify(listItem.id)">
|
||||
<u--image :src="imgUrl+listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
|
||||
</u--image>
|
||||
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
|
||||
@@ -26,11 +27,6 @@
|
||||
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular></u-swiper>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view style="width: 100px; height: 100px; z-index: 999;">
|
||||
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
||||
获取电话号码</u-button>
|
||||
</view> -->
|
||||
<!-- 选项卡: 上架时间和点赞量 -->
|
||||
<view>
|
||||
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
|
||||
@@ -49,7 +45,6 @@
|
||||
import {
|
||||
serverHost
|
||||
} from '@/service/request.js'
|
||||
import loginVue from '../my/login/login.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -80,7 +75,6 @@
|
||||
this.getCategories()
|
||||
this.getBanner()
|
||||
this.getImgUrl()
|
||||
this.getToken()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
methods: {
|
||||
@@ -114,42 +108,6 @@
|
||||
this.$refs.getProductsByTime.productList.push(...res.data.data)
|
||||
})
|
||||
},
|
||||
//获取token
|
||||
getToken() {
|
||||
var that = this
|
||||
uni.login({
|
||||
"provider": "weixin",
|
||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||
success: function(event) {
|
||||
const {
|
||||
code
|
||||
} = event
|
||||
that.$apiServe.login({
|
||||
code: code
|
||||
}).then(res => {
|
||||
var data = res.data.data
|
||||
// console.log('登录code换取的信息', data);
|
||||
uni.setStorageSync('token', data.token);
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
// 登录授权失败
|
||||
// err.code是错误码
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取手机code
|
||||
getphonenumber(e) {
|
||||
let that = this
|
||||
// const {
|
||||
// code
|
||||
// } = e.detail;
|
||||
// console.log("手机code : ", code);
|
||||
},
|
||||
//获取子组件的getProducts方法返回数据的length,用于当length为0时取消发送请求
|
||||
// getChild(e) {
|
||||
// this.reachBottomLength = e
|
||||
// },
|
||||
//获取一级分类
|
||||
getCategories() {
|
||||
this.$apiServe.getCategories().then(res => {
|
||||
@@ -178,6 +136,7 @@
|
||||
url: '../../packageSearch/goods-category-search/category-index?categoryId=' + id
|
||||
})
|
||||
},
|
||||
//获取图片url
|
||||
getImgUrl() {
|
||||
this.$apiServe.getImgUrl().then(res => {
|
||||
try {
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
@click="showModal()">
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
<u-modal :show="showM" showCancelButton closeOnClickOverlay confirmText="是" cancelText="否"
|
||||
<u-modal :show="showM" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
||||
@confirm="confirm" @cancel="cancel" @close="close">
|
||||
<view>
|
||||
<text>{{phone}}</text>
|
||||
<view>{{phone}}</view>
|
||||
<text>是否拨打客服电话</text>
|
||||
</view>
|
||||
</u-modal>
|
||||
@@ -101,6 +101,10 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.u-navbar__content__left {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.table {
|
||||
background-color: #fff;
|
||||
margin-top: 50rpx;
|
||||
|
||||
Reference in New Issue
Block a user