门店详情优化

master
gongfuxiang 2024-12-24 21:49:26 +08:00
parent a8ae53ce80
commit 8899c7e1b7
4 changed files with 112 additions and 103 deletions

View File

@ -33,7 +33,8 @@ iframe,
.pa-w,
.plugins-realstore-cart-content,
.tabs-content,
.header-around {
.header-around,
.plugins-realstore-detail-base-mode-nav {
max-width: 1600rpx !important;
margin: 0 auto !important;
}
@ -46,7 +47,8 @@ iframe,
.nav-more-view,
.quick-movable-container,
.online-service-movable-container,
.plugins-realstore-cart-content {
.plugins-realstore-cart-content,
.plugins-realstore-detail-base-mode-nav {
left: auto !important;
}
iframe,

View File

@ -1,6 +1,6 @@
<template>
<view :class="theme_view">
<view v-if="propStatus">
<view v-if="!propIsBaseMode && propStatus">
<!-- 购物车弹层背景 -->
<view v-if="cart_status" class="plugins-realstore-cart-mask wh-auto ht-auto pf" @tap="cart_switch_event"></view>
<!-- 购物车列表 -->
@ -197,6 +197,10 @@
type: String,
default: app.globalData.currency_symbol(),
},
propIsBaseMode: {
type: Boolean,
default: false,
},
propStatus: {
type: Boolean,
default: true,
@ -212,106 +216,109 @@
methods: {
//
init(params) {
//
var tabbar_height = app.globalData.is_tabbar_pages() ? (app.globalData.app_tabbar_height_value()*2) : 0;
//
var info = params.info || null;
if(info != null && (params.source || null) != null) {
this.setData({
params: params,
info: info,
base: params.base || null,
source: params.source,
realstore_cart_content_style: 'bottom: '+tabbar_height+'rpx',
});
//
if(!this.propIsBaseMode) {
//
var tabbar_height = app.globalData.is_tabbar_pages() ? (app.globalData.app_tabbar_height_value()*2) : 0;
//
var info = params.info || null;
if(info != null && (params.source || null) != null) {
this.setData({
params: params,
info: info,
base: params.base || null,
source: params.source,
realstore_cart_content_style: 'bottom: '+tabbar_height+'rpx',
});
//
var index = this.get_buy_use_type_index();
if(this.source == 'goods' && (params.realstore_id || null) == null) {
//
this.$emit('RefreshLoadingEvent', {buy_use_type_index: index, realstore_id: this.info.id});
} else {
//
if(this.source != 'system-cart') {
//
var cart_status = false;
var cart_type = '';
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.error || null) != null) {
cart_text = realstore_goods_data.buy_button.error;
//
if((realstore_goods_data.buy_button.data || null) != null && (realstore_goods_data.buy_button['data'][0] || null) != null && realstore_goods_data.buy_button['data'][0]['type'] == 'show') {
var cart_value = ((info.service_data || null) == null ? info.contacts_tel : (info.service_data.service_tel || info.contacts_tel)) || null;
if(cart_value != null) {
cart_status = true;
cart_type = 'show';
cart_text = this.$t('cart.cart.31h34v');
}
}
} 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) {
//
var index = this.get_buy_use_type_index();
if(this.source == 'goods' && (params.realstore_id || null) == null) {
//
this.$emit('RefreshLoadingEvent', {buy_use_type_index: index, realstore_id: this.info.id});
} else {
//
if(this.source != 'system-cart') {
//
var cart_status = false;
var cart_type = '';
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.error || null) != null) {
cart_text = realstore_goods_data.buy_button.error;
//
if((realstore_goods_data.buy_button.data || null) != null && (realstore_goods_data.buy_button['data'][0] || null) != null && realstore_goods_data.buy_button['data'][0]['type'] == 'show') {
var cart_value = ((info.service_data || null) == null ? info.contacts_tel : (info.service_data.service_tel || info.contacts_tel)) || null;
if(cart_value != null) {
cart_status = true;
cart_type = buy_button[i]['type'];
cart_text = this.$t('realstore-cart.realstore-cart.b27ln3');
break;
cart_type = 'show';
cart_text = this.$t('cart.cart.31h34v');
}
}
} 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_type = buy_button[i]['type'];
cart_text = this.$t('realstore-cart.realstore-cart.b27ln3');
break;
}
}
}
}
}
}
this.setData({
realstore_goods_data: realstore_goods_data,
realstore_goods_data_cart_status: cart_status,
realstore_goods_data_cart_type: cart_type,
realstore_goods_data_cart_value: cart_value,
realstore_goods_data_cart_loading: false,
realstore_goods_data_cart_text: cart_text,
});
this.setData({
realstore_goods_data: realstore_goods_data,
realstore_goods_data_cart_status: cart_status,
realstore_goods_data_cart_type: cart_type,
realstore_goods_data_cart_value: cart_value,
realstore_goods_data_cart_loading: false,
realstore_goods_data_cart_text: cart_text,
});
//
//
var cache_index = this.get_cache_buy_use_type_index();
if((this.base || null) != null && parseInt(this.base.is_tips_user_choice_buy_use_type || 0) == 1 && (cache_index === null || cache_index === '') && (this.info.buy_use_type_list || null) != null && this.info.buy_use_type_list.length > 1 && (this.info.status_info || null) != null && this.info.status_info.status == 1) {
//
var key = 'is_tips_user_choice_buy_use_type_'+this.params.source+'_detail';
if(parseInt(this.base[key] || 0) == 1) {
//
var interval_time = parseInt(this.base.tips_user_choice_buy_use_type_interval_time || 0);
//
var cache_time = parseInt(uni.getStorageSync(this.cache_buy_use_type_interval_time_key+this.info.id) || 0);
//
var current_time = Date.parse(new Date()) / 1000;
// +
if (interval_time == 0 || (cache_time == 0 || current_time > cache_time+interval_time)) {
//
var temp = [];
this.info.buy_use_type_list.forEach((v, i) => {
v['key'] = i;
temp.unshift(v);
});
this.setData({
buy_use_type_choice_list: temp,
buy_use_type_choice_status: true
});
//
//
var cache_index = this.get_cache_buy_use_type_index();
if((this.base || null) != null && parseInt(this.base.is_tips_user_choice_buy_use_type || 0) == 1 && (cache_index === null || cache_index === '') && (this.info.buy_use_type_list || null) != null && this.info.buy_use_type_list.length > 1 && (this.info.status_info || null) != null && this.info.status_info.status == 1) {
//
var key = 'is_tips_user_choice_buy_use_type_'+this.params.source+'_detail';
if(parseInt(this.base[key] || 0) == 1) {
//
var interval_time = parseInt(this.base.tips_user_choice_buy_use_type_interval_time || 0);
//
var cache_time = parseInt(uni.getStorageSync(this.cache_buy_use_type_interval_time_key+this.info.id) || 0);
//
var current_time = Date.parse(new Date()) / 1000;
// +
if (interval_time == 0 || (cache_time == 0 || current_time > cache_time+interval_time)) {
//
var temp = [];
this.info.buy_use_type_list.forEach((v, i) => {
v['key'] = i;
temp.unshift(v);
});
this.setData({
buy_use_type_choice_list: temp,
buy_use_type_choice_status: true
});
}
}
}
//
this.setData({
buy_use_type_index: index,
});
//
this.get_cart_data();
}
//
this.setData({
buy_use_type_index: index,
});
//
this.get_cart_data();
}
}
}

View File

@ -89,7 +89,7 @@ page {
padding-bottom: calc(145rpx + env(safe-area-inset-bottom));
}
.right-content-actual.base-mode-goods {
padding-bottom: calc(166rpx + env(safe-area-inset-bottom));
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
}
.goods-list-top-nav {
position: sticky;

View File

@ -103,7 +103,9 @@
</view>
<!-- 门店基础模式 - 商品 -->
<view v-if="is_base_mode == 1 && (is_base_mode_show_type == 0 || (is_base_mode_show_type == 2 && nav_base_index == 0))" class="padding-horizontal-main border-radius-main bg-white">
<view v-if="is_base_mode_show_type == 0" class="fw-b title-left-border margin-bottom-sm margin-top-main">{{$t('goods-detail.goods-detail.dfge45')}}</view>
<view v-if="is_base_mode_show_type == 0" class="padding-top-sm margin-bottom-sm margin-top-main">
<view class="fw-b title-left-border">{{$t('goods-detail.goods-detail.dfge45')}}</view>
</view>
<scroll-view :scroll-y="true" class="cr-base text-size-sm" :style="content_style">
<view class="right-content-actual base-mode-goods">
<mp-html :content="info.describe" />
@ -205,7 +207,7 @@
</block>
<!-- 基础模式底部导航 -->
<view v-if="is_base_mode == 1" class="bg-white pf left-0 bottom-0 wh-auto padding-main bs-bb br-top-shadow">
<view v-if="is_base_mode == 1" class="plugins-realstore-detail-base-mode-nav z-i-deep bg-white pf left-0 bottom-0 wh-auto padding-main bs-bb br-top-shadow">
<view class="bottom-line-exclude button-list">
<view :class="'button-left tc '+(is_service_info == 1 ? '' : 'wh-auto')">
<!-- #ifndef MP-KUAISHOU -->
@ -237,9 +239,7 @@
</view>
<!-- 门店购物车 -->
<block v-if="is_base_mode != 1">
<component-realstore-cart ref="realstore_cart" :propCurrencySymbol="currency_symbol" :propStatus="is_cart_nav" v-on:CartSuccessEvent="goods_opt_cart_back_event" v-on:BuyTypeSwitchEvent="buy_type_switch_event" v-on:CartDataBackEvent="cart_data_back_event"></component-realstore-cart>
</block>
<component-realstore-cart ref="realstore_cart" :propIsBaseMode="is_base_mode == 1" :propCurrencySymbol="currency_symbol" :propStatus="is_cart_nav" v-on:CartSuccessEvent="goods_opt_cart_back_event" v-on:BuyTypeSwitchEvent="buy_type_switch_event" v-on:CartDataBackEvent="cart_data_back_event"></component-realstore-cart>
<!-- 客服弹窗 -->
<component-popup :propShow="popup_service_status" propPosition="bottom" @onclose="popup_service_close_event">
@ -594,7 +594,7 @@
//
if (this.is_first == 1) {
//
if(this.is_base_mode != 1 || is_base_mode_show_type != 0) {
if(this.is_base_mode != 1 || this.is_base_mode_show_type != 0) {
this.get_data_list();
}
//
@ -736,11 +736,11 @@
content_actual_size_handle() {
//
var value = 0;
if(this.is_base_mode == 1 && (this.is_base_mode_show_type == 0 || this.is_base_mode_show_type == 2)) {
value = (this.is_base_mode_show_type == 0) ? 58 : 92;
if(this.is_base_mode == 1) {
value = (this.is_base_mode_show_type == 1) ? 110 : 220;
}
//
value += (this.client_type == 'h5') ? 370 : 328;
value += (this.client_type == 'h5') ? 370 : 352;
//
if(this.tablecode != null) {
value += 44;