|
@@ -618,7 +618,7 @@
|
|
|
<cm-share-popup ref="sharePopup" :data="posterData" type="product"></cm-share-popup>
|
|
|
|
|
|
<!-- 协销名片 -->
|
|
|
- <cm-seller-modal :sellerUserId="sellerUserId"></cm-seller-modal>
|
|
|
+ <cm-seller-modal :suid="suid"></cm-seller-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -777,8 +777,9 @@ export default {
|
|
|
returnGoodsStutas: false,
|
|
|
helpContent: '',
|
|
|
posterData: {}, // 商品详情
|
|
|
- sellerUserId: 0 ,// 协销id
|
|
|
- scene: {} //获取二维码参数
|
|
|
+ suid: 0 ,// 协销id
|
|
|
+ scene: {} ,//获取二维码参数
|
|
|
+ options: {},
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -831,14 +832,7 @@ export default {
|
|
|
if (option.page == 2) {
|
|
|
this.backPage = option.page
|
|
|
}
|
|
|
- const sellerUserId = option.sellerUserId ? option.sellerUserId : this.scene.sellerUserId ? this.scene.sellerUserId : 0
|
|
|
- if(!uni.getStorageSync('sellerUserId')) {
|
|
|
- uni.setStorageSync('sellerUserId', sellerUserId)
|
|
|
- }
|
|
|
- console.log('sellerUserId', uni.getStorageSync('sellerUserId'), sellerUserId)
|
|
|
- // if (!uni.getStorageSync('sellerCardChange')) {
|
|
|
- // uni.setStorageSync('sellerCardChange', 1)
|
|
|
- // }
|
|
|
+ this.options = option.scene ? this.scene : option
|
|
|
this.getWinHeight()
|
|
|
},
|
|
|
onReady() {
|
|
@@ -1409,7 +1403,7 @@ export default {
|
|
|
this.posterData = {
|
|
|
productName: this.product.name,
|
|
|
productImage: this.productImage[0],
|
|
|
- sellerUserId: this.sellerUserId,
|
|
|
+ suid: this.suid,
|
|
|
path: 'pages/goods/product',
|
|
|
id: this.productId
|
|
|
}
|
|
@@ -1601,9 +1595,9 @@ export default {
|
|
|
}
|
|
|
return {
|
|
|
title: `${this.product.name}`,
|
|
|
- path: `pages/goods/product?type=share&id=${this.productId}&sellerUserId=${
|
|
|
+ path: `pages/goods/product?type=4&id=${this.productId}&suid=${
|
|
|
this.userInfo.userIdentity === 1 ? this.userInfo.userId : 0
|
|
|
- }`,
|
|
|
+ }&spId=${this.userInfo.userIdentity === 1 ? this.userInfo.serviceProviderId : 0}`,
|
|
|
imageUrl: `${this.productImage[0]}`
|
|
|
}
|
|
|
},
|
|
@@ -1614,20 +1608,22 @@ export default {
|
|
|
this.initGetStotage()
|
|
|
}
|
|
|
this.isPreviewImage = false
|
|
|
- if (!uni.getStorageSync('spUserId')) {
|
|
|
- this.sellerUserId = uni.getStorageSync('sellerUserId')
|
|
|
- } else {
|
|
|
- if (uni.getStorageSync('spUserId') === uni.getStorageSync('sellerUserId')) {
|
|
|
- this.sellerUserId = uni.getStorageSync('sellerUserId')
|
|
|
+ const suid = this.options.suid ? this.options.suid : this.scene.suid ? this.scene.suid : uni.getStorageSync('suid') * 1 ? uni.getStorageSync('suid') * 1 : 0 // 协销userId
|
|
|
+ const spId = this.options.spId ? this.options.spId : this.scene.spId ? this.scene.spId : uni.getStorageSync('spId') * 1 ? uni.getStorageSync('spId') * 1 : 0 // 协销id
|
|
|
+ const isShare = this.options.type == 4 ? true : this.scene.type == 4 ? true : false //是否从分享页进入
|
|
|
+ if ((isShare || uni.getStorageSync('suid') * 1 > 0) && this.userInfo.userIdentity !== 1) { // 分享进入 且 用户非协销 或不是从分享进入有缓存
|
|
|
+ if (!uni.getStorageSync('spUserId') || (uni.getStorageSync('spUserId') * 1 === uni.getStorageSync('suid') * 1)) {// 如果未分配或者分配相同
|
|
|
+ this.suid = suid
|
|
|
+ uni.setStorageSync('suid', suid)
|
|
|
+ uni.setStorageSync('spId', spId)
|
|
|
} else {
|
|
|
- uni.setStorageSync('sellerUserId', 0)
|
|
|
- this.sellerUserId = 0
|
|
|
+ uni.setStorageSync('suid', 0)
|
|
|
+ this.suid = 0
|
|
|
+ uni.setStorageSync('spId', 0)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
- if (this.userInfo.userIdentity === 1) {
|
|
|
- this.sellerUserId = 0
|
|
|
- uni.setStorageSync('sellerUserId', 0)
|
|
|
- }
|
|
|
+ console.log(this.suid, "uni.getStorageSync('spId')", uni.getStorageSync('spId'))
|
|
|
}
|
|
|
}
|
|
|
</script>
|