门店细节优化

master
gongfuxiang 2023-12-10 23:56:32 +08:00
parent 8a2ee58b93
commit 00ce55c7e6
3 changed files with 48 additions and 29 deletions

View File

@ -72,13 +72,11 @@
<text class="cr-red padding-left-xs padding-right-xs">{{ base_data.quantity }}</text>
<text>{{ goods.inventory_unit }}</text>
</text>
<text class="text-size-xs fr"
>金额<text class="fw-b sales-price">{{ currency_symbol }}{{ base_data.amount_money }}</text></text
>
<text class="text-size-xs fr">金额<text class="fw-b sales-price">{{ currency_symbol }}{{ base_data.amount_money }}</text></text>
</view>
<view v-if="(buy_button.data || null) != null && buy_button.data.length > 0" class="padding-bottom-main">
<view :class="'oh buy-nav-btn-number-' + buy_button.count || 0">
<block v-for="(item, index) in buy_button.data" :key="index">
<view v-if="(opt_button || null) != null && opt_button.length > 0" class="padding-bottom-main">
<view :class="'oh buy-nav-btn-number-' + (opt_button.length || 0)">
<block v-for="(item, index) in opt_button" :key="index">
<view v-if="(item.name || null) != null && (item.type || null) != null" class="item fl bs-bb padding-horizontal-main">
<button :class="'cr-white round text-size-sm bg-' + ((item.color || 'main') == 'main' ? 'main' : 'main-pair')" type="default" @tap="confirm_event" :data-type="item.type" hover-class="none">{{ item.name }}</button>
</view>
@ -108,9 +106,9 @@ export default {
popup_status: false,
nav_active_index: 0,
goods: null,
buy_button: null,
batchbuy_data: null,
back_data: null,
opt_button: [],
base_data: {
kind: 0,
quantity: 0,
@ -132,11 +130,24 @@ export default {
if (!app.globalData.is_single_page_check()) {
return false;
}
//
var opt_button = [];
if(buy_button != null && (buy_button.data || null) != null && buy_button.data.length > 0) {
var arr = ['plugins-batchbuy-button-cart', 'plugins-batchbuy-button-buy'];
for(var i in buy_button.data) {
if(arr.indexOf(buy_button.data[i]['type']) != -1) {
opt_button.push(buy_button.data[i]);
}
}
}
//
this.setData({
popup_status: true,
goods: goods || null,
batchbuy_data: batchbuy_data || null,
buy_button: buy_button || null,
opt_button: opt_button,
back_data: back_data,
});
},

View File

@ -169,29 +169,37 @@
var cart_text = '';
var realstore_goods_data = params.realstore_goods_data || null;
if(realstore_goods_data != null && (realstore_goods_data.buy_button || null) != null) {
if(realstore_goods_data.buy_button.data.length > 0) {
var buy_button = realstore_goods_data.buy_button.data;
var arr = ['cart', 'buy', 'plugins-batchbuy-button-cart', 'plugins-batchbuy-button-buy'];
for(var i in buy_button) {
if(arr.indexOf(buy_button[i]['type']) != -1) {
cart_status = true;
cart_text = '加入购物车';
break;
//
if((realstore_goods_data.buy_button.error || null) != null) {
cart_text = realstore_goods_data.buy_button.error;
} else {
//
if(realstore_goods_data.buy_button.data.length > 0) {
var buy_button = realstore_goods_data.buy_button.data;
var arr = ['cart', 'buy', 'plugins-batchbuy-button-cart', 'plugins-batchbuy-button-buy'];
for(var i in buy_button) {
if(arr.indexOf(buy_button[i]['type']) != -1) {
cart_status = true;
cart_text = '加入购物车';
break;
}
}
}
} else {
cart_text = realstore_goods_data.buy_button.error;
}
}
this.setData({
params: params || {},
info: info,
buy_use_type_index: this.get_buy_use_type_index(),
realstore_goods_data: realstore_goods_data,
realstore_goods_data_cart_status: cart_status,
realstore_goods_data_cart_text: cart_text,
});
//
this.setData({
buy_use_type_index: this.get_buy_use_type_index()
});
//
this.get_cart_data();
}

View File

@ -397,11 +397,6 @@
content_style: 'height: calc(100vh - '+content_other_height+' - '+this.status_bar_height+'px - '+(tablecode == null ? '0rpx' : '44rpx')+');',
});
//
this.setData({
buy_use_type_index: this.get_buy_use_type_index(),
});
//
if ((this.info || null) != null) {
//
@ -414,6 +409,11 @@
},
});
//
uni.setNavigationBarTitle({
title: this.info.name,
});
//
this.setData({
share_info: {
@ -425,14 +425,14 @@
},
});
//
uni.setNavigationBarTitle({
title: this.info.name,
});
//
this.get_cart_data();
//
this.setData({
buy_use_type_index: this.get_buy_use_type_index(),
});
//
if (this.is_first == 1) {
this.get_data_list();