This commit is contained in:
zhangmanman
2021-08-09 15:57:37 +08:00
parent c661dd0e16
commit 540d76bdb8
158 changed files with 4914 additions and 788 deletions

View File

@@ -34,6 +34,10 @@ Page({
this.indexNav(options.id,options.areaname,options.latitude,options.userlng)
this.setData({
isUser : getApp().globalData.isUser
})
},
/**
* 生命周期函数--监听页面显示
@@ -79,30 +83,27 @@ Page({
userNav(e){
let newid = e.currentTarget.dataset.id,
canFrom = e.currentTarget.dataset.from
wx.getStorage({
key : 'token',
success:res=>{
if(canFrom == 'washcar') {
wx.$api.index.washcarUrl('', newid).then(res=>{
const newUrl = res.data
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}`
});
})
} else {
// 跳转权益详情页
wx.navigateTo({
url: '/pages/rights/rights?rightsId=' + newid
})
}
},
fail: (err) => {
if(this.data.isUser){
if(canFrom == 'washcar') {
wx.$api.index.washcarUrl('', newid).then(res=>{
const newUrl = res.data
let url= encodeURIComponent(newUrl)
wx.redirectTo({
// 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}`
});
}).catch(err => {});
} else {
// 跳转权益详情页
wx.navigateTo({
url: "/pages/login/login"
url: '/pages/rights/rights?rightsId=' + newid
})
}
})
}else{
// 去登录
wx.navigateTo({
url: "/pages/login/login"
})
}
}
})