|
|
@ -1,6 +1,7 @@ |
|
|
import { getMemberExpenseList, getMemberInfo, buyMemberInfo } from "../../api/ztb" |
|
|
import { getMemberExpenseList, getMemberInfo, buyMemberInfo } from "../../api/ztb" |
|
|
const util = require('../../utils/util') |
|
|
const util = require('../../utils/util') |
|
|
const event = require('../../utils/event.js') |
|
|
const event = require('../../utils/event.js') |
|
|
|
|
|
const tdsdk = require('../../libs/tdweapp.js') |
|
|
const app = getApp() |
|
|
const app = getApp() |
|
|
|
|
|
|
|
|
Page({ |
|
|
Page({ |
|
|
@ -14,7 +15,8 @@ Page({ |
|
|
iconList: [], |
|
|
iconList: [], |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
divIndex:null, |
|
|
divIndex:null, |
|
|
vipInfo: null |
|
|
|
|
|
|
|
|
vipInfo: null, |
|
|
|
|
|
visible: false |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
@ -24,9 +26,11 @@ Page({ |
|
|
getMemberExpenseList().then(res => { |
|
|
getMemberExpenseList().then(res => { |
|
|
this.setData({ iconList: res.data, divIndex:res.data[0].id }) |
|
|
this.setData({ iconList: res.data, divIndex:res.data[0].id }) |
|
|
}).catch(err => { }) |
|
|
}).catch(err => { }) |
|
|
|
|
|
event.on('EventMessage', this, this.onEvent) |
|
|
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') |
|
|
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') |
|
|
}, |
|
|
}, |
|
|
onShow: function () { |
|
|
onShow: function () { |
|
|
|
|
|
tdsdk.Page.onShow() |
|
|
if(!app.globalData.userInfo){ |
|
|
if(!app.globalData.userInfo){ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -47,6 +51,17 @@ Page({ |
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
onEvent: function (message) { |
|
|
|
|
|
if(message.what == 200){ |
|
|
|
|
|
this.setData({ visible: true }) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onClose: function(){ |
|
|
|
|
|
this.setData({ visible: false }) |
|
|
|
|
|
}, |
|
|
|
|
|
onImageClick: function(){ |
|
|
|
|
|
wx.navigateBack() |
|
|
|
|
|
}, |
|
|
toAuthor: function(){ |
|
|
toAuthor: function(){ |
|
|
if(this.data.userInfo && !this.data.userInfo.isAuth){ |
|
|
if(this.data.userInfo && !this.data.userInfo.isAuth){ |
|
|
util.navigateTo('/pages/home/idcard/index') |
|
|
util.navigateTo('/pages/home/idcard/index') |
|
|
@ -84,10 +99,16 @@ Page({ |
|
|
} else { |
|
|
} else { |
|
|
app.globalData.userInfo.isVIP = 1 |
|
|
app.globalData.userInfo.isVIP = 1 |
|
|
event.emit('EventMessage', { what: 200, desc: 'Vip' }) |
|
|
event.emit('EventMessage', { what: 200, desc: 'Vip' }) |
|
|
util.showBackToast('会员购买成功') |
|
|
|
|
|
} |
|
|
} |
|
|
}).catch((e) => { |
|
|
}).catch((e) => { |
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
onHide: function(){ |
|
|
|
|
|
tdsdk.Page.onHide() |
|
|
|
|
|
}, |
|
|
|
|
|
onUnload: function(){ |
|
|
|
|
|
tdsdk.Page.onUnload() |
|
|
|
|
|
event.remove('EventMessage', this) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |