diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index f7e56fd0..b7932858 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -355,7 +355,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, children: [ { - path: 'productSpuAdd', // TODO @puhui999:最好拆成 add 和 edit 两个路由;添加商品;修改商品 fix + path: 'spu/add', component: () => import('@/views/mall/product/spu/addForm.vue'), name: 'ProductSpuAdd', meta: { @@ -368,9 +368,9 @@ const remainingRouter: AppRouteRecordRaw[] = [ } }, { - path: 'productSpuEdit/:spuId(\\d+)', + path: 'spu/edit/:spuId(\\d+)', component: () => import('@/views/mall/product/spu/addForm.vue'), - name: 'productSpuEdit', + name: 'ProductSpuEdit', meta: { noCache: true, hidden: true, @@ -381,9 +381,9 @@ const remainingRouter: AppRouteRecordRaw[] = [ } }, { - path: 'productSpuDetail/:spuId(\\d+)', + path: 'spu/detail/:spuId(\\d+)', component: () => import('@/views/mall/product/spu/addForm.vue'), - name: 'productSpuDetail', + name: 'ProductSpuDetail', meta: { noCache: true, hidden: true, diff --git a/src/views/mall/product/spu/addForm.vue b/src/views/mall/product/spu/addForm.vue index 2d5a3528..7d91d857 100644 --- a/src/views/mall/product/spu/addForm.vue +++ b/src/views/mall/product/spu/addForm.vue @@ -104,7 +104,7 @@ const getDetail = async () => { formLoading.value = true try { const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.Spu - res.skus!.forEach((item) => { + res.skus?.forEach((item) => { // 回显价格分转元 item.price = formatToFraction(item.price) item.marketPrice = formatToFraction(item.marketPrice) diff --git a/src/views/mall/product/spu/components/BasicInfoForm.vue b/src/views/mall/product/spu/components/BasicInfoForm.vue index b8ae405c..7b122151 100644 --- a/src/views/mall/product/spu/components/BasicInfoForm.vue +++ b/src/views/mall/product/spu/components/BasicInfoForm.vue @@ -14,7 +14,6 @@ - - - +