jufubao-base 1.0.169-beta5 → 1.0.169-beta7

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.
Files changed (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
  3. package/src/components/JfbBaseTfkCardBind/Attr.js +25 -1
  4. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +139 -7
  5. package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
  6. package/src/components/JfbBaseTfkCardDetail/Api.js +11 -0
  7. package/src/components/JfbBaseTfkCardDetail/Attr.js +74 -0
  8. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +141 -8
  9. package/src/components/JfbBaseTfkCardLogin/Attr.js +182 -0
  10. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +250 -33
  11. package/src/components/JfbBaseTfkCardLogin/Mock.js +1 -1
  12. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +68 -16
  13. package/src/components/JfbBaseTfkSearch/AllList.vue +231 -0
  14. package/src/components/JfbBaseTfkSearch/Api.js +11 -42
  15. package/src/components/JfbBaseTfkSearch/Attr.js +125 -2
  16. package/src/components/JfbBaseTfkSearch/ContentCinema.vue +12 -2
  17. package/src/components/JfbBaseTfkSearch/{ContentItem.vue → ContentFilm.vue} +18 -4
  18. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +308 -0
  19. package/src/components/JfbBaseTfkSearch/ContentShop.vue +184 -0
  20. package/src/components/JfbBaseTfkSearch/CusAttr.js +2 -0
  21. package/src/components/JfbBaseTfkSearch/CustomList.vue +181 -28
  22. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +132 -20
  23. package/src/components/JfbBaseTfkSearch/Mock.js +90 -11
  24. package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +1 -2
  25. package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +98 -72
  26. package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
  27. package/src/components/JfbBaseTfkSearch/listMixins.js +71 -0
  28. package/src/components/JfbBaseTfkSearch/search.js +270 -152
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.169-beta5",
3
+ "version": "1.0.169-beta7",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -6,53 +6,72 @@
6
6
  */
7
7
  module.exports = [
8
8
  {
9
- //设置方法名字当别忘记加上【模块名字】:Tfk
10
- mapFnName: 'getTfkByIdFilmSquate',
11
- title: '获取电影广场列表',
12
- path: '/api/account/film/list-film-square',
9
+ mapFnName: 'qrcodeCardBind',
13
10
  isRule: false,
14
- params: {
15
- last_key: ['当前页', 'Number', '必选'],
16
- page_size: ['每页数量', 'Number', '必选'],
11
+ title: '根据二维码绑定卡',
12
+ prefix: 'qrcode',
13
+ path: '/card/v1/card-bind/bind-card-by-qrcode',
14
+ data: {
15
+ card_qrcode: ['二维码内容', 'String', '必选'],
17
16
  },
18
- isConsole: true,
19
17
  disabled: true,
20
18
  },
21
19
  {
22
- //设置方法名字当别忘记加上【模块名字】:Tfk
23
- mapFnName: 'updateTfkFilmPaiqiDate',
24
- title: '更新排期',
25
- path: '/api/account/film/paiqi-date',
20
+ mapFnName: 'getByPwdCardDetail',
26
21
  isRule: false,
27
- params: {
28
- film_id: ['电影id', 'Number', '必选'],
29
- cinema_id: ['影院id', 'Number', '必选'],
22
+ title: '根据卡号密码获得卡信息',
23
+ prefix: 'detal',
24
+ path: '/card/v1/card-bind/get-card-by-password',
25
+ data: {
26
+ card_number: ['卡号', 'String', '必选'],
27
+ card_password: ['卡号密码', 'String', '必选']
30
28
  },
31
- isConsole: true,
32
29
  disabled: true,
33
30
  },
34
31
  {
35
- //设置方法名字当别忘记加上【模块名字】:Tfk
36
- mapFnName: 'removeTfkFilmAddress',
37
- title: '删除我的配送地址',
38
- path: '/api/account/film/paiqi-date',
32
+ mapFnName: 'getByQrCardDetail',
39
33
  isRule: false,
40
- params: {
41
- film_id: ['电影id', 'Number', '必选'],
34
+ title: '根据二维码获得卡信息',
35
+ prefix: 'detal',
36
+ path: '/card/v1/card-bind/get-card-by-qrcode',
37
+ data: {
38
+ card_qrcode: ['二维码', 'String', '必选'],
42
39
  },
43
- isConsole: true,
44
40
  disabled: true,
45
41
  },
46
42
  {
47
- //设置方法名字当别忘记加上【模块名字】:Tfk
48
- mapFnName: 'addTfkFilmcart',
49
- title: '添加购物车',
50
- path: '/api/account/film/paiqi-date',
43
+ mapFnName: 'pwdCardBind',
51
44
  isRule: false,
52
- params: {
53
- film_id: ['电影id', 'Number', '必选'],
45
+ title: '根据卡号密码绑定卡',
46
+ prefix: 'pwd',
47
+ path: '/card/v1/card-bind/bind-card-by-password',
48
+ data: {
49
+ card_number: ['卡号', 'String', '必选'],
50
+ card_password: ['密码', 'String', '可选'],
51
+ },
52
+ disabled: true,
53
+ },
54
+ {
55
+ mapFnName: 'qrCardBind',
56
+ isRule: false,
57
+ title: '根据二维码绑定卡',
58
+ prefix: 'qrcode',
59
+ path: '/card/v1/card-bind/bind-card-by-qrcode',
60
+ data: {
61
+ card_qrcode: ['二维码', 'String', '必选'],
54
62
  },
55
- isConsole: true,
56
63
  disabled: true,
57
64
  },
65
+ {
66
+ mapFnName: "checkValidCode",
67
+ title: "图片验证码 - 校验",
68
+ path: "/common/v1/valid_code/image/check",
69
+ isRule: false,
70
+ data: {
71
+ token: ['随机请求码,前端生成', 'String', '必选'],
72
+ valid_code: ['验证码', 'String', '必选'],
73
+ },
74
+ isConsole: true,
75
+ disabled: true,
76
+ }
58
77
  ];
@@ -624,7 +624,31 @@ export default {
624
624
  placeholder: '请设置边距',
625
625
  inline: false,
626
626
  notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
627
- }
627
+ },
628
+ {
629
+ label: '我的票券跳转地址:',
630
+ ele: 'xd-select-pages-path',
631
+ valueKey: 'my_card_url',
632
+ groupKey: 'advanced',
633
+ placeholder: '请选择我的票券跳转地址',
634
+ value: null,
635
+ setting: {
636
+ router: XdBus.getParentApi('getPagesTree'),
637
+ },
638
+ inline: false,
639
+ },
640
+ {
641
+ label: '卡绑定成功回跳地址:',
642
+ ele: 'xd-select-pages-path',
643
+ valueKey: 'back_url',
644
+ groupKey: 'advanced',
645
+ placeholder: '请选择卡绑定成功回跳地址',
646
+ value: null,
647
+ setting: {
648
+ router: XdBus.getParentApi('getPagesTree'),
649
+ },
650
+ inline: false,
651
+ },
628
652
  ].filter(i=>i)
629
653
  },
630
654
  advanced: [],
@@ -35,11 +35,11 @@
35
35
  }">
36
36
  <view class="menu_wrap" :style="menuBoxStyle">
37
37
  <view class="menu_list">
38
- <view class="menu_item">
38
+ <view class="menu_item" @click="switchShowType('ticket')">
39
39
  <view class="menu_inner" :class="menuShowType"
40
40
  :style="[menuType == 'ticket' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">实体券</view>
41
41
  </view>
42
- <view class="menu_item">
42
+ <view class="menu_item" @click="switchShowType('code')">
43
43
  <view class="menu_inner" :class="menuShowType"
44
44
  :style="[menuType == 'code' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">电子码</view>
45
45
  </view>
@@ -114,6 +114,7 @@
114
114
  <view :style="btnWrapStyle">
115
115
  <xd-button type="primary"
116
116
  :radius="btnRadius + 'rpx'"
117
+ @click="toBindCardTicket"
117
118
  >
118
119
  <xd-font-icon :icon="btnIcon.icon"
119
120
  style="display: inline-flex;margin-right: 12rpx;"
@@ -145,6 +146,7 @@
145
146
  <view :style="digitalBtnWrapStyle">
146
147
  <xd-button type="primary"
147
148
  :radius="btnRadius + 'rpx'"
149
+ @click="toBindCardDigital"
148
150
  >
149
151
  <xd-font-icon :icon="btnIcon.icon"
150
152
  style="display: inline-flex;margin-right: 12rpx;"
@@ -193,6 +195,7 @@
193
195
  validImageAPIUrl: "",
194
196
  valid_token: "",
195
197
  formRenderKey: "formRenderKey",
198
+ hasCon: "", //是否有优惠券
196
199
 
197
200
  //todo
198
201
  tips: "",
@@ -252,6 +255,8 @@
252
255
  digitalCodeLabelWidth: "",
253
256
  digitalCodeRadius: 0,
254
257
  digitalCodeColor: "",
258
+ my_card_url: "",
259
+ backUrl: "",
255
260
  }
256
261
  },
257
262
  computed: {
@@ -316,6 +321,7 @@
316
321
  return this.styleObjectToString({
317
322
  background: this.tipBgColor,
318
323
  padding: padding,
324
+ fontSize: '24rpx',
319
325
  })
320
326
  },
321
327
  menuItemBoxStyle(){
@@ -407,6 +413,8 @@
407
413
  this.digitalCodeLabelWidth = getContainerPropsValue(value, "content.digitalCodeLabelWidth", '100');
408
414
  this.digitalCodeRadius = getContainerPropsValue(value, "content.digitalCodeRadius", '0');
409
415
  this.digitalCodeColor = getContainerPropsValue(value, "content.digitalCodeColor", '#dddddd');
416
+ this.my_card_url = getContainerPropsValue(this.container, 'content.my_card_url', { value: "" }).value;
417
+ this.backUrl = getContainerPropsValue(this.container, 'content.back_url', { value: "" }).value;
410
418
 
411
419
  console.log(this.digitalCodeRadius, "digitalCodeRadius");
412
420
 
@@ -419,9 +427,130 @@
419
427
  this.formRenderKey = Date.now();
420
428
  }
421
429
  },
422
-
430
+ toShowCouponDialog(){
431
+ if(this.info){
432
+ jfbRootFnExec(this, 'onCustomEvent')("@showBaseConDialog", {user_card_number: this.form.card_number})
433
+ }
434
+ },
435
+ switchShowType(type){
436
+ this.menuType = type;
437
+ },
438
+ handlerAfterBindCard(res){
439
+ //已绑定卡券处理
440
+ if(res.pop_info && res.pop_info.pop_code === '1001'){
441
+ this.handleBindConfirm();
442
+ return;
443
+ }
444
+ let path = this.getUrlCallback(this.my_card_url || this.backUrl);
445
+ //有优惠券处理
446
+ if(this.hasCon){
447
+ this.toShowCouponDialog();
448
+ this.$bus.$on("onCloseConDialog",(container_id) => {
449
+ if(container_id === this.hasCon){
450
+ this.$xdUniHelper.redirectTo({
451
+ url: path,
452
+ });
453
+ }
454
+ })
455
+ }
456
+
457
+ //票券绑定成功
458
+ else{
459
+ this.$xdAlert({
460
+ content: "票券绑定成功",
461
+ close: () => {
462
+ this.$xdUniHelper.redirectTo({
463
+ url: path,
464
+ });
465
+ },
466
+ });
467
+ }
468
+ },
469
+ //卡券已被自己绑定时的弹框
470
+ handleBindConfirm(){
471
+ this.$xdConfirm({
472
+ styles: this.styles,
473
+ width: '90%',
474
+ content: '您已绑定该票券,无需再次绑定',
475
+ confirmText: '我的票券',
476
+ cancelText: '返回',
477
+ showClose: false,
478
+ success: (res) => {
479
+ if (res.confirm) {
480
+ let path = this.getUrlCallback(this.my_card_url || this.backUrl);
481
+ this.$xdUniHelper.redirectTo({ url: path});
482
+ }else{
483
+ }
484
+ }
485
+ })
486
+ },
487
+ //绑定实体券
488
+ async toBindCardTicket(){
489
+ console.log(this.form, 'this.form')
490
+ const { card_password, card_number, valid_code } = this.form;
491
+ if(!valid_code) return uni.showToast({
492
+ title: '请输入验证码',
493
+ icon: "none"
494
+ })
495
+ await this.checkValidToken();
496
+
497
+ jfbRootExec("pwdCardBind", {
498
+ vm: this,
499
+ data: {
500
+ card_password: card_password,
501
+ card_number: card_number + "",
502
+ is_show_pop: "Y"
503
+ }
504
+ }).then(res => {
505
+ this.handlerAfterBindCard(res);
506
+ })
507
+ },
508
+ //绑定电子码票券
509
+ toBindCardDigital(){
510
+ const { code } = this.form;
511
+
512
+ if(!code) return "";
513
+ jfbRootExec("pwdCardBind", {
514
+ vm: this,
515
+ data: {
516
+ card_password: code,
517
+ is_show_pop: "Y"
518
+ }
519
+ }).then(res => {
520
+ this.handlerAfterBindCard(res);
521
+ })
522
+ },
523
+ checkValidToken(){
524
+ const { valid_code } = this.form;
525
+ let token = this.valid_token;
526
+ return new Promise((r,j) => {
527
+ jfbRootExec("checkValidCode", {
528
+ vm: this,
529
+ data: {
530
+ token,
531
+ valid_code
532
+ }
533
+ }).then(res => {
534
+ if(res.is_valid){
535
+ r();
536
+ }else{
537
+ uni.showToast({
538
+ title: '验证码错误',
539
+ duration: 2000,
540
+ icon: "none"
541
+ });
542
+ this.switchValidToken();
543
+ j();
544
+ }
545
+ })
546
+ })
547
+ },
548
+ switchValidToken(){
549
+ let valid_token = this.$xdUniHelper.randomChar(20);
550
+ this.valid_token = valid_token;
551
+ },
423
552
  onJfbScroll(options) {
424
- console.log('event.onJfbScroll', options)
553
+ // console.log('event.onJfbScroll', options)
425
554
  },
426
555
  onJfbReachBottom(options) {
427
556
  console.log('event.onJfbReachBottom', options)
@@ -438,9 +567,12 @@
438
567
  onJfbUpdate(...data) {
439
568
  console.log('event.onJfbUpdate', data)
440
569
  },
441
- onJfbCustomEvent(options) {
442
- console.log('event.onJfbReachBottom', options)
443
- },
570
+ onJfbCustomEvent({action, data}){
571
+ if(action === 'baseConDialog@hasCon'){
572
+ this.hasCon = data;
573
+ }
574
+ console.log('onJfbCustomEvent',action, data);
575
+ }
444
576
  }
445
577
  }
446
578
 
@@ -1,13 +1,23 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
-
5
- getTfkByIdFilmSquate:{},
6
-
7
- updateTfkFilmPaiqiDate:{},
8
-
9
- removeTfkFilmAddress:{},
10
-
11
- addTfkFilmcart:{},
12
-
4
+ getByPwdCardDetail: {
5
+ "card_number": "101001000005195",
6
+ "card_point": 0,
7
+ "card_type_name": "聚福宝",
8
+ "end_time": "2024-10-31 23:59:59",
9
+ "card_status": "Y",
10
+ "card_status_name": "开启",
11
+ "unit": "点",
12
+ "main_product_name": "",
13
+ "is_exchange": "N",
14
+ "is_expired":'Y',
15
+ "request_id": "741c41d86c5ae0cf",
16
+ "main_business_code_name": "蛋糕(勿改)",
17
+ "other_card_point": 4073,
18
+ },
19
+ pwdCardBind: { "id": 20, "request_id": "91f76bd11d5889be" },
20
+ qrcodeCardBind: {},
21
+ getByQrCardDetail: {},
22
+ qrCardBind: {},
13
23
  }
@@ -16,6 +16,17 @@ module.exports = [
16
16
  },
17
17
  disabled: true,
18
18
  },
19
+ {
20
+ mapFnName: 'loginTfkCardBind',
21
+ isRule: false,
22
+ title: '登录卡',
23
+ prefix: 'login',
24
+ path: '/card/v1/card-bind/login-card',
25
+ data: {
26
+ card_number: ['卡号', 'String', '必选'],
27
+ },
28
+ disabled: true,
29
+ },
19
30
  {
20
31
  mapFnName: 'getListBaseNewsContent', //自定义方法名字(必选)
21
32
  title: '获取内容',
@@ -551,6 +551,52 @@ export default {
551
551
  value: data.codeDetailBgColor || '#ffffff',
552
552
  hidden: data.previewCurrent !== 'pickup'
553
553
  },
554
+ {
555
+ label: "提货码详情圆角",
556
+ ele: 'xd-site-select-list',
557
+ valueKey: 'codeDetailRadius',
558
+ value: data['codeDetailRadius'] || 16,
559
+ groupKey:'style',
560
+ placeholder: '请选择内容圆角设置',
561
+ multiple: false,
562
+ className: 'input80',
563
+ handleCustom({ action, data }) {
564
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
565
+ .then(res => {
566
+ data.cb(res.list)
567
+ })
568
+ .catch(error => {
569
+ console.error(error);
570
+ });
571
+ },
572
+ hidden: data.previewCurrent !== 'pickup'
573
+ },
574
+ {
575
+ label: "提货码详情边框",
576
+ ele: "xd-border",
577
+ valueKey: 'codeDetailBorder',
578
+ value: data.codeDetailBorder || null,
579
+ groupKey:'style',
580
+ hidden: data.previewCurrent !== 'pickup'
581
+ },
582
+ {
583
+ label: "提货码详情边框阴影",
584
+ ele: "xd-shadow",
585
+ valueKey: 'codeDetailShadow',
586
+ value: data.codeDetailShadow || null,
587
+ groupKey:'style',
588
+ handleCustom({action, data}) {
589
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
590
+ .then(res => {
591
+ data.cb(res.list)
592
+ })
593
+ .catch(error => {
594
+ console.error(error);
595
+ data.cb([])
596
+ });
597
+ },
598
+ hidden: data.previewCurrent !== 'pickup'
599
+ },
554
600
  {
555
601
  label: "二维码长宽设置",
556
602
  ele: "el-input",
@@ -636,6 +682,34 @@ export default {
636
682
  valueKey: 'ruleDetailBgColor',
637
683
  value: data.ruleDetailBgColor || '#ffffff',
638
684
  hidden: data.previewCurrent !== 'rule'
685
+ },
686
+ {
687
+ label: "规则字体颜色",
688
+ groupKey:'style',
689
+ ele: 'xd-color',
690
+ valueKey: 'ruleDetailFontColor',
691
+ value: data.ruleDetailFontColor || '#303133',
692
+ hidden: data.previewCurrent !== 'rule'
693
+ },
694
+ {
695
+ label: "规则信息边框圆角",
696
+ ele: 'xd-site-select-list',
697
+ valueKey: 'ruleDetailRadius',
698
+ value: data.ruleDetailRadius || '0',
699
+ groupKey:'style',
700
+ placeholder: '请选择内容圆角设置',
701
+ multiple: false,
702
+ className: 'input80',
703
+ handleCustom({ action, data }) {
704
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
705
+ .then(res => {
706
+ data.cb(res.list)
707
+ })
708
+ .catch(error => {
709
+ console.error(error);
710
+ });
711
+ },
712
+ hidden: data.previewCurrent !== 'rule'
639
713
  }
640
714
  ].filter(i=>i)
641
715
  },