Skip to content

Commit 76e37a3

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev-gitee
2 parents 45a6b3b + b8ca580 commit 76e37a3

File tree

21 files changed

+1112
-289
lines changed

21 files changed

+1112
-289
lines changed

src/api/mall/product/comment.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import request from '@/config/axios'
2+
3+
export interface CommentVO {
4+
id: number
5+
userId: number
6+
userNickname: string
7+
userAvatar: string
8+
anonymous: boolean
9+
orderId: number
10+
orderItemId: number
11+
spuId: number
12+
spuName: string
13+
skuId: number
14+
visible: boolean
15+
scores: number
16+
descriptionScores: number
17+
benefitScores: number
18+
content: string
19+
picUrls: string
20+
replyStatus: boolean
21+
replyUserId: number
22+
replyContent: string
23+
replyTime: Date
24+
}
25+
26+
// 查询商品评论列表
27+
export const getCommentPage = async (params) => {
28+
return await request.get({ url: `/product/comment/page`, params })
29+
}
30+
31+
// 查询商品评论详情
32+
export const getComment = async (id: number) => {
33+
return await request.get({ url: `/product/comment/get?id=` + id })
34+
}
35+
36+
// 添加自评
37+
export const createComment = async (data: CommentVO) => {
38+
return await request.post({ url: `/product/comment/create`, data })
39+
}
40+
41+
// 显示 / 隐藏评论
42+
export const updateCommentVisible = async (data: any) => {
43+
return await request.put({ url: `/product/comment/update-visible`, data })
44+
}
45+
46+
// 商家回复
47+
export const replyComment = async (data: any) => {
48+
return await request.put({ url: `/product/comment/reply`, data })
49+
}

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

0 commit comments

Comments
 (0)