From 8d7f82b07cd70387ff56abd13411ec2d515da982 Mon Sep 17 00:00:00 2001 From: Waiting Date: Mon, 18 Mar 2024 21:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 3 + src/api/company/index.ts | 1 + src/api/goods/index.ts | 9 +- src/api/goods/types.ts | 45 +++++++++- src/api/user/index.ts | 5 +- src/components/sku-dialog.vue | 29 ++++++- src/pages/home/index.vue | 16 +++- src/pages/mall/index.vue | 29 ++++--- src/pages/mall/subs/goods/detail.vue | 59 ++++++++----- .../subs/coupon/components/coupon-item.vue | 9 +- src/pages/mine/subs/coupon/index.vue | 86 ++++++------------- src/pages/qrcode/index.vue | 3 +- 13 files changed, 187 insertions(+), 108 deletions(-) diff --git a/package.json b/package.json index 067020f..c39e7d7 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@dcloudio/uni-components": "3.0.0-3090920231225001", "@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001", "@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001", + "dayjs": "^1.11.10", "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.2.1", "uview-plus": "^3.1.38", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7f57da..74a6264 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ dependencies: '@dcloudio/uni-mp-xhs': specifier: 3.0.0-3090920231225001 version: 3.0.0-3090920231225001(postcss@8.4.32)(vue@3.2.47) + dayjs: + specifier: ^1.11.10 + version: 1.11.10 pinia: specifier: 2.0.36 version: 2.0.36(typescript@5.3.2)(vue@3.2.47) diff --git a/src/api/company/index.ts b/src/api/company/index.ts index c8b2385..c69d014 100644 --- a/src/api/company/index.ts +++ b/src/api/company/index.ts @@ -1,3 +1,4 @@ import { get } from '@/utils/request'; +export const getCompanyList = (maOpenId: string) => get({ url: `/wc/wechat/company?maOpenId=${maOpenId}` }); export const getCompanyInfo = (companyId: string) => get({ url: `/ext/zconfig/company_find?companyId=${companyId}` }); diff --git a/src/api/goods/index.ts b/src/api/goods/index.ts index f42009b..8239694 100644 --- a/src/api/goods/index.ts +++ b/src/api/goods/index.ts @@ -1,14 +1,15 @@ import { get, post } from '@/utils'; +import { CategoryBean, GoodsBean } from '@/api/goods/types'; enum URL { - categoryList = '/ext//goods/category_list', + categoryList = '/ext/goods/category_list', goodsList = '/ext/goods/query', goodsDetail = '/ext/goods/info', order = '/user/logout', } -export const getCategoryList = (companyId: string) => get({ url: URL.categoryList + `?companyId=${companyId}` }); +export const getCategoryList = () => get({ url: URL.categoryList }); -export const getGoodsList = (params: any) => post({ url: URL.goodsList, data: params }); +export const getGoodsList = (params: any) => post({ url: URL.goodsList, data: params }); -export const getGoodsDetail = () => get({ url: URL.goodsDetail }); +export const getGoodsDetail = (goodsId: string) => get({ url: URL.goodsDetail + `?goodsId=${goodsId}` }); diff --git a/src/api/goods/types.ts b/src/api/goods/types.ts index 8d15b38..2c0c4bc 100644 --- a/src/api/goods/types.ts +++ b/src/api/goods/types.ts @@ -4,9 +4,52 @@ export interface CategoryBean { } export interface GoodsBean { - code: string; + id: string; goodsId: string; goodsName: string; + allow_integral: number; + available: number; + back_factory: number; + brand_id: string; + brand_name: string; + code: string; + company_id: string; + cost_price: number; + create_time: string; + creator_id: string; + discount: number; images: string; + market_time: string; + material_id: string; + material_name: string; + name: string; price: number; + price_ext: number; + profile: string; + remark: string; + remark1: string; + remark2: string; + remark3: string; + remark4: string; + season_id: string; + season_name: string; + status: number; + stocks: StockBean[], + store_id: string; + suplier_id: string; + suplier_name: string; + type_id: string; + type_name: string; + update_time: string; + years_id: string; + years_name: string; +} + +export interface StockBean { + colorId: string; + colorName: string; + existingNumber: number; + sizeId: string; + sizeName: string; + stockId: string; } diff --git a/src/api/user/index.ts b/src/api/user/index.ts index 28e6353..27eb09b 100644 --- a/src/api/user/index.ts +++ b/src/api/user/index.ts @@ -19,7 +19,8 @@ enum URL { addressUpdate = '/ext/addr/update', addressDelete = '/ext/addr/delete', dynamicCode = '/member/dynccode', - rechargeList = '/ext/recharge/rule_config' + rechargeList = '/ext/recharge/rule_config', + couponList = '/wechat/coupons/coupons/pageList', } export const getUserProfile = () => get({ url: URL.profile }); @@ -41,4 +42,4 @@ export const getDynamicCode = () => post({ url: URL.dynamicCode }); export const getRechargeList = () => get({ url: URL.rechargeList }); -export const getCouponList = (data: any) => post({ url: '/couponseUse/pageList', data }); +export const getCouponList = (data: any) => post({ url: URL.couponList, data }); diff --git a/src/components/sku-dialog.vue b/src/components/sku-dialog.vue index 0671dea..3f33457 100644 --- a/src/components/sku-dialog.vue +++ b/src/components/sku-dialog.vue @@ -2,10 +2,10 @@ - + - 女童夏装套装洋气装短袖阔… - 29.90 + {{ bean.name }}… + {{ bean?.price }} @@ -48,10 +48,15 @@