Skip to content

Commit ec412f7

Browse files
committed
Merge remote-tracking branch 'origin/dev' into owen_dev
2 parents bce427f + b8ca580 commit ec412f7

File tree

20 files changed

+308
-290
lines changed

20 files changed

+308
-290
lines changed

src/api/mall/product/spu.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ export interface Property {
99

1010
export interface Sku {
1111
id?: number // 商品 SKU 编号
12+
name?: string // 商品 SKU 名称
1213
spuId?: number // SPU 编号
1314
properties?: Property[] // 属性数组
14-
price?: number // 商品价格
15-
marketPrice?: number // 市场价
16-
costPrice?: number // 成本价
15+
price?: number | string // 商品价格
16+
marketPrice?: number | string // 市场价
17+
costPrice?: number | string // 成本价
1718
barCode?: string // 商品条码
1819
picUrl?: string // 图片地址
1920
stock?: number // 库存
2021
weight?: number // 商品重量,单位:kg 千克
2122
volume?: number // 商品体积,单位:m^3 平米
22-
subCommissionFirstPrice?: number // 一级分销的佣金
23-
subCommissionSecondPrice?: number // 二级分销的佣金
23+
subCommissionFirstPrice?: number | string // 一级分销的佣金
24+
subCommissionSecondPrice?: number | string // 二级分销的佣金
2425
salesCount?: number // 商品销量
2526
}
2627

src/api/mall/trade/order/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,20 @@ export interface DeliveryVO {
102102

103103
// 订单发货
104104
export const delivery = async (data: DeliveryVO) => {
105-
return await request.post({ url: `/trade/order/delivery`, data })
105+
return await request.put({ url: `/trade/order/delivery`, data })
106106
}
107107

108108
// 订单备注
109-
export const remark = async (data) => {
110-
return await request.post({ url: `/trade/order/remark`, data })
109+
export const updateRemark = async (data: any) => {
110+
return await request.put({ url: `/trade/order/update-remark`, data })
111111
}
112112

113113
// 订单调价
114-
export const adjustPrice = async (data) => {
115-
return await request.post({ url: `/trade/order/adjust-price`, data })
114+
export const updatePrice = async (data: any) => {
115+
return await request.put({ url: `/trade/order/update-price`, data })
116116
}
117117

118118
// 修改订单地址
119-
export const adjustAddress = async (data) => {
120-
return await request.post({ url: `/trade/order/adjust-address`, data })
119+
export const updateAddress = async (data: any) => {
120+
return await request.put({ url: `/trade/order/update-address`, data })
121121
}

src/router/modules/remaining.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
346346
}
347347
]
348348
},
349-
{
350-
path: '/property', // TODO @puhui999:这里的 path 有问题,应该是 /product/property
351-
component: Layout,
352-
name: 'Property',
353-
meta: {
354-
hidden: true
355-
},
356-
children: [
357-
{
358-
path: 'value/:propertyId(\\d+)',
359-
component: () => import('@/views/mall/product/property/value/index.vue'),
360-
name: 'ProductPropertyValue',
361-
meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' }
362-
}
363-
]
364-
},
365349
{
366350
path: '/product',
367351
component: Layout,
@@ -408,6 +392,19 @@ const remainingRouter: AppRouteRecordRaw[] = [
408392
title: '商品详情',
409393
activeMenu: '/product/product-spu'
410394
}
395+
},
396+
{
397+
path: 'property/value/:propertyId(\\d+)',
398+
component: () => import('@/views/mall/product/property/value/index.vue'),
399+
name: 'ProductPropertyValue',
400+
meta: {
401+
noCache: true,
402+
hidden: true,
403+
canTo: true,
404+
icon: 'ep:view',
405+
title: '商品属性值',
406+
activeMenu: '/product/property'
407+
}
411408
}
412409
]
413410
},
@@ -421,7 +418,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
421418
children: [
422419
{
423420
path: 'detail/:orderId(\\d+)',
424-
component: () => import('@/views/mall/trade/order/components/OrderDetailForm.vue'),
421+
component: () => import('@/views/mall/trade/order/detail/index.vue'),
425422
name: 'TradeOrderDetailForm',
426423
meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' }
427424
}

src/utils/dict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export enum DICT_TYPE {
131131
BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type',
132132

133133
// ========== PAY 模块 ==========
134-
PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
134+
PAY_CHANNEL_CODE = 'pay_channel_code_type', // 支付渠道编码类型
135135
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
136136
PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态
137137
PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态

src/utils/index.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export const copyValueToTarget = (target, source) => {
174174
Object.assign(target, newObj)
175175
}
176176

177-
// TODO @puhui999:返回要带上 .00 哈.例如说 1.00
178177
/**
179178
* 将一个整数转换为分数保留两位小数
180179
* @param num
@@ -185,6 +184,31 @@ export const formatToFraction = (num: number | string | undefined): number => {
185184
return parseFloat((parsedNumber / 100).toFixed(2))
186185
}
187186

187+
/**
188+
* 将一个数转换为 1.00 这样
189+
* 数据呈现的时候使用
190+
*
191+
* @param num 整数
192+
*/
193+
export const floatToFixed2 = (num: number | string | undefined): string => {
194+
let str = '0.00'
195+
if (typeof num === 'undefined') {
196+
return str
197+
}
198+
const f = formatToFraction(num)
199+
const decimalPart = f.toString().split('.')[1]
200+
const len = decimalPart ? decimalPart.length : 0
201+
switch (len) {
202+
case 0:
203+
str = f.toString() + '.00'
204+
break
205+
case 1:
206+
str = f.toString() + '0'
207+
break
208+
}
209+
return str
210+
}
211+
188212
/**
189213
* 将一个分数转换为整数
190214
* @param num

src/views/mall/product/comment/CommentForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<el-form-item label="评论内容" prop="content">
3737
<el-input type="textarea" v-model="formData.content" />
3838
</el-form-item>
39+
<!-- TODO @疯狂:formData.scores 是通过后端计算的哈,不要前端传递 -->
3940
<el-form-item label="评分星级" prop="scores">
4041
<el-rate v-model="formData.scores" />
4142
</el-form-item>

src/views/mall/product/comment/components/SkuTableSelect.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { ElTable } from 'element-plus'
3737
import * as ProductSpuApi from '@/api/mall/product/spu'
3838
import { propTypes } from '@/utils/propTypes'
3939
40+
// TODO @疯狂:是不是挪到 spu 的 components 下哈
4041
defineOptions({ name: 'SkuTableSelect' })
4142
4243
const props = defineProps({

src/views/mall/product/comment/components/SpuTableSelect.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import { defaultProps, handleTree } from '@/utils/tree'
8686
import * as ProductCategoryApi from '@/api/mall/product/category'
8787
import * as ProductSpuApi from '@/api/mall/product/spu'
8888
89+
// TODO @疯狂:是不是挪到 spu 的 components 下哈
8990
defineOptions({ name: 'SpuTableSelect' })
9091
9192
const message = useMessage() // 消息弹窗

src/views/mall/product/comment/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<ContentWrap>
6161
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="false">
6262
<el-table-column label="评论编号" align="center" prop="id" min-width="60" />
63+
<!-- TODO @疯狂:后端貌似没读取? -->
6364
<el-table-column label="用户名称" align="center" prop="userNickname" width="80" />
6465
<el-table-column label="商品信息" align="center" min-width="210">
6566
<template #default="scope">
@@ -210,7 +211,7 @@ const getList = async () => {
210211
loading.value = true
211212
try {
212213
const data = await CommentApi.getCommentPage(queryParams)
213-
// visible 如果为 null,会导致刷新的时候触发e-switch的change事件
214+
// visible 如果为 null,会导致刷新的时候触发 e-switch 的 change 事件
214215
data.list.forEach((item) => {
215216
if (!item.visible) {
216217
item.visible = false
@@ -241,6 +242,7 @@ const openForm = (type: string, id?: number) => {
241242
formRef.value.open(type, id)
242243
}
243244
245+
// TODO @疯狂:要不回复,也搞一个组件出去?
244246
/** 回复 **/
245247
const replyFormRef = ref()
246248
const replyDialog = reactive({

src/views/mall/product/property/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
import { dateFormatter } from '@/utils/formatTime'
102102
import * as PropertyApi from '@/api/mall/product/property'
103103
import PropertyForm from './PropertyForm.vue'
104+
104105
const { push } = useRouter()
105106
106107
defineOptions({ name: 'ProductProperty' })
@@ -164,7 +165,7 @@ const handleDelete = async (id: number) => {
164165
165166
/** 跳转商品属性列表 */
166167
const goValueList = (id: number) => {
167-
push({ path: '/property/value/' + id })
168+
push({ path: '/product/property/value/' + id })
168169
}
169170
170171
/** 初始化 **/

0 commit comments

Comments
 (0)