Compare commits

...

4 Commits

8 changed files with 59 additions and 17 deletions

View File

@@ -244,7 +244,7 @@ const localDevConfig = ({
// })['2811']; // 本地 // })['2811']; // 本地
// })['5g-317']; // 电磁兼容 // })['5g-317']; // 电磁兼容
// })['5g-351']; // // })['5g-351']; //
})['1']; // 本地 })['5g-351']; // 本地
// })['local-2']; // 本地 // })['local-2']; // 本地
// })['local-11']; // 本地 // })['local-11']; // 本地
// })['1-test']; // test // })['1-test']; // test

View File

@@ -187,8 +187,9 @@
<!-- 三级分类(及更深层级): 一级分类标题 + 二级分类网格(图3) --> <!-- 三级分类(及更深层级): 一级分类标题 + 二级分类网格(图3) -->
<view :class="['category-title', '']">{{ category.category_name }}</view> <view :class="['category-title', '']">{{ category.category_name }}</view>
<view class="category-list"> <view class="category-list">
<!-- 点二级分类进入商品列表: 带 list_style=grid 让列表页默认用竖版(双列宫格)视图, hide_sort=1 隐藏排序栏 -->
<view class="category-item" v-for="(one, oneIndex) in category.child_list" :key="oneIndex" <view class="category-item" v-for="(one, oneIndex) in category.child_list" :key="oneIndex"
@tap.stop="$util.redirectTo('/pages_goods/list', { category_id: one.category_id })"> @tap.stop="$util.redirectTo('/pages_goods/list', { category_id: one.category_id, list_style: 'grid', hide_sort: 1 })">
<view class="img-box"> <view class="img-box">
<image :src="categoryImg(one.image)" mode="aspectFit" @error="categoryImgError(2, oneIndex, -1)" show-menu-by-longpress /> <image :src="categoryImg(one.image)" mode="aspectFit" @error="categoryImgError(2, oneIndex, -1)" show-menu-by-longpress />
</view> </view>

View File

@@ -1,7 +1,7 @@
<template> <template>
<!-- Vue 2 / uni-app 单根约束:用 view 包一层 --> <!-- Vue 2 / uni-app 单根约束:用 view 包一层 -->
<view> <view>
<view v-if="pageCount === 1 || need" class="fixed-box" <view v-if="(pageCount === 1 || need) && hasVisibleFixBtn" class="fixed-box"
:style="[customContainerStyle, { :style="[customContainerStyle, {
height: containerHeight, height: containerHeight,
bottom: containerBottom, bottom: containerBottom,
@@ -74,10 +74,11 @@
<text class="icox icox-kefu" v-if="!kefuimg"></text> <text class="icox icox-kefu" v-if="!kefuimg"></text>
</button> </button>
<!-- 电话按钮 --> <!-- 电话按钮 (已隐藏: 仅 display:none, DOM/事件/逻辑全部保留, 把 hidePhoneBtn 改回 false 即恢复) -->
<view <view
v-if="fixBtnShow" v-if="fixBtnShow"
class="btn-item common-bg" class="btn-item common-bg"
:class="{ 'btn-item-hide': hidePhoneBtn }"
:style="[btnItemStyle, { backgroundImage: phoneimg ? `url(${phoneimg})` : '', backgroundSize: '100% 100%' }, customButtonStyle]" :style="[btnItemStyle, { backgroundImage: phoneimg ? `url(${phoneimg})` : '', backgroundSize: '100% 100%' }, customButtonStyle]"
@click="call" @click="call"
> >
@@ -178,6 +179,9 @@ export default {
langDisplayMap: { ...LANG_DISPLAY_NAMES }, // 后端 langDisplayNames 会覆盖默认值 langDisplayMap: { ...LANG_DISPLAY_NAMES }, // 后端 langDisplayNames 会覆盖默认值
showLangPopup: false, // 语言选择弹窗显隐 showLangPopup: false, // 语言选择弹窗显隐
customerService: null, customerService: null,
// 是否隐藏「电话」悬浮按钮: true = 隐藏(只隐藏不移除, DOM/点击事件/拨打逻辑都保留)
// 需要恢复时改回 false 即可, 或按需接后端配置
hidePhoneBtn: true,
// ============================================================ // ============================================================
// 布局参数(从 App.vue 的 :root CSS 变量读取,权威源在 App.vue) // 布局参数(从 App.vue 的 :root CSS 变量读取,权威源在 App.vue)
// 关键设计: // 关键设计:
@@ -295,6 +299,12 @@ export default {
const customerService = createCustomerService(this); const customerService = createCustomerService(this);
return customerService.hasValidKefuConfig(); return customerService.hasValidKefuConfig();
}, },
// 是否还有需要展示的浮动按钮:
// 电话按钮被隐藏、且没有语言切换/客服按钮时, 整个浮动按钮容器都不渲染,
// 避免留下一个透明的空容器挡住下面的页面内容点击
hasVisibleFixBtn() {
return !this.hidePhoneBtn || this.isLanguageSwitchEnabled || this.hasValidKefuConfig;
},
//根据显示的按钮数量动态计算容器高度 //根据显示的按钮数量动态计算容器高度
// 计算明细(buttonCount 按钮场景): // 计算明细(buttonCount 按钮场景):
@@ -309,7 +319,8 @@ export default {
containerHeight() { containerHeight() {
if (!this.fixBtnShow) return '320rpx'; if (!this.fixBtnShow) return '320rpx';
let buttonCount = 1; // 电话按钮隐藏时不再占用容器高度, 避免底部留白
let buttonCount = this.hidePhoneBtn ? 0 : 1;
if (this.isLanguageSwitchEnabled) buttonCount++; if (this.isLanguageSwitchEnabled) buttonCount++;
if (this.showWeappSystemKefu) buttonCount++; if (this.showWeappSystemKefu) buttonCount++;
buttonCount++; buttonCount++;
@@ -864,6 +875,11 @@ export default {
background-color: var(--hover-nav-bg-color); background-color: var(--hover-nav-bg-color);
} }
/* 电话悬浮按钮隐藏态: 只隐藏不移除(DOM、点击事件、拨打逻辑都还在), 去掉该类即恢复 */
.btn-item-hide {
display: none !important;
}
.btn-item text { .btn-item text {
font-size: 28rpx; font-size: 28rpx;
} }

View File

@@ -90,16 +90,17 @@ export default {
} }
}, },
// 跟随 goodsSkuDetail 变化重新决定默认 Tab // 跟随 goodsSkuDetail 变化重新决定默认 Tab
// 解决 refreshGoodsSkuDetail 后续合并 pdf_url 时,Tab 已显示但 detailTab 仍为 'html' 的问题 // 默认展示排在前面的「商品详情」, 只有在没有图文详情、仅有说明书(pdf_url)时才默认选中说明书;
// 同时解决 refreshGoodsSkuDetail 后续合并数据时,Tab 已显示但 detailTab 未跟上的问题
goodsSkuDetail: { goodsSkuDetail: {
deep: true, deep: true,
immediate: true, immediate: true,
handler(newVal) { handler(newVal) {
if (!newVal) return; if (!newVal) return;
if (newVal.pdf_url) { if (this.hasHtmlTab) {
this.detailTab = 'pdf';
} else if (newVal.goods_content) {
this.detailTab = 'html'; this.detailTab = 'html';
} else if (newVal.pdf_url) {
this.detailTab = 'pdf';
} }
} }
} }

View File

@@ -386,14 +386,15 @@
<!-- 商品详情 --> <!-- 商品详情 -->
<view v-if="hasDetailContent" class="goods-detail-tab"> <view v-if="hasDetailContent" class="goods-detail-tab">
<view class="detail-tab"> <view class="detail-tab">
<view v-if="goodsSkuDetail.pdf_url" class="tab-item" <!-- 商品详情 在前, 产品说明书(文档详情) 在后 -->
:class="{ active: detailTab === 'pdf' }" @click="switchDetailTab('pdf')">
<text class="tab-label">{{ $lang('goods.detail.document') }}</text>
</view>
<view v-if="hasHtmlTab" class="tab-item" <view v-if="hasHtmlTab" class="tab-item"
:class="{ active: detailTab === 'html' }" @click="switchDetailTab('html')"> :class="{ active: detailTab === 'html' }" @click="switchDetailTab('html')">
<text class="tab-label">{{ $lang('goods.detail.details') }}</text> <text class="tab-label">{{ $lang('goods.detail.details') }}</text>
</view> </view>
<view v-if="goodsSkuDetail.pdf_url" class="tab-item"
:class="{ active: detailTab === 'pdf' }" @click="switchDetailTab('pdf')">
<text class="tab-label">{{ $lang('goods.detail.document') }}</text>
</view>
</view> </view>
<view class="detail-content active"> <view class="detail-content active">
<!-- PDF文档 --> <!-- PDF文档 -->

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="content" :style="themeColor"> <view class="content" :style="themeColor">
<view class="head-wrap"> <view class="head-wrap" :class="{ 'head-wrap-extend': hideSort }">
<!-- 搜索区域 --> <!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row"> <view class="search-wrap uni-flex uni-row">
<view class="flex-item input-wrap"> <view class="flex-item input-wrap">
@@ -12,8 +12,8 @@
@click="changeListStyle()"></view> @click="changeListStyle()"></view>
</view> </view>
<!-- 排序 --> <!-- 排序 (商品分类模板5进入时隐藏, 只隐藏不移除) -->
<view class="sort-wrap"> <view class="sort-wrap" :class="{ 'sort-wrap-hide': hideSort }">
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }" <view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
@click="sortTabClick('')"> @click="sortTabClick('')">
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('goods.list.Random') }}</text> <text :class="{ 'color-base-text': orderType === '' }">{{ $lang('goods.list.Random') }}</text>
@@ -45,7 +45,7 @@
</view> </view>
</view> </view>
<mescroll-uni top="180" ref="mescroll" @getData="getGoodsList"> <mescroll-uni :top="hideSort ? 120 : 180" ref="mescroll" @getData="getGoodsList">
<block slot="list"> <block slot="list">
<view v-if="isList" class="goods-list single-column" :class="{ show: isList }"> <view v-if="isList" class="goods-list single-column" :class="{ show: isList }">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id" <view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="item.id"

View File

@@ -5,6 +5,13 @@
left: 0; left: 0;
z-index: 1; z-index: 1;
// 商品分类模板5进入时排序栏被隐藏, 让白色背景继续向下延伸(搜索框位置不变),
// 一直覆盖到第一行商品卡片顶部, 避免搜索框下方出现灰色空白条
&.head-wrap-extend {
// 26rpx = mescroll top(100rpx) - 搜索区高度(94rpx) + 列表 padding-top($margin-updown: 20rpx)
padding-bottom: 20rpx;
}
.search-wrap { .search-wrap {
flex: 0.5; flex: 0.5;
padding: 30rpx 30rpx 0; padding: 30rpx 30rpx 0;
@@ -60,6 +67,12 @@
.sort-wrap { .sort-wrap {
display: flex; display: flex;
padding: 10rpx 20rpx 10rpx 0; padding: 10rpx 20rpx 10rpx 0;
// 商品分类模板5进入商品列表时隐藏排序栏(综合/销量/价格/筛选), 只隐藏不移除
&.sort-wrap-hide {
display: none;
}
> view { > view {
flex: 1; flex: 1;
text-align: center; text-align: center;

View File

@@ -19,6 +19,7 @@ export default {
coupon: 0, coupon: 0,
emptyShow: false, emptyShow: false,
isList: true, //列表样式 isList: true, //列表样式
hideSort: false, //是否隐藏排序栏(综合/销量/价格/筛选)
//分享所需标题 //分享所需标题
share_title: '', share_title: '',
//搜索到多少件商品 //搜索到多少件商品
@@ -82,6 +83,15 @@ export default {
}); });
this.categoryId = options.category_id || 0; this.categoryId = options.category_id || 0;
// 商品分类(模板5)点二级分类进入时带 list_style=grid, 默认展示竖版(双列宫格)视图;
// 其它入口(搜索/优惠券/品牌等)保持原有的单列列表视图
if (options.list_style === 'grid') {
this.isList = false;
}
// 商品分类(模板5)进入时隐藏排序栏(综合/销量/价格/筛选), 只隐藏不移除
if (options.hide_sort == 1) {
this.hideSort = true;
}
this.keyword = options.keyword || ''; this.keyword = options.keyword || '';
this.coupon = options.coupon || 0; this.coupon = options.coupon || 0;
this.goods_id_arr = options.goods_id_arr || 0; this.goods_id_arr = options.goods_id_arr || 0;