jufubao-base 1.0.438-beta2 → 1.0.438-beta4

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-beta4",
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,498 @@
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
+ <view style="height: 100rpx;"></view>
36
+ <!--包裹列表-->
37
+ <view class="jfb-base-express-list__list">
38
+ <view
39
+ class="jfb-base-express-list__item"
40
+ v-for="(item, index) in express"
41
+ :key="index"
42
+ >
43
+ <view class="jfb-base-express-list__item-title">
44
+ <view class="jfb-base-express-list__item-title-left">
45
+ <xd-font-icon icon="iconbaoguo" size="30" color="#999"></xd-font-icon>
46
+ <text class="jfb-base-express-list__item-title-text">包裹 {{ index + 1 }}</text>
47
+ </view>
48
+ <view class="jfb-base-express-list__item-title-right" @click="handleToDetail(item)">
49
+ <text>查看详情</text>
50
+ <xd-font-icon icon="iconxiangyou_xian" size="24" color="#999"></xd-font-icon>
51
+ </view>
52
+ </view>
53
+ <view class="jfb-base-express-list__item-number">
54
+ <view class="jfb-base-express-list__item-number-info">
55
+ <text class="jfb-base-express-list__item-number-company">{{ item.logistics_company_name }}</text>
56
+ <text class="jfb-base-express-list__item-number-no">{{ item.logistics_number }}</text>
57
+ </view>
58
+ <view
59
+ class="jfb-base-express-list__item-number-copy"
60
+ v-if="item.logistics_number"
61
+ @click.stop="copy(item.logistics_number)"
62
+ >复制单号</view>
63
+ </view>
64
+ <view class="jfb-base-express-list__item-goods">
65
+ <view
66
+ class="jfb-base-express-list__item-goods-item"
67
+ v-for="(Sitem, Sindex) in item.product_list"
68
+ :key="Sindex"
69
+ >
70
+ <image
71
+ class="jfb-base-express-list__item-goods-image"
72
+ :src="Sitem.product_thumb"
73
+ mode="aspectFill"
74
+ ></image>
75
+ <view class="jfb-base-express-list__item-goods-info">
76
+ <view class="jfb-base-express-list__item-goods-name">{{ Sitem.product_name }}</view>
77
+ <view class="jfb-base-express-list__item-goods-brand" v-if="Sitem.brand_name">{{ Sitem.brand_name }}</view>
78
+ <view class="jfb-base-express-list__item-goods-bottom">
79
+ <view class="jfb-base-express-list__item-goods-price">
80
+ <xd-unit :isOld="false" :price="Sitem.price" :color="mainColor" :fontSize="36"></xd-unit>
81
+ </view>
82
+ <view class="jfb-base-express-list__item-goods-num">x{{ Sitem.product_num }}</view>
83
+ </view>
84
+ </view>
85
+ </view>
86
+ </view>
87
+ </view>
88
+ </view>
89
+ <!--空状态-->
90
+ <view class="jfb-base-express-list__empty" v-if="express.length === 0">暂无数据</view>
91
+ </view>
92
+ </view>
93
+ </template>
94
+
95
+ <script>
96
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
97
+ import XdUnit from "@/components/XdUnit/XdUnit";
98
+ import { jfbRootExec } from "@/utils/xd.event";
99
+ import JfbBaseExpressListMixin from "./JfbBaseExpressListMixin";
100
+ import { getContainerPropsValue } from "@/utils/xd.base";
101
+ import getServiceUrl from "@/common/getServiceUrl";
102
+ import componentsMixins from "@/mixins/componentsMixins";
103
+ import extsMixins from "@/mixins/extsMixins";
104
+ export default {
105
+ // #ifdef MP-WEIXIN
106
+ options: { styleIsolation: 'shared' },
107
+ // #endif
108
+ name: "JfbBaseExpressList",
109
+ components: {
110
+ XdFontIcon,
111
+ XdUnit,
112
+ },
113
+ mixins: [
114
+ componentsMixins, extsMixins, JfbBaseExpressListMixin
115
+ ],
116
+ data() {
117
+ return {
118
+ expressPath: "", //物流详情路径
119
+ activeStatus: "logistics_status_p", //当前选中状态
120
+ statusList: [], //状态tab列表
121
+ express: [], //包裹列表
122
+ page_token: "1", //当前页码
123
+ page_size: 20, //每页数量
124
+ hasNext: false, //是否有下一页
125
+ next_page_token: "", //下一页token
126
+ }
127
+ },
128
+ watch: {
129
+ container(value, oldValue) {
130
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
131
+ if (this.$configProject['isPreview']) this.init(value)
132
+ },
133
+ },
134
+ created() {
135
+ this.init(this.container);
136
+ },
137
+ methods: {
138
+ onJfbLoad(options) {
139
+ if(options.tab) {
140
+ this.activeStatus = options.tab
141
+ }
142
+ //加载状态tab数量与包裹列表
143
+ this.getExpressCount();
144
+ this.getExpressList();
145
+ },
146
+ /**
147
+ * @description 监听事件变化
148
+ * @param container {object} 业务组件对象自己
149
+ */
150
+ init(container) {
151
+ this.expressPath = getContainerPropsValue(container, 'content.select-pages-path', {value: ""}).value;
152
+ },
153
+ /**
154
+ * @description 获取各状态包裹数量
155
+ */
156
+ getExpressCount() {
157
+ jfbRootExec("getExpressCount", {
158
+ vm: this,
159
+ data: {
160
+ page_id: this.pageAttr['page_id'], //页面ID
161
+ container_id: this.containerId, //组件ID
162
+ },
163
+ })
164
+ .then((res) => {
165
+ //已签收状态不显示数量
166
+ this.statusList = [
167
+ { status: 'logistics_status_p', label: '待签收', count: res.proxy_sign_count },
168
+ { status: 'logistics_status_n', label: '运输中', count: res.transport_count },
169
+ { status: 'logistics_status_y', label: '已签收', count: 0 },
170
+ ];
171
+ })
172
+ .catch((err) => {
173
+ this.$xdLog.catch(err);
174
+ this.statusList = [];
175
+ });
176
+ },
177
+ /**
178
+ * @description 获取包裹列表
179
+ */
180
+ getExpressList() {
181
+ jfbRootExec("getExpressList", {
182
+ vm: this,
183
+ data: this.$xdUniHelper.deleteParamEmptyKey({
184
+ page_id: this.pageAttr['page_id'], //页面ID
185
+ container_id: this.containerId, //组件ID
186
+ logistics_status: this.activeStatus, //当前状态
187
+ page_token: this.page_token, //当前页码
188
+ page_size: this.page_size, //每页数量
189
+ }),
190
+ })
191
+ .then((res) => {
192
+ const list = (res.list || []).map((item) => {
193
+ item.product_list = (item.product_list || []).map((Sitem) => {
194
+ Sitem.product_thumb = Sitem.product_thumb ? getServiceUrl(Sitem.product_thumb, "size3") : "";
195
+ return Sitem;
196
+ });
197
+ return item;
198
+ });
199
+ //追加列表(首屏替换,分页累加)
200
+ this.express = this.page_token === '1' ? list : (this.express || []).concat(list);
201
+ this.next_page_token = res.next_page_token;
202
+ this.hasNext = !!res.next_page_token;
203
+ })
204
+ .catch((err) => {
205
+ this.$xdLog.catch(err);
206
+ if (this.page_token === '1') this.express = [];
207
+ });
208
+ },
209
+ /**
210
+ * @description 切换状态
211
+ * @param status {string} 状态值
212
+ */
213
+ handleStatusChange(status) {
214
+ this.activeStatus = status;
215
+ this.page_token = '1';
216
+ this.getExpressList();
217
+ },
218
+ /**
219
+ * @description 查看物流详情
220
+ * @param item {object} 包裹对象
221
+ */
222
+ handleToDetail(item) {
223
+ console.log(this.expressPath,'this.expressPath')
224
+ if (this.$configProject['isPreview']) return;
225
+ this.$xdUniHelper.navigateTo({
226
+ url: `${this.expressPath}?package_id=${item.package_id}`,
227
+ });
228
+ },
229
+ /**
230
+ * @description 复制功能
231
+ * @param text {string} 复制内容
232
+ */
233
+ copy(text) {
234
+ // #ifdef H5
235
+ this.$copyText(text).then((res) => {
236
+ this.$xdAlert({ content: "复制成功" });
237
+ });
238
+ // #endif
239
+ // #ifndef H5
240
+ uni.setClipboardData({
241
+ data: text,
242
+ showToast: false,
243
+ success: () => {
244
+ //this.$xdAlert({ content: "复制成功" });
245
+ },
246
+ });
247
+ // #endif
248
+ },
249
+ onJfbScroll(options) {
250
+ console.log('event.onJfbScroll', options)
251
+ },
252
+ onJfbReachBottom(options) {
253
+ if (this.hasNext) {
254
+ this.page_token = this.next_page_token;
255
+ this.getExpressList();
256
+ }
257
+ },
258
+ onJfbShow(options) {
259
+ console.log('event.onJfbShow', options)
260
+ },
261
+ onJfbHide(options) {
262
+ console.log('event.onJfbHide', options)
263
+ },
264
+ onJfbBack(options) {
265
+ console.log('event.onJfbBack', options)
266
+ },
267
+ onJfbUpdate(...data) {
268
+ console.log('event.onJfbUpdate', data)
269
+ },
270
+ onJfbCustomEvent(options) {
271
+ console.log('event.onJfbReachBottom', options)
272
+ },
273
+ }
274
+ }
275
+
276
+ </script>
277
+
278
+ <style scoped lang="less">
279
+ @import "./JfbBaseExpressListLess.less";
280
+
281
+ .jfb-base-express-list {
282
+ &__body {
283
+ background: #f8f8f8;
284
+ .fixed_top{
285
+ position: fixed;
286
+ top: 0;
287
+ left: 0;
288
+ width: 100%;
289
+ background: #FFFFFF;
290
+ z-index: 999;
291
+ }
292
+ }
293
+
294
+ //状态tab栏
295
+ &__status {
296
+ background: #fff;
297
+ display: flex;
298
+ align-items: center;
299
+
300
+ &-item {
301
+ flex: 1;
302
+ height: 100rpx;
303
+ display: flex;
304
+ justify-content: center;
305
+ align-items: center;
306
+ color: #666;
307
+
308
+ &.is-active {
309
+ color: #333;
310
+ font-weight: 600;
311
+ }
312
+ }
313
+
314
+ &-text {
315
+ display: flex;
316
+ align-items: center;
317
+ }
318
+
319
+ &-name {
320
+ position: relative;
321
+ font-size: 28rpx;
322
+ }
323
+
324
+ &-line {
325
+ position: absolute;
326
+ left: 0;
327
+ bottom: -8rpx;
328
+ width: 100%;
329
+ height: 6rpx;
330
+ border-radius: 3rpx;
331
+ background: #333;
332
+ visibility: hidden;
333
+
334
+ &.is-visible {
335
+ visibility: visible;
336
+ }
337
+ }
338
+
339
+ &-count {
340
+ width: 50rpx;
341
+ height: 40rpx;
342
+ line-height: 40rpx;
343
+ margin-left: 8rpx;
344
+ border-radius: 24rpx;
345
+ background: rgba(240, 31, 31, 1);
346
+ box-shadow: 0px 2rpx 4rpx rgba(240, 31, 31, 0.25);
347
+ color: #fff;
348
+ font-size: 22rpx;
349
+ text-align: center;
350
+ box-sizing: border-box;
351
+ }
352
+ }
353
+
354
+ //包裹列表
355
+ &__list {
356
+ padding: 16rpx;
357
+ }
358
+
359
+ &__item {
360
+ background: #fff;
361
+ border-radius: 16rpx;
362
+ overflow: hidden;
363
+ margin-bottom: 16rpx;
364
+
365
+ &:last-child {
366
+ margin-bottom: 0;
367
+ }
368
+
369
+ &-title {
370
+ padding: 24rpx;
371
+ display: flex;
372
+ justify-content: space-between;
373
+ align-items: center;
374
+ font-size: 24rpx;
375
+ color: #999;
376
+
377
+ &-left,
378
+ &-right {
379
+ display: flex;
380
+ align-items: center;
381
+ }
382
+
383
+ &-text {
384
+ margin-left: 12rpx;
385
+ }
386
+ }
387
+
388
+ &-number {
389
+ margin: 0 24rpx;
390
+ padding-bottom: 24rpx;
391
+ display: flex;
392
+ justify-content: space-between;
393
+ align-items: center;
394
+
395
+ &-info {
396
+ display: flex;
397
+ align-items: center;
398
+ overflow: hidden;
399
+ }
400
+
401
+ &-company {
402
+ font-size: 32rpx;
403
+ font-weight: 500;
404
+ color: #333;
405
+ margin-right: 16rpx;
406
+ flex-shrink: 0;
407
+ }
408
+
409
+ &-no {
410
+ font-size: 32rpx;
411
+ font-weight: 500;
412
+ color: #333;
413
+ }
414
+
415
+ &-copy {
416
+ flex-shrink: 0;
417
+ border: 2rpx solid #e5e5e5;
418
+ border-radius: 30rpx;
419
+ color: #999;
420
+ font-size: 24rpx;
421
+ padding: 6rpx 20rpx;
422
+ }
423
+ }
424
+
425
+ &-goods {
426
+ border-top: 2rpx solid #f5f5f5;
427
+ padding: 24rpx;
428
+
429
+ &-item {
430
+ display: flex;
431
+ align-items: center;
432
+ margin-bottom: 24rpx;
433
+
434
+ &:last-child {
435
+ margin-bottom: 0;
436
+ }
437
+ }
438
+
439
+ &-image {
440
+ width: 160rpx;
441
+ height: 160rpx;
442
+ border-radius: 8rpx;
443
+ flex-shrink: 0;
444
+ }
445
+
446
+ &-info {
447
+ flex: 1;
448
+ display: flex;
449
+ flex-direction: column;
450
+ justify-content: space-between;
451
+ min-height: 160rpx;
452
+ margin-left: 20rpx;
453
+ overflow: hidden;
454
+ }
455
+
456
+ &-name {
457
+ font-size: 28rpx;
458
+ color: #333;
459
+ line-height: 40rpx;
460
+ .uni-max-cut(2, 80);
461
+ word-break: break-all;
462
+ }
463
+
464
+ &-brand {
465
+ font-size: 24rpx;
466
+ color: #999;
467
+ margin-top: 6rpx;
468
+ .uni-max-cut(1, 32);
469
+ }
470
+
471
+ &-bottom {
472
+ display: flex;
473
+ justify-content: space-between;
474
+ align-items: center;
475
+ margin-top: 12rpx;
476
+ }
477
+
478
+ &-price {
479
+ display: flex;
480
+ align-items: center;
481
+ }
482
+
483
+ &-num {
484
+ flex-shrink: 0;
485
+ font-size: 24rpx;
486
+ color: #999;
487
+ }
488
+ }
489
+ }
490
+
491
+ &__empty {
492
+ padding: 80rpx 0;
493
+ text-align: center;
494
+ font-size: 26rpx;
495
+ color: #999;
496
+ }
497
+ }
498
+ </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
+ }