jufubao-base 1.0.169-beta5 → 1.0.169-beta6

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.
@@ -48,7 +48,9 @@
48
48
  <view class="bus_title">进入业务板块</view>
49
49
  <view class="bus_list">
50
50
  <view class="bus_item" v-for="(item, i) in businessList" :key="i"
51
- :style="businessItemBox">
51
+ :style="businessItemBox"
52
+ @click="handleBusinessLogin(item)"
53
+ >
52
54
  <view class="bus_img">
53
55
  <image :src="item.image_url" />
54
56
  </view>
@@ -57,17 +59,17 @@
57
59
  </view>
58
60
  </view>
59
61
  <view v-else>
60
- <xd-button type="primary">立即使用</xd-button>
62
+ <xd-button type="primary" @click="doCardLogin">立即使用</xd-button>
61
63
  </view>
62
64
  </view>
63
65
  <view class="list_col_wrap" :style="listColWrapBoxStyle">
64
- <view class="list_item" :style="listColItemStyle">
66
+ <view class="list_item" :style="listColItemStyle" @click="switchModule('rule')">
65
67
  <view class="list_title">使用规则</view>
66
68
  <view class="list_icon">
67
69
  <xd-font-icon icon="iconxiangyou_xian" size="24"></xd-font-icon>
68
70
  </view>
69
71
  </view>
70
- <view class="list_item" :style="listColItemStyle">
72
+ <view class="list_item" :style="listColItemStyle" @click="switchModule('pickup')">
71
73
  <view class="list_title">提货码</view>
72
74
  <view class="list_icon">
73
75
  <xd-font-icon icon="iconxiangyou_xian" size="24"></xd-font-icon>
@@ -114,7 +116,9 @@
114
116
  import { getContainerPropsValue } from "@/utils/xd.base";
115
117
  import componentsMixins from "@/mixins/componentsMixins";
116
118
  import extsMixins from "@/mixins/extsMixins";
119
+ import colorCardMixins from "@/mixins/colorCardMixins";
117
120
  import getServiceUrl from '@/common/getServiceUrl'
121
+ import { mapState, mapActions } from "vuex";
118
122
  export default {
119
123
  name: "JfbBaseTfkCardDetail",
120
124
  components: {
@@ -123,7 +127,7 @@
123
127
  XdUnit,
124
128
  },
125
129
  mixins: [
126
- componentsMixins, extsMixins, JfbBaseTfkCardDetailMixin
130
+ componentsMixins, extsMixins, JfbBaseTfkCardDetailMixin, colorCardMixins
127
131
  ],
128
132
  data() {
129
133
  return {
@@ -163,9 +167,18 @@
163
167
  payPreIcon: "",
164
168
  refreshIcon: "",
165
169
  bussWidth: 100,
170
+ codeDetailRadius: 16,
171
+ codeDetailBorder: {},
172
+ codeDetailShadow: {},
173
+ ruleDetailFontColor: "",
174
+ ruleDetailRadius: 0,
166
175
  }
167
176
  },
168
177
  computed: {
178
+ ...mapState({
179
+ jwxSDK: (state) => state.jwxSDK,
180
+ jfbAuthorize: (state) => state.jfbAuthorize,
181
+ }),
169
182
  cardWrapBoxStyle(){
170
183
  let padding = `${this.checkValue(this.cardInfoMargin.top, 20)}rpx`;
171
184
  padding = `${padding} ${this.checkValue(this.cardInfoMargin.right, 20)}rpx`;
@@ -266,9 +279,21 @@
266
279
  margin: margin,
267
280
  padding: padding,
268
281
  backgroundColor: this.ruleDetailBgColor,
282
+ color: this.ruleDetailFontColor,
283
+ borderRadius: this.ruleDetailRadius + 'rpx',
269
284
  })
270
285
  },
271
286
  codeDetailBoxStyle(){
287
+ let border = "none";
288
+ let boxShadow = "none";
289
+ if(this.codeDetailBorder && this.codeDetailBorder.type === 'Y'){
290
+ let { width, color } = this.codeDetailBorder.value || {};
291
+ border = `${width || 0}rpx solid ${color || 'transparent'}`;
292
+ }
293
+ if(this.codeDetailShadow && this.codeDetailShadow.type === 'Y'){
294
+ let { width, color } = this.codeDetailShadow.value || {};
295
+ boxShadow = `0 0 ${width || 0}rpx ${color || 'transparent'}`;
296
+ }
272
297
  let padding = `${this.checkValue(this.codeDetailPadding.top, 20)}rpx`;
273
298
  padding = `${padding} ${this.checkValue(this.codeDetailPadding.right, 20)}rpx`;
274
299
  padding = `${padding} ${this.checkValue(this.codeDetailPadding.bottom, 20)}rpx`;
@@ -281,6 +306,9 @@
281
306
  margin: margin,
282
307
  padding: padding,
283
308
  backgroundColor: this.codeDetailBgColor,
309
+ borderRadius: this.codeDetailRadius + 'rpx',
310
+ border: border,
311
+ boxShadow: boxShadow,
284
312
  })
285
313
  },
286
314
  qrcodeBoxStyle(){
@@ -338,25 +366,69 @@
338
366
  this.payPreIcon = getContainerPropsValue(value, 'content.payPreIcon', '');
339
367
  this.refreshIcon = getContainerPropsValue(value, 'content.refreshIcon', '');
340
368
  this.bussWidth = getContainerPropsValue(value, 'content.bussWidth', 100);
369
+ this.codeDetailRadius = getContainerPropsValue(value, 'content.codeDetailRadius', 16);
370
+ this.codeDetailBorder = getContainerPropsValue(value, 'content.codeDetailBorder', {});
371
+ this.codeDetailShadow = getContainerPropsValue(value, 'content.codeDetailShadow', {});
372
+ this.ruleDetailFontColor = getContainerPropsValue(value, 'content.ruleDetailFontColor', '');
373
+ this.ruleDetailRadius = getContainerPropsValue(value, 'content.ruleDetailRadius', 0);
374
+
375
+ console.log(this.codeDetailBorder, 'codeDetailBorder')
341
376
 
342
377
  if(this.$configProject.isPreview){
343
378
  this.curModule = this.previewCurrent;
344
379
  }
345
380
  },
381
+ switchModule(module){
382
+ this.curModule = module;
383
+ },
384
+ handleBusinessLogin(item){
385
+ this.doCardLogin(() => {
386
+ this.handleClick(item);
387
+ })
388
+ },
389
+ doCardLogin(cb){
390
+ this.$xdShowLoading({});
391
+ jfbRootExec("loginTfkCardBind", {
392
+ vm: this,
393
+ data: {
394
+ card_number: this.card_number
395
+ }
396
+ }).then(res => {
397
+ this.$xdHideLoading();
398
+ //#ifdef MP-WEIXIN
399
+ if (this.jfbAuthorize !== null) {
400
+ this.jfbAuthorize.setCardToken(res);
401
+ }
402
+ //#endif
403
+
404
+ if(cb) return cb();
405
+
406
+ if (this.$configProject.isPreview) {
407
+ console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
408
+ } else {
409
+ this.$xdUniHelper.redirectTo({
410
+ url: this.settings.index
411
+ });
412
+ }
413
+ }).catch((res) => {
414
+ this.$xdHideLoading();
415
+ });
416
+ },
346
417
  getCardDetail(){
347
418
  jfbRootExec("getTfkCardDetail", {
348
419
  vm: this,
349
420
  data: {
350
421
  card_number: this.card_number,
351
- is_show_entry_settings: this.showBusinessList,
422
+ is_show_entry_settings: this.curModule === 'main' ? this.showBusinessList : "N",
352
423
  }
353
424
  }).then(res => {
354
425
  this.cardInfo = Object.assign({}, res, {
355
426
  other_card_point: res.other_card_point ? this.$xdUniHelper.divisionFloatNumber(res.other_card_point, 100) : 0
356
427
  });
357
- this.businessList = res.site_entry_settings.map(item => {
428
+ let businessList = this.filterNotSupportEntry(res.site_entry_settings);
429
+ this.businessList = businessList.filter(item => {
358
430
  item['image_url'] = getServiceUrl(item.image_url);
359
- return item;
431
+ return res.business_codes.includes(item.business_code);
360
432
  })
361
433
  if(!this.$configProject.isPreview) {
362
434
  this.setIntval(res.card_qrcode_expire);
@@ -365,6 +437,56 @@
365
437
  }
366
438
  })
367
439
  },
440
+ handleClick(entry){
441
+ const {dir, path, host, appType} = entry['redirect_data'];
442
+ let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
443
+ let regSp = /(-apiuri\/v)/;
444
+
445
+ if(!appType) entry.redirect_data.appType = 'h5';
446
+ let nsp = Base64.encodeURI(JSON.stringify({business_code: entry['business_code']}));
447
+
448
+ //外站配置地址
449
+ if(entry.redirect_type === 'URL') {
450
+ if(regHttp.test(entry.redirect_data['path']) || regSp.test(entry.redirect_data['path'])) {
451
+ this.$xdUniHelper.redirectTo({
452
+ url:`${entry.redirect_data['path']}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`
453
+ }, false)
454
+ }
455
+ else {
456
+ console.error(`配置错误:${entry.redirect_data['path']}`);
457
+ throw new Error(`配置错误:${entry.redirect_data['path']}`)
458
+ }
459
+ return
460
+ }
461
+
462
+ //站内应用处理
463
+ let jumpUrl = path;
464
+ let cardPathStr = '';
465
+ const {deploy_dir} = this.projectAttr;
466
+ if(host === this.projectAttr.host && deploy_dir !== dir){
467
+ jumpUrl = `//${host}/${dir}${path}`;
468
+ //#ifdef MP-WEIXIN
469
+ jumpUrl = `https:${jumpUrl}`;
470
+ //#endif
471
+ }
472
+
473
+ //#ifdef MP-WEIXIN
474
+ //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
475
+ if(entry.redirect_data.appType === 'h5') {
476
+ const custom_redirect_data = this.$xdUniHelper.checkVarType(entry['custom_redirect_data']) === 'object'?entry['custom_redirect_data']:{};
477
+ const cardPathObject = this.getCardPath(custom_redirect_data);
478
+ if(cardPathObject !== null) {
479
+ const {cardPath, cardSelf} =cardPathObject
480
+ if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
481
+ }
482
+ }
483
+ //#endif
484
+
485
+ jumpUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`;
486
+ console.warn(`entry.path:${jumpUrl}`);
487
+ if(regHttp.test(jumpUrl)) this.$xdUniHelper.redirectTo({url:jumpUrl}, false)
488
+ else this.$xdUniHelper.navigateTo({url:jumpUrl}, false)
489
+ },
368
490
  getContent() {
369
491
  jfbRootExec("getListBaseNewsContent", {
370
492
  vm: this,
@@ -449,6 +571,7 @@
449
571
  display: flex;
450
572
  flex-direction: column;
451
573
  justify-content: space-between;
574
+ font-size: 26rpx;
452
575
  .card_top{
453
576
  display: flex;
454
577
  flex-direction: column;
@@ -539,11 +662,13 @@
539
662
  .code_wrap{
540
663
  display: flex;
541
664
  flex-direction: column;
665
+ font-size: 28rpx;
542
666
  .code_title{
543
667
  display: flex;
544
668
  align-items: center;
545
669
  ._title{
546
670
  margin-left: 30rpx;
671
+ font-size: 32rpx;
547
672
  }
548
673
  }
549
674
  .barcode{
@@ -18,6 +18,28 @@ export default {
18
18
  { label: '我的优惠券', value: 'coupon' },
19
19
  ],
20
20
  },
21
+ // {
22
+ // label: '选择综合入口类型:',
23
+ // ele: 'xd-site-select-list',
24
+ // valueKey: 'entryGroupId',
25
+ // value: data.entryGroupId || 'default',
26
+ // placeholder: '请选择综合入口类型',
27
+ // multiple: false,
28
+ // groupKey:'content',
29
+ // className: 'input50',
30
+ // rules: [
31
+ // {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
32
+ // ],
33
+ // handleCustom({action, data}) {
34
+ // XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
35
+ // .then(res => {
36
+ // data.cb(res.list)
37
+ // })
38
+ // .catch(error => {
39
+ // console.error(error);
40
+ // });
41
+ // },
42
+ // },
21
43
  {
22
44
  ele: "title",
23
45
  label: "公告内容配置 - 通用",
@@ -276,6 +298,18 @@ export default {
276
298
  maxlen: 100,
277
299
  hidden: data.previewCurrent !== 'card'
278
300
  },
301
+ {
302
+ label: "背景图裁剪、缩放模式:",
303
+ ele: "xd-select-list",
304
+ valueKey: "cardImageMode",
305
+ groupKey:'content',
306
+ value: data.cardImageMode || '',
307
+ className: "input70",
308
+ list: [
309
+ {label: '铺满背景,裁剪掉多余', value: 'cover'},
310
+ {label: '图像缩放成适合背景区域的最大大小', value: 'contain'}
311
+ ],
312
+ },
279
313
  {
280
314
  ele: "title",
281
315
  label: "我的优惠券内容配置",
@@ -304,6 +338,21 @@ export default {
304
338
  maxlen: 100,
305
339
  hidden: data.previewCurrent !== 'coupon'
306
340
  },
341
+ {
342
+ label: '顶部菜单配置 - 通用:',
343
+ ele: "title",
344
+ size: "small",
345
+ groupKey: "content",
346
+ },
347
+ {
348
+ label: "顶部菜单右侧文案:",
349
+ ele: "el-input",
350
+ valueKey: "bindCardText",
351
+ value: data.bindCardText || "",
352
+ placeholder: "请输入内容",
353
+ groupKey:'content',
354
+ className: "input70",
355
+ },
307
356
  {
308
357
  ele: "title",
309
358
  label: "列表容器配置 - 通用",
@@ -410,6 +459,67 @@ export default {
410
459
  groupKey: "style",
411
460
  type: "number",
412
461
  },
462
+ {
463
+ label: "顶部菜单右侧配置 - 通用:",
464
+ ele: "title",
465
+ size: "small",
466
+ groupKey: "style",
467
+ },
468
+ {
469
+ label: "展示方式:",
470
+ ele: "xd-radio",
471
+ valueKey: "bindCardShowType",
472
+ value: data.bindCardShowType || 'text',
473
+ groupKey:'style',
474
+ list: [
475
+ {label: '文本', value: 'text'},
476
+ {label: '按钮', value: 'button'}
477
+ ],
478
+ },
479
+ {
480
+ label: "按钮圆角",
481
+ ele: 'xd-site-select-list',
482
+ valueKey: 'bindCardBtnRadius',
483
+ value: data['bindCardBtnRadius'] || 16,
484
+ groupKey:'style',
485
+ placeholder: '请选择内容圆角设置',
486
+ multiple: false,
487
+ className: 'input80',
488
+ handleCustom({ action, data }) {
489
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
490
+ .then(res => {
491
+ data.cb(res.list)
492
+ })
493
+ .catch(error => {
494
+ console.error(error);
495
+ });
496
+ },
497
+ hidden: data.bindCardShowType !== 'button'
498
+ },
499
+ {
500
+ label: "右侧文案字体样式:",
501
+ ele: "xd-font",
502
+ valueKey: "bindCardTextStyle",
503
+ value: data.bindCardTextStyle || {},
504
+ groupKey:'style',
505
+ setting: {
506
+ align: false,
507
+ lineHeight: false,
508
+ },
509
+ handleCustom({action, data}) {
510
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_font_size'})
511
+ .then(res => {
512
+ data.cb(res.list)
513
+ })
514
+ .catch(error => {
515
+ data.cb([])
516
+ console.error(error);
517
+ });
518
+ },
519
+ inline: false,
520
+ notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
521
+ hidden: data.bindCardText === ''
522
+ },
413
523
  {
414
524
  label: "右侧图标(跳转票券绑定):",
415
525
  ele: "xd-font",
@@ -513,6 +623,32 @@ export default {
513
623
  groupKey: "style",
514
624
  hidden: data.previewCurrent !== 'card'
515
625
  },
626
+ {
627
+ label: "边框设置:",
628
+ ele: "xd-border",
629
+ groupKey:'style',
630
+ valueKey: "cardBorder",
631
+ value: data.cardBorder || null,
632
+ hidden: data.previewCurrent !== 'card'
633
+ },
634
+ {
635
+ label: "边框阴影设置:",
636
+ ele: "xd-shadow",
637
+ groupKey:'style',
638
+ valueKey: "cardShadow",
639
+ value: data.cardShadow || null,
640
+ handleCustom({action, data}) {
641
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
642
+ .then(res => {
643
+ data.cb(res.list)
644
+ })
645
+ .catch(error => {
646
+ console.error(error);
647
+ data.cb([])
648
+ });
649
+ },
650
+ hidden: data.previewCurrent !== 'card'
651
+ },
516
652
  {
517
653
  label: "单项内边距设置:",
518
654
  groupKey:'style',
@@ -722,6 +858,30 @@ export default {
722
858
  },
723
859
  inline: false,
724
860
  },
861
+ {
862
+ label: '票券详情地址:',
863
+ ele: 'xd-select-pages-path',
864
+ valueKey: 'cardDetailPath',
865
+ groupKey:'advanced',
866
+ placeholder: '请选择票券详情地址',
867
+ value: data.cardDetailPath || null,
868
+ setting: {
869
+ router: XdBus.getParentApi('getPagesTree'),
870
+ },
871
+ inline: false,
872
+ },
873
+ {
874
+ label: '综合福利入口页:',
875
+ ele: 'xd-select-pages-path',
876
+ valueKey: 'allEntryPath',
877
+ groupKey: 'advanced',
878
+ placeholder: '请选择综合福利入口页',
879
+ value: data.allEntryPath || null,
880
+ setting: {
881
+ router: XdBus.getParentApi('getPagesTree'),
882
+ },
883
+ inline: false,
884
+ },
725
885
  ].filter(i=>i)
726
886
  },
727
887
  advanced: [],