Files
sykl-hy/pages/member/rights/index.js

70 lines
1.5 KiB
JavaScript

/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
buttonText : '',
couponPrice : '', //抵值券
tabType : 'season', //会员标签
rights : [], //权益
rules : [],
newId: '',
identities : '',
identityId : '',
can : ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// 获取身份前置
this.identityInfo();
},
/**
* 身份前置
*/
identityInfo(){
// 3为季卡,4为年卡
let identityId = ''
if(this.data.tabType == 'season') {
identityId = 3
} else {
identityId = 4
}
wx.$api.member.identitySee(identityId).then(res => {
this.setData({
identities : res.data,
rules : res.data.rules,
couponPrice : res.data.coupon_price,
rights : res.data.rights,
newId : res.data.identity_id,
can : res.data.can,
buttonText : res.data.buttonText
})
}).catch(err => {})
},
/**
* 切换身份
*/
typeClick(e) {
this.setData({
tabType: e.currentTarget.dataset.type
})
// 获取身份前置
this.identityInfo();
}
})