优化
This commit is contained in:
+3
-60
@@ -21,72 +21,15 @@ Page({
|
||||
let url = e.currentTarget.dataset.url;
|
||||
wx.setStorageSync('usertype', usertype);
|
||||
wx.setStorageSync('next_url', url);
|
||||
let user_uuid = wx.getStorageSync('user_id');
|
||||
console.log(user_uuid);
|
||||
if(user_uuid){
|
||||
let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
|
||||
console.log(token);
|
||||
if(token){
|
||||
wx.switchTab({
|
||||
url: url
|
||||
})
|
||||
}else{
|
||||
app.go(app.globalData.login_url);
|
||||
}
|
||||
},
|
||||
bindGetUserInfo(){
|
||||
wx.getUserInfo({
|
||||
success: function(res) {
|
||||
var userInfo = res.userInfo
|
||||
var nickName = userInfo.nickName
|
||||
var avatarUrl = userInfo.avatarUrl
|
||||
var gender = userInfo.gender //性别 0:未知、1:男、2:女
|
||||
var province = userInfo.province
|
||||
var city = userInfo.city
|
||||
var country = userInfo.country
|
||||
console.log(res.userInfo)
|
||||
}
|
||||
})
|
||||
},
|
||||
shenfang(){
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: [
|
||||
"5Tl-xmaWXrKP5BB8E6b3oTdPHbHa7WYWbmvZiuz4TLs",
|
||||
"kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40"
|
||||
],
|
||||
success(res){
|
||||
console.log(res)
|
||||
},
|
||||
fail(res){
|
||||
console.log(res)
|
||||
},
|
||||
complete(res){
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
},
|
||||
yici(){
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: [
|
||||
"jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM",
|
||||
"JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc"
|
||||
],
|
||||
success(res){
|
||||
console.log(res)
|
||||
},
|
||||
fail(res){
|
||||
console.log(res)
|
||||
},
|
||||
complete(res){
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
},
|
||||
check(){
|
||||
wx.getSetting({
|
||||
withSubscriptions: true,
|
||||
success (res) {
|
||||
console.log(res.authSetting)
|
||||
console.log(res.subscriptionsSetting)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
@@ -26,10 +26,6 @@
|
||||
<t-loading slot="loading" theme="circular" size="40rpx" loading />
|
||||
</t-image>
|
||||
</view>
|
||||
|
||||
<!-- <button bindtap="shenfang">审方提醒(长期)</button>
|
||||
<button bindtap="yici">患者回复通知(一次)</button>
|
||||
<button bindtap="check">获取订阅状态</button> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user