Commit ed2c6beb authored by mengcuiguang's avatar mengcuiguang

添加签约支付

parent 8190e475
...@@ -98,7 +98,8 @@ ...@@ -98,7 +98,8 @@
vipList: [], vipList: [],
selectedIndex: 0, selectedIndex: 0,
agreeFlag: false, agreeFlag: false,
userBean: {}, userBean: {},
agreementDto: null,
os: 'android', os: 'android',
titleText: '超多精彩小说一键解锁', titleText: '超多精彩小说一键解锁',
showClone: false showClone: false
...@@ -140,12 +141,12 @@ ...@@ -140,12 +141,12 @@
}); });
this.post({ this.post({
url: '/user/baseMsg', url: '/vip/getOrderList',
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
this.userBean = data; this.agreementDto = data.agreement;
} }
}); });
}, },
...@@ -169,21 +170,28 @@ ...@@ -169,21 +170,28 @@
handlePay() { handlePay() {
let that = this; let that = this;
var vipBean = this.vipList[this.selectedIndex]; var vipBean = this.vipList[this.selectedIndex];
if (this.os == 'ios') { if (this.os == 'ios') {
message.notify('暂不支持ios系统~'); message.notify('暂不支持ios系统~');
} else { } else {
this.post({ this.post({
url: '/vip/getVipPayParams/wechat', url: '/vip/getVipPayParams/wechat',
data: { data: {
pid: vipBean.pid, pid: vipBean.pid,
payChannel: 'WEIXIN' payChannel: 'WEIXIN'
}, },
showLoading: true, showLoading: true,
success: ({ success: ({
data data
}) => { }) => {
that.wxPay(data, vipBean.largeType); if (vipBean.firstPayPrice == 0) {
} //签约
that.wxSign(data, vipBean.largeType);
} else {
//普通支付
that.wxPay(data, vipBean.largeType);
}
}
}); });
} }
}, },
...@@ -198,11 +206,30 @@ ...@@ -198,11 +206,30 @@
signType: wxParams.signType, signType: wxParams.signType,
paySign: wxParams.paySign, paySign: wxParams.paySign,
success(res) { success(res) {
that.queryOrderStatus(largeType,wxData.tidStr); that.queryOrderStatus(largeType, wxData.tidStr);
}, },
fail(res) {} fail(res) {}
}) })
}, },
wxSign(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
// 发起微信签约
wx.navigateToMiniProgram({
appId: wxData.appId,
path: 'pages/loading',
extraData: wxData.params,
success(res) {
console.log("wxSign suc=",res);
// 成功跳转到签约小程序
that.queryOrderStatus(largeType, wxData.tidStr);
},
fail(res) {
// 未成功跳转到签约小程序
console.log("wxSign fail=",res);
}
})
},
queryOrderStatus(largeType, tid) { queryOrderStatus(largeType, tid) {
let that = this; let that = this;
this.post({ this.post({
......
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view> 到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view> </view>
</view> </view>
<view v-if="userBean.expireTime<=0" style="width: 220rpx;"> <view style="width: 220rpx;">
<view <view
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;"> style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view @click="handleCoinPay" <view @click="handleCoinPay"
style="width: 160rpx;height: 60rpx;background-color: #fff;border-radius:30rpx;color: 263358;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;"> style="width: 160rpx;height: 60rpx;background-color: #fff;border-radius:30rpx;color: 263358;font-size: 26rpx;justify-content: center;align-items: center;display: flex;padding-bottom: 4rpx;">
去开通 {{userBean.expireTime<=0 ? '去开通' : 'VIP会员'}}
</view> </view>
</view> </view>
</view> </view>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
阅读记录 阅读记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view> <view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view> </view>
<view class="item arrow" @click="handleFind"> <view v-if="false" class="item arrow" @click="handleFind">
如何找到我 如何找到我
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view> <view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view> </view>
......
...@@ -90,9 +90,7 @@ ...@@ -90,9 +90,7 @@
app.globalData.userId = data.idcode; app.globalData.userId = data.idcode;
saveToken(data.token) saveToken(data.token)
setTimeout(() => { setTimeout(() => {
// redirectTo('home?activiteFlag='+data.activiteFlag+"&idcode="+data.idcode); redirectTo('home?activiteFlag='+data.activiteFlag+"&idcode="+data.idcode);
redirectTo('home?activiteFlag='+1+"&idcode="+data.idcode);
}, 1000); }, 1000);
} }
}); });
......
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