细节优化

master
gongfuxiang 2023-04-07 20:23:31 +08:00
parent 9948b8aa8f
commit a3f3bc3f76
12 changed files with 732 additions and 685 deletions

View File

@ -61,9 +61,9 @@
"/pages/user/user"
],
//
request_url: 'http://shopxo.com/',
request_url: 'https://d1.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'http://shopxo.com/',
static_url: 'https://d1.shopxo.vip/',
// default
system_type: 'default',
//
@ -72,7 +72,7 @@
// logo /static/images/common/logo.png
application_logo: '',
//
version: 'v2.3.2',
version: 'v2.3.3',
//
currency_symbol: '¥',
//

View File

@ -1,4 +1,4 @@
## v2.3.32023-000
## v2.3.32023-04-10
* 商品列表使用统一组件
* 商品参数新增弹窗展示
* 初始访问登录页面优化
@ -21,6 +21,10 @@
* 新增组合搭配
* 新增列表快捷加入购物车
* 商品列表新增错误提示
* 商家详情新增搜索全站开关控制
* 门店详情新增扫码开关控制
* 新增多规格批量下单
* 插件分包处理
## v2.3.22022-11-30

View File

@ -2,7 +2,7 @@
<view>
<view v-if="data_list.length > 0" class="cart-page">
<!-- 数据列表 -->
<view class="padding-horizontal-main padding-top-main">
<view :class="'padding-horizontal-main padding-top-main '+(source_type != 'cart' ? 'bottom-line-exclude' : '')">
<uni-swipe-action>
<view v-for="(item, index) in data_list" :key="index" class="oh border-radius-main bg-white spacing-mb">
<uni-swipe-action-item :right-options="swipe_options" @click="swipe_opt_event" @change="swipe_change($event, index)">
@ -59,34 +59,33 @@
</view>
<!-- 操作导航 -->
<view class="cart-buy-nav oh wh-auto">
<!-- 展示型 -->
<view v-if="common_site_type == 1" class="cart-exhibition-mode padding-horizontal-main">
<button class="bg-main cr-white round wh-auto text-size" type="default" @tap="exhibition_submit_event" hover-class="none">
<!-- 展示型 -->
<view v-if="common_site_type == 1" :class="'cart-buy-nav oh wh-auto '+(source_type != 'cart' ? 'bottom-line-exclude' : '')">
<view class="cart-exhibition-mode padding-horizontal-main">
<button class="bg-main cr-white round wh-auto text-size-sm" type="default" @tap="exhibition_submit_event" hover-class="none">
<view class="dis-inline-block va-m margin-right-xl">
<uni-icons type="phone" size="14" color="#fff" />
</view>
<text class="va-m">{{common_is_exhibition_mode_btn_text}}</text>
</button>
</view>
<!-- 销售,自提,虚拟销售 -->
<view v-else class="br-t bg-white wh-auto ht-auto">
<view class="cart-nav-base fl single-text padding-left">
<view @tap="selected_event" data-type="all" class="fl cart-selected">
<image class="icon va-m" :src="common_static_url+'select' + (is_selected_all ? '-active' : '') + '-icon.png'" mode="widthFix"></image>
<text v-if="!already_selected_status" class="va-m cr-base"></text>
</view>
<view v-if="already_selected_status" @tap="cart_all_remove_event" class="cart-nav-remove-submit pa bg-white cr-red br-red round cp"></view>
<view class="fr price">
<view class="sales-price single-text fr">{{currency_symbol}}{{total_price}}</view>
<view class="fr">合计</view>
</view>
</view>
</view>
<!-- 销售,自提,虚拟销售 -->
<view v-else :class="'cart-buy-nav oh wh-auto br-t bg-white '+(source_type != 'cart' ? 'bottom-line-exclude' : '')">
<view class="cart-nav-base fl single-text padding-left">
<view @tap="selected_event" data-type="all" class="fl cart-selected">
<image class="icon va-m" :src="common_static_url+'select' + (is_selected_all ? '-active' : '') + '-icon.png'" mode="widthFix"></image>
<text v-if="!already_selected_status" class="va-m cr-base"></text>
</view>
<view class="fr cart-nav-submit padding-top padding-bottom padding-horizontal-main">
<button class="bg-main cr-white round text-size-lg" type="default" @tap="buy_submit_event" :disabled="!already_selected_status" hover-class="none">结算</button>
<view v-if="already_selected_status" @tap="cart_all_remove_event" class="cart-nav-remove-submit pa bg-white cr-red br-red round cp"></view>
<view class="fr price">
<view class="sales-price single-text fr">{{currency_symbol}}{{total_price}}</view>
<view class="fr">合计</view>
</view>
</view>
<view class="fr cart-nav-submit padding-top padding-bottom padding-horizontal-main">
<button class="bg-main cr-white round text-size-lg" type="default" @tap="buy_submit_event" :disabled="!already_selected_status" hover-class="none">结算</button>
</view>
</view>
</view>
@ -121,7 +120,8 @@
data_list: [],
total_price: '0.00',
is_selected_all: false,
already_selected_status: false,
already_selected_status: false,
source_type: null,
//
currency_symbol: app.globalData.data.currency_symbol,
common_site_type: 0,
@ -180,7 +180,8 @@
},
//
init(e) {
init(source_type = null) {
this.setData({source_type: source_type});
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
//

View File

@ -10,7 +10,7 @@
<view class="plugins-batchbuy-container oh">
<block v-if="(goods || null) != null && (batchbuy_data || null) != null && (batchbuy_data.goods_spec_data || null) != null && batchbuy_data.goods_spec_data.length > 0">
<block v-if="batchbuy_data.is_only_level_one == 0">
<view class="left-nav ht-auto pa bg-base">
<view class="left-nav pa bg-base">
<scroll-view :scroll-y="true" class="ht-auto">
<block v-for="(item, index) in batchbuy_data.goods_spec_data" :key="index">
<view :class="'padding-top-xxl padding-bottom-xxl tc cp oh pr ' + (nav_active_index == index ? 'bg-white cr-main' : '')" :data-index="index" @tap="nav_event">
@ -63,8 +63,26 @@
</scroll-view>
</view>
</block>
<view class="pa confirm-submit padding-horizontal-main wh-auto bs-bb bottom-line-exclude">
<button type="default" class="bg-main cr-white text-size tc wh-auto round" @tap="confirm_event">{{(buy_event_type == 'buy') ? '' : ''}}</button>
<view class="confirm-submit pa wh-auto bottom-line-exclude bg-white padding-top-main">
<view class="oh padding-horizontal-main padding-bottom-main cr-grey">
<text class="text-size-xs">
<text>已选</text>
<text class="cr-red padding-left-xs padding-right-xs">{{base_data.kind}}</text>
<text></text>
<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>
</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="(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>
</block>
</view>
</view>
</view>
</block>
<block v-else>
@ -86,10 +104,15 @@
currency_symbol: app.globalData.get_config('currency_symbol', app.globalData.data.currency_symbol),
popup_status: false,
nav_active_index: 0,
buy_event_type: 'buy',
goods: null,
buy_button: null,
batchbuy_data: null,
back_data: null,
back_data: null,
base_data: {
kind: 0,
quantity: 0,
amount_money: '0.00',
}
};
},
@ -102,7 +125,7 @@
methods: {
//
init(goods = null, batchbuy_data = null, buy_event_type = 'buy', back_data = null) {
init(goods = null, batchbuy_data = null, buy_button = null, back_data = null) {
if(!app.globalData.is_single_page_check()) {
return false;
}
@ -110,7 +133,7 @@
popup_status: true,
goods: goods || null,
batchbuy_data: batchbuy_data || null,
buy_event_type: buy_event_type || 'buy',
buy_button: buy_button || null,
back_data: back_data,
});
},
@ -196,28 +219,48 @@
{
var badge_total = 0;
temp_data.goods_spec_data[this.nav_active_index]['data'].forEach(item => {
badge_total += parseInt(item.buy_number || 0);
var temp_badge = parseInt(item.buy_number || 0);
if(temp_badge > 0) {
badge_total += temp_badge;
}
});
temp_data.goods_spec_data[this.nav_active_index]['badge_total'] = badge_total;
}
//
this.setData({
batchbuy_data: temp_data
});
//
//
var stock_total = 0;
var kind_total = 0;
var amount_money_total = 0;
temp_data.goods_spec_data.forEach(item => {
if(parseInt(temp_data.is_only_level_one || 0) == 1) {
stock_total += parseInt(item.buy_number || 0);
var temp_stock = parseInt(item.buy_number || 0);
if(temp_stock > 0) {
stock_total += temp_stock;
kind_total += 1;
amount_money_total += temp_stock*parseFloat(item.base.price);
}
} else {
item.data.forEach(item2 => {
stock_total += parseInt(item2.buy_number || 0);
var temp_stock = parseInt(item2.buy_number || 0);
if(temp_stock > 0) {
stock_total += temp_stock;
kind_total += 1;
amount_money_total += temp_stock*parseFloat(item2.base.price);
}
});
}
});
//
this.setData({
batchbuy_data: temp_data,
base_data: {
kind: kind_total,
quantity: stock_total,
amount_money: app.globalData.price_two_decimal(amount_money_total)
}
});
//
var goods_data = [];
var goods_id = this.goods.id;
@ -323,8 +366,8 @@
}
//
switch (this.buy_event_type) {
case 'buy':
switch (e.currentTarget.dataset.type) {
case 'plugins-batchbuy-button-buy':
//
var data = {
buy_type: "goods",
@ -337,7 +380,7 @@
break;
//
case 'cart':
case 'plugins-batchbuy-button-cart':
this.goods_cart_event(goods_data);
break;
@ -389,12 +432,13 @@
<style>
.plugins-batchbuy-container {
height: 60vh;
padding-bottom: 100rpx;;
padding-bottom: 160rpx;
}
.plugins-batchbuy-container .left-nav {
width: 200rpx;
top: 0;
left: 0;
height: calc(100% - 160rpx);
}
.plugins-batchbuy-container .left-nav .badge-icon {
top: 8rpx;
@ -436,6 +480,19 @@
}
.plugins-batchbuy-container .confirm-submit {
left: 0;
bottom: 20rpx;
bottom: 0;
}
.plugins-batchbuy-container .buy-nav-btn-number-0 .item,
.plugins-batchbuy-container .buy-nav-btn-number-1 .item {
width: 100% !important;
}
.plugins-batchbuy-container .buy-nav-btn-number-2 .item {
width: 50% !important;
}
.plugins-batchbuy-container .buy-nav-btn-number-3 .item {
width: 33.33% !important;
}
.plugins-batchbuy-container .buy-nav-btn-number-4 .item {
width: 25% !important;
}
</style>

View File

@ -627,16 +627,12 @@
data['goods_id'] = this.goods.id;
data['spec'] = JSON.stringify(spec);
data['stock'] = this.buy_number;
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url('save', 'cart'),
method: 'POST',
data: data,
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
//
if(this.is_success_tips == 1) {
@ -669,7 +665,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});

View File

@ -104,7 +104,7 @@
is_first: 0,
system: system,
x: 12,
y: height - 210
y: height - 280
});
},
methods: {

1172
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -23,13 +23,13 @@
onShow() {
//
if((this.$refs.cart || null) != null) {
this.$refs.cart.init();
this.$refs.cart.init('cart');
}
},
//
onPullDownRefresh() {
this.$refs.cart.init();
this.$refs.cart.init('cart');
},
methods: {}

View File

@ -778,7 +778,16 @@
if(res === false) {
return false;
}
//
this.setData({
temp_opt_data: {
pos: e,
goods: temp_goods,
type: type,
}
});
//
if(res == 0) {
this.cart_delete(temp_goods['id']);
@ -855,9 +864,6 @@
//
cart_save(goods_id, buy_number, spec = '') {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url('save', 'cart'),
method: 'POST',
@ -868,7 +874,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.cart_para_curve_handle();
this.get_cart_data();
@ -879,7 +884,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
@ -887,10 +891,6 @@
//
cart_update(cart_id, goods_id, buy_number) {
uni.showLoading({
title: '处理中...',
mask: true
});
uni.request({
url: app.globalData.get_request_url("stock", "cart"),
method: 'POST',
@ -901,7 +901,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.cart_para_curve_handle();
this.get_cart_data();
@ -914,7 +913,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
@ -922,10 +920,6 @@
//
cart_delete(cart_id) {
uni.showLoading({
title: '处理中...',
mask: true
});
uni.request({
url: app.globalData.get_request_url('delete', 'cart'),
method: 'POST',
@ -934,7 +928,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.get_cart_data();
} else {
@ -946,7 +939,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});

View File

@ -1043,7 +1043,7 @@
// -
case 'plugins-batchbuy-button-cart' :
if((this.$refs.goods_batch_buy || null) != null) {
this.$refs.goods_batch_buy.init(this.goods, this.plugins_batchbuy_data, type.replace('plugins-batchbuy-button-', ''));
this.$refs.goods_batch_buy.init(this.goods, this.plugins_batchbuy_data, this.buy_button);
}
break;
//

View File

@ -40,15 +40,17 @@
<!-- 导航 -->
<view class="nav-button bottom-fixed padding-main pr">
<view class="left-price fl">
<view v-if="data.estimate_discount_price != 0" class="pa single-text estimate-discount-price">
<text class="discount-icon cr-white text-size-xs">节省</text>
<text class="cr-green">{{currency_symbol}}{{data.estimate_discount_price}}</text>
<view class="bottom-line-exclude oh">
<view class="left-price fl">
<view v-if="data.estimate_discount_price != 0" class="pa single-text estimate-discount-price">
<text class="discount-icon cr-white text-size-xs">节省</text>
<text class="cr-green">{{currency_symbol}}{{data.estimate_discount_price}}</text>
</view>
<view :class="'sales-price single-text margin-top-'+(data.estimate_discount_price == 0 ? 'sm' : 'xl')">{{currency_symbol}}{{data.estimate_price}}</view>
</view>
<view class="right-button fr tr">
<button type="default" size="mini" class="bg-main br-main cr-white round dis-block text-size-sm" @tap="buy_event"></button>
</view>
<view :class="'sales-price single-text margin-top-'+(data.estimate_discount_price == 0 ? 'sm' : 'xl')">{{currency_symbol}}{{data.estimate_price}}</view>
</view>
<view class="right-button fr tr">
<button type="default" size="mini" class="bg-main br-main cr-white round dis-block text-size-sm" @tap="buy_event"></button>
</view>
</view>
</view>

View File

@ -713,7 +713,16 @@
if(res === false) {
return false;
}
//
this.setData({
temp_opt_data: {
pos: e,
goods: temp_goods,
type: type,
}
});
//
if(res == 0) {
this.cart_delete(temp_goods['id']);
@ -815,9 +824,6 @@
//
cart_save(goods_id, buy_number, spec = '') {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url('save', 'cart'),
method: 'POST',
@ -828,7 +834,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.cart_para_curve_handle();
this.get_cart_data();
@ -839,7 +844,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
@ -847,10 +851,6 @@
//
cart_update(cart_id, goods_id, buy_number) {
uni.showLoading({
title: '处理中...',
mask: true
});
uni.request({
url: app.globalData.get_request_url("stock", "cart"),
method: 'POST',
@ -861,7 +861,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.cart_para_curve_handle();
this.get_cart_data();
@ -874,7 +873,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
@ -882,10 +880,6 @@
//
cart_delete(cart_id) {
uni.showLoading({
title: '处理中...',
mask: true
});
uni.request({
url: app.globalData.get_request_url('delete', 'cart'),
method: 'POST',
@ -894,7 +888,6 @@
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
this.get_cart_data();
} else {
@ -906,7 +899,6 @@
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});