Commit ed2c6beb authored by mengcuiguang's avatar mengcuiguang

添加签约支付

parent 8190e475
......@@ -99,6 +99,7 @@
selectedIndex: 0,
agreeFlag: false,
userBean: {},
agreementDto: null,
os: 'android',
titleText: '超多精彩小说一键解锁',
showClone: false
......@@ -140,12 +141,12 @@
});
this.post({
url: '/user/baseMsg',
url: '/vip/getOrderList',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
this.agreementDto = data.agreement;
}
});
},
......@@ -182,8 +183,15 @@
success: ({
data
}) => {
if (vipBean.firstPayPrice == 0) {
//签约
that.wxSign(data, vipBean.largeType);
} else {
//普通支付
that.wxPay(data, vipBean.largeType);
}
}
});
}
},
......@@ -198,11 +206,30 @@
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.queryOrderStatus(largeType,wxData.tidStr);
that.queryOrderStatus(largeType, wxData.tidStr);
},
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) {
let that = this;
this.post({
......
......@@ -42,12 +42,12 @@
到期时间:{{userBean.expireTime*1000 | formatDate('yyyy-MM-dd')}}</view>
</view>
</view>
<view v-if="userBean.expireTime<=0" style="width: 220rpx;">
<view style="width: 220rpx;">
<view
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<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;">
去开通
{{userBean.expireTime<=0 ? '去开通' : 'VIP会员'}}
</view>
</view>
</view>
......@@ -70,7 +70,7 @@
阅读记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></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>
......
......@@ -90,9 +90,7 @@
app.globalData.userId = data.idcode;
saveToken(data.token)
setTimeout(() => {
// redirectTo('home?activiteFlag='+data.activiteFlag+"&idcode="+data.idcode);
redirectTo('home?activiteFlag='+1+"&idcode="+data.idcode);
redirectTo('home?activiteFlag='+data.activiteFlag+"&idcode="+data.idcode);
}, 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