Browse Source

Merge remote-tracking branch 'remotes/origin/developer' into developerA

zhengjinyi 1 year ago
parent
commit
2a6bb972b5

+ 2 - 2
components/cm-share-popup/cm-seller-modal.vue

@@ -69,7 +69,7 @@
 <script>
 export default {
     props: {
-        sellerUserId: {
+        suid: {
             type: Number,
             default: 0
         }
@@ -94,7 +94,7 @@ export default {
             uni.setStorageSync('sellerCardChange', 2)
         },
         initData() {
-            this.userId = this.sellerUserId || uni.getStorageSync('sellerUserId')
+            this.userId = this.suid || uni.getStorageSync('suid')
             if(this.userId > 0) {
                 this.getUserInfo()
                 if (uni.getStorageSync('sellerCardChange') === 1) {

+ 1 - 1
components/cm-share-popup/cm-share-popup.vue

@@ -107,7 +107,7 @@ export default {
                     this.posterData = { ...this.posterData, ...this.data }
                     const { data: qrCodeImage } = await generateWxUnlimited(this, {
                         pagePath: this.posterData.path,
-                        queryStr: 'sellerUserId=' + this.userInfo.userId + '&id=' + this.posterData.id
+                        queryStr: 'suid=' + this.userInfo.userId + '&id=' + this.posterData.id + '&spId=' + this.userInfo.serviceProviderId
                     })
                     this.posterData.qrCodeImage = qrCodeImage
                     switch (this.type) {

+ 21 - 25
pages/goods/product.vue

@@ -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>

+ 6 - 1
pages/login/register.vue

@@ -171,7 +171,7 @@ export default {
                 source: 1,
                 unionId: '',
                 isSp: 1,
-                spId: uni.getStorageSync('sellerUserId') || '', // 协销分享的id
+                spId: '', // 协销分享的id
             },
             imageCode: '', //图形验证码
             imageCodeUrl: '', //图形验证码图片
@@ -249,6 +249,11 @@ export default {
                     self.wxLogin(res.userInfo)
                     self.params.nickName = res.userInfo.nickName
                     self.params.avatarUrl = res.userInfo.avatarUrl
+					console.log('spId', uni.getStorageSync('spId'))
+                    if (uni.getStorageSync('spId') * 1 > 0) {
+                        self.params.spId = uni.getStorageSync('spId') * 1
+                    }
+					console.log('params', self.params)
                     self.UserRegisterClub(self.params)
                     // 友盟自定义事件
                     if (process.env.NODE_ENV != 'development') {

+ 1 - 5
pages/seller/index/index.vue

@@ -100,11 +100,7 @@ export default {
     computed: {
         ...mapState(['userInfo'])
     },
-    // onShow() {
-    //     this.updateSellerNoticeNum() // 消息通知
-    // },
 	methods: {
-        // ...mapMutations(['updateSellerNoticeNum']),
 		// 切换组件
 		cut_index(type) {
 			this.show_index = type
@@ -148,7 +144,7 @@ export default {
 		}
 		return {
 			title: '生美医美正品采购服务平台',
-			path: `pages/tabBar/home/index?type=sellerShare&sellerUserId=${this.userInfo.userId || 0}`,
+			path: `pages/tabBar/home/index?type=4&suid=${this.userInfo.userId}&spId=${this.userInfo.serviceProviderId}`,
 			imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
 		}
 	}

+ 3 - 2
pages/seller/notice/components/trajectory.vue

@@ -10,7 +10,7 @@
                     <image :src="item.titleImage || '../../../../static/temp/icon-new@2x.png'" class="axis-product" mode=""></image>
                     <view class="axis-product-info">
                         <view class="product-title">【{{item.pageType | pageTypeChange}}】</view>
-                        <view class="product-info">{{item.title}}</view>
+                        <view class="product-info" v-if="item.title">{{item.title}}</view>
                     </view>
                 </view>
             </template>
@@ -34,7 +34,8 @@ export default {
         pageTypeChange(val) {
             const obj = {
                 '6': '商品',
-                '11': '文章'
+                '11': '文章',
+                '8': '搜索记录'
             }
             return obj[val]
         }

+ 19 - 16
pages/seller/notice/service/Institutional_visits.vue

@@ -22,15 +22,18 @@ export default {
         return {
             visitsList: [],
             accDateTime: '',
-            userInfo: {}
+            spId: ''
         }
     },
-    onLoad(options) {
-        this.accDateTime = options.accDateTime
-    },
-    mounted() {
-        this.userInfo = uni.getStorageSync('userInfo')
-        this.getVisitesClubList()
+    async onLoad(options) {
+        this.spId = options.spId
+        const { data } = await this.SellerService.getVisitesClubList({
+            spId: options.spId,
+            accDateTime: options.accDateTime
+        })
+        this.visitsList = data
+        this.accDateTime = data[0].accessDate
+		console.log('options', options, 'visitsList', data)
     },
     onReachBottom() {
     },
@@ -41,23 +44,23 @@ export default {
     },
     methods: {
         handlerVisits($event) {
-            uni.setStorageSync('visitsInfo', JSON.stringify($event))
             this.$api.navigateTo(
                 '/pages/seller/notice/service/visits_details?spId=' +
-                    this.userInfo.serviceProviderId +
+                    this.spId +
                     '&clubId=' +
                     $event.clubId +
                     '&accessTime=' +
                     $event.accessTime.substr(0, 10)
             )
         },
-        async getVisitesClubList() {
-            const { data } = await this.SellerService.getVisitesClubList({
-                spId: this.userInfo.serviceProviderId,
-                accDateTime: this.accDateTime
-            })
-            this.visitsList = data
-        }
+		async getVisitesClubList() {
+			const { data } = await this.SellerService.getVisitesClubList({
+			    spId: options.spId,
+			    accDateTime: options.accDateTime
+			})
+			this.visitsList = data
+			console.log('visitsList', this.visitsList)
+		}
     }
 }
 </script>

+ 18 - 2
pages/seller/notice/service/visits_details.vue

@@ -27,10 +27,20 @@ export default {
             detailList: []
         }
     },
-    onLoad(options) {
+    async onLoad(options) {
         this.accessTime = options.accessTime
         this.spId = options.spId
         this.clubId = options.clubId
+		const { data } = await this.SellerService.getVisitesClubInfo({accessTime: options.accessTime, spId: options.spId, clubId: options.clubId})
+		this.detailList = data
+		this.visitsInfo = {
+		    image: data[0].image,
+		    linkMan: data[0].linkMan,
+		    contractMobile: data[0].contractMobile,
+		    pageLabel: data[0].pageLabel,
+            name: data[0].name
+		}
+		console.log('options', options, 'visitsInfo', data, '详情', this.visitsInfo)
     },
     mounted() {
         this.getVisitesClubDetail()
@@ -38,9 +48,15 @@ export default {
     methods: {
         handlerVisits($event) {},
         async getVisitesClubDetail() {
-            this.visitsInfo = JSON.parse(uni.getStorageSync('visitsInfo')) || {}
             const {data} = await this.SellerService.getVisitesClubInfo({accessTime: this.accessTime, spId: this.spId, clubId: this.clubId})
             this.detailList = data
+            this.visitsInfo = {
+                image: data[0].image,
+                linkMan: data[0].linkMan,
+                contractMobile: data[0].contractMobile,
+                pageLabel: data[0].pageLabel
+            }
+            console.log('visitsInfo', data)
         }
     }
 }

+ 20 - 22
pages/tabBar/home/index.vue

@@ -49,7 +49,7 @@
 			:beanNumber="beanNumber"
 			@cancel="handleBeanlClick"
 		></activityBean>
-        <cm-seller-modal :sellerUserId="sellerUserId"></cm-seller-modal>
+        <cm-seller-modal :suid="suid"></cm-seller-modal>
 	</view>
 </template>
 
@@ -127,30 +127,12 @@ export default {
 			couponEntry: 2,
 			autoplay: true,
             isScroll: false,
-            sellerUserId: 0, // 协销id
+            suid: 0, // 协销id
+            options: {}, // 分享数据
 		}
 	},
 	onLoad(option) {
-        console.log('options', option)
-        if(!uni.getStorageSync('sellerUserId')) {
-            uni.setStorageSync('sellerUserId', option.sellerUserId || 0)
-        }
-    },
-    onShow() {
-        if (!uni.getStorageSync('spUserId')) {
-            this.sellerUserId = uni.getStorageSync('sellerUserId')
-        } else {
-            if (uni.getStorageSync('spUserId') === uni.getStorageSync('sellerUserId')) {
-                this.sellerUserId = uni.getStorageSync('sellerUserId')
-            } else {
-                uni.setStorageSync('sellerUserId', 0)
-                this.sellerUserId = 0
-            }
-        }
-        if (this.userInfo.userIdentity === 1) {
-            this.sellerUserId = 0
-            uni.setStorageSync('sellerUserId', 0)
-        }
+        this.options = option
     },
     computed: {
         ...mapState(['hasLogin', 'userInfo'])
@@ -192,6 +174,22 @@ export default {
 	onShow() {
 		this.autoplay = true
 		this.GetWxAuthorize()
+		const suid = this.options.suid ? this.options.suid : uni.getStorageSync('suid') * 1 ? uni.getStorageSync('suid') * 1 : 0 // 协销userId
+		const spId = this.options.spId ? this.options.spId : uni.getStorageSync('spId') * 1 ? uni.getStorageSync('spId') * 1 : 0 // 协销id
+		const isShare = this.options.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('suid', 0)
+		        this.suid = 0
+		        uni.setStorageSync('spId', 0)
+		    }
+		    
+		}
+		console.log(this.suid, "uni.getStorageSync('spId')", uni.getStorageSync('spId'))
 	},
 	onHide() {
 		this.autoplay = false