虚拟销售快速下单支付错误处理

master
gongfuxiang 2023-12-06 12:08:26 +08:00
parent 419596993b
commit dac42534ef
2 changed files with 53 additions and 27 deletions

View File

@ -28,10 +28,10 @@
<text class="text-size-md">{{ propCurrencySymbol }}</text>
{{ propPayPrice }}
</view>
<view v-if="propPaymentList.length > 0" class="oh">
<view v-if="payment_list.length > 0" class="oh">
<view class="payment-list">
<scroll-view scroll-y="true" class="scroll-y wh-auto">
<view v-for="(item, index) in propPaymentList" :key="index" class="item br-b flex-row jc-sb align-c" :data-value="item.id" @tap="checked_payment">
<view v-for="(item, index) in payment_list" :key="index" class="item br-b flex-row jc-sb align-c" :data-value="item.id" @tap="checked_payment">
<view class="flex-1">
<image v-if="(item.logo || null) != null" class="icon va-m margin-right-sm" :src="item.logo" mode="widthFix"></image>
<text class="va-m">{{ item.name }}</text>
@ -161,18 +161,19 @@
components: {
componentPopup,
},
watch: {
watch: {
//
propIsShowPayment(newVal, oldVal) {
if (newVal !== oldVal) {
let bool = true;
if (this.propPaymentList.length === 1) {
if (this.payment_list.length === 1) {
bool = false;
this.setData({
payment_id: this.propPaymentList[0].id,
payment_id: this.payment_list[0].id,
});
} else {
let self = this;
self.propPaymentList.forEach((item) => {
self.payment_list.forEach((item) => {
let new_payment_id = Number(self.propPaymentId) === 0 ? self.propDefaultPaymentId : Number(self.propPaymentId);
if (item.id == new_payment_id) {
bool = false;
@ -187,11 +188,25 @@
submit_disabled_status: bool,
});
}
},
//
propPaymentList(value, old_value) {
this.setData({
payment_list: value,
});
},
},
//
created: function () {
this.setData({
payment_list: this.payment_list
});
},
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
theme_view: app.globalData.get_theme_value_view(),
//
payment_list: [],
//
is_show_payment_popup: false,
popup_view_pay_qrcode_is_show: false,
@ -240,11 +255,17 @@
},
//
pay_handle(order_id, payment_id) {
var self = this;
this.propPaymentList.forEach((item) => {
pay_handle(order_id, payment_id, payment_list = []) {
// 使
if((payment_list || null) != null && payment_list.length > 0) {
this.setData({
payment_list: payment_list
});
}
this.payment_list.forEach((item) => {
if (item.id == payment_id) {
if (item.payment === 'WalletPay') {
if (item.payment === 'WalletPay') {
var self = this;
uni.showModal({
title: '温馨提示',
content: '操作后将立即扣除支付费用、确认继续吗?',
@ -263,7 +284,8 @@
}
}
});
},
},
//
pay_handle_event(order_id, payment_id) {
// #ifdef H5
// web_openid
@ -273,9 +295,9 @@
// #endif
//
var payment = null;
for (var i in this.propPaymentList) {
if (this.propPaymentList[i]['id'] == (payment_id || this.payment_id)) {
payment = this.propPaymentList[i];
for (var i in this.payment_list) {
if (this.payment_list[i]['id'] == (payment_id || this.payment_id)) {
payment = this.payment_list[i];
}
}
if (payment == null) {
@ -328,7 +350,7 @@
this.app_pay_handle(this, data, order_id);
// #endif
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
this.common_pay_handle(this, data, order_id);
this.mp_pay_handle(this, data, order_id);
// #endif
// #ifdef MP-KUAISHOU
this.kuaishou_pay_handle(this, data, order_id);
@ -444,8 +466,8 @@
},
});
},
// QQ
common_pay_handle(self, data, order_id) {
// : QQ
mp_pay_handle(self, data, order_id) {
uni.requestPayment({
// #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO
orderInfo: data.data,
@ -504,7 +526,7 @@
},
});
} else {
self.common_pay_handle(self, data, order_id);
self.mp_pay_handle(self, data, order_id);
}
},
// h5

View File

@ -477,7 +477,14 @@
uni.stopPullDownRefresh();
uni.hideLoading();
if (res.data.code == 0) {
var data = res.data.data;
var data = res.data.data;
//
this.setData({
currency_symbol: data.currency_symbol || app.globalData.currency_symbol(),
payment_list: data.payment_list || [],
payment_id: data.default_payment_id || '',
});
//
if ((data.is_order_submit || 0) == 1) {
@ -520,16 +527,13 @@
};
//
this.setData({
currency_symbol: data.currency_symbol || app.globalData.currency_symbol(),
this.setData({
goods_list: data.goods_list,
total_price: data.base.actual_price,
extension_data: data.extension_data || [],
data_list_loding_status: 3,
common_site_type: data.common_site_type || 0,
extraction_address: data.base.extraction_address || [],
payment_list: data.payment_list || [],
payment_id: data.default_payment_id || '',
buy_datetime_info: datetime,
plugins_coupon_data: data.plugins_coupon_data || null,
plugins_points_data: data.plugins_points_data || null,
@ -538,7 +542,7 @@
});
// 使
if(this.plugins_coupon_data != null && this.is_first == 1) {
if(this.plugins_points_data != null && this.is_first == 1) {
this.setData({
actual_use_integral: this.plugins_points_data.use_integral || ''
});
@ -752,8 +756,8 @@
buy_submit_response_handle(data) {
this.setData({
to_appoint_page: this.to_appoint_page+'?order_ids=' + data.order_ids.join(','),
});
this.$refs.payment.pay_handle(data.order_ids.join(','), data.payment_id);
});
this.$refs.payment.pay_handle(data.order_ids.join(','), data.payment_id, this.payment_list);
},
//