|
@@ -39,6 +39,13 @@ const returnAddress = { |
|
@@ -39,6 +39,13 @@ const returnAddress = { |
39
|
// return d;
|
39
|
// return d;
|
40
|
// };
|
40
|
// };
|
41
|
|
41
|
|
|
|
42
|
+/**
|
|
|
43
|
+ * 获取用户退换货列表
|
|
|
44
|
+ * @function getUserReturn
|
|
|
45
|
+ * @param { string } uid 用户uid
|
|
|
46
|
+ * @param { number } page 分页数量
|
|
|
47
|
+ * @return { Object } 退换货列表
|
|
|
48
|
+ */
|
42
|
const getUserReturn = (uid, page) => {
|
49
|
const getUserReturn = (uid, page) => {
|
43
|
|
50
|
|
44
|
return api.get('', {
|
51
|
return api.get('', {
|
|
@@ -89,6 +96,12 @@ const getUserReturn = (uid, page) => { |
|
@@ -89,6 +96,12 @@ const getUserReturn = (uid, page) => { |
89
|
});
|
96
|
});
|
90
|
};
|
97
|
};
|
91
|
|
98
|
|
|
|
99
|
+/**
|
|
|
100
|
+ * 设置侧边栏列表
|
|
|
101
|
+ * @function _setSideMenu
|
|
|
102
|
+ * @param { string } type 当前所在模块类型
|
|
|
103
|
+ * @return { Object } 侧边栏列表
|
|
|
104
|
+ */
|
92
|
const _setSideMenu = (type) => {
|
105
|
const _setSideMenu = (type) => {
|
93
|
return {
|
106
|
return {
|
94
|
nav: mcHandler.getMeCrumb(type),
|
107
|
nav: mcHandler.getMeCrumb(type),
|
|
@@ -96,6 +109,13 @@ const _setSideMenu = (type) => { |
|
@@ -96,6 +109,13 @@ const _setSideMenu = (type) => { |
96
|
};
|
109
|
};
|
97
|
};
|
110
|
};
|
98
|
|
111
|
|
|
|
112
|
+/**
|
|
|
113
|
+ * 计算进度条进度
|
|
|
114
|
+ * @function _calcStatusRate
|
|
|
115
|
+ * @param { number } num 当前数量
|
|
|
116
|
+ * @param { number } total 总共数量
|
|
|
117
|
+ * @return { string } 进度条进度百分比
|
|
|
118
|
+ */
|
99
|
const _calcStatusRate = (num, total) => {
|
119
|
const _calcStatusRate = (num, total) => {
|
100
|
let rate = 0;
|
120
|
let rate = 0;
|
101
|
|
121
|
|
|
@@ -106,12 +126,25 @@ const _calcStatusRate = (num, total) => { |
|
@@ -106,12 +126,25 @@ const _calcStatusRate = (num, total) => { |
106
|
return rate;
|
126
|
return rate;
|
107
|
};
|
127
|
};
|
108
|
|
128
|
|
|
|
129
|
+/**
|
|
|
130
|
+ * 提交换货申请
|
|
|
131
|
+ * @function submitChange
|
|
|
132
|
+ * @param { Object } data 换货数据
|
|
|
133
|
+ * @param { number } uid 用户uid
|
|
|
134
|
+ * @return { Object } 换货申请结果
|
|
|
135
|
+ */
|
109
|
const submitChange = (data, uid) => {
|
136
|
const submitChange = (data, uid) => {
|
110
|
return returnsAPI.changeSubmitAsync(data, uid).then(result => {
|
137
|
return returnsAPI.changeSubmitAsync(data, uid).then(result => {
|
111
|
return result;
|
138
|
return result;
|
112
|
});
|
139
|
});
|
113
|
};
|
140
|
};
|
114
|
|
141
|
|
|
|
142
|
+/**
|
|
|
143
|
+ * 设置默认退换货状态进度信息
|
|
|
144
|
+ * @function _setDefaultStatus
|
|
|
145
|
+ * @param { string } type 退换货类型(退货/换货)
|
|
|
146
|
+ * @return { Object } 退换货状态进度信息
|
|
|
147
|
+ */
|
115
|
const _setDefaultStatus = (type) => {
|
148
|
const _setDefaultStatus = (type) => {
|
116
|
const list = ['提交申请', '审核通过', '商品寄回', '商品入库', `${type}完成`];
|
149
|
const list = ['提交申请', '审核通过', '商品寄回', '商品入库', `${type}完成`];
|
117
|
let statusList = [];
|
150
|
let statusList = [];
|
|
@@ -133,6 +166,13 @@ const _setDefaultStatus = (type) => { |
|
@@ -133,6 +166,13 @@ const _setDefaultStatus = (type) => { |
133
|
return resData;
|
166
|
return resData;
|
134
|
};
|
167
|
};
|
135
|
|
168
|
|
|
|
169
|
+/**
|
|
|
170
|
+ * 设置退换货状态进度信息
|
|
|
171
|
+ * @function _setReturnStatus
|
|
|
172
|
+ * @param { number } list 退换货进度列表
|
|
|
173
|
+ * @param { boolean } half 是否比正常进度多半格
|
|
|
174
|
+ * @return { Object } 退换货状态进度信息
|
|
|
175
|
+ */
|
136
|
const _setReturnStatus = (list, half) => {
|
176
|
const _setReturnStatus = (list, half) => {
|
137
|
let resData = {};
|
177
|
let resData = {};
|
138
|
|
178
|
|
|
@@ -171,6 +211,12 @@ const _setReturnStatus = (list, half) => { |
|
@@ -171,6 +211,12 @@ const _setReturnStatus = (list, half) => { |
171
|
return resData;
|
211
|
return resData;
|
172
|
};
|
212
|
};
|
173
|
|
213
|
|
|
|
214
|
+/**
|
|
|
215
|
+ * 设置退货列表信息
|
|
|
216
|
+ * @function _setRefundGoodList
|
|
|
217
|
+ * @param { Object } data 接口返货订单信息
|
|
|
218
|
+ * @return { Object } 订单退货信息
|
|
|
219
|
+ */
|
174
|
const _setRefundGoodList = (data) => {
|
220
|
const _setRefundGoodList = (data) => {
|
175
|
let resData = {};
|
221
|
let resData = {};
|
176
|
|
222
|
|
|
@@ -207,6 +253,12 @@ const _setRefundGoodList = (data) => { |
|
@@ -207,6 +253,12 @@ const _setRefundGoodList = (data) => { |
207
|
return resData;
|
253
|
return resData;
|
208
|
};
|
254
|
};
|
209
|
|
255
|
|
|
|
256
|
+/**
|
|
|
257
|
+ * 设置退货订单数据
|
|
|
258
|
+ * @function _setRefundDetailData
|
|
|
259
|
+ * @param { Object } data 接口返回退货订单数据
|
|
|
260
|
+ * @return { Object } 模板渲染退货订单数据
|
|
|
261
|
+ */
|
210
|
const _setRefundDetailData = (data) => {
|
262
|
const _setRefundDetailData = (data) => {
|
211
|
let resData = {
|
263
|
let resData = {
|
212
|
id: data.id || 0
|
264
|
id: data.id || 0
|
|
@@ -281,6 +333,12 @@ const _setRefundDetailData = (data) => { |
|
@@ -281,6 +333,12 @@ const _setRefundDetailData = (data) => { |
281
|
return resData;
|
333
|
return resData;
|
282
|
};
|
334
|
};
|
283
|
|
335
|
|
|
|
336
|
+/**
|
|
|
337
|
+ * 设置物流公司列表
|
|
|
338
|
+ * @function _setExpressData
|
|
|
339
|
+ * @param { Object } data 接口返回物流公司列表
|
|
|
340
|
+ * @return { Array } 物流公司列表
|
|
|
341
|
+ */
|
284
|
const _setExpressData = (data) => {
|
342
|
const _setExpressData = (data) => {
|
285
|
var resData = [];
|
343
|
var resData = [];
|
286
|
|
344
|
|
|
@@ -301,6 +359,12 @@ const _setExpressData = (data) => { |
|
@@ -301,6 +359,12 @@ const _setExpressData = (data) => { |
301
|
return resData;
|
359
|
return resData;
|
302
|
};
|
360
|
};
|
303
|
|
361
|
|
|
|
362
|
+/**
|
|
|
363
|
+ * 设置换货详情数据
|
|
|
364
|
+ * @function _setExchangeDetailData
|
|
|
365
|
+ * @param { Object } data 接口返回换货订单数据
|
|
|
366
|
+ * @return { Object } 模板渲染换货数据
|
|
|
367
|
+ */
|
304
|
const _setExchangeDetailData = (data) => {
|
368
|
const _setExchangeDetailData = (data) => {
|
305
|
data = camelCase(data);
|
369
|
data = camelCase(data);
|
306
|
|
370
|
|
|
@@ -337,6 +401,13 @@ const _setExchangeDetailData = (data) => { |
|
@@ -337,6 +401,13 @@ const _setExchangeDetailData = (data) => { |
337
|
return list;
|
401
|
return list;
|
338
|
};
|
402
|
};
|
339
|
|
403
|
|
|
|
404
|
+/**
|
|
|
405
|
+ * 获取退货商品信息
|
|
|
406
|
+ * @function getRefundGoodsData
|
|
|
407
|
+ * @param { number } orderCode 订单号
|
|
|
408
|
+ * @param { number } uid 用户uid
|
|
|
409
|
+ * @return { Object } 退货商品信息
|
|
|
410
|
+ */
|
340
|
const getRefundGoodsData = (orderCode, uid) => {
|
411
|
const getRefundGoodsData = (orderCode, uid) => {
|
341
|
return returnsAPI.getRefundGoodsAsync(orderCode, uid).then(result => {
|
412
|
return returnsAPI.getRefundGoodsAsync(orderCode, uid).then(result => {
|
342
|
let resData = {};
|
413
|
let resData = {};
|
|
@@ -348,8 +419,6 @@ const getRefundGoodsData = (orderCode, uid) => { |
|
@@ -348,8 +419,6 @@ const getRefundGoodsData = (orderCode, uid) => { |
348
|
refund: _setDefaultStatus('退货') || {}
|
419
|
refund: _setDefaultStatus('退货') || {}
|
349
|
};
|
420
|
};
|
350
|
|
421
|
|
351
|
- // console.log(resData);
|
|
|
352
|
-
|
|
|
353
|
if (result.data) {
|
422
|
if (result.data) {
|
354
|
Object.assign(resData.returns.refund, _setRefundGoodList(result.data), {
|
423
|
Object.assign(resData.returns.refund, _setRefundGoodList(result.data), {
|
355
|
orderCode: orderCode
|
424
|
orderCode: orderCode
|
|
@@ -360,6 +429,13 @@ const getRefundGoodsData = (orderCode, uid) => { |
|
@@ -360,6 +429,13 @@ const getRefundGoodsData = (orderCode, uid) => { |
360
|
});
|
429
|
});
|
361
|
};
|
430
|
};
|
362
|
|
431
|
|
|
|
432
|
+/**
|
|
|
433
|
+ * 获取退货详情信息
|
|
|
434
|
+ * @function getRefundDetailData
|
|
|
435
|
+ * @param { number } applyId 退货申请id
|
|
|
436
|
+ * @param { number } uid 用户uid
|
|
|
437
|
+ * @return { Object } 退货详情信息
|
|
|
438
|
+ */
|
363
|
const getRefundDetailData = (applyId, uid) => {
|
439
|
const getRefundDetailData = (applyId, uid) => {
|
364
|
return Promise.all([
|
440
|
return Promise.all([
|
365
|
returnsAPI.getRefundDetailAsync(applyId, uid),
|
441
|
returnsAPI.getRefundDetailAsync(applyId, uid),
|
|
@@ -393,6 +469,15 @@ const getRefundDetailData = (applyId, uid) => { |
|
@@ -393,6 +469,15 @@ const getRefundDetailData = (applyId, uid) => { |
393
|
});
|
469
|
});
|
394
|
};
|
470
|
};
|
395
|
|
471
|
|
|
|
472
|
+/**
|
|
|
473
|
+ * 保存退货信息
|
|
|
474
|
+ * @function saveRefund
|
|
|
475
|
+ * @param { number } orderCode 订单号
|
|
|
476
|
+ * @param { number } uid 用户uid
|
|
|
477
|
+ * @param { Object } goods 退货商品信息
|
|
|
478
|
+ * @param { Object } payment 退款信息
|
|
|
479
|
+ * @return { Object } 提交退货申请结果
|
|
|
480
|
+ */
|
396
|
const saveRefund = (orderCode, uid, goods, payment) => {
|
481
|
const saveRefund = (orderCode, uid, goods, payment) => {
|
397
|
return returnsAPI.getOrderInfoAsync(orderCode, uid, '').then(result => {
|
482
|
return returnsAPI.getOrderInfoAsync(orderCode, uid, '').then(result => {
|
398
|
if (!_.isEmpty(result)) {
|
483
|
if (!_.isEmpty(result)) {
|
|
@@ -413,6 +498,13 @@ const saveRefund = (orderCode, uid, goods, payment) => { |
|
@@ -413,6 +498,13 @@ const saveRefund = (orderCode, uid, goods, payment) => { |
413
|
});
|
498
|
});
|
414
|
};
|
499
|
};
|
415
|
|
500
|
|
|
|
501
|
+/**
|
|
|
502
|
+ * 获取商品详情
|
|
|
503
|
+ * @function getProductInfo
|
|
|
504
|
+ * @param { number } productId 商品id
|
|
|
505
|
+ * @param { number } productSkn 商品skn
|
|
|
506
|
+ * @return { Object } 商品详情信息
|
|
|
507
|
+ */
|
416
|
const getProductInfo = (productId, productSkn) => {
|
508
|
const getProductInfo = (productId, productSkn) => {
|
417
|
return returnsAPI.getProductInfoAsync(productId, productSkn).then(result => {
|
509
|
return returnsAPI.getProductInfoAsync(productId, productSkn).then(result => {
|
418
|
if (result.code === 200) {
|
510
|
if (result.code === 200) {
|
|
@@ -425,6 +517,13 @@ const getProductInfo = (productId, productSkn) => { |
|
@@ -425,6 +517,13 @@ const getProductInfo = (productId, productSkn) => { |
425
|
});
|
517
|
});
|
426
|
};
|
518
|
};
|
427
|
|
519
|
|
|
|
520
|
+/**
|
|
|
521
|
+ * 获取换货商品列表
|
|
|
522
|
+ * @function getChangeGoodsList
|
|
|
523
|
+ * @param { number } orderCode 订单号
|
|
|
524
|
+ * @param { number } uid 用户uid
|
|
|
525
|
+ * @return { Object } 换货商品列表信息
|
|
|
526
|
+ */
|
428
|
const getChangeGoodsList = (orderCode, uid) => {
|
527
|
const getChangeGoodsList = (orderCode, uid) => {
|
429
|
return returnsAPI.getChangeGoodsListAsync(orderCode, uid).then(result => {
|
528
|
return returnsAPI.getChangeGoodsListAsync(orderCode, uid).then(result => {
|
430
|
const basicData = {
|
529
|
const basicData = {
|
|
@@ -456,6 +555,13 @@ const getChangeGoodsList = (orderCode, uid) => { |
|
@@ -456,6 +555,13 @@ const getChangeGoodsList = (orderCode, uid) => { |
456
|
});
|
555
|
});
|
457
|
};
|
556
|
};
|
458
|
|
557
|
|
|
|
558
|
+/**
|
|
|
559
|
+ * 获取换货详情信息
|
|
|
560
|
+ * @function getExchangeDetailData
|
|
|
561
|
+ * @param { number } id 换货申请单号
|
|
|
562
|
+ * @param { number } uid 用户uid
|
|
|
563
|
+ * @return { Object } 换货详情信息
|
|
|
564
|
+ */
|
459
|
const getExchangeDetailData = (id, uid) => {
|
565
|
const getExchangeDetailData = (id, uid) => {
|
460
|
return Promise.all([
|
566
|
return Promise.all([
|
461
|
returnsAPI.getExchangeDetail(id, uid),
|
567
|
returnsAPI.getExchangeDetail(id, uid),
|
|
@@ -501,6 +607,14 @@ const getExchangeDetailData = (id, uid) => { |
|
@@ -501,6 +607,14 @@ const getExchangeDetailData = (id, uid) => { |
501
|
});
|
607
|
});
|
502
|
};
|
608
|
};
|
503
|
|
609
|
|
|
|
610
|
+/**
|
|
|
611
|
+ * 取消退换货申请
|
|
|
612
|
+ * @function cancelReturnApply
|
|
|
613
|
+ * @param { number } id 退换货id
|
|
|
614
|
+ * @param { number } uid 用户uid
|
|
|
615
|
+ * @param { string } type 退换货类型 refund--退货 exchange--换货
|
|
|
616
|
+ * @return { Object } 取消退换货申请结果
|
|
|
617
|
+ */
|
504
|
const cancelReturnApply = (id, uid, type) => {
|
618
|
const cancelReturnApply = (id, uid, type) => {
|
505
|
return returnsAPI.cancelReturnAsync(id, uid, type).then(result => {
|
619
|
return returnsAPI.cancelReturnAsync(id, uid, type).then(result => {
|
506
|
let resData = result || {
|
620
|
let resData = result || {
|
|
@@ -512,6 +626,13 @@ const cancelReturnApply = (id, uid, type) => { |
|
@@ -512,6 +626,13 @@ const cancelReturnApply = (id, uid, type) => { |
512
|
});
|
626
|
});
|
513
|
};
|
627
|
};
|
514
|
|
628
|
|
|
|
629
|
+/**
|
|
|
630
|
+ * 设置寄回物流信息
|
|
|
631
|
+ * @function setBackEepress
|
|
|
632
|
+ * @param { number } uid 用户uid
|
|
|
633
|
+ * @param { Object } param 物流参数
|
|
|
634
|
+ * @return { Object } 设置寄回物流信息结果
|
|
|
635
|
+ */
|
515
|
const setBackEepress = (uid, param) => {
|
636
|
const setBackEepress = (uid, param) => {
|
516
|
const type = param.type === 'exchange';
|
637
|
const type = param.type === 'exchange';
|
517
|
|
638
|
|