...
|
...
|
@@ -41,12 +41,29 @@ const getProductUrlBySkc = (skn) => { |
|
|
|
|
|
const setDetailGoods = (list) => {
|
|
|
let resData = [];
|
|
|
let goods;
|
|
|
|
|
|
_.forEach(list, value => {
|
|
|
resData.push({
|
|
|
|
|
|
goods = {
|
|
|
href: getProductUrlBySkc(value.product_id, value.goods_id, ''),
|
|
|
thumb: helpers.image(value.goods_image, 60, 60),
|
|
|
name: value.product_name || '',
|
|
|
color: value.color_name,
|
|
|
size: value.size_name,
|
|
|
yoho_coin_cut_num: value.yoho_coin_cut_num,
|
|
|
real_pay_price: value.real_pay_price,
|
|
|
price: value.sales_price,
|
|
|
goods_type: value.goods_type,
|
|
|
reason: value.reason_name
|
|
|
});
|
|
|
};
|
|
|
|
|
|
if (value.real_pay_price < value.sales_price) {
|
|
|
goods.price = value.real_pay_price;// 显示分摊价
|
|
|
goods.linePrice = value.sales_price; // 划线的价格
|
|
|
}
|
|
|
|
|
|
resData.push(goods);
|
|
|
});
|
|
|
|
|
|
return resData;
|
...
|
...
|
@@ -174,8 +191,7 @@ const getOrderRefund = (orderCode, uid) => { |
|
|
if (result.data) {
|
|
|
let goods = [];
|
|
|
let returnReason = result.data.return_reason,
|
|
|
remarks = _.split(_.get(result, 'data.special_notice.remark', ''), ' ', 2), // 使用3个空格拆分
|
|
|
amount = 0;
|
|
|
remarks = _.split(_.get(result, 'data.special_notice.remark', ''), ' ', 2); // 使用3个空格拆分
|
|
|
|
|
|
|
|
|
_.forEach(_.get(result, 'data.goods_list', []), value => {
|
...
|
...
|
@@ -185,7 +201,8 @@ const getOrderRefund = (orderCode, uid) => { |
|
|
name: value.product_name,
|
|
|
color: value.factory_color_name,
|
|
|
size: value.size_name,
|
|
|
price: value.last_price,
|
|
|
lastPrice: value.last_price,
|
|
|
price: value.real_pay_price,
|
|
|
skn: value.product_skn,
|
|
|
skc: value.product_skc,
|
|
|
sku: value.product_sku,
|
...
|
...
|
@@ -194,8 +211,6 @@ const getOrderRefund = (orderCode, uid) => { |
|
|
reason: returnReason
|
|
|
};
|
|
|
|
|
|
amount += parseInt(value.last_price, 10);
|
|
|
|
|
|
// tar note 为每个特殊商品都添加标识
|
|
|
if (value.is_limit_skn === 'Y') {
|
|
|
item.specialNoticeBo = {
|
...
|
...
|
@@ -226,14 +241,7 @@ const getOrderRefund = (orderCode, uid) => { |
|
|
|
|
|
Object.assign(resData, {
|
|
|
goods: goods,
|
|
|
orderCode: orderCode,
|
|
|
|
|
|
// 计算相关支付细节
|
|
|
amount: amount - _.get(result, 'data.yoho_coin_num', 0) -
|
|
|
_.get(result, 'data.coupon_amount', 0),
|
|
|
yohoCoin: result.data.yoho_coin_num,
|
|
|
coupon: result.data.coupon_amount,
|
|
|
cash: amount
|
|
|
orderCode: orderCode
|
|
|
});
|
|
|
|
|
|
_.forEach(result.data.return_amount_mode, (val, key) => {
|
...
|
...
|
@@ -329,6 +337,8 @@ const getRefundDetail = (applyId, uid) => { |
|
|
applyTime: data.create_time,
|
|
|
payMode: data.source_payment_type_desc || '',
|
|
|
backMode: data.return_amount_mode_name || '',
|
|
|
return_asset_desc: data.return_asset_desc,
|
|
|
return_amount: data.return_amount,
|
|
|
goods: setDetailGoods(data.goods_list)
|
|
|
};
|
|
|
|
...
|
...
|
@@ -336,7 +346,8 @@ const getRefundDetail = (applyId, uid) => { |
|
|
detail.express = {
|
|
|
id: _.get(data, 'notice.express_id', ''),
|
|
|
company: _.get(data, 'notice.express_company', ''),
|
|
|
number: _.get(data, 'notice.express_number', '')
|
|
|
number: _.get(data, 'notice.express_number', ''),
|
|
|
title: _.get(data, 'notice.title', '请填写寄回快递单号,以便我们查询')
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -396,7 +407,8 @@ const getChangeDetail = (applyId, uid) => { |
|
|
id: _.get(data, 'notice.express_id', ''),
|
|
|
company: _.get(data, 'notice.express_company', ''),
|
|
|
number: _.get(data, 'notice.express_number', ''),
|
|
|
expressDeadLine: _.get(data, 'notice.date', '')
|
|
|
expressDeadLine: _.get(data, 'notice.date', ''),
|
|
|
title: _.get(data, 'notice.title', '请填写寄回快递单号,以便我们查询')
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -525,7 +537,8 @@ const getOrderExchange = (orderCode, uid) => { |
|
|
name: value.product_name,
|
|
|
color: value.color_name,
|
|
|
size: value.size_name,
|
|
|
price: value.last_price,
|
|
|
lastPrice: value.last_price,
|
|
|
price: value.real_pay_price,
|
|
|
skn: value.product_skn,
|
|
|
skc: value.product_skc,
|
|
|
sku: value.product_sku,
|
...
|
...
|
@@ -644,6 +657,10 @@ const setExpressNumber = (id, expressId, expressNumber, uid, expressCompany, isC |
|
|
});
|
|
|
};
|
|
|
|
|
|
const refundCompute = (uid, orderCode, goods) => {
|
|
|
return returnAPI.refundComputeAsync(uid, orderCode, goods);
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getReturnsList, // 我的订单,退换货列表
|
|
|
getOrderRefund, // 我的订单,申请退货
|
...
|
...
|
@@ -655,5 +672,6 @@ module.exports = { |
|
|
getDelivery, // 获取换货方式
|
|
|
getCancelRefund, // 取消退货申请
|
|
|
getCancelChange, // 取消换货申请
|
|
|
setExpressNumber // 设置快递
|
|
|
setExpressNumber, // 设置快递
|
|
|
refundCompute // 退货结算
|
|
|
}; |
...
|
...
|
|