完善商品邀请

This commit is contained in:
2021-10-29 15:21:09 +08:00
parent f2eafd91f1
commit 18fc1f2239
2 changed files with 21 additions and 1 deletions

10
App.vue
View File

@@ -29,6 +29,7 @@
onShow() {
uni.getClipboardData({
success: res=> {
// 包含分享邀请码
if(res.data.indexOf('$InviTaTiOn$CoDe/$-?') === 2){
let parentId = res.data.replace('$InviTaTiOn$CoDe/$-?', '')
this.globalData.parentId = parentId.substr(0, 10)
@@ -39,6 +40,15 @@
this.$Router.push({name: 'goodsDetails', params: {id: goodsId}})
}, 1000)
}
return
}
// 不包含用户信息
if(res.data.indexOf('&GoodsId/$-?') > -1){
let goodsId = res.data.substr(12, res.data.length - 1)
setTimeout(() => {
if(this.$Route.name === 'goodsDetails' && this.$Route.query.id === goodsId) return
this.$Router.push({name: 'goodsDetails', params: {id: goodsId}})
}, 1000)
}
}
})