积分接口联调

This commit is contained in:
2024-03-21 23:22:24 +08:00
parent 792aa4268a
commit 4fb648f003
9 changed files with 67 additions and 33 deletions

View File

@@ -65,20 +65,25 @@ const changeCategory = async (index: number) => {
};
const fetchGoodsList = async () => {
const data = await getGoodsList({
pageNum: 1,
pageSize: 20,
bean: {
keyword: '',
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
const { rows } = await getGoodsList({
page: {
pageNum: 1,
pageSize: 100,
bean: {
keyword: '',
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
}
}
});
goodsList.value = data.rows;
goodsList.value = rows;
};
const addShoppingCart = (goodsBean: GoodsBean) => {
shoppingCart.save({
...goodsBean
...goodsBean,
name: goodsBean.goodsName,
count: 1
});
};
</script>

View File

@@ -116,11 +116,13 @@ const swiperIndex = ref(0);
onLoad(async (e: any) => {
goodsBean.value = await getGoodsDetail(e.goodsId);
const { rows } = await getGoodsList({
page: 1,
pageSize: 10,
bean: {
keyword: '',
typeIds: ['1724629185362591745']
page: {
page: 1,
pageSize: 20,
bean: {
keyword: '',
typeIds: ['1724629185362591745']
}
}
});
recommendList.value = rows;
@@ -146,7 +148,8 @@ const addShoppingCart = () => {
shoppingCart.save(
{
...goodsBean.value,
...skuBean.value
...skuBean.value,
count: 1
}
);
showToast('加入购物车成功');

View File

@@ -11,12 +11,12 @@
<image v-show='isEditMode' class='checkbox' :src='assetsUrl("ic_checkbox_active_red.png")' />
<image class='goods-image' :src='item.images' />
<view class='c-flex-column'>
<text>{{item.name}}</text>
<text>{{ item.name }}</text>
<view class='sku-view'>
<text>紫色120cm x1</text>
<text>{{ item?.colorName }}{{ item?.sizeName }} x{{ item?.count }}</text>
<image :src='assetsUrl("ic_arrow_down_gray.png")' />
</view>
<text>{{item.price}}</text>
<text style='margin-top: 50rpx'>{{ item.price }}</text>
<view class='count-change-view c-flex-row'>
<view class='count-image' @click.stop='countChange(false)'>
<image :src='assetsUrl("ic_reduce.png")' />
@@ -57,8 +57,6 @@ const checkedAll = ref(false);
const shoppingCart = useShoppingCartStore();
const { shoppingCartList } = storeToRefs(shoppingCart);
// const goodsCount = ref(1);
const countChange = (isPlus: Boolean) => {
};