jufubao-base 1.0.237 → 1.0.238-beta67

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.237",
3
+ "version": "1.0.238-beta67",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -16,6 +16,28 @@ export default {
16
16
  {label: "布局2", value: "2"},
17
17
  ]
18
18
  },
19
+ {
20
+ label: '选择综合入口类型:',
21
+ ele: 'xd-site-select-list',
22
+ valueKey: 'entryGroupId',
23
+ value: data.entryGroupId || 'default',
24
+ placeholder: '请选择综合入口类型',
25
+ multiple: false,
26
+ groupKey:'content',
27
+ className: 'input50',
28
+ rules: [
29
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
30
+ ],
31
+ handleCustom({action, data}) {
32
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
33
+ .then(res => {
34
+ data.cb(res.list)
35
+ })
36
+ .catch(error => {
37
+ console.error(error);
38
+ });
39
+ },
40
+ },
19
41
  {
20
42
  label: '提示内容:',
21
43
  ele: 'xd-site-news',
@@ -123,7 +123,7 @@
123
123
  >可转换票券</view>
124
124
  <view class="debuger" v-if="cardList.length === 0" @click="openDebugger(true)" style="opacity: 0">debuger</view>
125
125
  </view>
126
-
126
+
127
127
  </view>
128
128
  <view
129
129
  class="jfb-base-card__body-tips"
@@ -183,7 +183,7 @@
183
183
  :style="{marginRight: '18rpx'}"
184
184
  :color="mainColor"
185
185
  ></xd-font-icon>
186
- <view class="card_name_text">{{ item.card_type_name }}</view>
186
+ <view class="card_name_text">{{ item.card_type_name }}-{{item.entries.length}}</view>
187
187
  </view>
188
188
  <view>
189
189
  <view>{{ item.card_number }}{{showIndex?(':' + index):''}}</view>
@@ -375,6 +375,9 @@ export default {
375
375
  changeList: [], //可转化卡列表
376
376
  disableList: [], //不可用卡列表
377
377
  inCallback: null, //内部跳转地址
378
+ businessList:{
379
+
380
+ },
378
381
  loadingCardList: true,
379
382
  showIndex: false,
380
383
 
@@ -409,7 +412,8 @@ export default {
409
412
  popup: "https://img.zcool.cn/community/01784158abe781a801219c77e981ee.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100",
410
413
  buy_name: '',
411
414
  isShowBuy: 'N',
412
- buy_new_url: ''
415
+ buy_new_url: '',
416
+ entryGroupId:'default'
413
417
  };
414
418
  },
415
419
  created() {
@@ -449,6 +453,7 @@ export default {
449
453
  this.detailUrl = getContainerPropsValue(container,"content.detail_url",{value: ""}).value;
450
454
  this.confirmUrl = getContainerPropsValue(container,"content.confirm_url",{value: ""}).value;
451
455
  this.allEntryPath = getContainerPropsValue(container,"content.allEntryPath",{value: ""}).value;
456
+ this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
452
457
 
453
458
  //登录样式
454
459
  this.login_name = getContainerPropsValue(container, "content.login_name", "登录");
@@ -467,7 +472,7 @@ export default {
467
472
  this.look_text_radius = getContainerPropsValue(container, 'content.look_text_radius', '20');
468
473
 
469
474
  this.isShowBuy = getContainerPropsValue(container, "content.isShowBuy", "N");
470
- this.buy_name = getContainerPropsValue(container, "content.buy_name", "购买新卡");
475
+ this.buy_name = getContainerPropsValue(container, "content.buy_name", "购买新卡");
471
476
  this.buy_new_url = getContainerPropsValue(container,"content.buy_new_url",{value: ""}).value;
472
477
  this.show_coupon_tab = getContainerPropsValue(container, "content.show_coupon_tab", "N");
473
478
  },
@@ -559,8 +564,9 @@ export default {
559
564
  * @param item
560
565
  */
561
566
  handleBindLogin(item) {
567
+ if(this.$configProject.isPreview) return;
568
+ //普通卡
562
569
  if (this.tabIndex === 1) {
563
-
564
570
  //无效卡
565
571
  if (item["is_valid"] !== "Y") {
566
572
  console.log(
@@ -571,6 +577,8 @@ export default {
571
577
  );
572
578
  return;
573
579
  }
580
+
581
+ //正常卡券
574
582
  this.$xdShowLoading({});
575
583
  jfbRootExec("loginCardBind", {
576
584
  vm: this,
@@ -582,32 +590,30 @@ export default {
582
590
  //#ifdef MP-WEIXIN
583
591
  if (this.jfbAuthorize !== null) {
584
592
  this.jfbAuthorize.setCardToken(res);
585
- // this.jfbAuthorize.setToken("card", res["card_token"], {
586
- // expires: res["card_expire_in"] / 60 / 60,
587
- // });
588
593
  }
589
594
  //#endif
590
595
 
591
- if (this.$configProject.isPreview) {
592
- console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
593
- } else {
594
- this.$xdUniHelper.redirectTo({
595
- url: this.inCallback,
596
- });
596
+ //单业务线卡券直接跳转到业务线
597
+ if(item.entries.length ===1) {
598
+ this.handleOneBussClick(item.entries[0]);
599
+ return
597
600
  }
601
+
602
+ //其他情况
603
+ this.$xdUniHelper.redirectTo({
604
+ url: this.inCallback,
605
+ });
598
606
  })
599
607
  .catch((res) => {
600
608
  this.$xdHideLoading();
601
609
  });
602
- } else {
603
- this.$xdUniHelper.navigateTo(
604
- {
605
- url: `${this.changeUrl}?card_number=${item["card_number"]}`,
606
- },
607
- false
608
- );
610
+ }
611
+ //转移卡券
612
+ else {
613
+ this.$xdUniHelper.navigateTo({url: `${this.changeUrl}?card_number=${item["card_number"]}`}, false);
609
614
  }
610
615
  },
616
+
611
617
  toDetail(item) {
612
618
  this.$xdUniHelper.navigateTo(
613
619
  {
@@ -640,13 +646,14 @@ export default {
640
646
  },
641
647
 
642
648
  getCardList(options) {
643
- let params = {is_all: 'Y'};
649
+ let params = {is_all: 'Y',is_show_entry_settings: 'Y'};
644
650
  if(options['jfb_business_code']) {
645
651
  params['card_business_code'] = options['jfb_business_code'];
646
652
  }
647
653
  if(this.show_coupon_tab === 'Y'){
648
654
  params.show_type = this.show_type;
649
655
  }
656
+ if(this.entryGroupId) params['group_id'] = this.entryGroupId;
650
657
  this.$xdShowLoading({});
651
658
  jfbRootExec("getListCardBind", {
652
659
  vm: this,
@@ -668,12 +675,18 @@ export default {
668
675
  ),
669
676
  };
670
677
  });
678
+
679
+ //过滤入口配置
680
+ res['site_entry_settings'] = this.filterNotSupportEntry(res['site_entry_settings']);
681
+
671
682
  this.cardList = res.list.filter((item,index) => {
672
683
  return item["is_valid"] === "Y";
673
684
  }).map((item,index)=>{
674
685
  item['index'] = index;
686
+ item['entries'] = this.getEntry(item['business_codes'], res['site_entry_settings'])
675
687
  return item
676
688
  });
689
+
677
690
  console.warn(`cardList:${this.cardList.length}`)
678
691
  this.disableList = res.list.filter((item) => {
679
692
  return item["is_valid"] === "N";
@@ -684,7 +697,6 @@ export default {
684
697
  })
685
698
  console.warn(`changeList:${this.changeList.length}`)
686
699
  this.showList = this.getPageCardContent(this.cardList);
687
- // this.showList = []
688
700
  if(this.hasContent) this.offsetIndex++;
689
701
  this.$xdHideLoading();
690
702
  })
@@ -785,7 +785,6 @@ export default {
785
785
  }
786
786
  },
787
787
 
788
-
789
788
  getCardPath(custom_redirect_data = {}){
790
789
  //#ifdef H5
791
790
  return null;
@@ -813,68 +812,69 @@ export default {
813
812
  },
814
813
 
815
814
  handleClick(entry){
816
- if (this.$configProject['isPreview']) return;
817
-
818
- //登陆成功,有回调地址返回回调地址
819
- if(this.inCallbackUrlOrg) {
820
- this.$xdUniHelper.redirectTo({
821
- url:this.inCallback
822
- }, false);
823
- return;
824
- }
825
-
826
- const {dir, path, host, appType} = entry['redirect_data'];
827
- let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
828
- let regSp = /(-apiuri\/v)/;
829
-
830
- if(!appType) entry.redirect_data.appType = 'h5';
831
- let nsp = Base64.encodeURI(JSON.stringify({business_code: entry['business_code']}));
832
-
833
- //外站配置地址
834
- if(entry.redirect_type === 'URL') {
835
- if(regHttp.test(entry.redirect_data['path']) || regSp.test(entry.redirect_data['path'])) {
836
- let urlPath = entry.redirect_data['path'];
837
- if(urlPath.indexOf('?') === -1) urlPath = `${urlPath}?x-common=${nsp}&vs=${new Date().getTime()}`;
838
- else urlPath = `${urlPath}&x-common=${nsp}&vs=${new Date().getTime()}`;
839
- this.$xdUniHelper.redirectTo({
840
- url:urlPath
841
- }, false)
842
- }
843
- else {
844
- console.error(`配置错误:${entry.redirect_data['path']}`);
845
- throw new Error(`配置错误:${entry.redirect_data['path']}`)
846
- }
847
- return
848
- }
849
-
850
- //站内应用处理
851
- let jumpUrl = path;
852
- let cardPathStr = '';
853
- const {deploy_dir} = this.projectAttr;
854
- if(host === this.projectAttr.host && deploy_dir !== dir){
855
- jumpUrl = `//${host}/${dir}${path}`;
856
- //#ifdef MP-WEIXIN
857
- jumpUrl = `https:${jumpUrl}`;
858
- //#endif
859
- }
860
-
861
-
862
- //#ifdef MP-WEIXIN
863
- //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
864
- if(entry.redirect_data.appType === 'h5') {
865
- const custom_redirect_data = this.$xdUniHelper.checkVarType(entry['custom_redirect_data']) === 'object'?entry['custom_redirect_data']:{};
866
- const cardPathObject = this.getCardPath(custom_redirect_data);
867
- if(cardPathObject !== null) {
868
- const {cardPath, cardSelf} =cardPathObject
869
- if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
870
- }
871
- }
872
- //#endif
873
-
874
- jumpUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`;
875
- console.warn(`entry.path:${jumpUrl}`);
876
- if(regHttp.test(jumpUrl)) this.$xdUniHelper.redirectTo({url:jumpUrl}, false)
877
- else this.$xdUniHelper.navigateTo({url:jumpUrl}, false)
815
+ this.handleOneBussClick(entry);
816
+ // if (this.$configProject['isPreview']) return;
817
+ //
818
+ // //登陆成功,有回调地址返回回调地址
819
+ // if(this.inCallbackUrlOrg) {
820
+ // this.$xdUniHelper.redirectTo({
821
+ // url:this.inCallback
822
+ // }, false);
823
+ // return;
824
+ // }
825
+ //
826
+ // const {dir, path, host, appType} = entry['redirect_data'];
827
+ // let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
828
+ // let regSp = /(-apiuri\/v)/;
829
+ //
830
+ // if(!appType) entry.redirect_data.appType = 'h5';
831
+ // let nsp = Base64.encodeURI(JSON.stringify({business_code: entry['business_code']}));
832
+ //
833
+ // //外站配置地址
834
+ // if(entry.redirect_type === 'URL') {
835
+ // if(regHttp.test(entry.redirect_data['path']) || regSp.test(entry.redirect_data['path'])) {
836
+ // let urlPath = entry.redirect_data['path'];
837
+ // if(urlPath.indexOf('?') === -1) urlPath = `${urlPath}?x-common=${nsp}&vs=${new Date().getTime()}`;
838
+ // else urlPath = `${urlPath}&x-common=${nsp}&vs=${new Date().getTime()}`;
839
+ // this.$xdUniHelper.redirectTo({
840
+ // url:urlPath
841
+ // }, false)
842
+ // }
843
+ // else {
844
+ // console.error(`配置错误:${entry.redirect_data['path']}`);
845
+ // throw new Error(`配置错误:${entry.redirect_data['path']}`)
846
+ // }
847
+ // return
848
+ // }
849
+ //
850
+ // //站内应用处理
851
+ // let jumpUrl = path;
852
+ // let cardPathStr = '';
853
+ // const {deploy_dir} = this.projectAttr;
854
+ // if(host === this.projectAttr.host && deploy_dir !== dir){
855
+ // jumpUrl = `//${host}/${dir}${path}`;
856
+ // //#ifdef MP-WEIXIN
857
+ // jumpUrl = `https:${jumpUrl}`;
858
+ // //#endif
859
+ // }
860
+ //
861
+ //
862
+ // //#ifdef MP-WEIXIN
863
+ // //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
864
+ // if(entry.redirect_data.appType === 'h5') {
865
+ // const custom_redirect_data = this.$xdUniHelper.checkVarType(entry['custom_redirect_data']) === 'object'?entry['custom_redirect_data']:{};
866
+ // const cardPathObject = this.getCardPath(custom_redirect_data);
867
+ // if(cardPathObject !== null) {
868
+ // const {cardPath, cardSelf} =cardPathObject
869
+ // if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
870
+ // }
871
+ // }
872
+ // //#endif
873
+ //
874
+ // jumpUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`;
875
+ // console.warn(`entry.path:${jumpUrl}`);
876
+ // if(regHttp.test(jumpUrl)) this.$xdUniHelper.redirectTo({url:jumpUrl}, false)
877
+ // else this.$xdUniHelper.navigateTo({url:jumpUrl}, false)
878
878
  },
879
879
 
880
880
  toDetail(item, out=true) {
@@ -7,6 +7,28 @@ export default {
7
7
  style: [],
8
8
  content: (data) => {
9
9
  return [
10
+ {
11
+ label: '选择综合入口类型:',
12
+ ele: 'xd-site-select-list',
13
+ valueKey: 'entryGroupId',
14
+ value: data.entryGroupId || 'default',
15
+ placeholder: '请选择综合入口类型',
16
+ multiple: false,
17
+ groupKey:'content',
18
+ className: 'input50',
19
+ rules: [
20
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
21
+ ],
22
+ handleCustom({action, data}) {
23
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
24
+ .then(res => {
25
+ data.cb(res.list)
26
+ })
27
+ .catch(error => {
28
+ console.error(error);
29
+ });
30
+ },
31
+ },
10
32
  {
11
33
  label: '票券登录文案:',
12
34
  ele: 'el-input',
@@ -183,7 +183,8 @@
183
183
  inCallbackUrlOrg:'',//是否带有回调地址
184
184
  buy_new_url: '',
185
185
  isShowBuy: "",
186
- buy_name: ""
186
+ buy_name: "",
187
+ entryGroupId:'default'
187
188
  }
188
189
  },
189
190
  watch: {
@@ -231,9 +232,15 @@
231
232
  }
232
233
  }
233
234
  this.inCallback = inCallback || this.settings.index;
235
+
234
236
  this.getList();
235
237
  },
236
238
 
239
+ onJfbShow(options) {
240
+ this.cardList = [];
241
+ this.onJfbLoad(options);
242
+ },
243
+
237
244
  /**
238
245
  * @description 监听事件变化
239
246
  * @param container {object} 业务组件对象自己
@@ -251,40 +258,51 @@
251
258
  this.buy_name = getContainerPropsValue(container, "content.buy_name", "购买新卡");
252
259
  this.buy_new_url = getContainerPropsValue(container,"content.buy_new_url",{value: ""}).value;
253
260
  this.show_coupon_tab = getContainerPropsValue(container, "content.show_coupon_tab", "N");
261
+ this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
254
262
  },
263
+
255
264
  getList(){
256
265
  let options = this.options;
257
- let params = {is_all: 'Y'};
266
+ let params = {is_all: 'Y',is_show_entry_settings: 'Y'};
258
267
  if (options['jfb_business_code']) {
259
268
  params['card_business_code'] = options['jfb_business_code'];
260
269
  }
261
270
  if(this.show_coupon_tab === 'Y'){
262
271
  params.show_type = this.show_type;
263
272
  }
264
-
273
+ if(this.entryGroupId) params['group_id'] = this.entryGroupId;
265
274
  jfbRootExec("getListCardBind", {
266
275
  vm: this,
267
276
  data: params,
268
277
  }).then((res) => {
269
278
  this.loadingCardList = false;
279
+ //过滤入口配置
280
+ res['site_entry_settings'] = this.filterNotSupportEntry(res['site_entry_settings']);
281
+
270
282
  this.cardList = res.list.map((item) => {
271
283
  item['card_point'] = this.$xdUniHelper.divisionFloatNumber(item.card_point,100);
272
284
  item['other_card_point'] = this.$xdUniHelper.divisionFloatNumber(item.other_card_point,100);
285
+ item['entries'] = this.getEntry(item['business_codes'], res['site_entry_settings'])
273
286
  return item;
274
287
  }).filter((item) => item["is_valid"] === "Y");
275
288
  })
276
289
  },
290
+
277
291
  switchShowType(type){
278
292
  this.show_type = type;
293
+ this.getList();
279
294
  },
295
+
280
296
  handleBindLogin(item){
297
+ if(this.$configProject.isPreview) return;
298
+
281
299
  this.$xdShowLoading({});
282
300
  jfbRootExec("loginCardBind", {
283
301
  vm: this,
284
302
  data: { card_number: item["card_number"] },
285
303
  })
286
- .then((res) => {
287
- this.$xdHideLoading();
304
+ .then(async (res) => {
305
+ await this.$xdHideLoading();
288
306
 
289
307
  //#ifdef MP-WEIXIN
290
308
  if (this.jfbAuthorize !== null) {
@@ -292,21 +310,23 @@
292
310
  }
293
311
  //#endif
294
312
 
295
- if (this.$configProject.isPreview) {
296
- console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
297
- }
298
- else {
299
- console.warn(`handleBindLogin: ${this.inCallback}`);
300
- this.$xdUniHelper.redirectTo({
301
- url: this.inCallback,
302
- });
313
+ //单业务线卡券直接跳转到业务线
314
+ if(item.entries.length ===1) {
315
+ this.handleOneBussClick(item.entries[0]);
316
+ return
303
317
  }
318
+
319
+ //其他情况
320
+ this.$xdUniHelper.redirectTo({
321
+ url: this.inCallback,
322
+ });
304
323
  })
305
324
  .catch((res) => {
306
325
  console.error(res);
307
326
  this.$xdHideLoading();
308
327
  });
309
328
  },
329
+
310
330
  toBindCard(){
311
331
  let path = this.getUrlCallback(this.cardBindPath)
312
332
  this.$xdUniHelper.navigateTo({
@@ -7,6 +7,28 @@ export default {
7
7
  style: [],
8
8
  content: (data) => {
9
9
  return [
10
+ {
11
+ label: '选择综合入口类型:',
12
+ ele: 'xd-site-select-list',
13
+ valueKey: 'entryGroupId',
14
+ value: data.entryGroupId || 'default',
15
+ placeholder: '请选择综合入口类型',
16
+ multiple: false,
17
+ groupKey:'content',
18
+ className: 'input50',
19
+ rules: [
20
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
21
+ ],
22
+ handleCustom({action, data}) {
23
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
24
+ .then(res => {
25
+ data.cb(res.list)
26
+ })
27
+ .catch(error => {
28
+ console.error(error);
29
+ });
30
+ },
31
+ },
10
32
  {
11
33
  label: '票券登录文案:',
12
34
  ele: 'el-input',
@@ -39,7 +39,8 @@
39
39
  @bindLogin="handleBindLogin(item)"
40
40
  ></xd-card-v2>
41
41
  </view>
42
- <view v-else class="empty_data">暂时没有票券
42
+ <view v-else class="empty_data">
43
+ <view>暂时没有票券</view>
43
44
  <view v-if="isShowBuy==='Y'" class="buy_new" @click="toBuyNew" :style="{color: mainColor}"><view>{{buy_name}}</view> <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon></view>
44
45
  </view>
45
46
  </template>
@@ -62,6 +63,7 @@
62
63
  import extsMixins from "@/mixins/extsMixins";
63
64
  import {Base64} from "js-base64";
64
65
  import {mapState} from "vuex";
66
+ import colorCardMixins from "@/mixins/colorCardMixins";
65
67
 
66
68
  export default {
67
69
  name: "JfbBaseCardV3",
@@ -72,7 +74,7 @@
72
74
  XdCardV2Skeleton
73
75
  },
74
76
  mixins: [
75
- componentsMixins, extsMixins, JfbBaseCardV3Mixin
77
+ componentsMixins, extsMixins, JfbBaseCardV3Mixin,colorCardMixins
76
78
  ],
77
79
  data() {
78
80
  return {
@@ -92,7 +94,8 @@
92
94
  inCallbackUrlOrg:'',//是否带有回调地址
93
95
  buy_new_url: '',
94
96
  isShowBuy: "",
95
- buy_name: ""
97
+ buy_name: "",
98
+ entryGroupId:'default'
96
99
  }
97
100
  },
98
101
  watch: {
@@ -130,6 +133,7 @@
130
133
 
131
134
  this.getList();
132
135
  },
136
+
133
137
  /**
134
138
  * @description 监听事件变化
135
139
  * @param container {object} 业务组件对象自己
@@ -145,30 +149,37 @@
145
149
  this.buy_new_url = getContainerPropsValue(container,"content.buy_new_url",{value: ""}).value;
146
150
  this.show_coupon_tab = getContainerPropsValue(container, "content.show_coupon_tab", "N");
147
151
  },
152
+
148
153
  getList(){
149
154
  let options = this.options;
150
- let params = {is_all: 'Y'};
155
+ let params = {is_all: 'Y',is_show_entry_settings: 'Y'};
151
156
  if (options['jfb_business_code']) {
152
157
  params['card_business_code'] = options['jfb_business_code'];
153
158
  }
154
159
  if(this.show_coupon_tab === 'Y'){
155
160
  params.show_type = this.show_type;
156
161
  }
157
-
162
+ if(this.entryGroupId) params['group_id'] = this.entryGroupId;
158
163
  jfbRootExec("getListCardBind", {
159
164
  vm: this,
160
165
  data: params,
161
166
  }).then((res) => {
162
167
  this.loadingCardList = false;
168
+
169
+ //过滤入口配置
170
+ res['site_entry_settings'] = this.filterNotSupportEntry(res['site_entry_settings']);
171
+
163
172
  this.cardList = res.list.map((item) => {
164
173
  item['card_point'] = this.$xdUniHelper.divisionFloatNumber(item.card_point,100);
165
174
  item['other_card_point'] = this.$xdUniHelper.divisionFloatNumber(item.other_card_point,100);
175
+ item['entries'] = this.getEntry(item['business_codes'], res['site_entry_settings'])
166
176
  return item;
167
177
  }).filter((item) => item["is_valid"] === "Y");
168
178
  });
169
179
  },
170
180
  switchShowType(type){
171
181
  this.show_type = type;
182
+ this.getList();
172
183
  },
173
184
  toBindCard(){
174
185
  let path = this.getUrlCallback(this.cardBindPath)
@@ -189,9 +200,9 @@
189
200
  * @param item
190
201
  */
191
202
  handleBindLogin(item) {
192
- if (this.tabIndex === 1) {
193
- console.log("bindCardLogin", this.inCallback);
203
+ if(this.$configProject.isPreview) return;
194
204
 
205
+ if (this.tabIndex === 1) {
195
206
  //无效卡
196
207
  if (item["is_valid"] !== "Y") {
197
208
  console.log(
@@ -207,38 +218,38 @@
207
218
  vm: this,
208
219
  data: { card_number: item["card_number"] },
209
220
  })
210
- .then((res) => {
211
- console.log(res);
212
- this.$xdHideLoading();
221
+ .then(async (res) => {
222
+ await this.$xdHideLoading();
223
+
213
224
  //#ifdef MP-WEIXIN
214
225
  if (this.jfbAuthorize !== null) {
215
226
  this.jfbAuthorize.setCardToken(res, null);
216
227
  }
217
228
  //#endif
218
- console.log(this.inCallback);
219
- debugger
220
- if (this.$configProject.isPreview) {
221
- console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
222
- } else {
223
- this.$xdUniHelper.redirectTo({
224
- url: this.inCallback,
225
- });
229
+
230
+ //单业务线卡券直接跳转到业务线
231
+ if(item.entries.length ===1) {
232
+ this.handleOneBussClick(item.entries[0]);
233
+ return
226
234
  }
235
+
236
+ //其他情况
237
+ this.$xdUniHelper.redirectTo({
238
+ url: this.inCallback,
239
+ });
227
240
  })
228
241
  .catch((res) => {
229
242
  this.$xdHideLoading();
230
243
  });
231
244
  }
232
245
  else {
233
- this.$xdUniHelper.navigateTo({
234
- url: `${this.changeUrl}?card_number=${item["card_number"]}`,
235
- },
236
- false
237
- );
246
+ this.$xdUniHelper.navigateTo({url: `${this.changeUrl}?card_number=${item["card_number"]}`,}, false);
238
247
  }
239
248
  },
240
249
 
241
250
  onJfbShow(options) {
251
+ this.cardList = [];
252
+ this.tabIndex = 1;
242
253
  this.onJfbLoad(options);
243
254
  },
244
255
  }