From 52bfc4dac00bf1e1be9a3d8e49a72d18c4c401bf Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 17 May 2023 01:17:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9B=E4=B8=80=E6=AD=A5=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DTODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/spu.ts | 22 ++- src/views/mall/product/spu/index.vue | 205 +++++++++++++-------------- 2 files changed, 111 insertions(+), 116 deletions(-) diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 9e32a1dc..1d32046f 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -33,7 +33,7 @@ export interface SpuType { picUrl?: string // 商品封面图 sliderPicUrls?: string[] // 商品轮播图 introduction?: string // 商品简介 - deliveryTemplateId?: number // 运费模版 + deliveryTemplateId?: number | null // 运费模版 specType?: boolean // 商品规格 subCommissionType?: boolean // 分销类型 skus: SkuType[] // sku数组 @@ -48,39 +48,37 @@ export interface SpuType { recommendGood?: boolean // 是否优品 } -// TODO @puhui999:中英文之间有空格 - -// 获得spu列表 TODO @puhui999:这个是 getSpuPage 哈 +// 获得 Spu 列表 export const getSpuPage = (params: PageParam) => { return request.get({ url: '/product/spu/page', params }) } -// 获得spu列表tabsCount +// 获得 Spu 列表 tabsCount export const getTabsCount = () => { - return request.get({ url: '/product/spu/tabsCount' }) + return request.get({ url: '/product/spu/get-count' }) } -// 创建商品spu +// 创建商品 Spu export const createSpu = (data: SpuType) => { return request.post({ url: '/product/spu/create', data }) } -// 更新商品spu +// 更新商品 Spu export const updateSpu = (data: SpuType) => { return request.put({ url: '/product/spu/update', data }) } -// 更新商品spu status +// 更新商品 Spu status export const updateStatus = (data: { id: number; status: number }) => { - return request.put({ url: '/product/spu/updateStatus', data }) + return request.put({ url: '/product/spu/update-status', data }) } -// 获得商品 spu +// 获得商品 Spu export const getSpu = (id: number) => { return request.get({ url: `/product/spu/get-detail?id=${id}` }) } -// 删除商品Spu +// 删除商品 Spu export const deleteSpu = (id: number) => { return request.delete({ url: `/product/spu/delete?id=${id}` }) } diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index b3a04c88..0a8837a9 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -18,15 +18,17 @@ @keyup.enter="handleQuery" /> - - - - + + + - + - - - - - - - - - - - - - - - - - + + + + + + @@ -107,19 +110,23 @@ prop="createTime" width="180" /> - + @@ -138,7 +145,7 @@ v-hasPermi="['product:spu:update']" link type="primary" - @click="addToTrash(row, ProductSpuStatusEnum.DISABLE.status)" + @click="changeStatus(row, ProductSpuStatusEnum.DISABLE.status)" > 恢复到仓库 @@ -156,7 +163,7 @@ v-hasPermi="['product:spu:update']" link type="primary" - @click="addToTrash(row, ProductSpuStatusEnum.RECYCLE.status)" + @click="changeStatus(row, ProductSpuStatusEnum.RECYCLE.status)" > 加入回收站 @@ -172,21 +179,17 @@ @pagination="getList" /> - - - - +