Commit 7d4fae55 authored by mengcuiguang's avatar mengcuiguang

接口修改

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