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