调整商品邀请
This commit is contained in:
54
App.vue
54
App.vue
@@ -2,33 +2,53 @@
|
||||
export default {
|
||||
onLaunch() {
|
||||
//#ifdef H5
|
||||
if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
|
||||
handleFontSize()
|
||||
} else {
|
||||
document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
|
||||
}
|
||||
function handleFontSize() {
|
||||
// 设置网页字体为默认大小
|
||||
if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
|
||||
handleFontSize()
|
||||
} else {
|
||||
document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
|
||||
}
|
||||
function handleFontSize() {
|
||||
// 设置网页字体为默认大小
|
||||
WeixinJSBridge.invoke('setFontSizeCallback', {
|
||||
fontSize: 0
|
||||
})
|
||||
// 重写设置网页字体大小的事件
|
||||
WeixinJSBridge.on('menu:setfont', function() {
|
||||
WeixinJSBridge.invoke('setFontSizeCallback', {
|
||||
fontSize: 0
|
||||
})
|
||||
// 重写设置网页字体大小的事件
|
||||
WeixinJSBridge.on('menu:setfont', function() {
|
||||
WeixinJSBridge.invoke('setFontSizeCallback', {
|
||||
fontSize: 0
|
||||
})
|
||||
})
|
||||
}
|
||||
//#endif
|
||||
})
|
||||
}
|
||||
//#endif
|
||||
|
||||
//#ifdef APP-PLUS
|
||||
|
||||
console.log('检查更新')
|
||||
//#endif
|
||||
},
|
||||
onShow() {
|
||||
console.log('App Show');
|
||||
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)
|
||||
if(res.data.indexOf('&GoodsId/$-?') === 30){
|
||||
let goodsId = res.data.substr(42, 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onHide() {
|
||||
console.log('App Hide');
|
||||
},
|
||||
globalData: {
|
||||
mainColor: 'white'
|
||||
mainColor: 'white',
|
||||
parentId:''
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user