diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 0ea324b8..2ad9bc60 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -9,18 +9,19 @@ export interface Property { export interface Sku { id?: number // 商品 SKU 编号 + name?: string // 商品 SKU 名称 spuId?: number // SPU 编号 properties?: Property[] // 属性数组 - price?: number // 商品价格 - marketPrice?: number // 市场价 - costPrice?: number // 成本价 + price?: number | string // 商品价格 + marketPrice?: number | string // 市场价 + costPrice?: number | string // 成本价 barCode?: string // 商品条码 picUrl?: string // 图片地址 stock?: number // 库存 weight?: number // 商品重量,单位:kg 千克 volume?: number // 商品体积,单位:m^3 平米 - subCommissionFirstPrice?: number // 一级分销的佣金 - subCommissionSecondPrice?: number // 二级分销的佣金 + subCommissionFirstPrice?: number | string // 一级分销的佣金 + subCommissionSecondPrice?: number | string // 二级分销的佣金 salesCount?: number // 商品销量 } diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index e99b1338..9413b73c 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -102,20 +102,20 @@ export interface DeliveryVO { // 订单发货 export const delivery = async (data: DeliveryVO) => { - return await request.post({ url: `/trade/order/delivery`, data }) + return await request.put({ url: `/trade/order/delivery`, data }) } // 订单备注 -export const remark = async (data) => { - return await request.post({ url: `/trade/order/remark`, data }) +export const updateRemark = async (data: any) => { + return await request.put({ url: `/trade/order/update-remark`, data }) } // 订单调价 -export const adjustPrice = async (data) => { - return await request.post({ url: `/trade/order/adjust-price`, data }) +export const updatePrice = async (data: any) => { + return await request.put({ url: `/trade/order/update-price`, data }) } // 修改订单地址 -export const adjustAddress = async (data) => { - return await request.post({ url: `/trade/order/adjust-address`, data }) +export const updateAddress = async (data: any) => { + return await request.put({ url: `/trade/order/update-address`, data }) } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 40909f4a..87ffd1e5 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -346,22 +346,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - { - path: '/property', // TODO @puhui999:这里的 path 有问题,应该是 /product/property - component: Layout, - name: 'Property', - meta: { - hidden: true - }, - children: [ - { - path: 'value/:propertyId(\\d+)', - component: () => import('@/views/mall/product/property/value/index.vue'), - name: 'ProductPropertyValue', - meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } - } - ] - }, { path: '/product', component: Layout, @@ -408,6 +392,19 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '商品详情', activeMenu: '/product/product-spu' } + }, + { + path: 'property/value/:propertyId(\\d+)', + component: () => import('@/views/mall/product/property/value/index.vue'), + name: 'ProductPropertyValue', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:view', + title: '商品属性值', + activeMenu: '/product/property' + } } ] }, @@ -421,7 +418,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'detail/:orderId(\\d+)', - component: () => import('@/views/mall/trade/order/components/OrderDetailForm.vue'), + component: () => import('@/views/mall/trade/order/detail/index.vue'), name: 'TradeOrderDetailForm', meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' } } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 9ec2e994..6b163628 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -131,7 +131,7 @@ export enum DICT_TYPE { BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type', // ========== PAY 模块 ========== - PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型 + PAY_CHANNEL_CODE = 'pay_channel_code_type', // 支付渠道编码类型 PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态 PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态 PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态 diff --git a/src/utils/index.ts b/src/utils/index.ts index 3d596a36..c73b8d2f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -174,7 +174,6 @@ export const copyValueToTarget = (target, source) => { Object.assign(target, newObj) } -// TODO @puhui999:返回要带上 .00 哈.例如说 1.00 /** * 将一个整数转换为分数保留两位小数 * @param num @@ -185,6 +184,31 @@ export const formatToFraction = (num: number | string | undefined): number => { return parseFloat((parsedNumber / 100).toFixed(2)) } +/** + * 将一个数转换为 1.00 这样 + * 数据呈现的时候使用 + * + * @param num 整数 + */ +export const floatToFixed2 = (num: number | string | undefined): string => { + let str = '0.00' + if (typeof num === 'undefined') { + return str + } + const f = formatToFraction(num) + const decimalPart = f.toString().split('.')[1] + const len = decimalPart ? decimalPart.length : 0 + switch (len) { + case 0: + str = f.toString() + '.00' + break + case 1: + str = f.toString() + '0' + break + } + return str +} + /** * 将一个分数转换为整数 * @param num diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue index 85458c3d..f4180f45 100644 --- a/src/views/mall/product/comment/CommentForm.vue +++ b/src/views/mall/product/comment/CommentForm.vue @@ -36,6 +36,7 @@ + diff --git a/src/views/mall/product/comment/components/SkuTableSelect.vue b/src/views/mall/product/comment/components/SkuTableSelect.vue index 8bbc50cf..f72870e4 100644 --- a/src/views/mall/product/comment/components/SkuTableSelect.vue +++ b/src/views/mall/product/comment/components/SkuTableSelect.vue @@ -37,6 +37,7 @@ import { ElTable } from 'element-plus' import * as ProductSpuApi from '@/api/mall/product/spu' import { propTypes } from '@/utils/propTypes' +// TODO @疯狂:是不是挪到 spu 的 components 下哈 defineOptions({ name: 'SkuTableSelect' }) const props = defineProps({ diff --git a/src/views/mall/product/comment/components/SpuTableSelect.vue b/src/views/mall/product/comment/components/SpuTableSelect.vue index f8560aa3..2a62a2fa 100644 --- a/src/views/mall/product/comment/components/SpuTableSelect.vue +++ b/src/views/mall/product/comment/components/SpuTableSelect.vue @@ -86,6 +86,7 @@ import { defaultProps, handleTree } from '@/utils/tree' import * as ProductCategoryApi from '@/api/mall/product/category' import * as ProductSpuApi from '@/api/mall/product/spu' +// TODO @疯狂:是不是挪到 spu 的 components 下哈 defineOptions({ name: 'SpuTableSelect' }) const message = useMessage() // 消息弹窗 diff --git a/src/views/mall/product/comment/index.vue b/src/views/mall/product/comment/index.vue index ecb519c9..7647aff1 100644 --- a/src/views/mall/product/comment/index.vue +++ b/src/views/mall/product/comment/index.vue @@ -60,6 +60,7 @@ +