From dd0f396efd1c0d514a46e96cff8d08bb5742302f Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 11 Apr 2024 20:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=B8=81=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/buy/buy.vue | 141 ++++++++++++++++++++-------------------------- 1 file changed, 60 insertions(+), 81 deletions(-) diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index 7ffd491a..c129b2e0 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -198,51 +198,45 @@ - - - - - - - - - - {{ item.name }} - {{ item.tips }} - - - + + + + + + + + + + + + {{ item.platform_name }} + + {{ item.default_symbol }}{{ item.default_coin }} + {{ item.platform_symbol }}{{ item.normal_coin }} + + - - - - - - - - - - - {{ item.name }} - - {{ item.name }} - {{ item.name }} - - - - - - - - - - - {{ plugins_coin_more_control ? '展开更多' : '收起更多' }} - - - - - + + + + + + + + + + + + + {{ item.name }} + {{ item.tips }} + + + + + + + @@ -364,8 +358,7 @@ params: null, payment_list: [], payment_index: -1, - payment_id: 0, - payment_type: 'system-pay', + payment_id: 0, goods_list: [], address: null, address_id: null, @@ -408,8 +401,7 @@ plugins_freightfee_choice_data: {}, // 虚拟币 plugins_coin_data: null, - plugins_coin_index: -1, - plugins_coin_more_control: true, + plugins_coin_payment_id: 0, // 支付弹窗参数 pay_url: '', @@ -527,7 +519,7 @@ // 现金--跳转指定页面 to_appoint_page: realstore_order_page, }); - } + } // 加载loding uni.showLoading({ @@ -538,8 +530,7 @@ }); var data = this.params; data['address_id'] = this.address_id; - data['payment_id'] = this.payment_id; - data['payment_type'] = this.payment_type; + data['payment_id'] = this.payment_id; data['site_model'] = this.site_model; uni.request({ url: app.globalData.get_request_url('index', 'buy'), @@ -556,20 +547,13 @@ this.setData({ currency_symbol: data.currency_symbol || app.globalData.currency_symbol(), payment_list: data.payment_list || [], - payment_id: data.default_payment_id || 0, - payment_type: data.default_payment_type || 'system-pay', }); - // 支付选中索引 - if(this.payment_list.length > 0 && parseInt(this.payment_id) > 0 && this.payment_type == 'system-pay') { - for(var i in this.payment_list) { - if(this.payment_id == this.payment_list[i]['id']) { - this.setData({ - payment_index: i - }); - break; - } - } + // 首次赋值默认支付方式 + if(this.is_first == 1) { + this.setData({ + payment_id: data.default_payment_id || 0 + }); } // 订单是否已提交、直接进入支付页面 @@ -739,7 +723,11 @@ data['is_points'] = this.plugins_points_status === true ? 1 : 0; if (data['is_points'] == 1) { data['actual_use_integral'] = this.actual_use_integral; - } + } + + // 虚拟币 + data['plugins_coin_payment_id'] = this.plugins_coin_payment_id; + return data; }, @@ -901,32 +889,23 @@ }, // 支付方式选择 - payment_event(e) { + payment_event(e) { + var value = e.currentTarget.dataset.value; this.setData({ - payment_id: e.currentTarget.dataset.value, - payment_type: 'system-pay', - payment_index: e.currentTarget.dataset.index, - plugins_coin_index: -1, + payment_id: (this.payment_id == value) ? 0 : value, + plugins_coin_payment_id: 0, }); this.init(); }, // 虚拟币支付方式选择 - coin_payment_event(e) { + plugins_coin_payment_event(e) { + var value = e.currentTarget.dataset.value; this.setData({ - payment_id: e.currentTarget.dataset.value, - payment_type: 'plugins-coin', - plugins_coin_index: e.currentTarget.dataset.index, - payment_index: -1, + plugins_coin_payment_id: (this.plugins_coin_payment_id == value) ? 0 : value, + payment_id: 0, }); this.init(); - }, - - // 展开更多 - change_coin_more_event() { - this.setData({ - plugins_coin_more_control: !this.plugins_coin_more_control, - }); }, // 优惠劵弹层开启