jufubao-base 1.0.61-beta1007 → 1.0.61-beta1009

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.61-beta1007",
3
+ "version": "1.0.61-beta1009",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -440,7 +440,7 @@ export default {
440
440
  })
441
441
  .then((res) => {
442
442
  this.$xdAlert({
443
- content: "解绑成功",
443
+ content: "票券已解绑",
444
444
  close: () => {
445
445
  this.$xdUniHelper.redirectTo({
446
446
  url: this.backUrl || this.settings.index,
@@ -74,7 +74,7 @@
74
74
  </view>
75
75
  </view>
76
76
  <view class="bottom_btn-mask"></view>
77
- <view v-if="disableList&&disableList.length>0" class="bottom_btn" :style="prod_bottom">
77
+ <view v-if="ajaxCardList && ajaxCardList.length>0" class="bottom_btn" :style="prod_bottom">
78
78
  <xd-button
79
79
  width="680rpx"
80
80
  radius="50rpx"
@@ -92,6 +92,7 @@ import { jfbRootExec } from "@/utils/xd.event";
92
92
  import JfbBaseCardDisabledEntryMixin from "./JfbBaseCardDisabledEntryMixin";
93
93
  import componentsMixins from "@/mixins/componentsMixins";
94
94
  import colorCardMixins from "@/mixins/colorCardMixins";
95
+ import cardListMixins from "./cardListMixins";
95
96
  import XdButton from "@/components/XdButton/XdButton";
96
97
  import XdNoData from '@/components/XdNoData/XdNoData'
97
98
  import extsMixins from "@/mixins/extsMixins";
@@ -102,7 +103,7 @@ export default {
102
103
  XdNoData,
103
104
  XdButton
104
105
  },
105
- mixins: [componentsMixins, extsMixins, JfbBaseCardDisabledEntryMixin, colorCardMixins],
106
+ mixins: [componentsMixins, extsMixins, JfbBaseCardDisabledEntryMixin, colorCardMixins, cardListMixins],
106
107
  data() {
107
108
  return {
108
109
  disableList: [],
@@ -123,14 +124,13 @@ export default {
123
124
  },
124
125
  },
125
126
  created() {
126
- console.log(this.getNoData(),'this.getNoData()this.getNoData()');
127
127
  this.init(this.container);
128
128
  },
129
129
  methods: {
130
130
  onJfbLoad(options) {
131
131
  this.getCardList();
132
132
  },
133
-
133
+
134
134
  getCardList() {
135
135
  this.$xdShowLoading({});
136
136
  jfbRootExec("getDisableCardListEntry", {vm: this, data: {is_all: "Y", is_show_entry_settings: 'Y'},})
@@ -149,14 +149,16 @@ export default {
149
149
  ),
150
150
  };
151
151
  });
152
- this.disableList = this.getCardGroupItem(res.list.filter((item) => {
153
- return item["is_valid"] === "N";
154
- }), res['site_entry_settings'], 'Y');
152
+
153
+ //设置列表
154
+ this.ajaxCardList = res;
155
+ this.handleCardInit(this.ajaxCardList);
156
+
155
157
  this.$xdHideLoading();
156
158
  })
157
159
  .catch(() => this.$xdHideLoading());
158
160
  },
159
-
161
+
160
162
  handleAllUnBindCard(){
161
163
  this.$xdConfirm({
162
164
  $vm: this,
@@ -186,9 +188,9 @@ export default {
186
188
  }
187
189
  },
188
190
  });
189
-
191
+
190
192
  },
191
-
193
+
192
194
  handleUnBindCard(item) {
193
195
  this.$xdConfirm({
194
196
  $vm: this,
@@ -222,13 +224,13 @@ export default {
222
224
  },
223
225
  });
224
226
  },
225
-
227
+
226
228
  /**
227
229
  * @description 监听事件变化
228
230
  * @param container {object} 业务组件对象自己
229
231
  */
230
232
  init(container) {},
231
-
233
+
232
234
  onJfbBack(options) {
233
235
  console.log("event.onJfbBack", options);
234
236
  },
@@ -357,18 +359,18 @@ export default {
357
359
  overflow: hidden;
358
360
  border-radius: unit(16, rpx);
359
361
  margin-bottom: unit(30, rpx);
360
-
362
+
361
363
  &:last-child {
362
364
  margin-bottom: 0;
363
365
  }
364
-
365
-
366
+
367
+
366
368
  &__title {
367
369
  height: unit(56, rpx);
368
370
  display: flex;
369
371
  justify-content: flex-start;
370
372
  align-items: center;
371
-
373
+
372
374
  & > view {
373
375
  padding: 0 unit(80, rpx);
374
376
  font-size: unit(24, rpx);
@@ -377,23 +379,23 @@ export default {
377
379
  color: #fff;
378
380
  border-radius: 0 0 unit(16, rpx) 0;
379
381
  }
380
-
382
+
381
383
  }
382
-
384
+
383
385
  &__content {
384
386
  padding: unit(10, rpx) unit(40, rpx) 0;
385
387
  height: unit(86, rpx);
386
388
  display: flex;
387
389
  justify-content: space-between;
388
390
  align-items: center;
389
-
391
+
390
392
  & > view:first-child {
391
393
  font-size: unit(36, rpx);
392
394
  line-height: unit(86, rpx);
393
395
  color: #fff;
394
396
  font-weight: 700;
395
397
  }
396
-
398
+
397
399
  & > view:nth-child(2) {
398
400
  font-size: unit(24, rpx);
399
401
  display: flex;
@@ -404,32 +406,32 @@ export default {
404
406
  color: #fff;
405
407
  }
406
408
  }
407
-
409
+
408
410
  &__date {
409
411
  padding: 0 unit(40, rpx);
410
412
  font-size: unit(28, rpx);
411
413
  line-height: unit(32, rpx);
412
414
  color: #fff;
413
415
  }
414
-
416
+
415
417
  &__yue {
416
418
  padding: unit(10, rpx) unit(40, rpx) 0;
417
419
  font-size: unit(28, rpx);
418
420
  line-height: unit(32, rpx);
419
421
  color: #fff;
420
-
422
+
421
423
  & > text:nth-child(2) {
422
424
  font-weight: 700;
423
425
  }
424
426
  }
425
-
427
+
426
428
  &__other {
427
429
  display: flex;
428
430
  justify-content: flex-start;
429
431
  align-items: center;
430
432
  padding: unit(20, rpx) unit(40, rpx) 0;
431
433
  margin-top: unit(0, rpx);
432
-
434
+
433
435
  & > view {
434
436
  border-radius: unit(8, rpx);
435
437
  background: rgba(255, 255, 255, 0.2);
@@ -443,20 +445,20 @@ export default {
443
445
  padding: 0 unit(20, rpx);
444
446
  color: #fff;
445
447
  }
446
-
447
-
448
+
449
+
448
450
  }
449
-
451
+
450
452
  &__nodata {
451
453
  padding: unit(20, rpx) unit(40, rpx) 0;
452
454
  margin-top: unit(0, rpx);
453
455
  color: #fff;
454
456
  font-size: unit(28, rpx);
455
457
  }
456
-
458
+
457
459
  &__entry {
458
460
  padding: unit(20, rpx) unit(40, rpx) 0;
459
-
461
+
460
462
  & > view {
461
463
  line-height: unit(64, rpx);
462
464
  text-align: center;
@@ -467,26 +469,26 @@ export default {
467
469
  font-weight: 500;
468
470
  }
469
471
  }
470
-
472
+
471
473
  &__entrys {
472
474
  margin: unit(20, rpx) unit(20, rpx) 0;
473
475
  padding: unit(30, rpx);
474
476
  border-radius: unit(16, rpx);
475
477
  background: rgba(255, 255, 255, 1);
476
478
  box-shadow: 0 unit(4, rpx) unit(8, rpx) rgba(156, 62, 0, 0.11);
477
-
479
+
478
480
  &-title {
479
481
  display: flex;
480
482
  justify-content: space-between;
481
483
  align-items: center;
482
-
483
-
484
+
485
+
484
486
  & > view:first-child {
485
487
  font-size: unit(28, rpx);
486
488
  font-weight: 500;
487
489
  flex: 1;
488
490
  }
489
-
491
+
490
492
  & > view:nth-child(2) {
491
493
  display: flex;
492
494
  justify-content: flex-start;
@@ -496,11 +498,11 @@ export default {
496
498
  color: #999;
497
499
  }
498
500
  }
499
-
501
+
500
502
  &-scroll {
501
-
503
+
502
504
  }
503
-
505
+
504
506
  &-item {
505
507
  display: flex;
506
508
  justify-content: flex-start;
@@ -508,7 +510,7 @@ export default {
508
510
  flex-flow: nowrap;
509
511
  margin-left: unit(-14, rpx);
510
512
  padding-top: unit(20, rpx);
511
-
513
+
512
514
  & > view {
513
515
  width: unit(120, rpx);
514
516
  margin-right: unit(10, rpx);
@@ -517,25 +519,25 @@ export default {
517
519
  justify-content: center;
518
520
  flex-direction: column;
519
521
  align-items: center;
520
-
522
+
521
523
  & > view:first-child {
522
524
  width: unit(76, rpx);
523
525
  height: unit(76, rpx);
524
526
  overflow: hidden;
525
-
527
+
526
528
  & > image {
527
529
  height: 100%;
528
530
  width: 100%;
529
531
  }
530
532
  }
531
-
533
+
532
534
  & > view:nth-child(2) {
533
535
  margin-top: unit(10, rpx);
534
536
  font-size: unit(24, rpx);
535
537
  line-height: unit(36, rpx);
536
538
  margin-bottom: unit(10, rpx);
537
539
  }
538
-
540
+
539
541
  & > view:nth-child(3) {
540
542
  display: flex;
541
543
  justify-content: flex-start;
@@ -544,18 +546,18 @@ export default {
544
546
  font-size: unit(20, rpx);
545
547
  color: #999;
546
548
  }
547
-
549
+
548
550
  &:last-child {
549
551
  margin-right: 0;
550
552
  }
551
-
553
+
552
554
  }
553
-
554
-
555
+
556
+
555
557
  }
556
558
  }
557
-
558
-
559
+
560
+
559
561
  &-warp {
560
562
  width: unit(700, rpx);
561
563
  min-height: unit(310, rpx);
@@ -574,7 +576,7 @@ export default {
574
576
  align-items: center;
575
577
  height: unit(120, rpx);
576
578
  background: #ffffff;
577
-
579
+
578
580
  &-mask {
579
581
  height: unit(120, rpx);
580
582
  }
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+ import {mapState} from "vuex";
3
+
4
+ export default {
5
+ data() {
6
+ return {
7
+ ajaxCardList: null, //接口返回原始数据
8
+
9
+ //卡券列表
10
+ cardOrgList:[], //原始数据
11
+ cardList:[], //计算后的卡列表
12
+ cardPageNum: 0, //当前页面
13
+ cardPageLen: 10, //每页获取数据调试
14
+ cardComputedList:[], //当前获取的数据列表
15
+ cardLoading: false, //加载状态值设置
16
+ cardNextTop: 0, //计算到每一个节点的距离顶部Top值
17
+ contentStatus: false, //内容框是否已经进行过计算距离顶部Top值状态
18
+ hasContent: true, //是否可以进行继续加载状态
19
+
20
+ //转换按钮
21
+ hasChangeStatus: false,//是否有转换按钮
22
+
23
+ cardItemBg1: '//img.jufubao.cn/component/card/card_item_02.png',
24
+ cardItemBg2: '//img.jufubao.cn/component/card/card_item_01.png'
25
+ }
26
+ },
27
+ computed:{
28
+ ...mapState(['srollPreview'])
29
+ },
30
+ watch:{
31
+ // srollPreview(value){
32
+ // console.log(value)
33
+ // }
34
+ },
35
+ created(){
36
+
37
+ },
38
+
39
+ mounted(){
40
+
41
+
42
+ },
43
+ methods:{
44
+ setCardItemShow({height , top},index){
45
+
46
+ //预览模式只获取10条
47
+ if(this.$configProject.isPreview) {
48
+ console.log(this.cardPageLen, index, this.cardPageLen > index)
49
+ return this.cardPageLen > index;
50
+ }
51
+
52
+ //打包模式
53
+ let fiexd = 50;
54
+ let boxTop = top + height + fiexd;
55
+ let boxBottom = top - (fiexd);
56
+ let {pageWindowPrevStart, pageWindowPrevEnd} = this.srollPreview;
57
+ return boxTop > pageWindowPrevStart && boxBottom < pageWindowPrevEnd;
58
+ },
59
+
60
+ getBoxTop(){
61
+ return new Promise((resolve, reject)=>{
62
+ const query = uni.createSelectorQuery().in(this);
63
+ query.select('.card-content').boundingClientRect(data=>{
64
+ this.cardNextTop = data.top;
65
+ this.contentStatus = true;
66
+ resolve();
67
+ }).exec()
68
+ })
69
+
70
+ },
71
+
72
+ async handleCardComputed(paddingBottom=30){
73
+ this.$xdShowLoading({});
74
+ if(this.contentStatus === false) await this.getBoxTop();
75
+ this.$nextTick(()=>{
76
+ const query = uni.createSelectorQuery().in(this);
77
+ query.selectAll('.computed-box').boundingClientRect(data => {
78
+ let arr = data.map(item=>{
79
+ let card = this.cardComputedList.filter(it=>{
80
+ return item.dataset.card === it.card_number;
81
+ })[0];
82
+ card['height'] = item.height;
83
+ card['top'] = this.cardNextTop;
84
+ this.cardNextTop = this.cardNextTop + card['height'] + (paddingBottom * this.$rpxNum)
85
+ return card
86
+ });
87
+ this.cardList = this.cardList.concat(arr);
88
+ this.$xdHideLoading();
89
+ }).exec();
90
+ })
91
+ },
92
+
93
+ handleCardInit(cardList, paddingBottom =30){
94
+ let newCardList = this.$xdUniHelper.cloneDeep(cardList);
95
+ let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
96
+ return item["is_valid"] === "N";
97
+ }), newCardList['site_entry_settings']).map((item,index)=>{
98
+ item['index'] = index;
99
+ return item
100
+ });
101
+ this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
102
+ this.cardComputedList = this.cardOrgList.slice(this.cardPageNum,this.cardPageLen);
103
+ this.handleCardComputed(paddingBottom).then().catch();
104
+ },
105
+
106
+ onJfbReachBottom(){
107
+ if(this.cardLoading || !this.hasContent) return;
108
+ this.cardLoading = true;
109
+ this.$xdShowLoading({});
110
+ this.cardPageNum++;
111
+ console.log('onJfbReachBottom',this.cardPageNum)
112
+ this.$nextTick(()=>{
113
+ setTimeout(()=>{
114
+ this.cardLoading = false;
115
+ this.$xdHideLoading();
116
+ this.cardComputedList = this.cardOrgList.slice(
117
+ this.cardPageNum*this.cardPageLen,
118
+ this.cardPageNum*this.cardPageLen + this.cardPageLen
119
+ );
120
+ this.handleCardComputed().then().catch();
121
+ if(this.cardComputedList.length < this.cardPageLen) {
122
+ this.hasContent = false;
123
+ }
124
+ },500)
125
+ })
126
+
127
+ },
128
+
129
+ clearDefault(){
130
+ this.cardOrgList = [];
131
+ this.cardList = [];
132
+ this.cardPageNum = 0;
133
+ this.cardComputedList = [];
134
+ this.cardLoading = false;
135
+ this.cardNextTop = 0;
136
+ this.contentStatus = false;
137
+ this.hasContent = true;
138
+ }
139
+ }
140
+ }
141
+
142
+
@@ -124,13 +124,14 @@
124
124
  >* 目前仅支持电影票兑换券进行转换</view>
125
125
  <view class="card-content">
126
126
  <view
127
- v-if="tabIndex === 2 || tabIndex === 1 && cardList.length > 0"
127
+ v-if="tabIndex === 2 || tabIndex === 1 && (cardList && cardList.length > 0)"
128
128
  class="jfb-base-card-entry__body-card"
129
129
  >
130
130
  <view
131
131
  v-for="(item,index) in cardList"
132
132
  :data-index="item.card_number"
133
133
  :data-idx="index"
134
+ :data-top="item.top"
134
135
  class="card-list"
135
136
  :key="item.card_number"
136
137
  @click="toDetail(item)"
@@ -212,13 +213,17 @@
212
213
  </view>
213
214
  <view
214
215
  class="card-content-empty card-list"
216
+ :data-index="item.card_number"
217
+ :data-idx="index"
218
+ :data-top="item.top"
215
219
  v-else
216
220
  :style="{
217
221
  height: item.height + 'px',
222
+ backgroundImage: 'url('+ (tabIndex===2 || item.entries.length <= 1 ? cardItem: cardItemEntry) +')'
218
223
  }"
219
- ><image :src="item.entries.length > 1 ? cardItemBg2: cardItemBg1"></image></view>
224
+ ></view>
220
225
  </view>
221
- <view v-else-if="cardList === null && cardList.length === 0">
226
+ <view v-else-if="cardList === null">
222
227
  <view class="jfb-base-card-entry__body-empty">
223
228
  <view class="jfb-base-card-entry__body-empty-wrap">
224
229
  <image :src="emptyBg"></image>
@@ -1014,6 +1019,9 @@ export default {
1014
1019
  width: unit(76, rpx);
1015
1020
  height: unit(76, rpx);
1016
1021
  overflow: hidden;
1022
+ display: flex;
1023
+ justify-content: center;
1024
+ align-items: center;
1017
1025
 
1018
1026
  & > image {
1019
1027
  height: 100%;
@@ -1049,7 +1057,6 @@ export default {
1049
1057
 
1050
1058
 
1051
1059
  &-warp {
1052
- width: unit(700, rpx);
1053
1060
  min-height: unit(310, rpx);
1054
1061
  position: relative;
1055
1062
  border-radius: unit(16, rpx);
@@ -10,7 +10,7 @@ export default {
10
10
  cardOrgList:[], //原始数据
11
11
  cardList:[], //计算后的卡列表
12
12
  cardPageNum: 0, //当前页面
13
- cardPageLen: 10, //每页获取数据调试
13
+ cardPageLen: 5, //每页获取数据调试
14
14
  cardComputedList:[], //当前获取的数据列表
15
15
  cardLoading: false, //加载状态值设置
16
16
  cardNextTop: 0, //计算到每一个节点的距离顶部Top值