Commit 38b1c38f authored by mengcuiguang's avatar mengcuiguang

接入签约支付

parent 2f2f1a2f
......@@ -101,11 +101,11 @@
</template>
<script>
import common from '@/mixins/common';
import {
navigateTo,
message,
loading
import common from '@/mixins/common';
import {
navigateTo,
message,
loading
} from '@/utils/fun.js';
export default {
name: 'coinPopup',
......@@ -198,12 +198,12 @@
this.handlePay();
},
handlePay() {
// if (this.os == 'ios') {
// message.notify('暂不支持ios支付');
// return
// }
handlePay() {
if (this.os == 'ios') {
message.notify('暂不支持ios支付');
return
}
let that = this;
let vipBean = this.vipList[this.selectedIndex];
this.post({
......@@ -217,12 +217,48 @@
success: ({
data
}) => {
that.ttPrePay(data, vipBean.largeType);
if (vipBean.trial == 1) {
// 签约
that.ttCreateSignOrder(data, vipBean.largeType);
} else {
that.ttPrePay(data, vipBean.largeType);
}
}
});
},
ttCreateSignOrder(ttData, largeType) {
if (!tt.canIUse('createSignOrder')) {
message.notify('请升级抖音APP版本.');
return
}
if (!tt.canIUse('sign')) {
message.notify('请升级抖音APP版本.');
return
}
let that = this;
tt.createSignOrder({
businessType: 2,
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
success: (res) => {
tt.sign({
businessType: 2,
orderId: res.authOrderId,
success: (res) => {
that.queryOrderStatus(largeType, ttData.tidStr);
}
})
},
fail: (res) => {
console.log('createSignOrdercreateSignOrder->:', JSON.stringify(res));
}
})
},
onVip() {
navigateTo(`/pagesA/vipPay/vipPay`)
navigateTo(`/pagesA/vipPay/vipPay`)
this.handleClose();
},
ttPrePay(ttData, largeType) {
......
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