Commit 972be5f7 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 30bde367
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
sourceType: '', sourceType: '',
slotParam: '', slotParam: '',
vipList: [], vipList: [],
localToken: '',
appName: '河狸小故事', appName: '河狸小故事',
isVip: false isVip: false
} }
...@@ -69,8 +70,26 @@ ...@@ -69,8 +70,26 @@
}, },
onShow(options) { onShow(options) {
this.ttLoging() this.ttLoging()
this.isVipStatus()
}, },
methods: { methods: {
isVipStatus() {
if (this.sourceType == 'android' && this.localToken) {
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
if (data.expireTime > 0) {
that.isVip = true
} else {
that.isVip = false
}
}
});
}
},
ttLoging() { ttLoging() {
var that = this; var that = this;
var obj = wx.getLaunchOptionsSync() var obj = wx.getLaunchOptionsSync()
...@@ -111,6 +130,7 @@ ...@@ -111,6 +130,7 @@
data data
}) => { }) => {
app.globalData.userId = data.idcode; app.globalData.userId = data.idcode;
that.localToken = data.token;
saveToken(data.token) saveToken(data.token)
// saveToken( // saveToken(
// 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997' // 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997'
...@@ -119,12 +139,7 @@ ...@@ -119,12 +139,7 @@
// that.handlePay() // that.handlePay()
if (data.activiteFlag == 101) { if (data.activiteFlag == 101) {
if (data.expireTime > 0) { that.handlePay()
that.isVip = true
} else {
that.isVip = false
that.handlePay()
}
} else { } else {
setTimeout(() => { setTimeout(() => {
redirectTo('home?activiteFlag=' + data redirectTo('home?activiteFlag=' + data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment