jufubao-base 1.0.61-beta1009 → 1.0.61-beta1011
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 +1 -1
- package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +94 -15
- package/src/components/JfbBaseCardDisabledEntry/cardListMixins.js +6 -30
- package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +1 -2
- package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +1 -1
- package/src/mixins/cardListMixins.js +0 -148
package/package.json
CHANGED
|
@@ -16,14 +16,83 @@
|
|
|
16
16
|
</view>
|
|
17
17
|
<!-- #endif -->
|
|
18
18
|
<view class="jfb-base-card-disabled-entry__body">
|
|
19
|
-
<view
|
|
20
|
-
v-if="disableList && disableList.length > 0"
|
|
21
|
-
class="jfb-base-card-entry__body-card"
|
|
22
|
-
>
|
|
19
|
+
<view class="card-content">
|
|
23
20
|
<view
|
|
24
|
-
v-
|
|
25
|
-
class="card-
|
|
21
|
+
v-if="cardList && cardList.length > 0"
|
|
22
|
+
class="jfb-base-card-entry__body-card"
|
|
23
|
+
>
|
|
24
|
+
<view
|
|
25
|
+
v-for="(item,index) in cardList"
|
|
26
|
+
class="card-list"
|
|
27
|
+
:data-card="item.card_number"
|
|
28
|
+
:data-index="index"
|
|
29
|
+
:data-top="item.top"
|
|
30
|
+
:key="item.card_number"
|
|
31
|
+
v-if="setCardItemShow(item,index)"
|
|
32
|
+
:style="{
|
|
33
|
+
background: item['theme']['color'],
|
|
34
|
+
backgroundSize: '100%'
|
|
35
|
+
}"
|
|
36
|
+
>
|
|
37
|
+
<view class="card-list-warp" :style="{backgroundImage: 'url('+ item['theme']['image'] +')'}">
|
|
38
|
+
<view class="card-list__title">
|
|
39
|
+
<view>{{item['card_type_name']}}</view>
|
|
40
|
+
</view>
|
|
41
|
+
<div class="card-list__content">
|
|
42
|
+
<view>
|
|
43
|
+
<text>券号:</text>
|
|
44
|
+
<text>{{item.card_number}}</text>
|
|
45
|
+
</view>
|
|
46
|
+
</div>
|
|
47
|
+
<view class="card-list__date">
|
|
48
|
+
<text>有效期:</text>
|
|
49
|
+
<text>--</text>
|
|
50
|
+
</view>
|
|
51
|
+
<view class="card-list__yue">
|
|
52
|
+
<text>余额:</text>
|
|
53
|
+
<text>--</text>
|
|
54
|
+
</view>
|
|
55
|
+
<view class="card-list__other" v-if="item.other_card_point && item.card_point_type === 2 ">
|
|
56
|
+
<view>
|
|
57
|
+
<text>购买其他物品可抵:</text>
|
|
58
|
+
<text>--</text>
|
|
59
|
+
</view>
|
|
60
|
+
</view>
|
|
61
|
+
<template>
|
|
62
|
+
<view class="card-list__entry" v-if="item.entries.length > 0">
|
|
63
|
+
<view
|
|
64
|
+
@click.stop="handleUnBindCard(item)"
|
|
65
|
+
:style="{color: item['theme']['color']}"
|
|
66
|
+
>解绑</view>
|
|
67
|
+
</view>
|
|
68
|
+
<view class="card-list__nodata" v-else>暂无支持服务列表</view>
|
|
69
|
+
</template>
|
|
70
|
+
</view>
|
|
71
|
+
</view>
|
|
72
|
+
<view
|
|
73
|
+
class="card-content-empty card-list"
|
|
74
|
+
v-else
|
|
75
|
+
:style="{
|
|
76
|
+
height: item.height + 'px',
|
|
77
|
+
backgroundImage: 'url('+ cardItem +')'
|
|
78
|
+
}"
|
|
79
|
+
></view>
|
|
80
|
+
</view>
|
|
81
|
+
<view v-if="cardList !== null && cardList.length === 0">
|
|
82
|
+
<view class="jfb-base-card-disabled-entry__body-empty">
|
|
83
|
+
<view class="jfb-base-card-disabled-entry__body-empty-wrap">
|
|
84
|
+
<image :src="emptyBg"></image>
|
|
85
|
+
暂无票券
|
|
86
|
+
</view>
|
|
87
|
+
</view>
|
|
88
|
+
</view>
|
|
89
|
+
</view>
|
|
90
|
+
<view class="computed-height">
|
|
91
|
+
<view
|
|
92
|
+
v-for="(item) in cardComputedList"
|
|
93
|
+
class="card-list computed-box"
|
|
26
94
|
:key="item.card_number"
|
|
95
|
+
:data-card="item.card_number"
|
|
27
96
|
:style="{
|
|
28
97
|
background: item['theme']['color'],
|
|
29
98
|
backgroundSize: '100%'
|
|
@@ -65,16 +134,8 @@
|
|
|
65
134
|
</view>
|
|
66
135
|
</view>
|
|
67
136
|
</view>
|
|
68
|
-
<view v-else>
|
|
69
|
-
<view class="jfb-base-card-disabled-entry__body-empty">
|
|
70
|
-
<view class="jfb-base-card-disabled-entry__body-empty-wrap">
|
|
71
|
-
<image :src="emptyBg"></image>
|
|
72
|
-
暂无票券
|
|
73
|
-
</view>
|
|
74
|
-
</view>
|
|
75
|
-
</view>
|
|
76
137
|
<view class="bottom_btn-mask"></view>
|
|
77
|
-
<view v-if="
|
|
138
|
+
<view v-if="cardList && cardList.length>0" class="bottom_btn" :style="prod_bottom">
|
|
78
139
|
<xd-button
|
|
79
140
|
width="680rpx"
|
|
80
141
|
radius="50rpx"
|
|
@@ -581,4 +642,22 @@ export default {
|
|
|
581
642
|
height: unit(120, rpx);
|
|
582
643
|
}
|
|
583
644
|
}
|
|
645
|
+
|
|
646
|
+
.computed-height {
|
|
647
|
+
position: fixed;
|
|
648
|
+
top:-999999px;
|
|
649
|
+
width: 100%;
|
|
650
|
+
z-index: 99999;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.card-content-empty {
|
|
654
|
+
background-size: 100%;
|
|
655
|
+
background-repeat: no-repeat;
|
|
656
|
+
background-position: top center;
|
|
657
|
+
|
|
658
|
+
& > image {
|
|
659
|
+
width: 100%;
|
|
660
|
+
height: 100%;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
584
663
|
</style>
|
|
@@ -8,9 +8,9 @@ export default {
|
|
|
8
8
|
|
|
9
9
|
//卡券列表
|
|
10
10
|
cardOrgList:[], //原始数据
|
|
11
|
-
cardList:
|
|
11
|
+
cardList:null, //计算后的卡列表
|
|
12
12
|
cardPageNum: 0, //当前页面
|
|
13
|
-
cardPageLen:
|
|
13
|
+
cardPageLen: 5, //每页获取数据调试
|
|
14
14
|
cardComputedList:[], //当前获取的数据列表
|
|
15
15
|
cardLoading: false, //加载状态值设置
|
|
16
16
|
cardNextTop: 0, //计算到每一个节点的距离顶部Top值
|
|
@@ -20,29 +20,16 @@ export default {
|
|
|
20
20
|
//转换按钮
|
|
21
21
|
hasChangeStatus: false,//是否有转换按钮
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
cardItemEntry: '//img.jufubao.cn/component/card/card_item_entry.png?v1=11',
|
|
24
|
+
cardItem: '//img.jufubao.cn/component/card/card_item.png?v1=11'
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
computed:{
|
|
28
28
|
...mapState(['srollPreview'])
|
|
29
29
|
},
|
|
30
|
-
watch:{
|
|
31
|
-
// srollPreview(value){
|
|
32
|
-
// console.log(value)
|
|
33
|
-
// }
|
|
34
|
-
},
|
|
35
|
-
created(){
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
mounted(){
|
|
40
|
-
|
|
41
30
|
|
|
42
|
-
},
|
|
43
31
|
methods:{
|
|
44
32
|
setCardItemShow({height , top},index){
|
|
45
|
-
|
|
46
33
|
//预览模式只获取10条
|
|
47
34
|
if(this.$configProject.isPreview) {
|
|
48
35
|
console.log(this.cardPageLen, index, this.cardPageLen > index)
|
|
@@ -84,7 +71,7 @@ export default {
|
|
|
84
71
|
this.cardNextTop = this.cardNextTop + card['height'] + (paddingBottom * this.$rpxNum)
|
|
85
72
|
return card
|
|
86
73
|
});
|
|
87
|
-
this.cardList = this.cardList.concat(arr);
|
|
74
|
+
this.cardList = (this.cardList||[]).concat(arr);
|
|
88
75
|
this.$xdHideLoading();
|
|
89
76
|
}).exec();
|
|
90
77
|
})
|
|
@@ -94,7 +81,7 @@ export default {
|
|
|
94
81
|
let newCardList = this.$xdUniHelper.cloneDeep(cardList);
|
|
95
82
|
let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
|
|
96
83
|
return item["is_valid"] === "N";
|
|
97
|
-
}), newCardList['site_entry_settings']).map((item,index)=>{
|
|
84
|
+
}), newCardList['site_entry_settings'],'Y').map((item,index)=>{
|
|
98
85
|
item['index'] = index;
|
|
99
86
|
return item
|
|
100
87
|
});
|
|
@@ -125,17 +112,6 @@ export default {
|
|
|
125
112
|
})
|
|
126
113
|
|
|
127
114
|
},
|
|
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
115
|
}
|
|
140
116
|
}
|
|
141
117
|
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
}"
|
|
224
224
|
></view>
|
|
225
225
|
</view>
|
|
226
|
-
<view v-else-if="cardList ===
|
|
226
|
+
<view v-else-if="cardList !== null && cardList.length === 0">
|
|
227
227
|
<view class="jfb-base-card-entry__body-empty">
|
|
228
228
|
<view class="jfb-base-card-entry__body-empty-wrap">
|
|
229
229
|
<image :src="emptyBg"></image>
|
|
@@ -261,7 +261,6 @@
|
|
|
261
261
|
:data-card="item.card_number"
|
|
262
262
|
class="card-list computed-box"
|
|
263
263
|
:key="item.card_number"
|
|
264
|
-
v-if="index < 20"
|
|
265
264
|
:style="{
|
|
266
265
|
background: item['theme']['color'],
|
|
267
266
|
backgroundSize: '100%'
|
|
@@ -1,148 +0,0 @@
|
|
|
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: 5, //每页获取数据调试
|
|
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){
|
|
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 + (paddingBottom * this.$rpxNum);
|
|
83
|
-
card['top'] = this.cardNextTop;
|
|
84
|
-
this.cardNextTop = this.cardNextTop + card['height']
|
|
85
|
-
return card
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this.cardList = this.cardList.concat(arr);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.$xdHideLoading();
|
|
94
|
-
}).exec();
|
|
95
|
-
})
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
handleCardInit(cardList,isChange = false, paddingBottom = 30){
|
|
99
|
-
let newCardList = this.$xdUniHelper.cloneDeep(cardList);
|
|
100
|
-
let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
|
|
101
|
-
if(isChange === true) return item["is_valid"] === "Y";
|
|
102
|
-
else return item["is_exchange"] === "Y";
|
|
103
|
-
}), newCardList['site_entry_settings']).map((item,index)=>{
|
|
104
|
-
item['index'] = index;
|
|
105
|
-
return item
|
|
106
|
-
});
|
|
107
|
-
this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
|
|
108
|
-
this.cardComputedList = this.cardOrgList.slice(this.cardPageNum,this.cardPageLen);
|
|
109
|
-
this.handleCardComputed(paddingBottom).then().catch();
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
onJfbReachBottom(){
|
|
113
|
-
if(this.cardLoading || !this.hasContent) return;
|
|
114
|
-
this.cardLoading = true;
|
|
115
|
-
this.$xdShowLoading({});
|
|
116
|
-
this.cardPageNum++;
|
|
117
|
-
console.log('onJfbReachBottom',this.cardPageNum)
|
|
118
|
-
this.$nextTick(()=>{
|
|
119
|
-
setTimeout(()=>{
|
|
120
|
-
this.cardLoading = false;
|
|
121
|
-
this.$xdHideLoading();
|
|
122
|
-
this.cardComputedList = this.cardOrgList.slice(
|
|
123
|
-
this.cardPageNum*this.cardPageLen,
|
|
124
|
-
this.cardPageNum*this.cardPageLen + this.cardPageLen
|
|
125
|
-
);
|
|
126
|
-
this.handleCardComputed().then().catch();
|
|
127
|
-
if(this.cardComputedList.length < this.cardPageLen) {
|
|
128
|
-
this.hasContent = false;
|
|
129
|
-
}
|
|
130
|
-
},500)
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
clearDefault(){
|
|
136
|
-
this.cardOrgList = [];
|
|
137
|
-
this.cardList = [];
|
|
138
|
-
this.cardPageNum = 0;
|
|
139
|
-
this.cardComputedList = [];
|
|
140
|
-
this.cardLoading = false;
|
|
141
|
-
this.cardNextTop = 0;
|
|
142
|
-
this.contentStatus = false;
|
|
143
|
-
this.hasContent = true;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|