jufubao-base 1.0.222-beta1 → 1.0.222-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.222-beta1",
3
+ "version": "1.0.222-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -6,51 +6,51 @@
6
6
  */
7
7
  module.exports = [
8
8
  {
9
- //设置方法名字当别忘记加上【模块名字】:After
10
- mapFnName: 'getAfterByIdFilmSquate',
11
- title: '获取电影广场列表',
12
- path: '/api/account/film/list-film-square',
9
+ mapFnName: "getAfterOmsOrder",
10
+ path: "/aftersale/v1/service-order/get-oms-order",
11
+ title: "获取订单信息",
13
12
  isRule: false,
14
13
  params: {
15
- last_key: ['当前页', 'Number', '必选'],
16
- page_size: ['每页数量', 'Number', '必选'],
14
+ main_order_id: ['主单订单号', 'String', true],
15
+ db_from: ['来源', 'String', true],
17
16
  },
18
17
  isConsole: true,
19
18
  disabled: true,
20
19
  },
21
20
  {
22
- //设置方法名字当别忘记加上【模块名字】:After
23
- mapFnName: 'updateAfterFilmPaiqiDate',
24
- title: '更新排期',
25
- path: '/api/account/film/paiqi-date',
21
+ mapFnName: "getAfterSalesTypeList",
22
+ path: "/aftersale/v1/service-order/after-sales-type-list",
23
+ title: "售后类型列表",
26
24
  isRule: false,
27
- params: {
28
- film_id: ['电影id', 'Number', '必选'],
29
- cinema_id: ['影院id', 'Number', '必选'],
30
- },
25
+ params: {},
31
26
  isConsole: true,
32
27
  disabled: true,
33
28
  },
34
29
  {
35
- //设置方法名字当别忘记加上【模块名字】:After
36
- mapFnName: 'removeAfterFilmAddress',
37
- title: '删除我的配送地址',
38
- path: '/api/account/film/paiqi-date',
30
+ mapFnName: "createAfterServiceOrder",
31
+ path: "/aftersale/v1/service-order/create",
32
+ title: "服务单创建",
39
33
  isRule: false,
40
- params: {
41
- film_id: ['电影id', 'Number', '必选'],
34
+ data: {
35
+ after_sale_method: ['售后方式', 'refund:退款 refund_and_good:退货退款 exchange:换货 again:补发 good:退货不退款', true],
36
+ after_sale_type: ['售后类型', 'String', true],
37
+ main_order_id: ['订单号', 'String', true],
38
+ customer_feedback: ['客户反馈', 'String', true],
39
+ sub_order_id: ['子订单号', 'String', true],
40
+ business_code: ['业务编码', 'String', false],
41
+ refund_voucher: ['售后图片json', 'String', false],
42
+ product_list: ['商品列表', 'String', false],
43
+ db_from: ['来源', 'String', true],
42
44
  },
43
45
  isConsole: true,
44
46
  disabled: true,
45
47
  },
46
48
  {
47
- //设置方法名字当别忘记加上【模块名字】:After
48
- mapFnName: 'addAfterFilmcart',
49
- title: '添加购物车',
50
- path: '/api/account/film/paiqi-date',
49
+ mapFnName: "getConOssSign",
50
+ title: "获取上传参数",
51
+ path: "/common-user/v1/h5-oss/sign",
51
52
  isRule: false,
52
- params: {
53
- film_id: ['电影id', 'Number', '必选'],
53
+ data: {
54
54
  },
55
55
  isConsole: true,
56
56
  disabled: true,
@@ -8,39 +8,16 @@ export default {
8
8
  content: (data) => {
9
9
  return [
10
10
  {
11
- label: '背景颜色:',
12
- ele: 'xd-color',
13
- valueKey: 'bgColor',
14
- value: data.bgColor || '',
15
- placeholder: '请输入占位框背景颜色',
16
- groupKey:'content',
17
- },
18
- {
19
- label: '选中路径:',
20
- groupKey:'advanced',
21
- className: 'input100',
11
+ label: '售后详情页面路径:',
22
12
  ele: 'xd-select-pages-path',
23
- valueKey: 'select-pages-path',
24
- value: data['select-pages-path'] || null,
13
+ valueKey: 'refundStepPath',
14
+ groupKey:'advanced',
15
+ placeholder: '请选择售后详情页面路径',
16
+ value: data['refundStepPath'] || null,
25
17
  setting: {
26
- router: XdBus.getParentApi('getPagesTree')
18
+ router: XdBus.getParentApi('getPagesTree'),
27
19
  },
28
- },
29
- data.bgColor && {
30
- label: '高度:',
31
- ele: 'el-input',
32
- groupKey:'style',
33
- type: 'number',
34
- valueKey: 'height',
35
- value: data.height || 100,
36
- placeholder: '请输入占位框高度,单位像素,默认:10px',
37
- className: 'input60',
38
- },
39
- {
40
- label: '', //label
41
- groupKey:'advanced',
42
- ele: 'slot', //package 名称
43
- slot: 'is_reference',
20
+ inline: false,
44
21
  },
45
22
  ].filter(i=>i)
46
23
  },
@@ -13,31 +13,159 @@
13
13
  <view class="jfb-base-after-sales__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-after-sales__body">
17
- <view>售后申请</view>
16
+ <view class="jfb-base-after-sales__body" :style="{
17
+ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx',
18
+ '--main-color': mainColor
19
+ }">
20
+ <template v-if="step == 1">
21
+ <view class="s_type_box">
22
+ <view class="s_type_title">请选择售后类型</view>
23
+ <view class="service_types">
24
+ <view class="service_item"
25
+ :class="{ active: item.value === after_sale_method }"
26
+ v-for="item in afterSalesMethod" :key="item.value"
27
+ @click="handleSelectAfterSalesMethod(item)"
28
+ >{{ item.label }}</view>
29
+ </view>
30
+ </view>
31
+
32
+ <RefundOrderInfo :list="productList"
33
+ :orderNumber="baseInfo.main_order_id"
34
+ :showRadio="canChoseProduct"
35
+ ></RefundOrderInfo>
36
+
37
+ <view class="bottom_fixed">
38
+ <xd-button type="primary" @click="handleStepNext">下一步</xd-button>
39
+ </view>
40
+ </template>
41
+
42
+ <template v-if="step == 2">
43
+ <RefundOrderInfo :list="productList"
44
+ :showRadio="false"
45
+ :orderNumber="baseInfo.main_order_id"
46
+ ></RefundOrderInfo>
47
+
48
+ <view class="list_section section_inline" @click="toChoseReason">
49
+ <view class="sec_label">
50
+ <view class="label_require">*</view>
51
+ <view>申请原因</view>
52
+ </view>
53
+ <view class="sec_content">
54
+ <view>{{ afterSaleTypeText }}</view>
55
+ <xd-font-icon icon="iconxiangyou_xian" :size="28" style="margin-left: 8rpx;"></xd-font-icon>
56
+ </view>
57
+ </view>
58
+ <view class="list_section">
59
+ <view class="sec_label">
60
+ <view class="label_require">*</view>
61
+ <view>问题描述</view>
62
+ </view>
63
+ <view class="sec_content">
64
+ <textarea v-model="customer_feedback"
65
+ placeholder="请描述您遇到的问题"
66
+ style="width: 100%;background:#FAFAFA;height: 140rpx;padding: 16rpx;border-radius: 8rpx;font-size: 24rpx;"
67
+ ></textarea>
68
+ </view>
69
+ </view>
70
+
71
+ <view class="list_section">
72
+ <view class="sec_label">
73
+ <view>上传凭证</view>
74
+ <view class="label_sub">最多9张</view>
75
+ </view>
76
+ <view class="sec_content">
77
+ <view class="img_list">
78
+ <view class="img_box" v-for="(img, i) in showRefundImages" :key="i">
79
+ <image :src="img" class="img_item" mode="aspectFit"></image>
80
+ </view>
81
+ <view class="img_box img_add" @click="doAddImage">
82
+ <view class="icon">+</view>
83
+ </view>
84
+ </view>
85
+ </view>
86
+ </view>
87
+
88
+ <view class="bottom_fixed">
89
+ <xd-button type="primary" @click="handleApplyRefund">提交申请</xd-button>
90
+ </view>
91
+ </template>
92
+ <xd-down-drawer :show.sync="reasonShow" :isClose="false">
93
+ <view class="refund_reason_head">申请原因</view>
94
+ <view class="refund_reason_body" style="min-height: 50vh;max-height: 75vh;">
95
+ <view class="reason_cont">
96
+ <view class="reason_item" v-for="item in afterSalesTypes" :key="item.id">
97
+ <view>{{ item.type_name }}</view>
98
+ <xd-radio :value="temp_type === item.id" @change="selectApplyReason(item.id)"></xd-radio>
99
+ </view>
100
+ </view>
101
+ <view class="reason_foot">
102
+ <xd-button type="primary" @click="handleChoseReason">确定</xd-button>
103
+ </view>
104
+ </view>
105
+ </xd-down-drawer>
18
106
  </view>
19
107
  </view>
20
108
  </template>
21
109
 
22
110
  <script>
23
111
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
112
+ import XdButton from "@/components/XdButton/XdButton";
113
+ import XdRadio from "@/components/XdRadio/XdRadio"
114
+ import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer"
115
+ import RefundOrderInfo from "./refundOrderInfo.vue"
24
116
  import { jfbRootExec } from "@/utils/xd.event";
25
117
  import JfbBaseAfterSalesMixin from "./JfbBaseAfterSalesMixin";
26
118
  import { getContainerPropsValue } from "@/utils/xd.base";
27
119
  import componentsMixins from "@/mixins/componentsMixins";
28
120
  import extsMixins from "@/mixins/extsMixins";
121
+ import getServiceUrl from "@/common/getServiceUrl";
29
122
  export default {
30
123
  name: "JfbBaseAfterSales",
31
124
  components: {
32
- XdFontIcon
125
+ XdFontIcon,
126
+ XdButton,
127
+ XdRadio,
128
+ XdDownDrawer,
129
+ RefundOrderInfo
33
130
  },
34
131
  mixins: [
35
132
  componentsMixins, extsMixins, JfbBaseAfterSalesMixin
36
133
  ],
37
134
  data() {
38
135
  return {
136
+ step: 1,
137
+ reasonShow: false,
138
+ afterSalesMethod: [],
139
+ after_sale_method: "",
140
+ after_sale_type: "",
141
+ temp_type: "",
142
+ service_product_list: [],
143
+ customer_feedback: "",
144
+
145
+ productList: [],
146
+ afterSalesTypes: [],
147
+ baseInfo: {},
39
148
 
149
+ refundImgList: [],
150
+ order_id: "",
40
151
  //todo
152
+ refundStepPath: "",
153
+ }
154
+ },
155
+ computed: {
156
+ canChoseProduct(){
157
+ if(!this.after_sale_method) return false;
158
+ if(this.baseInfo.support_refund_method === 'all' && this.after_sale_method === 'refund_and_good') return false;
159
+ if(this.productList.length === 1) return false;
160
+ return true;
161
+ },
162
+ afterSaleTypeText(){
163
+ if(!this.after_sale_type) return "";
164
+ let item = this.afterSalesTypes.find(i => i.id === this.after_sale_type);
165
+ return item ? item.type_name : "";
166
+ },
167
+ showRefundImages(){
168
+ return this.refundImgList.map(item => getServiceUrl(item))
41
169
  }
42
170
  },
43
171
  watch: {
@@ -53,29 +181,155 @@
53
181
  },
54
182
  methods: {
55
183
  onJfbLoad(options) {
56
-
57
- // jfbRootExec('baiduUserLogin', {
58
-
59
- // vm: this,// data: {
60
-
61
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
62
-
63
- // }
64
-
65
- // }).then().catch()
184
+ this.order_id = options.order_id;
185
+ this.p_getAfterOmsOrder();
186
+ this.p_getAfterSalesTypeList();
66
187
  },
67
188
  /**
68
189
  * @description 监听事件变化
69
190
  * @param container {object} 业务组件对象自己
70
191
  */
71
192
  init(container) {
193
+ this.refundStepPath = getContainerPropsValue(container, 'content.refundStepPath', {value: ""}).value;
194
+ },
195
+ doAddImage(){
196
+ uni.chooseImage({
197
+ count: 1,
198
+ sourceType: ['camera'],
199
+ success: async (res) => {
200
+ console.log('chooseImage',res);
201
+ // let filePath = res.tempFilePaths[0];
202
+ let file = res.tempFiles[0];
203
+ this.$xdShowLoading({});
204
+ try{
205
+ let image = await this.uploadImage(file);
206
+ this.refundImgList.push(image);
207
+ this.$xdHideLoading();
208
+ }catch(err){
209
+ this.$xdHideLoading();
210
+ }
211
+ }
212
+ })
213
+ },
214
+ uploadImage(file){
215
+ let fileName = file.name;
216
+ return new Promise((resolve, reject) => {
217
+ jfbRootExec("getConOssSign", {
218
+ vm: this,
219
+ data: { name: fileName }
220
+ }).then(res => {
221
+ let OSSAccessKeyId = res['id']
222
+ let cdnUrl = res['cdn_url']
223
+ delete res['id']
224
+ delete res['cdn_url']
225
+ uni.uploadFile({
226
+ url: res.action,
227
+ file: file,
228
+ name: 'file',
229
+ formData: {
230
+ ...res,
231
+ OSSAccessKeyId: OSSAccessKeyId,
232
+ name: fileName,
233
+ cdnUrl: cdnUrl,
234
+ success_action_status: 200
235
+ },
236
+ success: (r) => {
237
+ resolve(`/${res.key}`);
238
+ },
239
+ fail:(err)=>{
240
+ resolve('');
241
+ console.error(err)
242
+ }
243
+ });
244
+ }).catch(err => {
245
+ reject(err);
246
+ })
247
+ })
72
248
 
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
74
-
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
249
+ },
250
+ p_getAfterSalesTypeList(){
251
+ jfbRootExec("getAfterSalesTypeList", {
252
+ vm: this,
253
+ data: {}
254
+ }).then(res => {
255
+ this.afterSalesTypes = res.list;
256
+ })
257
+ },
258
+ p_getAfterOmsOrder(){
259
+ this.$xdShowLoading({});
260
+ jfbRootExec("getAfterOmsOrder", {
261
+ vm: this,
262
+ data: {
263
+ main_order_id: this.order_id
264
+ }
265
+ }).then(res => {
266
+ this.$xdHideLoading();
267
+ const { product_list, base_info } = res;
268
+ this.productList = product_list.map(item => {
269
+ item.product_thumb = getServiceUrl(item.product_thumb, 'size2');
270
+ return item;
271
+ });
272
+ this.baseInfo = base_info;
273
+ try{
274
+ this.afterSalesMethod = JSON.parse(base_info.support_aftersale_method);
275
+ }catch(e){}
276
+
277
+ })
278
+ },
279
+ handleSelectAfterSalesMethod(item){
280
+ this.after_sale_method = item.value;
281
+ this.$nextTick(() => {
282
+ if(this.productList.length === 1){
283
+ this.service_product_list = [this.productList[0]];
284
+ }
285
+ })
286
+ },
287
+ handleApplyRefund(){
288
+ let { order_id, after_sale_method, after_sale_type, customer_feedback } = this;
289
+ let data = {
290
+ main_order_id: order_id,
291
+ after_sale_method,
292
+ after_sale_type,
293
+ customer_feedback,
294
+ refund_voucher: JSON.stringify(this.refundImgList),
295
+ product_list: JSON.stringify(this.service_product_list.map(item => ({
296
+ product_id: item.product_id,
297
+ product_sku_id: item.sku_id,
298
+ product_num: item.product_num,
299
+ gift_id: item.gift_id
300
+ })))
301
+ }
302
+ jfbRootExec("createAfterServiceOrder", {
303
+ vm: this,
304
+ data: data
305
+ }).then(res => {
306
+ this.$xdUniHelper.navigateTo({
307
+ url: `${this.refundStepPath}?service_order_id=${res.service_order_id}`,
308
+ });
309
+ })
310
+ },
311
+ handleStepNext(){
312
+ if(!this.after_sale_method){
313
+ this.$xdAlert({
314
+ content: '请选择售后类型',
315
+ type: "error"
316
+ })
317
+ return;
318
+ }
319
+ this.step = 2;
320
+ },
321
+ toChoseReason(){
322
+ this.reasonShow = true;
323
+ },
324
+ selectApplyReason(id){
325
+ this.temp_type = id;
326
+ },
327
+ handleChoseReason(){
328
+ this.reasonShow = false;
329
+ this.after_sale_type = this.temp_type;
76
330
  },
77
331
  onJfbScroll(options) {
78
- console.log('event.onJfbScroll', options)
332
+ // console.log('event.onJfbScroll', options)
79
333
  },
80
334
  onJfbReachBottom(options) {
81
335
  console.log('event.onJfbReachBottom', options)
@@ -105,7 +359,147 @@
105
359
 
106
360
  .jfb-base-after-sales {
107
361
  &__body{
362
+ padding: 20rpx 20rpx 120rpx;
363
+ box-sizing: border-box;
364
+ background-color: #EEEEEE;
365
+ .s_type_box{
366
+ background-color: #FFFFFF;
367
+ border-radius: 16rpx;
368
+ padding: 36rpx;
369
+ font-size: 26rpx;
370
+ .s_type_title{
371
+ color: #333333;
372
+ font-weight: 500;
373
+ margin-bottom: 28rpx;
374
+ }
375
+ .service_types{
376
+ display: flex;
377
+ flex-wrap: wrap;
108
378
 
379
+ .service_item{
380
+ padding: 12rpx 48rpx;
381
+ border-radius: 40rpx;
382
+ background-color: #F3F3F3;
383
+ color: #999999;
384
+ margin-right: 15rpx;
385
+ &:nth-child(4n){
386
+ margin-right: 0;
387
+ }
388
+ &.active{
389
+ background-color: var(--main-color);
390
+ color: #FFFFFF;
391
+ }
392
+ }
393
+ }
394
+ }
395
+
396
+ .list_section{
397
+ padding: 24rpx 36rpx;
398
+ border-radius: 16rpx;
399
+ background-color: #FFFFFF;
400
+ display: flex;
401
+ flex-direction: column;
402
+ margin: 20rpx 0;
403
+ color: #333333;
404
+ font-size: 28rpx;
405
+ &.section_inline{
406
+ flex-direction: row;
407
+ justify-content: space-between;
408
+ .sec_label{
409
+ margin-bottom: 0;
410
+ }
411
+ }
412
+ .sec_label{
413
+ display: flex;
414
+ align-items: center;
415
+ margin-bottom: 24rpx;
416
+ .label_require{
417
+ color: #FF5733;
418
+ margin-right: 4rpx;
419
+ }
420
+ .label_sub{
421
+ color: #CCCCCC;
422
+ font-size: 24rpx;
423
+ margin-left: 16rpx;
424
+ }
425
+ }
426
+ .sec_content{
427
+ display: flex;
428
+ align-items: center;
429
+ color: #666666;
430
+
431
+ .img_list{
432
+ display: flex;
433
+ flex-wrap: wrap;
434
+ .img_box{
435
+ width: 160rpx;
436
+ height: 160rpx;
437
+ border-radius: 8rpx;
438
+ border: 1px solid #E0E0E0;
439
+ margin-right: 28rpx;
440
+ margin-bottom: 28rpx;
441
+ .img_item{
442
+ width: 100%;
443
+ height: 100%;
444
+ }
445
+
446
+ &.img_add{
447
+ display: flex;
448
+ align-items: center;
449
+ justify-content: center;
450
+ .icon{
451
+ border: 1px solid #E0E0E0;
452
+ width: 36rpx;
453
+ height: 36rpx;
454
+ border-radius: 6rpx;
455
+ display: flex;
456
+ align-items: center;
457
+ justify-content: center;
458
+ color: #E0E0E0;
459
+ }
460
+ }
461
+ }
462
+ }
463
+ }
464
+ }
465
+ .bottom_fixed{
466
+ position: fixed;
467
+ bottom: 0;
468
+ left: 0;
469
+ width: 100%;
470
+ padding: 20rpx;
471
+ box-sizing: border-box;
472
+ }
473
+ .refund_reason_head{
474
+ padding: 32rpx 0;
475
+ text-align: center;
476
+ border-bottom: 1px solid #F2F2F2;
477
+ margin: 0 32rpx;
478
+ font-size: 28rpx;
479
+ color: #333333;
480
+ font-weight: bold;
481
+ }
482
+ .refund_reason_body{
483
+ display: flex;
484
+ flex-direction: column;
485
+ .reason_cont{
486
+ flex: 1;
487
+ padding: 0 40rpx;
488
+ overflow: auto;
489
+ .reason_item{
490
+ display: flex;
491
+ align-items: center;
492
+ justify-content: space-between;
493
+ padding: 20rpx 20rpx;
494
+ font-size: 28rpx;
495
+ color: #333333;
496
+ }
497
+ }
498
+ .reason_foot{
499
+ padding: 32rpx;
500
+ border-top: 1px solid #F2F2F2;
501
+ }
502
+ }
109
503
  }
110
504
  }
111
505
  </style>