下单支付选择优化
parent
87a9f4a21b
commit
f00a181dbd
|
|
@ -203,21 +203,23 @@
|
|||
<!-- 支付方式 -->
|
||||
<view v-if="total_price > 0 && common_order_is_booking != 1 && (payment_list.length > 0 || ((plugins_coin_data || null) != null && (plugins_coin_data.accounts_list || null) != null && plugins_coin_data.accounts_list.length > 0))" class="payment-list border-radius-main bg-white oh spacing-mb">
|
||||
<view v-if="payment_list.length > 0" class="padding-horizontal-main padding-top-main br-b-f9">
|
||||
<view v-for="(item, index) in payment_list" :key="index" class="item flex-row jc-sb align-c" :class="payment_list.length === index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" data-type="1" @tap="payment_event">
|
||||
<view class="item-content pr flex-1 flex-width">
|
||||
<image v-if="(item.logo || null) != null" class="icon margin-right-sm va-m" :src="item.logo" mode="widthFix"></image>
|
||||
<text class="va-m">{{ item.name }}</text>
|
||||
<text v-if="(item.tips || null) !== null" class="pay-tips">{{ item.tips }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="payment_index === index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></iconfont>
|
||||
<view v-for="(item, index) in payment_list" :key="index">
|
||||
<view class="item flex-row jc-sb align-c" :data-value="item.id" :data-index="index" @tap="payment_event">
|
||||
<view class="item-content pr flex-1 flex-width">
|
||||
<image v-if="(item.logo || null) != null" class="icon margin-right-sm va-m" :src="item.logo" mode="widthFix"></image>
|
||||
<text class="va-m">{{ item.name }}</text>
|
||||
<text v-if="(item.tips || null) !== null" class="pay-tips">{{ item.tips }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="payment_index == index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(plugins_coin_data || null) != null && (plugins_coin_data.accounts_list || null) != null && plugins_coin_data.accounts_list.length > 0" class="padding-horizontal-main padding-bottom-main">
|
||||
<block v-for="(item, index) in plugins_coin_data.accounts_list">
|
||||
<block v-for="(item, index) in plugins_coin_data.accounts_list" :key="index">
|
||||
<block v-if="plugins_coin_more_control ? index < 3 : true">
|
||||
<view :key="index" class="item flex-row jc-sb align-c br-b-f9" :data-value="item.id" :data-index="index" data-type="2" @tap="coin_payment_event">
|
||||
<view class="item flex-row jc-sb align-c br-b-f9" :data-value="item.id" :data-index="index" @tap="coin_payment_event">
|
||||
<view class="item-content pr flex-row align-c">
|
||||
<image v-if="(item.logo || null) != null" class="icon margin-right-sm va-m" :src="item.logo" mode="widthFix"></image>
|
||||
<view class="flex-col">
|
||||
|
|
@ -229,7 +231,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="plugins_coin_choice_index === index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></iconfont>
|
||||
<iconfont :name="plugins_coin_index == index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
|
@ -361,7 +363,9 @@
|
|||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
payment_list: [],
|
||||
payment_index: 0,
|
||||
payment_index: -1,
|
||||
payment_id: 0,
|
||||
payment_type: 'system-pay',
|
||||
goods_list: [],
|
||||
address: null,
|
||||
address_id: null,
|
||||
|
|
@ -404,7 +408,7 @@
|
|||
plugins_freightfee_choice_data: {},
|
||||
// 虚拟币
|
||||
plugins_coin_data: null,
|
||||
plugins_coin_choice_index: -1,
|
||||
plugins_coin_index: -1,
|
||||
plugins_coin_more_control: true,
|
||||
|
||||
// 支付弹窗参数
|
||||
|
|
@ -535,6 +539,7 @@
|
|||
var data = this.params;
|
||||
data['address_id'] = this.address_id;
|
||||
data['payment_id'] = this.payment_id;
|
||||
data['payment_type'] = this.payment_type;
|
||||
data['site_model'] = this.site_model;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'buy'),
|
||||
|
|
@ -551,9 +556,22 @@
|
|||
this.setData({
|
||||
currency_symbol: data.currency_symbol || app.globalData.currency_symbol(),
|
||||
payment_list: data.payment_list || [],
|
||||
payment_id: data.default_payment_id || '',
|
||||
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 ((data.is_order_submit || 0) == 1) {
|
||||
this.buy_submit_response_handle(res.data);
|
||||
|
|
@ -774,6 +792,7 @@
|
|||
var data = this.params;
|
||||
data['address_id'] = this.address_id;
|
||||
data['payment_id'] = this.payment_id;
|
||||
data['payment_type'] = this.payment_type;
|
||||
data['user_note'] = this.user_note_value;
|
||||
data['site_model'] = this.site_model;
|
||||
|
||||
|
|
@ -883,22 +902,26 @@
|
|||
|
||||
// 支付方式选择
|
||||
payment_event(e) {
|
||||
if (e.currentTarget.dataset.type == '1') {
|
||||
this.setData({
|
||||
payment_index: e.currentTarget.dataset.index,
|
||||
plugins_coin_choice_index: -1,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
payment_index: -1,
|
||||
plugins_coin_choice_index: e.currentTarget.dataset.index,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
payment_id: e.currentTarget.dataset.value,
|
||||
payment_type: 'system-pay',
|
||||
payment_index: e.currentTarget.dataset.index,
|
||||
plugins_coin_index: -1,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 虚拟币支付方式选择
|
||||
coin_payment_event(e) {
|
||||
this.setData({
|
||||
payment_id: e.currentTarget.dataset.value,
|
||||
payment_type: 'plugins-coin',
|
||||
plugins_coin_index: e.currentTarget.dataset.index,
|
||||
payment_index: -1,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
// 展开更多
|
||||
change_coin_more_event() {
|
||||
this.setData({
|
||||
|
|
|
|||
Loading…
Reference in New Issue