jufubao-base 1.0.61-beta1001 → 1.0.61-beta1003

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.
@@ -21,78 +21,54 @@
21
21
  v-if="info !== null"
22
22
  :style="{minHeight: layoutInfo.bodyMinHeightRpx + 'rpx'}"
23
23
  >
24
- <view
25
- class="jfb-base-card-shift-entry__body-header"
26
- :style="{
27
- background: headerBg.color,
28
- backgroundSize: '100%',
29
- }"
30
- >
31
- <view
32
- class="jfb-base-card-shift-entry__body-header-wrap"
33
- :style="{
34
- backgroundImage: `url(${headerBg.image})`,
35
- }"
36
- >
37
- <view class="jfb-base-card-shift-entry__body-header__title">
38
- <view>
39
- <xd-font-icon
40
- size="40"
41
- color="#fff"
42
- icon="iconzhuanhuanshitu"
43
- style="margin-right:10rpx"
44
- ></xd-font-icon>
45
- 转换的票券
46
- </view>
24
+ <view class="card-list" :style="{
25
+ background: headerBg['color'],
26
+ backgroundSize: '100%'
27
+ }">
28
+ <view class="card-list-warp" :style="{backgroundImage: `url(${headerBg['image']})`}">
29
+ <view class="card-list__title">
30
+ <view style="display:flex;align-items:center">
31
+ <xd-font-icon
32
+ size="40"
33
+ color="#fff"
34
+ icon="iconzhuanhuanshitu"
35
+ style="margin-right:10rpx"
36
+ ></xd-font-icon>
37
+ <text>转换的票券</text>
47
38
  </view>
48
- <view style="padding-top:40rpx" class="jfb-base-card-shift-entry__body-header-item">
49
- <view>券名:</view>
50
- <view>{{info.card_type_name}}</view>
51
- </view>
52
- <view
53
- style="padding-bottom: 20rpx"
54
- class="jfb-base-card-shift-entry__body-header-item"
55
- >
56
- <view>券号:</view>
57
- <view>{{info.card_number}}</view>
39
+ </view>
40
+ <div class="card-list__content">
41
+ <view>
42
+ <text>券号:</text>
43
+ <text>{{info.card_number}}</text>
44
+ </view>
45
+ </div>
46
+ <view class="card-list__date">
47
+ <text>有效期:</text>
48
+ <text>{{info.end_time}}</text>
49
+ </view>
50
+ <view class="card-list__yue">
51
+ <text>余额:</text>
52
+ <text>{{info.card_point}} {{ info.unit }}</text>
53
+ </view>
54
+ <view class="card-list__other" v-if="info.other_card_point && info.card_point_type === 2">
55
+ <view><text>购买其他物品可抵:</text><text>{{info.other_card_point}} {{ info.unit }}</text></view>
56
+ </view>
58
57
  </view>
59
58
  </view>
60
- </view>
61
- <!-- 转换之前 -->
62
- <view
63
- class="jfb-base-card-shift-entry__body-content"
64
- >
65
- <view
66
- :class="
67
- item.key === 'other_card_point'
68
- ? 'jfb-base-card-shift-entry__body-content-special'
69
- : 'jfb-base-card-shift-entry__body-content-item'
70
- "
71
- v-for="(item, index) in valueKey"
72
- :key="index"
73
- >
74
- <view> {{ item.label }}: </view>
75
- <view :style="{color:mainColor,fontWeight:500}" v-if="item.type === 'price'">
76
- {{ info[item.key] }}
77
- <text>{{info.unit}}</text>
78
- </view>
79
- <view style="color: #333; font-weight: 500" v-else>
80
- {{ info[item.key] }}
81
- <text v-if="item.type === 'type'">券</text>
82
- </view>
83
- </view>
84
- </view>
85
59
  <!-- 转换剩余 -->
60
+ <view>
61
+ <xd-font-icon
62
+ size="32"
63
+ color="#bbb"
64
+ icon="iconrepository-xialaxuanxiangdown"
65
+ ></xd-font-icon>
66
+ </view>
86
67
  <view
87
68
  class="jfb-base-card-shift-entry__body-content"
88
69
  :style="{background:changeBg}"
89
70
  >
90
71
  <view class="jfb-base-card-shift-entry__body-content-title">
91
- <xd-font-icon
92
- size="32"
93
- :color="mainColor"
94
- icon="iconrepository-xialaxuanxiangdown"
95
- ></xd-font-icon>
96
72
  <view>转换后预估票券额度</view>
97
73
  </view>
98
74
  <view
@@ -188,23 +164,6 @@ export default {
188
164
  data() {
189
165
  return {
190
166
  info: null,
191
- valueKey: [
192
- {
193
- label: "票券余额",
194
- key: "card_point",
195
- type: "price",
196
- },
197
- {
198
- label: "购买其他物品可抵",
199
- key: "other_card_point",
200
- type: "price",
201
- },
202
- {
203
- label: "有效期限",
204
- key: "end_time",
205
- type: "normal",
206
- },
207
- ],
208
167
  changeValueKey: [
209
168
  {
210
169
  label: "票券余额",
@@ -287,14 +246,13 @@ export default {
287
246
  .then((res) => {
288
247
  let temp = {};
289
248
  Object.keys(res).map((key) => {
290
- if (key === "card_point" || key === "exchange_card_point") {
249
+ if (key === "card_point" || key === "exchange_card_point" || key=== "other_card_point") {
291
250
  temp[key] = this.$xdUniHelper.divisionFloatNumber(res[key], 100);
292
251
  } else {
293
252
  temp[key] = res[key];
294
253
  }
295
254
  });
296
255
  if(res.other_card_point===0 || res.card_point_type === 1) {
297
- this.valueKey.splice(1,1);
298
256
  this.changeValueKey.splice(1,1)
299
257
  }
300
258
  this.headerBg = this.getCardThemes(res.card_type_name);
@@ -323,57 +281,216 @@ export default {
323
281
  position: relative;
324
282
  color: #333;
325
283
  padding: unit(26, rpx);
326
- &-header {
327
- border-radius: unit(16, rpx);
328
- font-size: unit(40, rpx);
284
+ .card-list {
285
+ overflow: hidden;
286
+ border-radius: unit(16, rpx);
287
+ margin-bottom: unit(30, rpx);
288
+
289
+ &:last-child {
290
+ margin-bottom: 0;
291
+ }
292
+
293
+
294
+ &__title {
295
+ height: unit(56, rpx);
296
+ display: flex;
297
+ justify-content: flex-start;
298
+ align-items: center;
299
+
300
+ & > view {
301
+ padding: 0 unit(80, rpx);
302
+ font-size: unit(24, rpx);
303
+ line-height: unit(56, rpx);
304
+ background: rgba(102, 102, 102, 0.4);
305
+ color: #fff;
306
+ border-radius: 0 0 unit(16, rpx) 0;
307
+ }
308
+
309
+ }
310
+
311
+ &__content {
312
+ padding: unit(10, rpx) unit(40, rpx) 0;
313
+ height: unit(86, rpx);
314
+ display: flex;
315
+ justify-content: space-between;
316
+ align-items: center;
317
+
318
+ & > view:first-child {
319
+ font-size: unit(36, rpx);
320
+ line-height: unit(86, rpx);
321
+ color: #fff;
322
+ font-weight: 700;
323
+ }
324
+
325
+ & > view:nth-child(2) {
326
+ font-size: unit(24, rpx);
327
+ display: flex;
328
+ justify-content: space-between;
329
+ align-items: center;
330
+ flex-flow: wrap;
331
+ flex-direction: column;
332
+ color: #fff;
333
+ }
334
+ }
335
+
336
+ &__date {
337
+ padding: 0 unit(40, rpx);
338
+ font-size: unit(28, rpx);
339
+ line-height: unit(32, rpx);
340
+ color: #fff;
341
+ }
342
+
343
+ &__yue {
344
+ padding: unit(10, rpx) unit(40, rpx) 0;
345
+ font-size: unit(28, rpx);
346
+ line-height: unit(32, rpx);
347
+ color: #fff;
348
+
349
+ & > text:nth-child(2) {
329
350
  font-weight: 700;
351
+ }
352
+ }
353
+
354
+ &__other {
355
+ display: flex;
356
+ justify-content: flex-start;
357
+ align-items: center;
358
+ padding: unit(20, rpx) unit(40, rpx) 0;
359
+ margin-top: unit(0, rpx);
360
+
361
+ & > view {
362
+ border-radius:unit(8, rpx);
363
+ background: rgba(255, 255, 255, 0.2);
364
+ height: unit(48, rpx);
365
+ line-height: unit(48, rpx);
366
+ display: flex;
367
+ justify-content: flex-start;
368
+ align-items: center;
369
+ font-weight: 400;
370
+ font-size: unit(24, rpx);
371
+ padding: 0 unit(20, rpx);
330
372
  color: #fff;
331
- position: relative;
332
- min-height: unit(260,rpx);
333
-
334
- &__title {
335
- height: unit(56, rpx);
373
+ }
374
+
375
+
376
+ }
377
+
378
+ &__nodata {
379
+ padding: unit(20, rpx) unit(40, rpx) 0;
380
+ margin-top: unit(0, rpx);
381
+ color: #fff;
382
+ font-size: unit(28, rpx);
383
+ }
384
+
385
+ &__entry {
386
+ padding: unit(20, rpx) unit(40, rpx) 0;
387
+ & > view {
388
+ line-height: unit(64, rpx);
389
+ text-align: center;
390
+ font-size: unit(26, rpx);
391
+ border-radius: unit(32, rpx);
392
+ background: rgba(255, 255, 255, 1);
393
+ box-shadow: 0 unit(4, rpx) unit(8, rpx) rgba(156, 62, 0, 0.11);
394
+ font-weight: 500;
395
+ }
396
+ }
397
+
398
+ &__entrys {
399
+ margin: unit(20, rpx) unit(20, rpx) 0;
400
+ padding: unit(30, rpx);
401
+ border-radius: unit(16, rpx);
402
+ background: rgba(255, 255, 255, 1);
403
+ box-shadow: 0 unit(4, rpx) unit(8, rpx) rgba(156, 62, 0, 0.11);
404
+
405
+ &-title {
406
+ display: flex;
407
+ justify-content: space-between;
408
+ align-items: center;
409
+
410
+
411
+ & > view:first-child {
412
+ font-size: unit(28, rpx);
413
+ font-weight: 500;
414
+ flex: 1;
415
+ }
416
+
417
+ & > view:nth-child(2) {
336
418
  display: flex;
337
419
  justify-content: flex-start;
338
420
  align-items: center;
339
-
340
-
341
- & > view {
342
- padding: 0 unit(80, rpx);
343
- font-size: unit(24, rpx);
344
- line-height: unit(56, rpx);
345
- background: rgba(102, 102, 102, 0.4);
346
- color: #fff;
347
- border-radius:unit(16, rpx) 0 unit(16, rpx) 0;
348
- display: flex;
421
+ flex-shrink: 0;
422
+ font-size: unit(20, rpx);
423
+ color: #999;
349
424
  }
425
+ }
426
+
427
+ &-scroll {
350
428
 
351
429
  }
352
-
353
- &-wrap {
354
- width: unit(700, rpx);
355
- border-radius: unit(16, rpx);
356
- background-size: 100%;
357
- min-height: 100%;
430
+
431
+ &-item {
432
+ display: flex;
433
+ justify-content: flex-start;
434
+ align-items: center;
435
+ flex-flow: nowrap;
436
+ margin-left: unit(-14, rpx);
437
+ padding-top: unit(20, rpx);
438
+
439
+ & > view {
440
+ width: unit(120, rpx);
441
+ margin-right: unit(10, rpx);
442
+ flex-shrink: 0;
358
443
  display: flex;
359
- flex-direction: column;
360
444
  justify-content: center;
361
- }
362
-
363
- &-item {
364
- display: flex;
365
- justify-content: flex-start;
366
- align-content: center;
367
- padding-bottom: unit(32, rpx);
368
- padding-left: unit(40,rpx);
369
-
445
+ flex-direction: column;
446
+ align-items: center;
447
+
370
448
  & > view:first-child {
371
- flex-basis: unit(120,rpx);
449
+ width: unit(76, rpx);
450
+ height: unit(76, rpx);
451
+ overflow: hidden;
452
+
453
+ & > image {
454
+ height: 100%;
455
+ width: 100%;
456
+ }
457
+ }
458
+
459
+ & > view:nth-child(2) {
460
+ margin-top: unit(10, rpx);
461
+ font-size: unit(24, rpx);
462
+ line-height: unit(36, rpx);
463
+ margin-bottom: unit(10, rpx);
464
+ }
465
+
466
+ & > view:nth-child(3) {
467
+ display: flex;
468
+ justify-content: flex-start;
469
+ align-items: center;
372
470
  flex-shrink: 0;
471
+ font-size: unit(20, rpx);
472
+ color: #999;
473
+ }
474
+
475
+ &:last-child {
476
+ margin-right: 0;
477
+ }
478
+
373
479
  }
374
- }
480
+
481
+
375
482
  }
376
-
483
+ }
484
+
485
+ &-warp {
486
+ width: unit(700, rpx);
487
+ // min-height: unit(290, rpx);
488
+ position: relative;
489
+ border-radius: unit(16, rpx);
490
+ background-size: 100%;
491
+ padding-bottom: unit(20, rpx);
492
+ }
493
+ }
377
494
  &-content {
378
495
  background: #fff;
379
496
  border-radius: unit(16, rpx);
@@ -0,0 +1,125 @@
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:null, //计算后的卡列表
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
+ },
24
+ computed:{
25
+ ...mapState(['srollPreview'])
26
+ },
27
+ watch:{
28
+ srollPreview(value){
29
+ console.log(value)
30
+ }
31
+ },
32
+ created(){
33
+
34
+ },
35
+ methods:{
36
+ setCardItemShow({height , top}){
37
+ let fiexd = 100;
38
+ let boxTop = top + height + fiexd;
39
+ let boxBottom = top - (fiexd);
40
+ let {pageWindowPrevStart, pageWindowPrevEnd} = this.srollPreview;
41
+ return boxTop > pageWindowPrevStart && boxBottom < pageWindowPrevEnd;
42
+ },
43
+ getBoxTop(){
44
+ return new Promise((resolve, reject)=>{
45
+ const query = uni.createSelectorQuery().in(this);
46
+ query.select('.card-content').boundingClientRect(data=>{
47
+ this.cardNextTop = data.top;
48
+ this.contentStatus = true;
49
+ resolve();
50
+ }).exec()
51
+ })
52
+
53
+ },
54
+ async handleCardComputed(){
55
+ this.$xdShowLoading({});
56
+ if(this.contentStatus === false) await this.getBoxTop();
57
+ this.$nextTick(()=>{
58
+ const query = uni.createSelectorQuery().in(this);
59
+ query.selectAll('.computed-box').boundingClientRect(data => {
60
+ let arr = data.map(item=>{
61
+ let card = this.cardComputedList.filter(it=>{
62
+ return item.dataset.card === it.card_number;
63
+ })[0];
64
+ card['height'] = item.height + 15;
65
+ card['top'] = this.cardNextTop;
66
+ this.cardNextTop = this.cardNextTop + card['height']
67
+ return card
68
+ });
69
+ this.cardList = this.cardList.concat(arr);
70
+ this.$xdHideLoading();
71
+ }).exec();
72
+ })
73
+ },
74
+
75
+ handleCardInit(cardList,isChange = false){
76
+ let newCardList = this.$xdUniHelper.cloneDeep(cardList);
77
+ let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
78
+ if(isChange === true) return item["is_valid"] === "Y";
79
+ else return item["is_exchange"] === "Y";
80
+ }), newCardList['site_entry_settings']).map((item,index)=>{
81
+ item['index'] = index;
82
+ return item
83
+ });
84
+ this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
85
+ this.cardComputedList = this.cardOrgList.slice(this.cardPageNum,this.cardPageLen);
86
+ this.handleCardComputed().then().catch();
87
+ },
88
+
89
+ onJfbReachBottom(){
90
+ if(this.cardLoading || !this.hasContent) return;
91
+ this.cardLoading = true;
92
+ this.$xdShowLoading({});
93
+ this.cardPageNum++;
94
+ console.log('onJfbReachBottom',this.cardPageNum)
95
+ this.$nextTick(()=>{
96
+ setTimeout(()=>{
97
+ this.cardLoading = false;
98
+ this.$xdHideLoading();
99
+ this.cardComputedList = this.cardOrgList.slice(
100
+ this.cardPageNum*this.cardPageLen,
101
+ this.cardPageNum*this.cardPageLen + this.cardPageLen
102
+ );
103
+ this.handleCardComputed().then().catch();
104
+ if(this.cardComputedList.length < this.cardPageLen) {
105
+ this.hasContent = false;
106
+ }
107
+ },500)
108
+ })
109
+
110
+ },
111
+
112
+ clearDefault(){
113
+ this.cardOrgList = [];
114
+ this.cardList = null;
115
+ this.cardPageNum = 0;
116
+ this.cardComputedList = [];
117
+ this.cardLoading = false;
118
+ this.cardNextTop = 0;
119
+ this.contentStatus = false;
120
+ this.hasContent = true;
121
+ }
122
+ }
123
+ }
124
+
125
+