Commit 174dd9e9 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent a75301cc
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</view> </view>
<view class="section"> <view class="section">
<view>支付方式</view> <view>支付方式</view>
<view>微信</view> <view>抖音</view>
</view> </view>
<text class="unsignbutton" @click="unsign">取消自动续费</text> <text class="unsignbutton" @click="unsign">取消自动续费</text>
......
...@@ -224,14 +224,19 @@ ...@@ -224,14 +224,19 @@
if (!tt.canIUse('sign')) { if (!tt.canIUse('sign')) {
message.notify('请升级抖音APP版本.'); message.notify('请升级抖音APP版本.');
return return
} }
tt.showLoading({
title: '加载中...'
});
let that = this; let that = this;
tt.createSignOrder({ tt.createSignOrder({
businessType: ttData.params.businessType, businessType: ttData.params.businessType,
data: ttData.params.data, data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization, byteAuthorization: ttData.params.byteAuthorization,
success: (res) => { success: (res) => {
tt.hideLoading();
tt.sign({ tt.sign({
businessType: ttData.params.businessType, businessType: ttData.params.businessType,
orderId: res.authOrderId, orderId: res.authOrderId,
...@@ -244,7 +249,8 @@ ...@@ -244,7 +249,8 @@
} }
}) })
}, },
fail: (res) => { fail: (res) => {
tt.hideLoading();
// this.slotParam = JSON.stringify(res); // this.slotParam = JSON.stringify(res);
// this.$refs.select.open('center'); // this.$refs.select.open('center');
// console.log('createSignOrdercreateSignOrder->:', JSON.stringify(res)); // console.log('createSignOrdercreateSignOrder->:', JSON.stringify(res));
...@@ -256,7 +262,11 @@ ...@@ -256,7 +262,11 @@
if (!tt.canIUse('requestOrder')) { if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本!'); message.notify('请升级抖音APP版本!');
return return
} }
tt.showLoading({
title: '加载中...'
});
let that = this; let that = this;
tt.requestOrder({ tt.requestOrder({
...@@ -265,13 +275,16 @@ ...@@ -265,13 +275,16 @@
success(res) { success(res) {
that.ttPay(largeType, res.orderId, ttData); that.ttPay(largeType, res.orderId, ttData);
}, },
fail(res) { fail(res) {
tt.hideLoading();
// message.notify(res.errMsg); // message.notify(res.errMsg);
console.log('requestOrder res.errMsg', res) console.log('requestOrder res.errMsg', res)
}, },
}); });
}, },
ttPay(largeType, oid, ttData) { ttPay(largeType, oid, ttData) {
tt.hideLoading();
if (!tt.canIUse('getOrderPayment')) { if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本~'); message.notify('请升级抖音APP版本~');
return return
......
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