充值支付方式未选中修复

master
gongfuxiang 2024-07-12 22:29:39 +08:00
parent d18872f1d0
commit bca210a1b9
2 changed files with 49 additions and 46 deletions

View File

@ -64,7 +64,28 @@
import base64 from '@/common/js/lib/base64.js';
import componentPopup from '@/components/popup/popup';
export default {
name: 'pay',
name: 'pay',
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
//
payment_list: [],
//
is_show_payment_popup: false,
popup_view_pay_qrcode_is_show: false,
//
popup_view_pay_timer: null,
popup_view_pay_data: null,
// id
payment_id: 0,
submit_disabled_status: true,
order_id: 0,
popup_view_pay_html_is_show: false,
// url
open_pay_url_timer: null,
open_pay_url_status: true,
};
},
props: {
propCurrencySymbol: {
type: String,
@ -154,12 +175,18 @@
components: {
componentPopup,
},
watch: {
watch: {
//
propPaymentList(value, old_value) {
this.setData({
payment_list: value,
});
},
//
propIsShowPayment(newVal, oldVal) {
if (newVal !== oldVal) {
propIsShowPayment(new_val, old_val) {
if (new_val !== old_val) {
let bool = true;
if (this.payment_list.length === 1) {
if (this.payment_list.length == 1) {
bool = false;
this.setData({
payment_id: this.payment_list[0].id,
@ -167,55 +194,30 @@
} else {
let self = this;
self.payment_list.forEach((item) => {
let new_payment_id = Number(self.propPaymentId) === 0 ? self.propDefaultPaymentId : Number(self.propPaymentId);
let new_payment_id = Number(self.propPaymentId) == 0 ? self.propDefaultPaymentId : Number(self.propPaymentId);
if (item.id == new_payment_id) {
bool = false;
}
});
this.setData({
payment_id: Number(this.propPaymentId) === 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
payment_id: Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
});
}
}
this.setData({
is_show_payment_popup: newVal,
is_show_payment_popup: new_val,
submit_disabled_status: bool,
});
}
},
//
propPaymentList(value, old_value) {
this.setData({
payment_list: value,
});
},
}
},
//
created: function () {
this.setData({
payment_list: this.payment_list
payment_list: this.propPaymentList,
payment_id: Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
});
},
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
//
payment_list: [],
//
is_show_payment_popup: false,
popup_view_pay_qrcode_is_show: false,
//
popup_view_pay_timer: null,
popup_view_pay_data: null,
// id
payment_id: Number(this.propPaymentId) === 0 ? this.propDefaultPaymentId : Number(this.propPaymentId),
submit_disabled_status: true,
order_id: 0,
popup_view_pay_html_is_show: false,
// url
open_pay_url_timer: null,
open_pay_url_status: true,
};
},
methods: {
//
payment_popup_event_close(e) {
@ -267,7 +269,7 @@
//
this.payment_list.forEach((item) => {
if (item.id == payment_id) {
if (item.payment === 'WalletPay') {
if (item.payment == 'WalletPay') {
var self = this;
uni.showModal({
title: self.$t('common.warm_tips'),
@ -729,7 +731,7 @@
order_id: order_id,
is_to_page: is_to_page,
};
this.$emit('pay-success', back_data, this.propTempPayIndex, Number(this.propPaymentId) === 0 ? this.propDefaultPaymentId : Number(this.propPaymentId));
this.$emit('pay-success', back_data, this.propTempPayIndex, Number(this.propPaymentId) == 0 ? this.propDefaultPaymentId : Number(this.propPaymentId));
if (is_to_page) {
this.to_success_page_event();
}

View File

@ -157,7 +157,7 @@
},
get_data() {
uni.request({
url: app.globalData.get_request_url('rechargeconfigdata', 'user', 'wallet'),
url: app.globalData.get_request_url('rechargeconfigdata', 'recharge', 'wallet'),
method: 'POST',
data: {},
dataType: 'json',
@ -167,7 +167,6 @@
var data = res.data.data;
this.setData({
preset_data: data.preset_data || [],
payment_id: data.default_payment_id || 0,
recharge_desc: data.recharge_desc || '',
user_wallet: data.user_wallet || null,
data_list_loding_msg: '',
@ -237,12 +236,14 @@
});
uni.hideLoading();
if (res.data.code == 0) {
uni.setStorageSync(app.globalData.data.cache_page_pay_key, { type: 1 });
uni.setStorageSync(app.globalData.data.cache_page_pay_key, { type: 1 });
var data = res.data.data;
this.setData({
pay_price: data.money,
temp_pay_value: data.recharge_id,
payment_id: data.default_payment_id || 0,
payment_list: data.payment_list,
is_show_payment_popup: true,
pay_price: res.data.data.money,
temp_pay_value: res.data.data.recharge_id,
payment_list: res.data.data.payment_list,
});
} else {
if (app.globalData.is_login_check(res.data)) {