feat:0820需求
This commit is contained in:
+16
-7
@@ -125,11 +125,12 @@
|
||||
<view class="product_info_box">
|
||||
<view class="product_title">{{ item.name || item.title }}</view>
|
||||
|
||||
<view class="product_tags_row">
|
||||
<text class="tag_item tag_blue" v-if="item.tags && item.tags[0]">{{ item.tags[0] }}</text>
|
||||
<text class="tag_item tag_green" v-if="item.tags && item.tags[1]">{{ item.tags[1] }}</text>
|
||||
<text class="tag_item tag_blue" v-if="!item.tags">专业检测</text>
|
||||
<text class="tag_item tag_green" v-if="!item.tags">生态有机</text>
|
||||
<view class="product_tags_row" v-if="item.sellingPoint && getSellingPointTags(item.sellingPoint).length > 0">
|
||||
<text
|
||||
class="tag_item tag_green"
|
||||
v-for="(tag, tIndex) in getSellingPointTags(item.sellingPoint)"
|
||||
:key="tIndex"
|
||||
>{{ tag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="product_price_row">
|
||||
@@ -230,6 +231,13 @@ export default {
|
||||
this.fetchCategories(isBackFromSortShop);
|
||||
},
|
||||
methods: {
|
||||
getSellingPointTags(sellingPoint) {
|
||||
if (!sellingPoint || typeof sellingPoint !== 'string') return [];
|
||||
return sellingPoint
|
||||
.split(/[,,]/)
|
||||
.map(t => t.trim())
|
||||
.filter(Boolean);
|
||||
},
|
||||
// 异步查询级联分类接口 (common/getCascadeCategory)
|
||||
async getCategoryApi(pId) {
|
||||
try {
|
||||
@@ -439,8 +447,8 @@ export default {
|
||||
jumpInfo(item) {
|
||||
this.isFromSortShop = true;
|
||||
uni.navigateTo({
|
||||
url: `/pages/rwa_package/shop/sort-shop?id=${item.id}&name=${encodeURIComponent(item.name || item.title || '')}`,
|
||||
});
|
||||
url: '/pages/other_package/productInfo/productInfo?id=' + item.id,
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -844,6 +852,7 @@ page {
|
||||
|
||||
.product_tags_row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
margin-top: 8rpx;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user