jufubao-base 1.0.438-beta2 → 1.0.438-beta3

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.438-beta2",
3
+ "version": "1.0.438-beta3",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -51,7 +51,7 @@
51
51
  "dingtalk-jsapi": "^3.0.31",
52
52
  "flyio": "^0.6.2",
53
53
  "gxd-commands-bussiness": "^1.0.12",
54
- "gxd-uni-library-editx": "1.0.198-beta1",
54
+ "gxd-uni-library-editx": "1.0.202-beta3",
55
55
  "jweixin-module": "^1.6.0",
56
56
  "md5": "^2.3.0",
57
57
  "path-to-regexp": "^6.2.1",
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Express
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ //设置方法名字当别忘记加上【模块名字】:Express
10
+ mapFnName: 'getExpressCount',
11
+ title: '订单 - 快递包裹数量(代签收/运输中)',
12
+ path: '/order/v1/logistics/express-package-count',
13
+ isRule: false,
14
+ params: {
15
+
16
+ },
17
+ isConsole: true,
18
+ disabled: true,
19
+ },
20
+ {
21
+ //设置方法名字当别忘记加上【模块名字】:Express
22
+ mapFnName: 'getExpressList',
23
+ title: '订单 - 快递包裹分类列表',
24
+ path: '/order/v1/logistics/express-package-list',
25
+ isRule: false,
26
+ params: {
27
+ logistics_status: ['物流状态', 'String', '必选'],
28
+ page_size: ['每页数量', 'Number', '必选'],
29
+ page_token: ['分页token', 'String', '必选'],
30
+ },
31
+ isConsole: true,
32
+ disabled: true,
33
+ },
34
+ ];
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content: (data) => {
9
+ return [
10
+ {
11
+ label: '物流详情路径:',
12
+ groupKey:'advanced',
13
+ className: 'input100',
14
+ labelInline:true,
15
+ ele: 'xd-select-pages-path',
16
+ valueKey: 'select-pages-path',
17
+ value: data['select-pages-path'] || null,
18
+ setting: {
19
+ router: XdBus.getParentApi('getPagesTree')
20
+ },
21
+ },
22
+ ].filter(i=>i)
23
+ },
24
+ advanced: [],
25
+ };
@@ -0,0 +1,497 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-express-list"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-express-list__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-express-list__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-express-list__body">
17
+ <!--状态tab栏-->
18
+ <view class="jfb-base-express-list__status fixed_top" :style="{top: (layoutInfo.top - 2)+'rpx'}" v-if="statusList.length > 0">
19
+ <view
20
+ class="jfb-base-express-list__status-item"
21
+ :class="{ 'is-active': activeStatus === item.status }"
22
+ v-for="(item, index) in statusList"
23
+ :key="index"
24
+ @click="handleStatusChange(item.status)"
25
+ >
26
+ <view class="jfb-base-express-list__status-text">
27
+ <view class="jfb-base-express-list__status-name">
28
+ <text>{{ item.label }}</text>
29
+ <view class="jfb-base-express-list__status-line" :class="{ 'is-visible': activeStatus === item.status }"></view>
30
+ </view>
31
+ <view class="jfb-base-express-list__status-count" v-if="item.count">{{ item.count > 99 ? '99+' : item.count }}</view>
32
+ </view>
33
+ </view>
34
+ </view>
35
+ <!--包裹列表-->
36
+ <view class="jfb-base-express-list__list">
37
+ <view
38
+ class="jfb-base-express-list__item"
39
+ v-for="(item, index) in express"
40
+ :key="index"
41
+ >
42
+ <view class="jfb-base-express-list__item-title">
43
+ <view class="jfb-base-express-list__item-title-left">
44
+ <xd-font-icon icon="iconbaoguo" size="30" color="#999"></xd-font-icon>
45
+ <text class="jfb-base-express-list__item-title-text">包裹 {{ index + 1 }}</text>
46
+ </view>
47
+ <view class="jfb-base-express-list__item-title-right" @click="handleToDetail(item)">
48
+ <text>查看详情</text>
49
+ <xd-font-icon icon="iconxiangyou_xian" size="24" color="#999"></xd-font-icon>
50
+ </view>
51
+ </view>
52
+ <view class="jfb-base-express-list__item-number">
53
+ <view class="jfb-base-express-list__item-number-info">
54
+ <text class="jfb-base-express-list__item-number-company">{{ item.logistics_company_name }}</text>
55
+ <text class="jfb-base-express-list__item-number-no">{{ item.logistics_number }}</text>
56
+ </view>
57
+ <view
58
+ class="jfb-base-express-list__item-number-copy"
59
+ v-if="item.logistics_number"
60
+ @click.stop="copy(item.logistics_number)"
61
+ >复制单号</view>
62
+ </view>
63
+ <view class="jfb-base-express-list__item-goods">
64
+ <view
65
+ class="jfb-base-express-list__item-goods-item"
66
+ v-for="(Sitem, Sindex) in item.product_list"
67
+ :key="Sindex"
68
+ >
69
+ <image
70
+ class="jfb-base-express-list__item-goods-image"
71
+ :src="Sitem.product_thumb"
72
+ mode="aspectFill"
73
+ ></image>
74
+ <view class="jfb-base-express-list__item-goods-info">
75
+ <view class="jfb-base-express-list__item-goods-name">{{ Sitem.product_name }}</view>
76
+ <view class="jfb-base-express-list__item-goods-brand" v-if="Sitem.brand_name">{{ Sitem.brand_name }}</view>
77
+ <view class="jfb-base-express-list__item-goods-bottom">
78
+ <view class="jfb-base-express-list__item-goods-price">
79
+ <xd-unit :isOld="false" :price="Sitem.price" :color="mainColor" :fontSize="36"></xd-unit>
80
+ </view>
81
+ <view class="jfb-base-express-list__item-goods-num">x{{ Sitem.product_num }}</view>
82
+ </view>
83
+ </view>
84
+ </view>
85
+ </view>
86
+ </view>
87
+ </view>
88
+ <!--空状态-->
89
+ <view class="jfb-base-express-list__empty" v-if="express.length === 0">暂无数据</view>
90
+ </view>
91
+ </view>
92
+ </template>
93
+
94
+ <script>
95
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
96
+ import XdUnit from "@/components/XdUnit/XdUnit";
97
+ import { jfbRootExec } from "@/utils/xd.event";
98
+ import JfbBaseExpressListMixin from "./JfbBaseExpressListMixin";
99
+ import { getContainerPropsValue } from "@/utils/xd.base";
100
+ import getServiceUrl from "@/common/getServiceUrl";
101
+ import componentsMixins from "@/mixins/componentsMixins";
102
+ import extsMixins from "@/mixins/extsMixins";
103
+ export default {
104
+ // #ifdef MP-WEIXIN
105
+ options: { styleIsolation: 'shared' },
106
+ // #endif
107
+ name: "JfbBaseExpressList",
108
+ components: {
109
+ XdFontIcon,
110
+ XdUnit,
111
+ },
112
+ mixins: [
113
+ componentsMixins, extsMixins, JfbBaseExpressListMixin
114
+ ],
115
+ data() {
116
+ return {
117
+ expressPath: "", //物流详情路径
118
+ activeStatus: "logistics_status_p", //当前选中状态
119
+ statusList: [], //状态tab列表
120
+ express: [], //包裹列表
121
+ page_token: "1", //当前页码
122
+ page_size: 20, //每页数量
123
+ hasNext: false, //是否有下一页
124
+ next_page_token: "", //下一页token
125
+ }
126
+ },
127
+ watch: {
128
+ container(value, oldValue) {
129
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
130
+ if (this.$configProject['isPreview']) this.init(value)
131
+ },
132
+ },
133
+ created() {
134
+ this.init(this.container);
135
+ },
136
+ methods: {
137
+ onJfbLoad(options) {
138
+ if(options.tab) {
139
+ this.activeStatus = options.tab
140
+ }
141
+ //加载状态tab数量与包裹列表
142
+ this.getExpressCount();
143
+ this.getExpressList();
144
+ },
145
+ /**
146
+ * @description 监听事件变化
147
+ * @param container {object} 业务组件对象自己
148
+ */
149
+ init(container) {
150
+ this.expressPath = getContainerPropsValue(container, 'content.select-pages-path', {value: ""}).value;
151
+ },
152
+ /**
153
+ * @description 获取各状态包裹数量
154
+ */
155
+ getExpressCount() {
156
+ jfbRootExec("getExpressCount", {
157
+ vm: this,
158
+ data: {
159
+ page_id: this.pageAttr['page_id'], //页面ID
160
+ container_id: this.containerId, //组件ID
161
+ },
162
+ })
163
+ .then((res) => {
164
+ //已签收状态不显示数量
165
+ this.statusList = [
166
+ { status: 'logistics_status_p', label: '待签收', count: res.proxy_sign_count },
167
+ { status: 'logistics_status_n', label: '运输中', count: res.transport_count },
168
+ { status: 'logistics_status_y', label: '已签收', count: 0 },
169
+ ];
170
+ })
171
+ .catch((err) => {
172
+ this.$xdLog.catch(err);
173
+ this.statusList = [];
174
+ });
175
+ },
176
+ /**
177
+ * @description 获取包裹列表
178
+ */
179
+ getExpressList() {
180
+ jfbRootExec("getExpressList", {
181
+ vm: this,
182
+ data: this.$xdUniHelper.deleteParamEmptyKey({
183
+ page_id: this.pageAttr['page_id'], //页面ID
184
+ container_id: this.containerId, //组件ID
185
+ logistics_status: this.activeStatus, //当前状态
186
+ page_token: this.page_token, //当前页码
187
+ page_size: this.page_size, //每页数量
188
+ }),
189
+ })
190
+ .then((res) => {
191
+ const list = (res.list || []).map((item) => {
192
+ item.product_list = (item.product_list || []).map((Sitem) => {
193
+ Sitem.product_thumb = Sitem.product_thumb ? getServiceUrl(Sitem.product_thumb, "size3") : "";
194
+ return Sitem;
195
+ });
196
+ return item;
197
+ });
198
+ //追加列表(首屏替换,分页累加)
199
+ this.express = this.page_token === '1' ? list : (this.express || []).concat(list);
200
+ this.next_page_token = res.next_page_token;
201
+ this.hasNext = !!res.next_page_token;
202
+ })
203
+ .catch((err) => {
204
+ this.$xdLog.catch(err);
205
+ if (this.page_token === '1') this.express = [];
206
+ });
207
+ },
208
+ /**
209
+ * @description 切换状态
210
+ * @param status {string} 状态值
211
+ */
212
+ handleStatusChange(status) {
213
+ this.activeStatus = status;
214
+ this.page_token = '1';
215
+ this.getExpressList();
216
+ },
217
+ /**
218
+ * @description 查看物流详情
219
+ * @param item {object} 包裹对象
220
+ */
221
+ handleToDetail(item) {
222
+ console.log(this.expressPath,'this.expressPath')
223
+ if (this.$configProject['isPreview']) return;
224
+ this.$xdUniHelper.navigateTo({
225
+ url: `${this.expressPath}?package_id=${item.package_id}`,
226
+ });
227
+ },
228
+ /**
229
+ * @description 复制功能
230
+ * @param text {string} 复制内容
231
+ */
232
+ copy(text) {
233
+ // #ifdef H5
234
+ this.$copyText(text).then((res) => {
235
+ this.$xdAlert({ content: "复制成功" });
236
+ });
237
+ // #endif
238
+ // #ifndef H5
239
+ uni.setClipboardData({
240
+ data: text,
241
+ showToast: false,
242
+ success: () => {
243
+ //this.$xdAlert({ content: "复制成功" });
244
+ },
245
+ });
246
+ // #endif
247
+ },
248
+ onJfbScroll(options) {
249
+ console.log('event.onJfbScroll', options)
250
+ },
251
+ onJfbReachBottom(options) {
252
+ if (this.hasNext) {
253
+ this.page_token = this.next_page_token;
254
+ this.getExpressList();
255
+ }
256
+ },
257
+ onJfbShow(options) {
258
+ console.log('event.onJfbShow', options)
259
+ },
260
+ onJfbHide(options) {
261
+ console.log('event.onJfbHide', options)
262
+ },
263
+ onJfbBack(options) {
264
+ console.log('event.onJfbBack', options)
265
+ },
266
+ onJfbUpdate(...data) {
267
+ console.log('event.onJfbUpdate', data)
268
+ },
269
+ onJfbCustomEvent(options) {
270
+ console.log('event.onJfbReachBottom', options)
271
+ },
272
+ }
273
+ }
274
+
275
+ </script>
276
+
277
+ <style scoped lang="less">
278
+ @import "./JfbBaseExpressListLess.less";
279
+
280
+ .jfb-base-express-list {
281
+ &__body {
282
+ background: #f8f8f8;
283
+ .fixed_top{
284
+ position: fixed;
285
+ top: 0;
286
+ left: 0;
287
+ width: 100%;
288
+ background: #FFFFFF;
289
+ z-index: 999;
290
+ }
291
+ }
292
+
293
+ //状态tab栏
294
+ &__status {
295
+ background: #fff;
296
+ display: flex;
297
+ align-items: center;
298
+
299
+ &-item {
300
+ flex: 1;
301
+ height: 88rpx;
302
+ display: flex;
303
+ justify-content: center;
304
+ align-items: center;
305
+ color: #666;
306
+
307
+ &.is-active {
308
+ color: #333;
309
+ font-weight: 600;
310
+ }
311
+ }
312
+
313
+ &-text {
314
+ display: flex;
315
+ align-items: center;
316
+ }
317
+
318
+ &-name {
319
+ position: relative;
320
+ font-size: 28rpx;
321
+ }
322
+
323
+ &-line {
324
+ position: absolute;
325
+ left: 0;
326
+ bottom: -8rpx;
327
+ width: 100%;
328
+ height: 6rpx;
329
+ border-radius: 3rpx;
330
+ background: #333;
331
+ visibility: hidden;
332
+
333
+ &.is-visible {
334
+ visibility: visible;
335
+ }
336
+ }
337
+
338
+ &-count {
339
+ width: 50rpx;
340
+ height: 40rpx;
341
+ line-height: 40rpx;
342
+ margin-left: 8rpx;
343
+ border-radius: 24rpx;
344
+ background: rgba(240, 31, 31, 1);
345
+ box-shadow: 0px 2rpx 4rpx rgba(240, 31, 31, 0.25);
346
+ color: #fff;
347
+ font-size: 22rpx;
348
+ text-align: center;
349
+ box-sizing: border-box;
350
+ }
351
+ }
352
+
353
+ //包裹列表
354
+ &__list {
355
+ padding: 16rpx;
356
+ }
357
+
358
+ &__item {
359
+ background: #fff;
360
+ border-radius: 16rpx;
361
+ overflow: hidden;
362
+ margin-bottom: 16rpx;
363
+
364
+ &:last-child {
365
+ margin-bottom: 0;
366
+ }
367
+
368
+ &-title {
369
+ padding: 24rpx;
370
+ display: flex;
371
+ justify-content: space-between;
372
+ align-items: center;
373
+ font-size: 24rpx;
374
+ color: #999;
375
+
376
+ &-left,
377
+ &-right {
378
+ display: flex;
379
+ align-items: center;
380
+ }
381
+
382
+ &-text {
383
+ margin-left: 12rpx;
384
+ }
385
+ }
386
+
387
+ &-number {
388
+ margin: 0 24rpx;
389
+ padding-bottom: 24rpx;
390
+ display: flex;
391
+ justify-content: space-between;
392
+ align-items: center;
393
+
394
+ &-info {
395
+ display: flex;
396
+ align-items: center;
397
+ overflow: hidden;
398
+ }
399
+
400
+ &-company {
401
+ font-size: 32rpx;
402
+ font-weight: 500;
403
+ color: #333;
404
+ margin-right: 16rpx;
405
+ flex-shrink: 0;
406
+ }
407
+
408
+ &-no {
409
+ font-size: 32rpx;
410
+ font-weight: 500;
411
+ color: #333;
412
+ }
413
+
414
+ &-copy {
415
+ flex-shrink: 0;
416
+ border: 2rpx solid #e5e5e5;
417
+ border-radius: 30rpx;
418
+ color: #999;
419
+ font-size: 24rpx;
420
+ padding: 6rpx 20rpx;
421
+ }
422
+ }
423
+
424
+ &-goods {
425
+ border-top: 2rpx solid #f5f5f5;
426
+ padding: 24rpx;
427
+
428
+ &-item {
429
+ display: flex;
430
+ align-items: center;
431
+ margin-bottom: 24rpx;
432
+
433
+ &:last-child {
434
+ margin-bottom: 0;
435
+ }
436
+ }
437
+
438
+ &-image {
439
+ width: 160rpx;
440
+ height: 160rpx;
441
+ border-radius: 8rpx;
442
+ flex-shrink: 0;
443
+ }
444
+
445
+ &-info {
446
+ flex: 1;
447
+ display: flex;
448
+ flex-direction: column;
449
+ justify-content: space-between;
450
+ min-height: 160rpx;
451
+ margin-left: 20rpx;
452
+ overflow: hidden;
453
+ }
454
+
455
+ &-name {
456
+ font-size: 28rpx;
457
+ color: #333;
458
+ line-height: 40rpx;
459
+ .uni-max-cut(2, 80);
460
+ word-break: break-all;
461
+ }
462
+
463
+ &-brand {
464
+ font-size: 24rpx;
465
+ color: #999;
466
+ margin-top: 6rpx;
467
+ .uni-max-cut(1, 32);
468
+ }
469
+
470
+ &-bottom {
471
+ display: flex;
472
+ justify-content: space-between;
473
+ align-items: center;
474
+ margin-top: 12rpx;
475
+ }
476
+
477
+ &-price {
478
+ display: flex;
479
+ align-items: center;
480
+ }
481
+
482
+ &-num {
483
+ flex-shrink: 0;
484
+ font-size: 24rpx;
485
+ color: #999;
486
+ }
487
+ }
488
+ }
489
+
490
+ &__empty {
491
+ padding: 80rpx 0;
492
+ text-align: center;
493
+ font-size: 26rpx;
494
+ color: #999;
495
+ }
496
+ }
497
+ </style>
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  //start
15
- .jfb-base-card-consump-code {
15
+ .jfb-base-express-list {
16
16
  box-sizing: border-box;
17
17
 
18
18
  &__body{
@@ -70,7 +70,7 @@
70
70
 
71
71
 
72
72
  /**notPreview**/
73
- .jfb-base-card-consump-code {
73
+ .jfb-base-express-list {
74
74
  //&:before {
75
75
  //content: " ";
76
76
  //display: table;
@@ -16,7 +16,7 @@ export default {
16
16
  //@EndAttrData
17
17
 
18
18
  // #endif
19
- cssRoot: 'jfb-base-card-consump-code'
19
+ cssRoot: 'jfb-base-express-list'
20
20
  }
21
21
  },
22
22
  created() {
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+
5
+ getExpressCount:{
6
+ "proxy_sign_count": 2,
7
+ "transport_count": 3
8
+ },
9
+
10
+ getExpressList:{
11
+ "list": [
12
+ {
13
+ "package_id": "string",
14
+ "logistics_company_code": "string",
15
+ "logistics_company_name": "圆通快递",
16
+ "logistics_number": "9851324944905",
17
+ "logistics_status": "string",
18
+ "logistics_send_time": 0,
19
+ "product_list": [
20
+ {
21
+ "main_order_id": "string",
22
+ "sub_order_id": "string",
23
+ "product_id": 0,
24
+ "product_name": "港荣蒸蛋糕 奶香味手撕蛋糕900g/箱面包蛋糕早餐面包办公室零食",
25
+ "product_sku_name": "33",
26
+ "product_num": 1,
27
+ "product_thumb": "//sandbox-img.jufubao.cn/uploads/20230522/f1a75df336de07214278e97232207e97.jpg"
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "package_id": "string",
33
+ "logistics_company_code": "string",
34
+ "logistics_company_name": "顺丰快递",
35
+ "logistics_number": "9851324944905",
36
+ "logistics_status": "string",
37
+ "logistics_send_time": 0,
38
+ "product_list": [
39
+ {
40
+ "main_order_id": "string",
41
+ "sub_order_id": "string",
42
+ "product_id": 0,
43
+ "product_name": "良品铺子手撕面包2斤装",
44
+ "product_sku_name": "11",
45
+ "product_num": 1,
46
+ "product_thumb": "//sandbox-img.jufubao.cn/uploads/20230522/24f0e3386a80c2a6659d71862eedcae7.jpg"
47
+ },
48
+ {
49
+ "main_order_id": "string",
50
+ "sub_order_id": "string",
51
+ "product_id": 0,
52
+ "product_name": "好丽友(orion)零食休闲零食薯条膨化食品呀!土豆番茄酱味70g/袋",
53
+ "product_sku_name": "22",
54
+ "product_num": 2,
55
+ "product_thumb": "//sandbox-img.jufubao.cn/uploads/20230522/eb1d4222f69559e1ac0c999ae01da8ae.jpg"
56
+ }
57
+ ]
58
+ }
59
+ ],
60
+ "next_page_token": "string",
61
+ "total_size": 0
62
+ },
63
+
64
+ }
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ import ICONS from "@/ICONS";
4
+
3
5
  export default {
4
6
  style: [],
5
7
  content: (data)=>{
@@ -35,16 +37,20 @@ export default {
35
37
  groupKey:'content',
36
38
  setting: {
37
39
  router: XdBus.getParentApi('getPagesTree'),
40
+ //icons:ICONS,
41
+ icon:false,
42
+ size:false
38
43
  },
39
44
  handleCustom({action, data}) {
40
45
  if (action === 'number') {
41
- data.cb([
42
- {"label": "全部", "value": 'all'},
43
- {"label": "待付款", "value": 'unpaid'},
44
- {"label": "待收货", "value": 'unreceived'},
45
- {"label": "已取消", "value": 'cancel'},
46
- {"label": "已完成", "value": 'com'},
47
- ])
46
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'order_status_options'})
47
+ .then(res => {
48
+ data.cb(res.list)
49
+ })
50
+ .catch(error => {
51
+ console.error(error);
52
+ data.cb([])
53
+ });
48
54
  }
49
55
  },
50
56
  inline: false,