Browse Source

crm-Updated

yun-mo 1 year ago
parent
commit
4b1f58b45d

+ 2 - 2
main.js

@@ -9,7 +9,7 @@ import ResidenceTime from './plugins/simple-residence-time'
 import residence from './utils/residence.js'
 
 // 友盟
-// import Uma from './plugins/uma'
+import Uma from './plugins/uma'
 
 // 公共组件 全局组件
 import { msg, modal, prePage, boundingClientRect } from './utils/util'
@@ -58,7 +58,7 @@ Vue.prototype.$Static = 'https://static.caimei365.com/app/img/'
 App.mpType = 'app'
 
 // 使用插件
-// Vue.use(Uma)
+Vue.use(Uma)
 Vue.use(ResidenceTime, residence)
 
 

+ 6 - 6
pages/goods/product.vue

@@ -1608,11 +1608,11 @@ export default {
             this.initGetStotage()
         }
         this.isPreviewImage = false
-        console.log('userInfo', this.userInfo, this.options, this.scene, "uni.getStorageSync('suid')", uni.getStorageSync('suid'))
-        const suid = this.options.suid ? this.options.suid : this.scene.suid ? this.scene.suid : uni.getStorageSync('suid') > 0 ? uni.getStorageSync('suid') : 0 // 协销userId
-        const spId = this.options.spId ? this.options.spId : this.scene.spId ? this.scene.spId : uni.getStorageSync('spId') > 0 ? uni.getStorageSync('spId') : 0 // 协销id
-        if ((this.options.type == 4 || uni.getStorageSync('suid') > 0) && this.userInfo.userIdentity !== 1) { // 分享进入 且 用户非协销
-            if (!uni.getStorageSync('spUserId') || (uni.getStorageSync('spUserId') === uni.getStorageSync('suid'))) {// 如果未分配或者分配相同
+        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)
@@ -1623,7 +1623,7 @@ export default {
             }
             
         }
-        console.log(this.suid)
+        console.log(this.suid, "uni.getStorageSync('spId')", uni.getStorageSync('spId'))
     }
 }
 </script>

+ 4 - 2
pages/login/register.vue

@@ -249,9 +249,11 @@ export default {
                     self.wxLogin(res.userInfo)
                     self.params.nickName = res.userInfo.nickName
                     self.params.avatarUrl = res.userInfo.avatarUrl
-                    if (uni.getStorageSync('spId') && uni.getStorageSync('spId') > 0) {
-                        self.params.spId = uni.getStorageSync('spId')
+					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') {

+ 15 - 11
pages/seller/notice/service/Institutional_visits.vue

@@ -26,15 +26,18 @@ export default {
             spId: ''
         }
     },
-    onLoad(options) {
+    async onLoad(options) {
         this.accDateTime = options.accDateTime
         this.spId = options.spId
-        console.log('options',options)
+        const { data } = await this.SellerService.getVisitesClubList({
+            spId: options.spId,
+            accDateTime: options.accDateTime
+        })
+        this.visitsList = data
+		console.log('options', options, 'visitsList', data)
     },
     mounted() {
         this.userInfo = uni.getStorageSync('userInfo')
-        this.getVisitesClubList()
-        console.log('visitsList', this.visitsList)
     },
     onReachBottom() {
     },
@@ -54,13 +57,14 @@ export default {
                     $event.accessTime.substr(0, 10)
             )
         },
-        async getVisitesClubList() {
-            const { data } = await this.SellerService.getVisitesClubList({
-                spId: this.spId,
-                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>

+ 10 - 1
pages/seller/notice/service/visits_details.vue

@@ -27,10 +27,19 @@ 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
+		}
+		console.log('options', options, 'visitsInfo', data, '详情', this.visitsInfo)
     },
     mounted() {
         this.getVisitesClubDetail()

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

@@ -69,7 +69,6 @@ import activityAlert from '@/components/cm-module/activity/activity.vue'
 import activityBean from '@/components/cm-module/activity/activityBean.vue'
 import quickOpera from '@/components/cm-module/homeIndex/quickOperation.vue'
 import cmSellerModal from '@/components/cm-share-popup/cm-seller-modal.vue'
-import wxLogin from '@/common/config/wxLogin.js'
 import homeMiXins from './index.js'
 export default {
 	mixins: [ homeMiXins ], 
@@ -135,25 +134,6 @@ export default {
 	onLoad(option) {
         this.options = option
     },
-    onShow() {
-        wxLogin.wxLoginAuthorize()
-        console.log('userInfo', this.userInfo, this.options, this.scene, "uni.getStorageSync('suid')", uni.getStorageSync('suid'))
-        const suid = this.options.suid ? this.options.suid : uni.getStorageSync('suid') > 0 ? uni.getStorageSync('suid') : 0 // 协销userId
-        const spId = this.options.spId ? this.options.spId : uni.getStorageSync('spId') > 0 ? uni.getStorageSync('spId') : 0 // 协销id
-        if ((this.options.type == 4 || uni.getStorageSync('suid') > 0) && this.userInfo.userIdentity !== 1) { // 分享进入 且 用户非协销
-            if (!uni.getStorageSync('spUserId') || (uni.getStorageSync('spUserId') === uni.getStorageSync('suid'))) {// 如果未分配或者分配相同
-                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)
-    },
     computed: {
         ...mapState(['hasLogin', 'userInfo'])
     },
@@ -194,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