Commit 7d4fae55 authored by mengcuiguang's avatar mengcuiguang

接口修改

parent c2120915
......@@ -27,9 +27,8 @@
</view>
<view class="section">
<view class="pack-box">
<view class="pack-item"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view class="pack-item" :class="[{active: index==selectedIndex}]"
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
......@@ -130,7 +129,6 @@
}) => {
this.vipList = data.list;
if (data.list != null) {
// this.selectedIndex = data.list[0].activityType;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
......@@ -169,92 +167,41 @@
this.handlePay();
},
handlePay() {
if (this.os == 'ios') {
message.notify('iOS暂不支持购买');
return
}
let that = this;
let vipBean = this.vipList[this.selectedIndex];
// 抖音支付
this.post({
url: '/vip/getVipPayParams/douyin',
data: {
bookId: that.vedioId,
os: that.os,
pid: vipBean.pid
},
showLoading: true,
success: ({
data
}) => {
that.ttPrePay(data, vipBean.largeType);
}
});
},
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本.');
return
var vipBean = this.vipList[this.selectedIndex];
if (this.os == 'ios') {
message.notify('暂不支持ios系统~');
} else {
this.post({
url: '/vip/getVipPayParams/wechat',
data: {
pid: vipBean.pid,
payChannel: 'WEIXIN'
},
showLoading: true,
success: ({
data
}) => {
that.wxPay(data, vipBean.largeType);
}
});
}
uni.showLoading({
title: '加载中...'
});
},
wxPay(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
tt.requestOrder({
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.packageStr,
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
uni.hideLoading();
console.log('ttPrePay', res.errMsg);
// message.notify(res.errMsg);
that.queryOrderStatus(largeType,wxParams.sigData.outTradeNo);
},
});
},
ttPay(largeType, oid, ttData) {
uni.hideLoading();
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本!');
return
}
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本~');
return
}
tt.getOrderPayment({
orderId: oid,
imId: ttData.imId,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('ios pay', res.errMsg);
// message.notify(res.errMsg);
},
});
} else {
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('android pay', res.errMsg);
// message.notify(res.errMsg);
},
});
}
fail(res) {}
})
},
queryOrderStatus(largeType, tid) {
let that = this;
......@@ -309,7 +256,7 @@
align-items: center;
flex-wrap: wrap;
.active {
.active {
background-color: #f4c98b !important;
border: 6rpx solid #fd5350 !important;
}
......@@ -337,7 +284,7 @@
}
.name {
width: calc(90%);
width: calc(90%);
text-align: center;
font-size: 29rpx;
color: #333;
......
export const PAKEAGE_NAME = 'com.mingce.wxhelibook'
export const VERSION_CODE = '1.0.2'
export const VERSION_CODE = '1.0.3'
// export const PAKEAGE_NAME = 'com.test.test'
export function trim(str) {
......
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