优化占位图显示
This commit is contained in:
@@ -22,11 +22,15 @@
|
||||
@click.stop='goPath(`/pages/mall/subs/goods/detail?goodsId=${item.goodsId}`)'>
|
||||
<image class='goods-image' :src='item.images||defaultImage' />
|
||||
<text class='goods-name'>{{ item.goodsName || '未知' }}</text>
|
||||
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100)/100)).toFixed(2) }}
|
||||
<text v-if='userInfo.levelEntity?.discount>0' style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}</text></text>
|
||||
<text class='goods-price'>¥{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
||||
<text v-if='userInfo.levelEntity?.discount>0'
|
||||
style='text-decoration: line-through;color: #999999;font-size: 25rpx'>¥{{ item.price }}
|
||||
</text>
|
||||
</text>
|
||||
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' @click.stop='addShoppingCart(item)' />
|
||||
</view>
|
||||
</grid-view>
|
||||
<u-empty v-if='goodsList.length === 0' text='暂无商品数据' />
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
@@ -51,7 +55,7 @@ import useShoppingCartStore from '@/store/modules/shoppingcart';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const {userInfo, companyConfigInfo } = storeToRefs(userStore);
|
||||
const { userInfo, companyConfigInfo } = storeToRefs(userStore);
|
||||
const shoppingCartStore = useShoppingCartStore();
|
||||
const { totalCount } = storeToRefs(shoppingCartStore);
|
||||
|
||||
@@ -82,7 +86,11 @@ onLoad(() => {
|
||||
|
||||
const fetchCategoryList = async () => {
|
||||
if(companyConfigInfo.value.mallopen == 1) {
|
||||
categoryList.value = await getCategoryList();
|
||||
const list = await getCategoryList();
|
||||
list.unshift({ typeName: '上新精选', typeId: '0' });
|
||||
list.unshift({ typeName: '热销商品', typeId: '0' });
|
||||
list.unshift({ typeName: '全部分类', typeId: '0' });
|
||||
categoryList.value = list;
|
||||
await changeCategory(0);
|
||||
}
|
||||
};
|
||||
@@ -180,7 +188,7 @@ const addShoppingCart = (goodsBean: GoodsBean) => {
|
||||
.category-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 210rpx;
|
||||
width: 280rpx;
|
||||
height: 100vh;
|
||||
|
||||
.category-item {
|
||||
|
@@ -44,6 +44,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<u-empty v-else text='暂无数据' margin-top='100' />
|
||||
|
||||
<view class='bottom-view c-flex-row'>
|
||||
<view class='c-flex-row' @click.stop='handleAllCheck'>
|
||||
|
Reference in New Issue
Block a user