[更新]
This commit is contained in:
@@ -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"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user