Commit 38b1c38f authored by mengcuiguang's avatar mengcuiguang

接入签约支付

parent 2f2f1a2f
...@@ -101,11 +101,11 @@ ...@@ -101,11 +101,11 @@
</template> </template>
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
navigateTo, navigateTo,
message, message,
loading loading
} from '@/utils/fun.js'; } from '@/utils/fun.js';
export default { export default {
name: 'coinPopup', name: 'coinPopup',
...@@ -198,12 +198,12 @@ ...@@ -198,12 +198,12 @@
this.handlePay(); this.handlePay();
}, },
handlePay() { handlePay() {
// if (this.os == 'ios') { if (this.os == 'ios') {
// message.notify('暂不支持ios支付'); message.notify('暂不支持ios支付');
// return return
// } }
let that = this; let that = this;
let vipBean = this.vipList[this.selectedIndex]; let vipBean = this.vipList[this.selectedIndex];
this.post({ this.post({
...@@ -217,12 +217,48 @@ ...@@ -217,12 +217,48 @@
success: ({ success: ({
data 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() { onVip() {
navigateTo(`/pagesA/vipPay/vipPay`) navigateTo(`/pagesA/vipPay/vipPay`)
this.handleClose(); this.handleClose();
}, },
ttPrePay(ttData, largeType) { 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