|
@@ -103,6 +103,7 @@ Page({
|
|
|
pkData: 'pkData'
|
|
|
},
|
|
|
actions: {
|
|
|
+ setUser: 'setUser',
|
|
|
setReadDetail: 'setReadDetail'
|
|
|
}
|
|
|
})
|
|
@@ -192,10 +193,10 @@ Page({
|
|
|
},
|
|
|
// 获取是否vip
|
|
|
async getVipInfo() {
|
|
|
- let isVip = await getVipInfo()
|
|
|
- console.log(isVip, '111');
|
|
|
+ let vipTime = await getVipInfo()
|
|
|
+ console.log(vipTime, '111');
|
|
|
this.setData({
|
|
|
- isVip
|
|
|
+ isVip: vipTime != ''
|
|
|
})
|
|
|
},
|
|
|
// 获取阅读内容
|
|
@@ -668,14 +669,15 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
async toBuy({
|
|
|
- currentTarget
|
|
|
+ detail
|
|
|
}) {
|
|
|
+ console.log(detail);
|
|
|
wx.showLoading({
|
|
|
title: '提交中',
|
|
|
mask: true
|
|
|
})
|
|
|
let res = await buyVip({
|
|
|
- productId: currentTarget.dataset.id
|
|
|
+ productId: detail.id
|
|
|
}).finally(() => {
|
|
|
wx.hideLoading()
|
|
|
})
|
|
@@ -693,11 +695,12 @@ Page({
|
|
|
signType,
|
|
|
paySign,
|
|
|
success: (res) => {
|
|
|
+ this.selectComponent('#buyVip').close()
|
|
|
this.selectComponent('#vipModal').open({
|
|
|
- type: 'svip'
|
|
|
+ type: detail.payType == 'LIFELONG' ? 'sip' : 'vip'
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
- this.setUserInfo()
|
|
|
+ this.getVipInfo()
|
|
|
}, 1500)
|
|
|
},
|
|
|
fail(res) {
|