jufubao-base 1.0.169-beta1 → 1.0.169-beta10

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 (39) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseLogin/Attr.js +54 -16
  3. package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
  4. package/src/components/JfbBaseOrderDetail/Api.js +12 -7
  5. package/src/components/JfbBaseOrderDetail/Attr.js +28 -14
  6. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +68 -18
  7. package/src/components/JfbBaseOrderDetail/Mock.js +3 -1
  8. package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
  9. package/src/components/JfbBaseTfkCardBind/Attr.js +61 -10
  10. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +169 -9
  11. package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
  12. package/src/components/JfbBaseTfkCardDetail/Api.js +26 -0
  13. package/src/components/JfbBaseTfkCardDetail/Attr.js +336 -9
  14. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +236 -30
  15. package/src/components/JfbBaseTfkCardDetail/Mock.js +2 -2
  16. package/src/components/JfbBaseTfkCardLogin/Attr.js +301 -5
  17. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +317 -158
  18. package/src/components/JfbBaseTfkCardLogin/Mock.js +2 -46
  19. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +271 -0
  20. package/src/components/JfbBaseTfkSearch/AllList.vue +232 -0
  21. package/src/components/JfbBaseTfkSearch/Api.js +11 -42
  22. package/src/components/JfbBaseTfkSearch/Attr.js +225 -33
  23. package/src/components/JfbBaseTfkSearch/ContentCinema.vue +157 -0
  24. package/src/components/JfbBaseTfkSearch/ContentFilm.vue +179 -0
  25. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +308 -0
  26. package/src/components/JfbBaseTfkSearch/ContentShop.vue +184 -0
  27. package/src/components/JfbBaseTfkSearch/CusAttr.js +213 -0
  28. package/src/components/JfbBaseTfkSearch/CustomList.vue +402 -0
  29. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +230 -26
  30. package/src/components/JfbBaseTfkSearch/Mock.js +90 -11
  31. package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +45 -0
  32. package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +109 -0
  33. package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +246 -0
  34. package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +81 -0
  35. package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
  36. package/src/components/JfbBaseTfkSearch/listMixins.js +153 -0
  37. package/src/components/JfbBaseTfkSearch/search.js +293 -0
  38. package/src/mixins/colorCardMixins.js +71 -9
  39. package/src/mixins/componentsMixins.js +346 -23
@@ -31,8 +31,10 @@
31
31
  </view>
32
32
  <view class="_name">{{ cardInfo.card_type_name }}</view>
33
33
  </view>
34
- <view>
35
- <view class="card_deduct">购买其他物品可抵扣:78.21</view>
34
+ <view v-if="cardInfo.other_card_point && cardInfo.card_point_type !== 1">
35
+ <view class="card_deduct">
36
+ 购买其他物品可抵扣:{{ cardInfo.other_card_point }}
37
+ </view>
36
38
  </view>
37
39
  </view>
38
40
  <view class="card_bottom">
@@ -46,7 +48,9 @@
46
48
  <view class="bus_title">进入业务板块</view>
47
49
  <view class="bus_list">
48
50
  <view class="bus_item" v-for="(item, i) in businessList" :key="i"
49
- :style="businessItemBox">
51
+ :style="businessItemBox"
52
+ @click="handleBusinessLogin(item)"
53
+ >
50
54
  <view class="bus_img">
51
55
  <image :src="item.image_url" />
52
56
  </view>
@@ -55,17 +59,17 @@
55
59
  </view>
56
60
  </view>
57
61
  <view v-else>
58
- <xd-button type="primary">立即使用</xd-button>
62
+ <xd-button type="primary" @click="doCardLogin">立即使用</xd-button>
59
63
  </view>
60
64
  </view>
61
65
  <view class="list_col_wrap" :style="listColWrapBoxStyle">
62
- <view class="list_item" :style="listColItemStyle">
66
+ <view class="list_item" :style="listColItemStyle" @click="switchModule('rule')">
63
67
  <view class="list_title">使用规则</view>
64
68
  <view class="list_icon">
65
69
  <xd-font-icon icon="iconxiangyou_xian" size="24"></xd-font-icon>
66
70
  </view>
67
71
  </view>
68
- <view class="list_item" :style="listColItemStyle">
72
+ <view class="list_item" :style="listColItemStyle" @click="switchModule('pickup')">
69
73
  <view class="list_title">提货码</view>
70
74
  <view class="list_icon">
71
75
  <xd-font-icon icon="iconxiangyou_xian" size="24"></xd-font-icon>
@@ -74,8 +78,10 @@
74
78
  </view>
75
79
  </view>
76
80
  <view v-if="curModule === 'rule'">
77
- <view class="rule_wrap" :style="ruleDetailBoxStyle">
78
- 使用规则
81
+ <view v-if="cardRule" v-html="cardRule" class="rule_wrap" :style="ruleDetailBoxStyle">
82
+ </view>
83
+ <view v-else class="rule_wrap" :style="ruleDetailBoxStyle">
84
+ 使用规则暂无
79
85
  </view>
80
86
  </view>
81
87
  <view v-if="curModule === 'pickup'">
@@ -84,10 +90,14 @@
84
90
  <view><xd-font-icon :icon='payPreIcon || "iconsaoma1"' size="54"></xd-font-icon></view>
85
91
  <view class="_title">向商家付款</view>
86
92
  </view>
87
- <view class="barcode"></view>
88
- <view class="qrcode" :style="qrcodeBoxStyle"></view>
89
- <view class="time_loop">9分59秒后自动刷新</view>
90
- <view class="refresh_btn">
93
+ <view class="barcode">
94
+ <image :src="cardInfo.barcode" mode="widthFix"></image>
95
+ </view>
96
+ <view class="qrcode" :style="qrcodeBoxStyle">
97
+ <image :src="cardInfo.card_qrcode"></image>
98
+ </view>
99
+ <view class="time_loop">{{ timeStr }}后自动刷新</view>
100
+ <view class="refresh_btn" @click="handleRefresh">
91
101
  <xd-font-icon class="btn_icon" :icon="refreshIcon"></xd-font-icon>
92
102
  刷新二维码
93
103
  </view>
@@ -106,7 +116,9 @@
106
116
  import { getContainerPropsValue } from "@/utils/xd.base";
107
117
  import componentsMixins from "@/mixins/componentsMixins";
108
118
  import extsMixins from "@/mixins/extsMixins";
119
+ import colorCardMixins from "@/mixins/colorCardMixins";
109
120
  import getServiceUrl from '@/common/getServiceUrl'
121
+ import { mapState, mapActions } from "vuex";
110
122
  export default {
111
123
  name: "JfbBaseTfkCardDetail",
112
124
  components: {
@@ -115,7 +127,7 @@
115
127
  XdUnit,
116
128
  },
117
129
  mixins: [
118
- componentsMixins, extsMixins, JfbBaseTfkCardDetailMixin
130
+ componentsMixins, extsMixins, JfbBaseTfkCardDetailMixin, colorCardMixins
119
131
  ],
120
132
  data() {
121
133
  return {
@@ -123,7 +135,13 @@
123
135
  card_number: "",
124
136
  cardInfo: {},
125
137
  businessList: [],
138
+ timeStr: "",
139
+ timeer: null,
140
+ date: 2, //时间底数
141
+ time: 2, //时间幂指数
142
+ stopTimer: false, //停止轮询
126
143
 
144
+ cardRule: "",
127
145
  showBusinessList: "Y",
128
146
  //todo
129
147
  cardInfoMargin: {},
@@ -149,9 +167,18 @@
149
167
  payPreIcon: "",
150
168
  refreshIcon: "",
151
169
  bussWidth: 100,
170
+ codeDetailRadius: 16,
171
+ codeDetailBorder: {},
172
+ codeDetailShadow: {},
173
+ ruleDetailFontColor: "",
174
+ ruleDetailRadius: 0,
152
175
  }
153
176
  },
154
177
  computed: {
178
+ ...mapState({
179
+ jwxSDK: (state) => state.jwxSDK,
180
+ jfbAuthorize: (state) => state.jfbAuthorize,
181
+ }),
155
182
  cardWrapBoxStyle(){
156
183
  let padding = `${this.checkValue(this.cardInfoMargin.top, 20)}rpx`;
157
184
  padding = `${padding} ${this.checkValue(this.cardInfoMargin.right, 20)}rpx`;
@@ -252,9 +279,21 @@
252
279
  margin: margin,
253
280
  padding: padding,
254
281
  backgroundColor: this.ruleDetailBgColor,
282
+ color: this.ruleDetailFontColor,
283
+ borderRadius: this.ruleDetailRadius + 'rpx',
255
284
  })
256
285
  },
257
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
+ }
258
297
  let padding = `${this.checkValue(this.codeDetailPadding.top, 20)}rpx`;
259
298
  padding = `${padding} ${this.checkValue(this.codeDetailPadding.right, 20)}rpx`;
260
299
  padding = `${padding} ${this.checkValue(this.codeDetailPadding.bottom, 20)}rpx`;
@@ -267,6 +306,9 @@
267
306
  margin: margin,
268
307
  padding: padding,
269
308
  backgroundColor: this.codeDetailBgColor,
309
+ borderRadius: this.codeDetailRadius + 'rpx',
310
+ border: border,
311
+ boxShadow: boxShadow,
270
312
  })
271
313
  },
272
314
  qrcodeBoxStyle(){
@@ -292,6 +334,7 @@
292
334
  onJfbLoad(options) {
293
335
  this.card_number = options.card_number;
294
336
  this.getCardDetail();
337
+ this.getContent();
295
338
  },
296
339
  /**
297
340
  * @description 监听事件变化
@@ -308,7 +351,7 @@
308
351
  this.bussPadding = getContainerPropsValue(value, 'content.bussPadding', {top: 20, left: 20, right: 20, bottom: 20});
309
352
  this.bussMargin = getContainerPropsValue(value, 'content.bussMargin', {top: 20, left: 20, right: 20, bottom: 20});
310
353
  this.bussTempMargin = getContainerPropsValue(value, 'content.bussTempMargin', {top: 20, left: 20, right: 20, bottom: 20});
311
- this.bussTempBgColor = getContainerPropsValue(value, 'content.bussTempBgColor', '#fff');
354
+ this.bussTempBgColor = getContainerPropsValue(value, 'content.bussTempBgColor', 'transparent');
312
355
  this.listColMargin = getContainerPropsValue(value, 'content.listColMargin', {top: 20, left: 20, right: 20, bottom: 20});
313
356
  this.listColPadding = getContainerPropsValue(value, 'content.listColPadding', {top: 20, left: 20, right: 20, bottom: 20});
314
357
  this.listColSpace = getContainerPropsValue(value, 'content.listColSpace', 10);
@@ -323,41 +366,190 @@
323
366
  this.payPreIcon = getContainerPropsValue(value, 'content.payPreIcon', '');
324
367
  this.refreshIcon = getContainerPropsValue(value, 'content.refreshIcon', '');
325
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')
326
376
 
327
377
  if(this.$configProject.isPreview){
328
378
  this.curModule = this.previewCurrent;
329
379
  }
330
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
+ },
331
417
  getCardDetail(){
332
418
  jfbRootExec("getTfkCardDetail", {
333
419
  vm: this,
334
420
  data: {
335
421
  card_number: this.card_number,
336
- is_show_entry_settings: this.showBusinessList,
422
+ is_show_entry_settings: this.curModule === 'main' ? this.showBusinessList : "N",
337
423
  }
338
424
  }).then(res => {
339
- this.cardInfo = res;
340
- this.businessList = res.site_entry_settings.map(item => {
425
+ this.cardInfo = Object.assign({}, res, {
426
+ other_card_point: res.other_card_point ? this.$xdUniHelper.divisionFloatNumber(res.other_card_point, 100) : 0
427
+ });
428
+ let businessList = this.filterNotSupportEntry(res.site_entry_settings);
429
+ this.businessList = businessList.filter(item => {
341
430
  item['image_url'] = getServiceUrl(item.image_url);
342
- return item;
431
+ return res.business_codes.includes(item.business_code);
343
432
  })
433
+ if(!this.$configProject.isPreview) {
434
+ this.setIntval(res.card_qrcode_expire);
435
+ }else{
436
+ this.timeStr = "08分10秒";
437
+ }
438
+ })
439
+ },
440
+ handleClick(entry){
441
+ const {dir, path, host, appType} = entry['redirect_data'];
442
+ let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
443
+ let regSp = /(-apiuri\/v)/;
344
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
+ },
490
+ getContent() {
491
+ jfbRootExec("getListBaseNewsContent", {
492
+ vm: this,
493
+ data: {
494
+ page_id: this.pageAttr["page_id"], //页面ID
495
+ container_id: this.containerId, //组件ID
496
+ limit: 1,
497
+ },
345
498
  })
499
+ .then((res) => {
500
+ if (res.list.length > 0) {
501
+ if(res.list && res.list.length > 0) {
502
+ this.cardRule = this.$xdUniHelper.filterHtml(res.list[0].content);
503
+ }
504
+ // this.noticeStatus = true;
505
+ }
506
+ })
507
+ .catch((error) => {
508
+ console.error(error);
509
+ });
346
510
  },
347
- onJfbScroll(options) {
348
- console.log('event.onJfbScroll', options)
511
+ handleRefresh(){
512
+ clearInterval(this.timeer);
513
+ this.getCardDetail();
349
514
  },
350
- onJfbReachBottom(options) {
351
- console.log('event.onJfbReachBottom', options)
515
+ setIntval(time){
516
+ this.timeer = setInterval(() => {
517
+ if (time === 0) {
518
+ this.timeStr = "00分00秒";
519
+ clearInterval(this.timeer);
520
+ if (!this.stopTimer) this.getCardDetail();
521
+ } else {
522
+ time--;
523
+ let f = Math.floor(time / 60);
524
+ f = f < 10 ? "0" + f : f;
525
+ let m = time % 60;
526
+ m = m < 10 ? "0" + m : m;
527
+ this.timeStr = `${f}分${m}秒`;
528
+ }
529
+ }, 1000);
530
+ },
531
+
532
+ onJfbUnload(){
533
+ this.timeStr = ""
534
+ if (this.timeer) {
535
+ clearInterval(this.timeer);
536
+ }
352
537
  },
353
538
  onJfbShow(options) {
354
- console.log('event.onJfbShow', options)
539
+ this.onJfbLoad(options)
355
540
  },
356
541
  onJfbHide(options) {
357
- console.log('event.onJfbHide', options)
542
+ this.timeStr = ""
543
+ if (this.timeer) {
544
+ clearTimeout(this.timeer);
545
+ }
358
546
  },
359
547
  onJfbBack(options) {
360
- console.log('event.onJfbBack', options)
548
+ this.timeStr = ""
549
+ if (this.timeer) {
550
+ clearTimeout(this.timeer);
551
+ }
552
+ this.$xdUniHelper.navigateBack();
361
553
  },
362
554
  onJfbUpdate(...data) {
363
555
  console.log('event.onJfbUpdate', data)
@@ -379,6 +571,7 @@
379
571
  display: flex;
380
572
  flex-direction: column;
381
573
  justify-content: space-between;
574
+ font-size: 26rpx;
382
575
  .card_top{
383
576
  display: flex;
384
577
  flex-direction: column;
@@ -389,6 +582,14 @@
389
582
  ._point{
390
583
  font-size: 40rpx;
391
584
  font-weight: bold;
585
+ ::v-deep .xd-unit{
586
+ height: auto !important;
587
+ font-weight: bold;
588
+ align-items: flex-end;
589
+ .xd-unit__unit{
590
+ line-height: 1.5 !important;
591
+ }
592
+ }
392
593
  ._unit{
393
594
  font-size: 24rpx;
394
595
  margin-left: 4rpx;
@@ -469,24 +670,29 @@
469
670
  .code_wrap{
470
671
  display: flex;
471
672
  flex-direction: column;
673
+ font-size: 28rpx;
472
674
  .code_title{
473
675
  display: flex;
474
676
  align-items: center;
475
677
  ._title{
476
678
  margin-left: 30rpx;
679
+ font-size: 32rpx;
477
680
  }
478
681
  }
479
682
  .barcode{
480
- background-color: #EEE;
481
- height: 100rpx;
683
+ width: 100%;
482
684
  margin-top: 32rpx;
685
+ image{
686
+ width: 100%;
687
+ }
483
688
  }
484
689
  .qrcode{
485
- background-color: #EEE;
486
- height: 100rpx;
487
- width: 100rpx;
488
690
  margin: 40rpx 24rpx;
489
691
  align-self: center;
692
+ image{
693
+ width: 100%;
694
+ height: 100%;
695
+ }
490
696
  }
491
697
  .time_loop{
492
698
  align-self: center;
@@ -15,11 +15,11 @@ module.exports = {
15
15
  card_qrcode_expire: 600,
16
16
  unit: "点",
17
17
  main_business_code_name: "",
18
- other_card_point: 0,
18
+ other_card_point: 2480,
19
19
  is_exchange: "N",
20
20
  exchange_card_type_name: "福券",
21
21
  exchange_card_point: 86511,
22
- card_point_type: 1,
22
+ card_point_type: 2,
23
23
  is_show_qrcode_logo: "Y",
24
24
  is_can_unbind: "Y",
25
25
  is_can_transfer: "Y",