This commit is contained in:
2024-04-16 11:41:18 +08:00
parent 178e8ff5cb
commit 32aa0eb971
8 changed files with 105 additions and 29 deletions

View File

@@ -12,8 +12,12 @@
<view v-for='(item, index) in goodsList' :key='index' class='goods-item'
@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 }}</text>
<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>
<image class='add-image' :src='assetsUrl("ic_add_goods.png")' @click.stop='addShoppingCart(item)' />
</view>
</grid-view>
@@ -29,10 +33,14 @@ import { goPath } from '@/utils';
import { getGoodsList } from '@/api/goods';
import useShoppingCartStore from '@/store/modules/shoppingcart';
import { GoodsBean } from '@/api/goods/types';
import { useUserStore } from '@/store';
const skuDialogRef = ref();
const shoppingCartStore = useShoppingCartStore();
const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore);
const goodsList = ref<GoodsBean[]>([]);
onLoad((e) => {