Browse Source

商品详情

devlop
邓雄飞 4 years ago
parent
commit
661be27120
2 changed files with 17 additions and 14 deletions
  1. 9
      pages/paper-details/index.vue
  2. 22
      store/index.js

9
pages/paper-details/index.vue

@ -5,7 +5,7 @@
<uni-swiper-dot :info="info.imgList" :current="current" field="content" mode="indexes" style="height: 100%">
<swiper class="swiper-box" @change="swiperChange" style="height: 100%">
<swiper-item v-for="(item, index) in info.imgList" :key="index">
<view class="" @tap="previewImg(index, info.imgList)">
<view class="" @tap="item != '' && previewImg(index, info.imgList)">
<image class="image" :src="item || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default.png'" mode=""></image>
</view>
</swiper-item>
@ -227,6 +227,13 @@ export default {
return value == 1 ? '张' : '吨'
}
},
onShow() {
setTimeout(() => {
uni.showToast({
title: window.location.href
})
}, 2000)
},
onLoad(option) {
if (option.paperId) {
this.params.productId = option.paperId

22
store/index.js

@ -29,13 +29,7 @@ let qnToken = null,
* @value id 当前被分享的供应商账号id
*/
userId = null
const companyInfoParams = [
'id',
'name',
'fddEnterpriseStatus',
'isVip',
'vipExpireTime'
]
const companyInfoParams = ['id', 'name', 'fddEnterpriseStatus', 'isVip', 'vipExpireTime']
const userInfoParams = ['name', 'userId', 'mobile', 'avatar']
try {
uecToken = uni.getStorageSync('uecToken')
@ -187,12 +181,14 @@ const store = new Vuex.Store({
uni.setStorageSync('companyInfo', JSON.stringify(companyInfo))
state.companyInfo = companyInfo
// 绑定供应商销售账号
bindUser({
customerEnterpriseId: companyInfo.id,
sellerId: state.userId,
sellerSupplierId: state.supplierId,
customerId: state.userId
})
if (state.userId && state.userInfo.userId) {
bindUser({
customerEnterpriseId: companyInfo.id,
sellerId: state.userId,
sellerSupplierId: state.supplierId,
customerId: state.userInfo.userId
})
}
} catch (e) {
console.error('设置companyInfo失败:', e)
}

Loading…
Cancel
Save