jufubao-base 1.0.61-beta1003 → 1.0.61-beta1005

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-beta1003",
3
+ "version": "1.0.61-beta1005",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -262,9 +262,9 @@ export default {
262
262
  );
263
263
  }
264
264
  if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
265
- res.site_entry_settings = res.site_entry_settings.map(item=>{
265
+ res.site_entry_settings = res.site_entry_settings.filter(item=>{
266
266
  item['image_url'] = getServiceUrl(item['image_url'])
267
- return item
267
+ return res.business_codes.includes(item.business_code)
268
268
  })
269
269
  }
270
270
  this.info = res;
@@ -132,7 +132,7 @@
132
132
  class="card-list"
133
133
  :key="item.card_number"
134
134
  @click="toDetail(item)"
135
- v-if="setCardItemShow(item)"
135
+ v-if="setCardItemShow(item,index)"
136
136
  :style="{
137
137
  background: item['theme']['color'],
138
138
  backgroundSize: '100%',
@@ -209,13 +209,12 @@
209
209
  </view>
210
210
  </view>
211
211
  <view
212
- class="card-content-empty"
212
+ class="card-content-empty card-list"
213
213
  v-else
214
214
  :style="{
215
215
  height: item.height + 'px',
216
- backgroundImage: 'url('+ (item.entries.length > 1 ? cardItemBg2: cardItemBg1) +')'
217
216
  }"
218
- ></view>
217
+ ><image :src="item.entries.length > 1 ? cardItemBg2: cardItemBg1"></image></view>
219
218
  </view>
220
219
  <view v-else-if="cardList === null && cardList.length === 0">
221
220
  <view class="jfb-base-card-entry__body-empty">
@@ -1056,5 +1055,10 @@ export default {
1056
1055
  background-size: 100%;
1057
1056
  background-repeat: no-repeat;
1058
1057
  background-position: top center;
1058
+
1059
+ & > image {
1060
+ width: 100%;
1061
+ height: 100%;
1062
+ }
1059
1063
  }
1060
1064
  </style>
@@ -289,9 +289,9 @@ export default {
289
289
  }
290
290
  });
291
291
  if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
292
- res.site_entry_settings = res.site_entry_settings.map(item=>{
292
+ res.site_entry_settings = res.site_entry_settings.filter(item=>{
293
293
  item['image_url'] = getServiceUrl(item['image_url'])
294
- return item
294
+ return res.business_codes.includes(item.business_code)
295
295
  })
296
296
  }
297
297
 
@@ -326,9 +326,9 @@ export default {
326
326
  }
327
327
  });
328
328
  if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
329
- res.site_entry_settings = res.site_entry_settings.map(item=>{
329
+ res.site_entry_settings = res.site_entry_settings.filter(item=>{
330
330
  item['image_url'] = getServiceUrl(item['image_url'])
331
- return item
331
+ return res.business_codes.includes(item.business_code)
332
332
  })
333
333
  }
334
334
  this.headerBg = this.getCardThemes(res.card_type_name);
@@ -8,7 +8,7 @@ export default {
8
8
 
9
9
  //卡券列表
10
10
  cardOrgList:[], //原始数据
11
- cardList:null, //计算后的卡列表
11
+ cardList:[], //计算后的卡列表
12
12
  cardPageNum: 0, //当前页面
13
13
  cardPageLen: 10, //每页获取数据调试
14
14
  cardComputedList:[], //当前获取的数据列表
@@ -19,27 +19,44 @@ export default {
19
19
 
20
20
  //转换按钮
21
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'
22
25
  }
23
26
  },
24
27
  computed:{
25
28
  ...mapState(['srollPreview'])
26
29
  },
27
30
  watch:{
28
- srollPreview(value){
29
- console.log(value)
30
- }
31
+ // srollPreview(value){
32
+ // console.log(value)
33
+ // }
31
34
  },
32
35
  created(){
33
36
 
37
+ },
38
+
39
+ mounted(){
40
+
41
+
34
42
  },
35
43
  methods:{
36
- setCardItemShow({height , top}){
37
- let fiexd = 100;
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;
38
54
  let boxTop = top + height + fiexd;
39
55
  let boxBottom = top - (fiexd);
40
56
  let {pageWindowPrevStart, pageWindowPrevEnd} = this.srollPreview;
41
57
  return boxTop > pageWindowPrevStart && boxBottom < pageWindowPrevEnd;
42
58
  },
59
+
43
60
  getBoxTop(){
44
61
  return new Promise((resolve, reject)=>{
45
62
  const query = uni.createSelectorQuery().in(this);
@@ -51,7 +68,8 @@ export default {
51
68
  })
52
69
 
53
70
  },
54
- async handleCardComputed(){
71
+
72
+ async handleCardComputed(paddingBottom){
55
73
  this.$xdShowLoading({});
56
74
  if(this.contentStatus === false) await this.getBoxTop();
57
75
  this.$nextTick(()=>{
@@ -61,18 +79,23 @@ export default {
61
79
  let card = this.cardComputedList.filter(it=>{
62
80
  return item.dataset.card === it.card_number;
63
81
  })[0];
64
- card['height'] = item.height + 15;
82
+ card['height'] = item.height + (paddingBottom * this.$rpxNum);
65
83
  card['top'] = this.cardNextTop;
66
84
  this.cardNextTop = this.cardNextTop + card['height']
67
85
  return card
68
86
  });
87
+
88
+
69
89
  this.cardList = this.cardList.concat(arr);
90
+
91
+
92
+
70
93
  this.$xdHideLoading();
71
94
  }).exec();
72
95
  })
73
96
  },
74
97
 
75
- handleCardInit(cardList,isChange = false){
98
+ handleCardInit(cardList,isChange = false, paddingBottom = 30){
76
99
  let newCardList = this.$xdUniHelper.cloneDeep(cardList);
77
100
  let validCardList = this.getCardGroupItem(newCardList.list.filter((item) => {
78
101
  if(isChange === true) return item["is_valid"] === "Y";
@@ -83,7 +106,7 @@ export default {
83
106
  });
84
107
  this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
85
108
  this.cardComputedList = this.cardOrgList.slice(this.cardPageNum,this.cardPageLen);
86
- this.handleCardComputed().then().catch();
109
+ this.handleCardComputed(paddingBottom).then().catch();
87
110
  },
88
111
 
89
112
  onJfbReachBottom(){
@@ -111,7 +134,7 @@ export default {
111
134
 
112
135
  clearDefault(){
113
136
  this.cardOrgList = [];
114
- this.cardList = null;
137
+ this.cardList = [];
115
138
  this.cardPageNum = 0;
116
139
  this.cardComputedList = [];
117
140
  this.cardLoading = false;