From cdca21c0c12fa79ad4e85321d0f0960c0c4c3f33 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 06 三月 2026 10:56:17 +0800
Subject: [PATCH] 优化
---
mini-program/pages/mall/mall.vue | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/mini-program/pages/mall/mall.vue b/mini-program/pages/mall/mall.vue
index 28dd9e1..0b132df 100644
--- a/mini-program/pages/mall/mall.vue
+++ b/mini-program/pages/mall/mall.vue
@@ -18,9 +18,9 @@
<view class="head-list">
<view class="head-list-item" @click="openSearch(1)">
- <text :style="form.sortInfo ? 'color: #222222; font-weight: 500;' : ''">{{form.sortName}}</text>
- <u-icon name="arrow-down" color="#222222" size="13" v-if="form.sortInfo && !show"></u-icon>
- <u-icon name="arrow-up" color="#222222" size="13" v-else-if="form.sortInfo && show === 1"></u-icon>
+ <text :style="String(form.sortInfo) ? 'color: #222222; font-weight: 500;' : ''">{{form.sortName}}</text>
+ <u-icon name="arrow-down" color="#222222" size="13" v-if="String(form.sortInfo) && !show"></u-icon>
+ <u-icon name="arrow-up" color="#222222" size="13" v-else-if="String(form.sortInfo) && show === 1"></u-icon>
<u-icon name="arrow-down" color="#777777" size="13" v-else></u-icon>
</view>
<view class="head-list-item" @click="openSearch(2)">
@@ -58,7 +58,7 @@
</view>
<view class="commodity">
<view class="commodity-wu" v-if="goodsList.length === 0">
- <image src="/static/images/default_search@2x.png" mode="widthFix"></image>
+ <image src="/static/images/default_nodata_grey.png" mode="widthFix"></image>
</view>
<view class="commodity-item" v-else v-for="(item, i) in goodsList" :key="i" @click="jumpDetails(item.id)">
<view class="commodity-item-image">
@@ -74,11 +74,11 @@
<text>.{{item.minPrice[1]}}</text>
</view>
<view class="commodity-item-box-price-b">
- 楼{{item.price}}
+ 楼{{item.linePrice || 0}}
</view>
</view>
<view class="commodity-item-shou">
- <text>宸插敭{{item.saleNum + item.realSaleNum}}</text>
+ <text>宸插敭{{item.shou}}</text>
<view class="commodity-item-shou-add" @click.stop="addCard(item)">+</view>
</view>
</view>
@@ -212,11 +212,11 @@
}
this.$u.api.addCart({
goodsId: e.id,
- goodsSkuId: e.skuResponsesList[0].id,
+ goodsSkuId: e.goodsSkuResponseList[0].id,
num: 1
}).then(res => {
if (res.code === 200) {
- uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success' })
+ uni.showToast({ title: '娣诲姞鎴愬姛', icon: 'success', mask: true })
this.getCartNum()
}
})
@@ -237,6 +237,7 @@
if (res.code === 200) {
res.data.records.forEach(item => {
item.minPrice = item.minPrice.toFixed(2).split('.')
+ item.shou = (item.salenum || 0) + (item.realSaleNum || 0)
})
this.goodsList.push(...res.data.records)
this.page++
@@ -268,6 +269,8 @@
},
// 绯诲垪
getXiLie(parentId, i) {
+ this.form.seriesBrandId = ''
+ this.form.seriesBrandName = ''
this.xilie = []
this.pingpai.forEach((item, index) => {
item.active = index === i
@@ -417,11 +420,13 @@
.commodity-item-image {
width: 100%;
height: 336rpx;
+ overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
image {
width: 100%;
+ max-height:330rpx;
}
}
.commodity-item-box {
@@ -429,6 +434,11 @@
padding: 20rpx;
box-sizing: border-box;
.commodity-item-box-title {
+ width: 100%;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
font-weight: 600;
font-size: 30rpx;
color: #222222;
@@ -465,6 +475,7 @@
font-weight: 400;
font-size: 22rpx;
color: #999999;
+ text-decoration: line-through;
}
}
.commodity-item-shou {
--
Gitblit v1.9.3