jufubao-base 1.0.446 → 1.0.447-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/JfbBaseAfterSalesFast/Api.js +13 -0
- package/src/components/JfbBaseAfterSalesFast/JfbBaseAfterSalesFast.vue +58 -1
- package/src/components/JfbBaseAfterSalesFast/Mock.js +1 -0
- package/src/components/JfbBaseAfterSalesFast/refundOrderProduct.vue +177 -0
- package/get.package.path.js +0 -22
package/package.json
CHANGED
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
* @type {*[]}
|
|
6
6
|
*/
|
|
7
7
|
module.exports = [
|
|
8
|
+
{
|
|
9
|
+
mapFnName: "getAfterOmsOrder",
|
|
10
|
+
path: "/aftersale/v1/service-order/get-oms-order",
|
|
11
|
+
title: "获取订单信息",
|
|
12
|
+
isRule: false,
|
|
13
|
+
params: {
|
|
14
|
+
main_order_id: ['主单订单号', 'String', true],
|
|
15
|
+
db_from: ['来源', 'String', true],
|
|
16
|
+
},
|
|
17
|
+
isConsole: true,
|
|
18
|
+
disabled: true,
|
|
19
|
+
},
|
|
8
20
|
{
|
|
9
21
|
mapFnName: "getAfterSalesTypeList",
|
|
10
22
|
path: "/aftersale/v1/service-order/after-sales-type-list",
|
|
@@ -22,6 +34,7 @@ module.exports = [
|
|
|
22
34
|
data: {
|
|
23
35
|
main_order_id: ['主订单号', 'String', true],
|
|
24
36
|
after_sale_type: ['售后类型', 'String', true],
|
|
37
|
+
product_list: ['商品列表', 'String', false],
|
|
25
38
|
db_from: ['来源', 'String', true],
|
|
26
39
|
},
|
|
27
40
|
isConsole: true,
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
<view class="tip_title">温馨提示</view>
|
|
32
32
|
<xd-content-xss :html="warmTips"></xd-content-xss>
|
|
33
33
|
</view>
|
|
34
|
+
<refund-order-product :list="productList"
|
|
35
|
+
:orderNumber="baseInfo.main_order_id"
|
|
36
|
+
@change="handleSelectProduct"
|
|
37
|
+
></refund-order-product>
|
|
34
38
|
<view class="bottom_fixed" :style="prod_bottom">
|
|
35
39
|
<xd-button type="primary" @click="handleApplyRefund">提交申请</xd-button>
|
|
36
40
|
</view>
|
|
@@ -58,11 +62,13 @@
|
|
|
58
62
|
import XdButton from "@/components/XdButton/XdButton";
|
|
59
63
|
import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer"
|
|
60
64
|
import XdRadio from "@/components/XdRadio/XdRadio"
|
|
65
|
+
import RefundOrderProduct from "./refundOrderProduct.vue"
|
|
61
66
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
62
67
|
import JfbBaseAfterSalesFastMixin from "./JfbBaseAfterSalesFastMixin";
|
|
63
68
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
64
69
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
65
70
|
import extsMixins from "@/mixins/extsMixins";
|
|
71
|
+
import getServiceUrl from "@/common/getServiceUrl";
|
|
66
72
|
export default {
|
|
67
73
|
name: "JfbBaseAfterSalesFast",
|
|
68
74
|
components: {
|
|
@@ -70,7 +76,8 @@
|
|
|
70
76
|
XdContentXss,
|
|
71
77
|
XdButton,
|
|
72
78
|
XdDownDrawer,
|
|
73
|
-
XdRadio
|
|
79
|
+
XdRadio,
|
|
80
|
+
RefundOrderProduct
|
|
74
81
|
},
|
|
75
82
|
mixins: [
|
|
76
83
|
componentsMixins, extsMixins, JfbBaseAfterSalesFastMixin
|
|
@@ -86,6 +93,10 @@
|
|
|
86
93
|
temp_type: "",
|
|
87
94
|
afterSalesTypes: [],
|
|
88
95
|
|
|
96
|
+
productList: [],
|
|
97
|
+
service_product_list: [],
|
|
98
|
+
baseInfo: {},
|
|
99
|
+
|
|
89
100
|
refundStepPath: "",
|
|
90
101
|
}
|
|
91
102
|
},
|
|
@@ -114,6 +125,7 @@
|
|
|
114
125
|
methods: {
|
|
115
126
|
onJfbLoad(options) {
|
|
116
127
|
this.order_id = options.order_id;
|
|
128
|
+
this.p_getAfterOmsOrder();
|
|
117
129
|
this.p_getAfterSalesTypeList();
|
|
118
130
|
},
|
|
119
131
|
|
|
@@ -133,6 +145,38 @@
|
|
|
133
145
|
this.afterSalesTypes = res.list;
|
|
134
146
|
})
|
|
135
147
|
},
|
|
148
|
+
/**
|
|
149
|
+
* @description 获取订单商品信息(默认全选,便于快速退款)
|
|
150
|
+
*/
|
|
151
|
+
p_getAfterOmsOrder(){
|
|
152
|
+
this.$xdShowLoading({});
|
|
153
|
+
jfbRootExec("getAfterOmsOrder", {
|
|
154
|
+
vm: this,
|
|
155
|
+
data: {
|
|
156
|
+
main_order_id: this.order_id
|
|
157
|
+
}
|
|
158
|
+
}).then(res => {
|
|
159
|
+
this.$xdHideLoading();
|
|
160
|
+
const { product_list, base_info } = res;
|
|
161
|
+
this.productList = (product_list || []).map(item => {
|
|
162
|
+
item.product_thumb = getServiceUrl(item.product_thumb, 'size2');
|
|
163
|
+
item.checked = true;
|
|
164
|
+
return item;
|
|
165
|
+
});
|
|
166
|
+
this.baseInfo = base_info || {};
|
|
167
|
+
this.handleSelectProduct(this.productList);
|
|
168
|
+
}).catch(err => {
|
|
169
|
+
this.$xdHideLoading();
|
|
170
|
+
console.error(err)
|
|
171
|
+
})
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* @description 选中的售后商品变更
|
|
175
|
+
* @param productList {array} 已勾选的商品列表
|
|
176
|
+
*/
|
|
177
|
+
handleSelectProduct(productList){
|
|
178
|
+
this.service_product_list = productList;
|
|
179
|
+
},
|
|
136
180
|
selectApplyReason(id){
|
|
137
181
|
this.temp_type = id;
|
|
138
182
|
},
|
|
@@ -145,6 +189,14 @@
|
|
|
145
189
|
return;
|
|
146
190
|
}
|
|
147
191
|
|
|
192
|
+
if(!this.service_product_list.length) {
|
|
193
|
+
this.$xdAlert({
|
|
194
|
+
content: '请选择售后商品',
|
|
195
|
+
type: "error"
|
|
196
|
+
})
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
148
200
|
if(this.refundStepPath === '') {
|
|
149
201
|
this.$xdAlert({
|
|
150
202
|
content: '请配置售后详情跳转链接',
|
|
@@ -159,6 +211,11 @@
|
|
|
159
211
|
data: {
|
|
160
212
|
main_order_id: this.order_id,
|
|
161
213
|
after_sale_type: this.after_sale_type,
|
|
214
|
+
product_list: JSON.stringify(this.service_product_list.map(item => ({
|
|
215
|
+
product_id: item.product_id,
|
|
216
|
+
product_sku_id: item.sku_id,
|
|
217
|
+
gift_id: item.gift_id
|
|
218
|
+
})))
|
|
162
219
|
}
|
|
163
220
|
}).then(res => {
|
|
164
221
|
this.$xdHideLoading();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
+
getAfterOmsOrder: {"base_info":{"main_order_id":"m788348987084525809","partner_id":185,"site_id":"b7beb73251752cf1","business_code":"cake","freight_price":300,"support_aftersale_method":"[{\"value\":\"refund_and_good\",\"label\":\"\\u9000\\u8d27\"},{\"value\":\"again\",\"label\":\"\\u8865\\u53d1\"},{\"value\":\"exchange\",\"label\":\"\\u6362\\u8d27\"}]","support_refund_method":"part"},"product_list":[{"product_id":60030789,"product_name":"价格日历(185)","sku_id":"0","sku_name":"","product_num":1,"product_thumb":"\/uploads\/20240314\/a9121a540e92f35ec881f883daf6028c.jpg","brand_id":100003,"brand_name":"品牌jls0519","main_order_id":"m788348987084525809","sub_order_id":"s788348987671728370","gift_id":0,"can_use_sale_price":3000,"delivery_method_name":"快递配送","db_from":"online"},{"product_id":60031175,"product_name":"税率测试(货源96折,平台10折)","sku_id":"0","sku_name":"","product_num":1,"product_thumb":"\/uploads\/20241104\/021c99b07d40101e24af67bf416cf429.jpeg","brand_id":100003,"brand_name":"品牌jls0519","main_order_id":"m788348987084525809","sub_order_id":"s788348987671728371","gift_id":0,"can_use_sale_price":0,"delivery_method_name":"快递配送","db_from":"online"}],"request_id":"b85ae3a23d92d509"},
|
|
4
5
|
getAfterSalesTypeList: {
|
|
5
6
|
list: [
|
|
6
7
|
{
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="order_info">
|
|
3
|
+
<view class="order_number">
|
|
4
|
+
<view class="order_number_check" @click="handleCheckAll">
|
|
5
|
+
<view class="check_box" :class="{ checked: isAllChecked }" v-if="showRadio">
|
|
6
|
+
<xd-font-icon v-if="isAllChecked" icon="iconduigou-xian" :size="24" color="#fff"></xd-font-icon>
|
|
7
|
+
</view>
|
|
8
|
+
<text>全部商品</text>
|
|
9
|
+
</view>
|
|
10
|
+
</view>
|
|
11
|
+
<view class="prod_list">
|
|
12
|
+
<view class="prod_item" v-for="(item, i) in uiList" :key="i">
|
|
13
|
+
<view v-if="showRadio" class="prod_check" @click="handleChangeRadio(item, !item.checked)">
|
|
14
|
+
<view class="check_box" :class="{ checked: item.checked }">
|
|
15
|
+
<xd-font-icon v-if="item.checked" icon="iconduigou-xian" :size="24" color="#fff"></xd-font-icon>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
<view class="prod_img">
|
|
19
|
+
<image :src="item.product_thumb" mode="aspectFit"></image>
|
|
20
|
+
</view>
|
|
21
|
+
<view class="prod_info">
|
|
22
|
+
<view class="prod_title">{{ item.product_name }}</view>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
</view>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
31
|
+
export default {
|
|
32
|
+
components: {
|
|
33
|
+
XdFontIcon
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
list: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default() {
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
orderNumber: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
showRadio: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
data(){
|
|
52
|
+
return {
|
|
53
|
+
uiList: []
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
watch: {
|
|
57
|
+
list: {
|
|
58
|
+
handler(val){
|
|
59
|
+
this.uiList = val;
|
|
60
|
+
},
|
|
61
|
+
deep: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
created(){
|
|
65
|
+
this.uiList = this.list;
|
|
66
|
+
},
|
|
67
|
+
computed: {
|
|
68
|
+
//是否已全选(列表非空且每一项都已勾选)
|
|
69
|
+
isAllChecked(){
|
|
70
|
+
return this.uiList.length > 0 && this.uiList.every(item => item.checked);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
getReturnParams(){
|
|
75
|
+
if(this.showRadio){
|
|
76
|
+
return this.uiList.filter(item => item.checked);
|
|
77
|
+
}
|
|
78
|
+
return this.uiList;
|
|
79
|
+
},
|
|
80
|
+
update(){
|
|
81
|
+
let params = this.getReturnParams();
|
|
82
|
+
this.$emit("change", params);
|
|
83
|
+
},
|
|
84
|
+
handleChangeRadio(prod, checked){
|
|
85
|
+
//多选逻辑,只切换当前项的勾选状态,不影响其他项
|
|
86
|
+
this.uiList = this.uiList.map(item => {
|
|
87
|
+
if(prod.product_id === item.product_id && prod.sku_id === item.sku_id){
|
|
88
|
+
return {...item, checked: checked};
|
|
89
|
+
}
|
|
90
|
+
return item;
|
|
91
|
+
})
|
|
92
|
+
this.update();
|
|
93
|
+
},
|
|
94
|
+
//全选/取消全选(不可勾选时不处理)
|
|
95
|
+
handleCheckAll(){
|
|
96
|
+
if(!this.showRadio) return;
|
|
97
|
+
const checked = !this.isAllChecked;
|
|
98
|
+
this.uiList = this.uiList.map(item => ({...item, checked}));
|
|
99
|
+
this.update();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="less" scoped>
|
|
106
|
+
.order_info{
|
|
107
|
+
background-color: #FFFFFF;
|
|
108
|
+
margin-top: 20rpx;
|
|
109
|
+
border-radius: 16rpx;
|
|
110
|
+
font-size: 24rpx;
|
|
111
|
+
padding: 32rpx;
|
|
112
|
+
.order_number{
|
|
113
|
+
padding-bottom: 24rpx;
|
|
114
|
+
border-bottom: 1px solid #F2F2F2;
|
|
115
|
+
margin-bottom: 32rpx;
|
|
116
|
+
.order_number_check{
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//多选方框(“全部商品”与单个商品共用)
|
|
122
|
+
.check_box{
|
|
123
|
+
width: 32rpx;
|
|
124
|
+
height: 32rpx;
|
|
125
|
+
border: 2rpx solid #D7D7D7;
|
|
126
|
+
border-radius: 6rpx;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
&.checked{
|
|
132
|
+
background-color: var(--main-color, #FF5733);
|
|
133
|
+
border-color: var(--main-color, #FF5733);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.order_number_check .check_box{
|
|
137
|
+
margin-right: 12rpx;
|
|
138
|
+
}
|
|
139
|
+
.prod_check{
|
|
140
|
+
margin-right: 20rpx;
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
.prod_item{
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
margin-bottom: 40rpx;
|
|
149
|
+
&:last-child{
|
|
150
|
+
margin-bottom: 0;
|
|
151
|
+
}
|
|
152
|
+
.prod_img{
|
|
153
|
+
width: 140rpx;
|
|
154
|
+
height: 140rpx;
|
|
155
|
+
border-radius: 16rpx;
|
|
156
|
+
background-color: #F0F0F0;
|
|
157
|
+
image{
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
.prod_info{
|
|
163
|
+
margin-left: 20rpx;
|
|
164
|
+
flex: 1;
|
|
165
|
+
align-self: stretch;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
justify-content: space-between;
|
|
169
|
+
.prod_title{
|
|
170
|
+
margin-bottom: 10rpx;
|
|
171
|
+
font-size: 28rpx;
|
|
172
|
+
color: #333333;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
</style>
|
package/get.package.path.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description 第三方库
|
|
5
|
-
* @param threePackagePath {String} 第三方库所在项目路径存放路径路
|
|
6
|
-
* @param packname {String} 包名字
|
|
7
|
-
* @returns {string|*}
|
|
8
|
-
*/
|
|
9
|
-
const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
|
|
10
|
-
if(packname === 'gxd-commands-bussiness') {
|
|
11
|
-
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (packname === 'gxd-uni-library-editx') {
|
|
15
|
-
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
getPackagePath
|
|
22
|
-
}
|