|
@@ -23,39 +23,40 @@ Page({
|
|
|
// 跳转页面
|
|
|
toPath: function (e) {
|
|
|
const { data } = e.currentTarget.dataset;
|
|
|
- if (data.is_routine && data.is_routine == '1') {
|
|
|
- wx.getStorage({
|
|
|
- key: 'user',
|
|
|
- success: res => {
|
|
|
- if (res.data) {
|
|
|
- const { openid } = app.globalData.wxInfo;
|
|
|
- wx.request({
|
|
|
- url: app.globalData.publicUrl + `/api/hc/user/update/${res.data.id}`,
|
|
|
- method: "post",
|
|
|
- data: { openid: openid },
|
|
|
- header: {},
|
|
|
- success: (res) => {
|
|
|
- if (res.data.errcode == '0') {
|
|
|
- wx.showToast({ title: `绑定微信成功`, icon: 'success', duration: 2000 })
|
|
|
- } else {
|
|
|
- wx.showToast({ title: `${res.data.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (data.is_routine && data.is_routine == '2') {
|
|
|
- wx.clearStorage({
|
|
|
- key: 'user',
|
|
|
- success: res => {
|
|
|
- wx.showToast({ title: `退出登录成功`, icon: 'success', duration: 2000 })
|
|
|
- wx.redirectTo({ url: '/pages/login/index', })
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.navigateTo({ url: `/pages/${data.router}/index` })
|
|
|
- }
|
|
|
+ wx.navigateTo({ url: `/pages/${data.router}/index` })
|
|
|
+ // if (data.is_routine && data.is_routine == '1') {
|
|
|
+ // wx.getStorage({
|
|
|
+ // key: 'user',
|
|
|
+ // success: res => {
|
|
|
+ // if (res.data) {
|
|
|
+ // const { openid } = app.globalData.wxInfo;
|
|
|
+ // wx.request({
|
|
|
+ // url: app.globalData.publicUrl + `/api/hc/user/update/${res.data.id}`,
|
|
|
+ // method: "post",
|
|
|
+ // data: { openid: openid },
|
|
|
+ // header: {},
|
|
|
+ // success: (res) => {
|
|
|
+ // if (res.data.errcode == '0') {
|
|
|
+ // wx.showToast({ title: `绑定微信成功`, icon: 'success', duration: 2000 })
|
|
|
+ // } else {
|
|
|
+ // wx.showToast({ title: `${res.data.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else if (data.is_routine && data.is_routine == '2') {
|
|
|
+ // wx.clearStorage({
|
|
|
+ // key: 'user',
|
|
|
+ // success: res => {
|
|
|
+ // wx.showToast({ title: `退出登录成功`, icon: 'success', duration: 2000 })
|
|
|
+ // wx.redirectTo({ url: '/pages/login/index', })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // wx.navigateTo({ url: `/pages/${data.router}/index` })
|
|
|
+ // }
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|