chore:商品分类模板1,2,3,4,99全部正常

This commit is contained in:
2026-09-07 14:56:32 +08:00
parent 1deb805d29
commit 90c77096aa

View File

@@ -34,6 +34,11 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</block>
</view>
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="item.isinformation == 0 && showMarketPrice(item)">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="footer-wrap">
<view class="consult-now-btn-wrap" v-if="item.isinformation == 1">
@@ -75,6 +80,11 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</block>
</view>
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="item.isinformation == 0 && showMarketPrice(item)">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="footer-wrap footer-wrap-template1">
<view class="detail-btn" @tap.stop="toDetail(item)">{{ $lang('components-diy.diy-category-item.consultNow') }}</view>
@@ -112,6 +122,11 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</block>
</view>
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="item.isinformation == 0 && showMarketPrice(item)">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="footer-wrap footer-wrap-template1">
<view class="detail-btn" @tap.stop="toDetail(item)">{{ $lang('components-diy.diy-category-item.consultNow') }}</view>
@@ -178,6 +193,11 @@
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</block>
</view>
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="item.isinformation == 0 && showMarketPrice(item)">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="footer-wrap footer-wrap-template1">
<view class="detail-btn" @tap.stop="toDetail(item)">{{ $lang('components-diy.diy-category-item.consultNow') }}</view>
@@ -295,17 +315,17 @@
<image :src="$util.img('public/uniapp/index/discount.png')"
mode="widthFix" show-menu-by-longpress />
</view>
<!-- 模板4: 删除线价格(图片样式) -->
<!-- 模板2/4: 删除线价格(放在现价下方, 样式见 price-wrap 的 delete-price 规则) -->
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="showMarketPrice(item) && value.template == 4">
v-if="showMarketPrice(item) && (value.template == 2 || value.template == 4)">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="footer-wrap">
</view>
<view class="footer-wrap">
<view class="pro-info">
<view class="delete-price font-size-activity-tag color-tip price-font"
v-if="showMarketPrice(item) && value.template != 4">
v-if="showMarketPrice(item) && value.template != 4 && value.template != 2">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text>{{ showMarketPrice(item) }}</text>
</view>
@@ -530,7 +550,6 @@ export default {
mixins: [DiyMinx],
data() {
return {
type: 'goods',
level: 3,
categoryId: -1,
loading: false,
@@ -600,9 +619,17 @@ export default {
isGroupedDisplay() {
return this.value.template == 1 && this.value.level == 3;
},
/**
* 渲染类型: 模板1/99 用分类树卡片(category), 其它模板用商品卡片(goods)
* 用计算属性而非 created() 里的一次性赋值:
* 页面下拉刷新/装修数据更新时 value.template 可能变化, 组件被 Vue 复用不会重建,
* 若 type 不跟随更新, 模板1 会误走 goods 分支, 导致"资讯类商品=否"的商品不显示立即咨询按钮
*/
type() {
return this.value.template == 1 || this.value.template == 99 ? 'category' : 'goods';
},
},
created() {
this.type = this.value.template == 1 || this.value.template == 99 ? 'category' : 'goods';
if (this.index == this.select && this.pageIndex == 0) this.getGoodsList();
this.loadType = this.value.goodsLevel == 1 && this.value.loadType == 'all' ? 'all' : 'part';
if (this.value.template == 99 && this.index == this.select && this.category.child_list && this.category.child_list.length > 0) {
@@ -1445,6 +1472,18 @@ export default {
overflow: hidden;
margin-bottom: 20rpx;
// 划线价放在现价正下方(左边与现价对齐, 间距 6rpx)
.price-wrap {
.delete-price {
margin-left: 0;
margin-top: 6rpx;
width: 100%;
display: inline-flex;
align-items: baseline;
text-decoration: line-through;
}
}
.footer-wrap-template1 {
padding: 16rpx 4rpx 0rpx;
display: flex;
@@ -2327,6 +2366,16 @@ export default {
}
}
}
// 模板2/4: 划线价放在现价正下方(price-wrap 为 flex wrap, 划线价占满一行即换到现价下一行, 左边与现价对齐)
&[data-template='2'],
&[data-template='4'] {
.price-wrap .delete-price {
margin-left: 0;
margin-top: 6rpx;
width: 100%;
}
}
}
.categoty-goods-wrap {
@@ -2588,6 +2637,8 @@ export default {
display: flex;
align-items: baseline;
justify-content: space-between;
// 划线价占满一行, 换行到现价正下方
flex-wrap: wrap;
.discount-price {
color: #FF6B35;
@@ -2598,6 +2649,15 @@ export default {
font-size: 22rpx;
}
}
.delete-price {
margin-left: 0;
margin-top: 6rpx;
width: 100%;
display: inline-flex;
align-items: baseline;
text-decoration: line-through;
}
}
.footer-wrap {