门店详情优化
parent
a8ae53ce80
commit
8899c7e1b7
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue