diff --git a/src/api/goods/index.ts b/src/api/goods/index.ts index 8239694..bfe9876 100644 --- a/src/api/goods/index.ts +++ b/src/api/goods/index.ts @@ -10,6 +10,6 @@ enum URL { export const getCategoryList = () => get({ url: URL.categoryList }); -export const getGoodsList = (params: any) => post({ url: URL.goodsList, data: params }); +export const getGoodsList = (params: any) => get({ url: URL.goodsList, data: params }); export const getGoodsDetail = (goodsId: string) => get({ url: URL.goodsDetail + `?goodsId=${goodsId}` }); diff --git a/src/api/user/index.ts b/src/api/user/index.ts index 27eb09b..6139152 100644 --- a/src/api/user/index.ts +++ b/src/api/user/index.ts @@ -21,6 +21,7 @@ enum URL { dynamicCode = '/member/dynccode', rechargeList = '/ext/recharge/rule_config', couponList = '/wechat/coupons/coupons/pageList', + integralList = '/ext/member/integral_query' } export const getUserProfile = () => get({ url: URL.profile }); @@ -43,3 +44,5 @@ export const getDynamicCode = () => post({ url: URL.dynamicCode }); export const getRechargeList = () => get({ url: URL.rechargeList }); export const getCouponList = (data: any) => post({ url: URL.couponList, data }); + +export const getIntegralList =(data:any)=>post({url:URL.integralList, data}) diff --git a/src/api/user/types.ts b/src/api/user/types.ts index 2855de9..4e34823 100644 --- a/src/api/user/types.ts +++ b/src/api/user/types.ts @@ -31,3 +31,12 @@ export interface LoginResult { userInfo: any; token: string; } + +export interface IntegralBean { + id: string; + createtime: string; + exsitvalue: number; + remark: string; + type: number; + value: number; +} diff --git a/src/components/sku-dialog.vue b/src/components/sku-dialog.vue index 16cc61f..6ce5d75 100644 --- a/src/components/sku-dialog.vue +++ b/src/components/sku-dialog.vue @@ -22,7 +22,7 @@ 尺码 {{ item.sizeName }} @@ -104,7 +104,7 @@ const countChange = (isPlus: boolean) => { const confirm = () => { emits('confirm', { ...skuSizeList.value[currentSizeIndex.value], - goodsCount: goodsCount.value + count: goodsCount.value }); popupRef.value.close(); }; diff --git a/src/pages/mall/index.vue b/src/pages/mall/index.vue index 99c25a2..681f0a3 100644 --- a/src/pages/mall/index.vue +++ b/src/pages/mall/index.vue @@ -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 }); }; diff --git a/src/pages/mall/subs/goods/detail.vue b/src/pages/mall/subs/goods/detail.vue index df2f9e0..37baa2c 100644 --- a/src/pages/mall/subs/goods/detail.vue +++ b/src/pages/mall/subs/goods/detail.vue @@ -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('加入购物车成功'); diff --git a/src/pages/mall/subs/shoppingcart/index.vue b/src/pages/mall/subs/shoppingcart/index.vue index 7f9a105..d8ca863 100644 --- a/src/pages/mall/subs/shoppingcart/index.vue +++ b/src/pages/mall/subs/shoppingcart/index.vue @@ -11,12 +11,12 @@ - {{item.name}} + {{ item.name }} - 紫色,120cm x1 + {{ item?.colorName }},{{ item?.sizeName }} x{{ item?.count }} - ¥{{item.price}} + ¥{{ item.price }} @@ -57,8 +57,6 @@ const checkedAll = ref(false); const shoppingCart = useShoppingCartStore(); const { shoppingCartList } = storeToRefs(shoppingCart); -// const goodsCount = ref(1); - const countChange = (isPlus: Boolean) => { }; diff --git a/src/pages/mine/subs/integral/components/integral-item.vue b/src/pages/mine/subs/integral/components/integral-item.vue index 9e71565..622684a 100644 --- a/src/pages/mine/subs/integral/components/integral-item.vue +++ b/src/pages/mine/subs/integral/components/integral-item.vue @@ -1,23 +1,25 @@ diff --git a/src/pages/mine/subs/integral/index.vue b/src/pages/mine/subs/integral/index.vue index 15ceaa1..0837b35 100644 --- a/src/pages/mine/subs/integral/index.vue +++ b/src/pages/mine/subs/integral/index.vue @@ -1,7 +1,7 @@