jufubao-base 1.0.169-beta14 → 1.0.169-beta16

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.169-beta14",
3
+ "version": "1.0.169-beta16",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -17,11 +17,10 @@
17
17
  :color="{SEAT:$parentVm.mainColor,CODE:$parentVm.subMainColor,SELL:$parentVm.successColor}"
18
18
  :border-radius="$parentVm.imgRradius"
19
19
  :brand-color="$parentVm.brandColor"
20
- @on-schedule="(cinema)=>{$parentVm.handleSchedule(cinema,parent)}"
21
- @on-cashier-detail="(cinema)=>{$parentVm.handleCashierDetail(cinema,parent)}"
22
- @on-code-detail="(cinema)=>{$parentVm.handleCodeDetail(cinema,parent)}"
20
+ @on-schedule="handleFilmDetail"
21
+ @on-cashier-detail="handleCashierDetail"
22
+ @on-code-detail="handleCodeDetail"
23
23
  ></content-cinema>
24
-
25
24
  <content-film v-if="parent.type === 'film'"
26
25
  type="hot"
27
26
  style="width: 100%; height: 100%"
@@ -31,10 +30,9 @@
31
30
  :color="$parentVm.mainColor"
32
31
  :border-radius="$parentVm.imgRradius"
33
32
  :brand-color="$parentVm.brandColor"
34
- @on-film-detail="(film_id)=>{$parentVm.handleFilmDetail(film_id, parent)}"
35
- @on-buy="(film_id)=>{$parentVm.handleBuy(film_id, parent)}"
33
+ @on-film-detail="handleFilmDetail"
34
+ @on-buy="handleBuy"
36
35
  ></content-film>
37
-
38
36
  <content-shop v-if="parent.type === 'shop'"
39
37
  style="width: 100%; height: 100%"
40
38
  :keyword="keyword"
@@ -44,10 +42,9 @@
44
42
  :border-radius="$parentVm.imgRradius"
45
43
  :brand-color="$parentVm.brandColor"
46
44
  :is-echange="'Y' || $parentVm.isShowExchange"
47
- @on-shop-jhd="(shop)=>{$parentVm.handleShopJhd(shop,parent)}"
48
- @on-shop-detail="(shop)=>{$parentVm.handleShopDetail(shop,parent)}"
45
+ @on-shop-jhd="handleShopJhd"
46
+ @on-shop-detail="handleShopDetail"
49
47
  ></content-shop>
50
-
51
48
  </view>
52
49
  </view>
53
50
  <view v-else class="module_cont product_wrap">
@@ -68,7 +65,7 @@
68
65
  :brand-color="$parentVm.brandColor"
69
66
  :border-radius="$parentVm.imgRradius"
70
67
  :cell="getProductCell(parent.tab)"
71
- @on-product-detail="(product)=>{$parentVm.handleProductDetail(product,parent)}"
68
+ @on-product-detail="handleProductDetail"
72
69
  ></content-product>
73
70
  </view>
74
71
  </view>
@@ -130,7 +127,7 @@
130
127
  padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.right, 20)}rpx`;
131
128
  padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.bottom, 20)}rpx`;
132
129
  padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.left, 20)}rpx`;
133
-
130
+
134
131
  let allModuleTitleStyle = this.$parentVm.allModuleTitleStyle;
135
132
  let style = {padding: padding};
136
133
  if(allModuleTitleStyle === 'underline'){
@@ -142,7 +139,7 @@
142
139
  return this.styleObjectToString(style);
143
140
  },
144
141
  moduleItemContStyle(){
145
- let {
142
+ let {
146
143
  allModuleItemContBorder, allModuleItemContShadow, allModuleItemContPadding, allModuleItemContMargin,
147
144
  allModuleItemContRadius, allModuleItemContBgColor
148
145
  } = this.$parentVm;
@@ -255,7 +252,40 @@
255
252
  },
256
253
  switchMenu(item){
257
254
  this.$emit('on-switch', {...item, value: item.tab});
258
- }
255
+ },
256
+
257
+
258
+ //影片
259
+ handleFilmDetail(film){
260
+ this.$parentVm.handleFilmDetail(film, this.dataConfig)
261
+ },
262
+ handleBuy(film){
263
+ this.$parentVm.handleBuy(film, this.dataConfig)
264
+ },
265
+
266
+ //影院
267
+ handleSchedule(cinema){
268
+ this.$parentVm.handleSchedule(cinema, this.dataConfig)
269
+ },
270
+ handleCashierDetail(cinema){
271
+ this.$parentVm.handleCashierDetail(cinema, this.dataConfig)
272
+ },
273
+ handleCodeDetail(cinema){
274
+ this.$parentVm.handleCodeDetail(cinema, this.dataConfig)
275
+ },
276
+
277
+ //门店
278
+ handleShopJhd(shop){
279
+ this.$parentVm.handleShopJhd(shop, this.dataConfig)
280
+ },
281
+ handleShopDetail(shop){
282
+ this.$parentVm.handleShopDetail(shop, this.dataConfig)
283
+ },
284
+
285
+ //商品
286
+ handleProductDetail(product){
287
+ this.$parentVm.handleProductDetail(product, this.dataConfig)
288
+ },
259
289
  }
260
290
  }
261
291
  </script>
@@ -272,7 +302,7 @@
272
302
  }
273
303
  .module_cont{
274
304
  padding: 20rpx 0;
275
-
305
+
276
306
  &.product_wrap{
277
307
  display: flex;
278
308
  justify-content: space-between;
@@ -300,4 +330,4 @@
300
330
  }
301
331
  }
302
332
  }
303
- </style>
333
+ </style>
@@ -155,10 +155,9 @@
155
155
  align-items: flex-end;
156
156
  justify-content: flex-end;
157
157
  flex-flow: wrap;
158
- height: 100%;
159
158
  box-sizing: border-box;
160
159
  width: 160rpx;
161
- min-height: 200rpx;
160
+ height: 190rpx;
162
161
 
163
162
  & .score {
164
163
  height: 40rpx;
@@ -10,7 +10,7 @@
10
10
  borderRadius: borderRadius + 'rpx',
11
11
  }"
12
12
  >
13
- <image :src="imageUrl" :alt="item['product_name']" mode="aspectFit"></image>
13
+ <image :src="imageUrl" :alt="item['product_name']"></image>
14
14
  </view>
15
15
  <view class="prodcut-content" :style="{marginTop:cell === 1? 0: (outSpacing + 'rpx') }">
16
16
  <view class="prodcut-content-info">
@@ -75,7 +75,7 @@ export default {
75
75
  props:{
76
76
  keyword:{
77
77
  type:String,
78
- default:'北京'
78
+ default:''
79
79
  },
80
80
 
81
81
  height:{
@@ -197,6 +197,13 @@ export default {
197
197
  &.tow {
198
198
  .prodcut-image {
199
199
  width: 100%;
200
+ display: flex;
201
+ justify-content: center;
202
+ align-items: center;
203
+ & > image {
204
+ height: 100%;
205
+ width: 100%;
206
+ }
200
207
  }
201
208
 
202
209
  }
@@ -204,8 +211,8 @@ export default {
204
211
  &-image {
205
212
  overflow: hidden;
206
213
  & > image {
207
- max-height: 100%;
208
- max-width: 100%;
214
+ height: 100%;
215
+ width: 100%;
209
216
  }
210
217
  }
211
218
 
@@ -147,11 +147,13 @@ export default {
147
147
  justify-content: flex-start;
148
148
  align-items: flex-start;
149
149
  font-size: 22rpx;
150
+ line-height: 40rpx;
150
151
  color: #999;
151
152
 
152
153
  & > view:first-child {
153
154
  width: 40rpx;
154
155
  height: 40rpx;
156
+ line-height: 40rpx;
155
157
  margin-right: 10rpx;
156
158
  display: flex;
157
159
  justify-content: center;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="custom-list">
2
+ <view class="custom-list" v-if="parentStatus">
3
3
  <view v-if="dataList === null">
4
4
  <view :class="{productBoxCell2: type_other === 2 }">
5
5
  <view
@@ -8,22 +8,22 @@
8
8
  :class="{productItemCell2: type_other === 2 }"
9
9
  :key="item"
10
10
  :style="{
11
- marginBottom:$parentVm.outSpacing + 'rpx',
11
+ marginBottom:listItemStyle.outSpacing + 'rpx',
12
12
  padding:contMarginComp,
13
- borderRadius:$parentVm.contRradius+ 'rpx',
13
+ borderRadius:listItemStyle.contRradius+ 'rpx',
14
14
  boxShadow:'0 0 10rpx rgba(0,0,0,0.1)',
15
15
  width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
16
16
  }"
17
17
  >
18
18
  <skeleton-product
19
19
  :cell="type_other"
20
- v-if="$parentVm.productConfig !== null && type_code === 'product'"
21
- :product-config="$parentVm.productConfig"
22
- :out-spacing="$parentVm.outSpacing"
20
+ v-if="productConfig !== null && type_code === 'product'"
21
+ :product-config="productConfig"
22
+ :out-spacing="listItemStyle.outSpacing"
23
23
  :height="outItemProduct"
24
24
  ></skeleton-product>
25
- <skeleton-shop v-if="type_code === 'shop'" :out-spacing="$parentVm.outSpacing"></skeleton-shop>
26
- <skeleton-film v-if="type_code === 'film'" :out-spacing="$parentVm.outSpacing"></skeleton-film>
25
+ <skeleton-shop v-if="type_code === 'shop'" :out-spacing="listItemStyle.outSpacing"></skeleton-shop>
26
+ <skeleton-film v-if="type_code === 'film'" :out-spacing="listItemStyle.outSpacing"></skeleton-film>
27
27
  <skeleton-cinema v-if="type_code === 'cinema'"></skeleton-cinema>
28
28
  </view>
29
29
  </view>
@@ -34,26 +34,27 @@
34
34
  v-for="item in dataList"
35
35
  :key="item.cuid"
36
36
  :style="{
37
- marginBottom:$parentVm.outSpacing + 'rpx',
37
+ marginBottom:listItemStyle.outSpacing + 'rpx',
38
38
  padding:contMarginComp,
39
- borderRadius:$parentVm.contRradius+ 'rpx',
40
- border: $parentVm.contBorder,
41
- boxShadow:$parentVm.contShadow,
39
+ borderRadius:listItemStyle.contRradius+ 'rpx',
40
+ border: listItemStyle.contBorder,
41
+ boxShadow:listItemStyle.contShadow,
42
42
  width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
43
43
  height: heightRpx,
44
- backgroundColor: $parentVm.contBgColor
45
- }">
44
+ backgroundColor: listItemStyle.contBgColor
45
+ }"
46
+ >
46
47
  <content-film
47
48
  type="hot"
48
49
  v-if="type_code === 'film'"
49
50
  style="width: 100%; height: 100%"
50
51
  :keyword="keyword"
51
52
  :item="item"
52
- :out-spacing="$parentVm.outSpacing"
53
- :color="$parentVm.mainColor"
54
- :border-radius="$parentVm.imgRradius"
55
- @on-film-detail="(film)=>{$parentVm.handleFilmDetail(film, dataConfig)}"
56
- @on-buy="(film)=>{$parentVm.handleBuy(film, dataConfig)}"
53
+ :out-spacing="listItemStyle.outSpacing"
54
+ :color="listItemStyle.mainColor"
55
+ :border-radius="listItemStyle.imgRradius"
56
+ @on-film-detail="handleFilmDetail"
57
+ @on-buy="handleBuy"
57
58
  ></content-film>
58
59
  <content-cinema
59
60
  v-if="type_code === 'cinema'"
@@ -61,36 +62,37 @@
61
62
  type="list"
62
63
  :keyword="keyword"
63
64
  :item="item"
64
- :out-spacing="$parentVm.outSpacing"
65
- :color="{SEAT:$parentVm.mainColor,CODE:$parentVm.subMainColor,SELL:$parentVm.successColor}"
66
- :border-radius="$parentVm.imgRradius"
67
- @on-schedule="(cinema)=>{$parentVm.handleSchedule(cinema,dataConfig)}"
68
- @on-cashier-detail="(cinema)=>{$parentVm.handleCashierDetail(cinema,dataConfig)}"
69
- @on-code-detail="(cinema)=>{$parentVm.handleCodeDetail(cinema,dataConfig)}"
65
+ :out-spacing="listItemStyle.outSpacing"
66
+ :color="{SEAT:listItemStyle.mainColor,CODE:listItemStyle.subMainColor,SELL:listItemStyle.successColor}"
67
+ :border-radius="listItemStyle.imgRradius"
68
+ @on-schedule="handleSchedule"
69
+ @on-cashier-detail="handleCashierDetail"
70
+ @on-code-detail="handleCodeDetail"
70
71
  ></content-cinema>
71
72
  <content-shop
72
73
  v-if="type_code === 'shop'"
73
74
  style="width: 100%; height: 100%"
74
75
  :keyword="keyword"
75
- :out-spacing="$parentVm.outSpacing"
76
+ :out-spacing="listItemStyle.outSpacing"
76
77
  :item="item"
77
- :color="$parentVm.mainColor"
78
- :border-radius="$parentVm.imgRradius"
79
- :is-echange="'Y' || $parentVm.isShowExchange"
80
- @on-shop-jhd="(shop)=>{$parentVm.handleShopJhd(shop,dataConfig)}"
81
- @on-shop-detail="(shop)=>{$parentVm.handleShopDetail(shop,dataConfig)}"
78
+ :color="listItemStyle.mainColor"
79
+ :border-radius="listItemStyle.imgRradius"
80
+ :is-echange="'Y' || listItemStyle.isShowExchange"
81
+ @on-shop-jhd="handleShopJhd"
82
+ @on-shop-detail="handleShopDetail"
82
83
  ></content-shop>
83
84
  <content-product
84
- v-if="$parentVm.productConfig !== null && type_code === 'product'"
85
+ v-if="productConfig !== null && type_code === 'product'"
85
86
  style="width: 100%; height: 100%"
86
- :product-config="$parentVm.productConfig"
87
- :out-spacing="$parentVm.outSpacing"
87
+ :keyword="keyword"
88
+ :product-config="productConfig"
89
+ :out-spacing="listItemStyle.outSpacing"
88
90
  :item="item"
89
- :brand-color="$parentVm.brandColor"
90
- :color="$parentVm.mainColor"
91
- :border-radius="$parentVm.imgRradius"
91
+ :brand-color="listItemStyle.brandColor"
92
+ :color="listItemStyle.mainColor"
93
+ :border-radius="listItemStyle.imgRradius"
92
94
  :cell="type_other"
93
- @on-product-detail="(product)=>{$parentVm.handleProductDetail(product,dataConfig)}"
95
+ @on-product-detail="handleProductDetail"
94
96
  ></content-product>
95
97
  </view>
96
98
  </template>
@@ -101,28 +103,30 @@
101
103
  v-for="item in productTowList[listKey]"
102
104
  :key="item.cuid"
103
105
  :style="{
104
- marginBottom:$parentVm.outSpacing + 'rpx',
106
+ marginBottom:listItemStyle.outSpacing + 'rpx',
105
107
  padding:contMarginComp,
106
- borderRadius:$parentVm.contRradius+ 'rpx',
107
- border: $parentVm.contBorder,
108
- boxShadow:$parentVm.contShadow,
108
+ borderRadius:listItemStyle.contRradius+ 'rpx',
109
+ border: listItemStyle.contBorder,
110
+ boxShadow:listItemStyle.contShadow,
109
111
  width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
110
112
  height: heightRpx,
111
- backgroundColor: $parentVm.contBgColor
113
+ backgroundColor: listItemStyle.contBgColor
112
114
  }"
113
115
  >
114
116
  <content-product
115
- v-if="$parentVm.productConfig !== null"
117
+
118
+ v-if="productConfig !== null"
116
119
  style="width: 100%; height: 100%"
117
- :product-config="$parentVm.productConfig"
118
- :out-spacing="$parentVm.outSpacing"
120
+ :keyword="keyword"
121
+ :product-config="productConfig"
122
+ :out-spacing="listItemStyle.outSpacing"
119
123
  :item="item"
120
124
  :height="outItemProduct"
121
- :color="$parentVm.mainColor"
122
- :brand-color="$parentVm.brandColor"
123
- :border-radius="$parentVm.imgRradius"
125
+ :color="listItemStyle.mainColor"
126
+ :brand-color="listItemStyle.brandColor"
127
+ :border-radius="listItemStyle.imgRradius"
124
128
  :cell="type_other"
125
- @on-product-detail="(product)=>{$parentVm.handleProductDetail(product,dataConfig)}"
129
+ @on-product-detail="handleProductDetail"
126
130
  ></content-product>
127
131
  </view>
128
132
  </view>
@@ -159,6 +163,14 @@ export default {
159
163
  type:String,
160
164
  default:'',
161
165
  },
166
+ listItemStyle:{
167
+ type:Object|null,
168
+ default:null,
169
+ },
170
+ productConfig:{
171
+ type:Object|null,
172
+ default:null,
173
+ },
162
174
  tabId:{
163
175
  type:String,
164
176
  required:true
@@ -196,17 +208,19 @@ export default {
196
208
  return params
197
209
  },
198
210
  contMarginComp(){
199
- let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
200
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
201
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
202
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20)}rpx`;
211
+ if(this.getParent === null) return 0
212
+ let str = `${this.getParent().checkValue(this.listItemStyle.contMargin.top, 20)}rpx`;
213
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.right, 20)}rpx`;
214
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.bottom, 20)}rpx`;
215
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.left, 20)}rpx`;
203
216
  return str
204
217
  },
205
218
  outItemProduct(){
219
+ if(this.getParent === null) return 0
206
220
  //获取每列元素最大宽度
207
- let num = (750 - 3 * Number(this.$parentVm.outSpacing))/2;
208
- num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
209
- return num - this.$parentVm.contBorderWidth * 2
221
+ let num = (750 - 3 * Number(this.listItemStyle.outSpacing))/2;
222
+ num = num - this.getParent().checkValue(this.listItemStyle.contMargin.right, 20) - this.getParent().checkValue(this.listItemStyle.contMargin.left, 20);
223
+ return num - this.listItemStyle.contBorderWidth * 2
210
224
  },
211
225
  heightRpx(){
212
226
  let h = 'auto'
@@ -218,13 +232,14 @@ export default {
218
232
  },
219
233
  data(){
220
234
  return {
221
- $parentVm:null,
235
+ /**@type Function|null**/
236
+ getParent:null,
222
237
  parentStatus: false,
223
238
  skeletonCount: 6,
224
239
  hasNoData: false,
225
240
 
226
241
  page_token:'1',
227
- page_size: 100,
242
+ page_size: 20,
228
243
 
229
244
  //参数
230
245
  type_code:'',
@@ -284,7 +299,7 @@ export default {
284
299
  this.type_code = tabs[1];
285
300
  if(this.type_code === 'product'){
286
301
  this.type_other = Number(tabs[3]);
287
- if(this.type_other === 2) this.skeletonCount = 12
302
+ if(this.type_other === 2) this.skeletonCount = 6
288
303
  else this.skeletonCount = 6
289
304
  }
290
305
  else {
@@ -299,7 +314,7 @@ export default {
299
314
  this.is_open_city = 'N';
300
315
  this.dataConfig = null;
301
316
  this.page_token = '1';
302
- this.dataList = [];
317
+ this.dataList = null;
303
318
  this.productTowList = {
304
319
  left:null,
305
320
  right:null,
@@ -307,14 +322,14 @@ export default {
307
322
  },
308
323
 
309
324
  getParentMV(){
310
- this.$emit('on-parent-vm', ($vm)=>{
311
- this.$parentVm = $vm;
325
+ this.$emit('on-parent-vm', (getParent)=>{
326
+ this.getParent = getParent;
312
327
  this.parentStatus = true;
313
328
  })
314
329
  },
315
330
 
316
331
  onCusReachBottom(){
317
- if(!this.page_token) return false;
332
+ if(this.dataList === null || !this.page_token) return false;
318
333
  this.getList();
319
334
  },
320
335
 
@@ -324,7 +339,6 @@ export default {
324
339
  this.getList();
325
340
  },
326
341
 
327
-
328
342
  getList(){
329
343
  let time = new Date().getTime();
330
344
 
@@ -332,12 +346,11 @@ export default {
332
346
  if(this.keyword === '') {
333
347
  return;
334
348
  }
335
- this.$xdShowLoading({});
336
- console.log(new Date().getTime()-time)
349
+ //this.$xdShowLoading({});
337
350
  this.$emit('on-list', {
338
351
  params:this.getParams,
339
352
  cb:(res)=>{
340
- console.log(new Date().getTime()-time)
353
+ console.log(new Date().getTime()-time);
341
354
  //无数据处理
342
355
  if(res === null){
343
356
  this.hasNoData = true;
@@ -379,7 +392,40 @@ export default {
379
392
  })
380
393
  }
381
394
  })
382
- }
395
+ },
396
+
397
+ //影片
398
+ handleFilmDetail(film){
399
+ this.getParent().handleFilmDetail(film, this.dataConfig)
400
+ },
401
+ handleBuy(film){
402
+ this.getParent().handleBuy(film, this.dataConfig)
403
+ },
404
+
405
+ //影院
406
+ handleSchedule(cinema){
407
+ this.getParent().handleSchedule(cinema, this.dataConfig)
408
+ },
409
+ handleCashierDetail(cinema){
410
+ this.getParent().handleCashierDetail(cinema, this.dataConfig)
411
+ },
412
+ handleCodeDetail(cinema){
413
+ this.getParent().handleCodeDetail(cinema, this.dataConfig)
414
+ },
415
+
416
+ //门店
417
+ handleShopJhd(shop){
418
+ this.getParent().handleShopJhd(shop, this.dataConfig)
419
+ },
420
+ handleShopDetail(shop){
421
+ this.getParent().handleShopDetail(shop, this.dataConfig)
422
+ },
423
+
424
+ //商品
425
+ handleProductDetail(product){
426
+ this.getParent().handleProductDetail(product, this.dataConfig)
427
+ },
428
+
383
429
  }
384
430
  }
385
431
  </script>
@@ -41,25 +41,24 @@
41
41
  </view>
42
42
  </view>
43
43
  <view v-if="!isPreview" style="height: 100rpx;"></view>
44
-
45
44
  <view class="tfk-search" :style="{padding: outSpacing + 'rpx'}">
46
- <all-list v-if="tabId === 'all'"
47
- :keyword="keyword"
48
- @on-parent-vm="handleParentVm"
49
- @on-list="handleList"
50
- @on-switch="handleSwitchMenu"
51
- ></all-list>
45
+ <!-- <all-list v-if="tabId === 'all'"-->
46
+ <!-- :keyword="keyword"-->
47
+ <!-- @on-parent-vm="handleParentVm"-->
48
+ <!-- @on-list="handleList"-->
49
+ <!-- @on-switch="handleSwitchMenu"-->
50
+ <!-- ></all-list>-->
52
51
  <custom-list
53
- v-else
54
52
  :tab-id="tabId"
55
53
  :keyword="keyword"
54
+ :list-item-style="listItemStyle"
55
+ :product-config="productConfig"
56
56
  ref="customList"
57
57
  @on-parent-vm="handleParentVm"
58
58
  @on-list="handleList"
59
59
  ></custom-list>
60
60
  </view>
61
61
  </view>
62
-
63
62
  </view>
64
63
  </view>
65
64
  </template>
@@ -74,14 +73,20 @@
74
73
  import extsMixins from "@/mixins/extsMixins";
75
74
  import listMixins from "./listMixins";
76
75
  import CustomList from "./CustomList.vue";
77
- import AllList from "./AllList.vue";
76
+ //import AllList from "./AllList.vue";
77
+
78
+ class EmitParent {
79
+ constructor(options) {
80
+ this.options = options;
81
+ }
82
+ }
78
83
 
79
84
  export default {
80
85
  name: "JfbBaseTfkSearch",
81
86
  components: {
82
87
  CustomList,
83
88
  XdFontIcon,
84
- AllList,
89
+ //AllList,
85
90
  XdSearchHistory
86
91
  },
87
92
  mixins: [
@@ -91,7 +96,7 @@
91
96
  return {
92
97
  hideMask: true,
93
98
  tabId: 'all', //cinema/film/shop/product
94
- keyword: '',
99
+ keyword: '测试',
95
100
  options:{},
96
101
  menuList: [],
97
102
  //公共样式
@@ -121,7 +126,7 @@
121
126
  allModuleItemContPadding: {},
122
127
  allModuleItemContRadius: 16,
123
128
  allModuleItemContBgColor: "#FFFFFF",
124
-
129
+ emitParent:{},
125
130
  }
126
131
  },
127
132
  computed: {
@@ -187,14 +192,19 @@
187
192
  container(value, oldValue) {
188
193
  if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
189
194
  if (this.$configProject['isPreview']){
190
- this.cusInit(value)
191
195
  this.init(value);
196
+ this.cusInit(value)
192
197
  }
193
198
  },
194
199
  },
195
200
  created() {
196
- this.cusInit(this.container);
201
+ this.emitParent = new EmitParent({
202
+ getParent: ()=>{
203
+ return this;
204
+ }
205
+ })
197
206
  this.init(this.container);
207
+ this.cusInit(this.container);
198
208
  },
199
209
 
200
210
  methods: {
@@ -215,6 +225,7 @@
215
225
  }).then(res => {
216
226
  if(this.tabId === 'all'){
217
227
  if(!this.$configProject['isPreview']){
228
+ res = this.filtersResData(res);
218
229
  this.menuList = res.tabs;
219
230
  }
220
231
  cb(res.list)
@@ -222,7 +233,9 @@
222
233
  if(this.isPreview){
223
234
  return cb(res.list.find(item => item.type === this.tabId.split("@")[1]))
224
235
  }
225
- if(res.list.length > 0) cb(res.list[0])
236
+ if(res.list.length > 0) {
237
+ cb(res.list[0])
238
+ }
226
239
  else cb(null)
227
240
  }
228
241
  }).catch((e)=>{
@@ -278,18 +291,10 @@
278
291
  // console.log('event.onJfbScroll', options)
279
292
  },
280
293
 
281
- onJfbShow(options) {
282
- console.log('event.onJfbShow', options)
283
- },
284
- onJfbHide(options) {
285
- console.log('event.onJfbHide', options)
286
- },
287
294
  onJfbBack(options) {
288
- console.log('event.onJfbBack', options)
289
- },
290
- onJfbUpdate(...data) {
291
- console.log('event.onJfbUpdate', data)
295
+ this.$xdUniHelper.navigateBack()
292
296
  },
297
+
293
298
  onJfbCustomEvent({action, data}) {
294
299
  if(action === 'baseHeader@search'){
295
300
  uni.pageScrollTo({
@@ -4,17 +4,7 @@ import { getContainerPropsValue } from "@/utils/xd.base";
4
4
  export default {
5
5
  data(){
6
6
  return {
7
- isShowExchange:'N',
8
-
9
- contMargin:{},
10
- contRradius:'10',
11
- contShadow:'',
12
- contBorder:'',
13
- contBgColor:'',
14
- contBorderWidth: 0,
15
-
16
- imgRradius:'10',
17
-
7
+ listItemStyle:null,
18
8
  productConfig:null,
19
9
  }
20
10
  },
@@ -24,7 +14,6 @@ export default {
24
14
  methods:{
25
15
 
26
16
  cusInit(container){
27
- this.isShowExchange = getContainerPropsValue(container, 'content.isShowExchange', 'N');
28
17
 
29
18
  //商品相关
30
19
  let is_show_brand = getContainerPropsValue(container, 'content.is_show_brand', 'N');
@@ -34,43 +23,60 @@ export default {
34
23
  let isAddCart = getContainerPropsValue(container, 'content.isAddCart', "Y");
35
24
  let differ = getContainerPropsValue(container, 'content.differ', 1);
36
25
  let showActivityPrice = getContainerPropsValue(container, 'content.showActivityPrice', 'N');
37
- this.productConfig = {is_show_brand,isPrice,isShowTag,isShowDiscount,isAddCart,differ,showActivityPrice}
38
-
39
- this.brandColor = getContainerPropsValue(container, 'content.brandColor', '#aaa');
26
+ let isShowExchange = getContainerPropsValue(container, 'content.isShowExchange', 'N');
27
+ this.productConfig = {is_show_brand, isPrice, isShowTag, isShowDiscount, isAddCart, differ, showActivityPrice, isShowExchange};
40
28
 
41
29
  //内容
42
- this.contMargin = getContainerPropsValue(container, 'content.contMargin', {});
43
- this.contRradius = getContainerPropsValue(container, 'content.contRradius', '10');
44
- this.contShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contShadow', {}))
45
- this.contBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contBorder', {}));
46
- this.contBgColor = getContainerPropsValue(container, 'content.contBgColor', '#fff');
47
- this.contObjBorder = getContainerPropsValue(container, 'content.contBorder', {});
48
- if(this.contObjBorder && this.contObjBorder.type === 'Y') {
49
- if(this.contObjBorder.value && this.contObjBorder.value.width) {
50
- this.contBorderWidth = Number(this.contObjBorder.value.width);
30
+ let brandColor = getContainerPropsValue(container, 'content.brandColor', '#aaa');
31
+ let imgRradius = getContainerPropsValue(container, 'content.imgRradius', '10');
32
+ let contMargin = getContainerPropsValue(container, 'content.contMargin', {});
33
+ let contRradius = getContainerPropsValue(container, 'content.contRradius', '10');
34
+ let contShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contShadow', {}))
35
+ let contBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contBorder', {}));
36
+ let contBgColor = getContainerPropsValue(container, 'content.contBgColor', '#fff');
37
+ let contObjBorder = getContainerPropsValue(container, 'content.contBorder', {});
38
+ let contBorderWidth = 0
39
+ if(contObjBorder && contObjBorder.type === 'Y') {
40
+ if(contObjBorder.value && contObjBorder.value.width) {
41
+ contBorderWidth = Number(contObjBorder.value.width);
51
42
  }
52
- else this.contBorderWidth = 2;
43
+ else contBorderWidth = 2;
53
44
  }
45
+ this.listItemStyle = {
46
+ outSpacing: this.outSpacing,
47
+ mainColor: this.mainColor,
48
+ subMainColor: this.subMainColor,
49
+ successColor: this.successColor,
50
+ brandColor,imgRradius,contMargin,contRradius,contShadow,contBorder,contBgColor,contObjBorder,contBorderWidth}
51
+ },
54
52
 
55
- //图片
56
- this.imgRradius = getContainerPropsValue(container, 'content.imgRradius', '10');
57
-
53
+ filtersResData(res){
54
+ let list = res.list.filter(item=>{
55
+ return item.items.length > 0
56
+ });
57
+ if(res.list.length === list.length) return res;
58
+ let tabs = list.map(item=>{
59
+ return {
60
+ label: item.name,
61
+ value: item.tab
62
+ }
63
+ });
64
+ return {...res, list, tabs}
58
65
  },
59
66
 
60
67
 
61
68
  //通信相关================
62
69
  handleParentVm(cb){
63
- cb(this)
70
+ cb(this.emitParent.options.getParent)
64
71
  },
65
72
 
66
73
  onJfbReachBottom(options) {
67
- console.log('event.onJfbReachBottom', options)
68
- this.$refs['customList']['onCusReachBottom'](options)
69
-
74
+ if(this.tabId !== "all") {
75
+ this.$refs['customList']['onCusReachBottom'](options)
76
+ }
70
77
  },
71
78
 
72
79
  onCusReload() {
73
- console.log('event.onCusReload', this.options)
74
80
  this.$refs['customList']['onCusReloadList'](this.options)
75
81
  },
76
82
  //通信相关================
@@ -560,7 +560,7 @@ export default {
560
560
  //#endif
561
561
  },
562
562
 
563
- getUrlHasSpStr(pathDir){
563
+ getUrlHasSpStrDIR(pathDir){
564
564
  if(pathDir.indexOf('@site_domain@/') === 0) {
565
565
  return pathDir.replace('@site_domain@/','').split('/')[0]
566
566
  }
@@ -569,18 +569,48 @@ export default {
569
569
 
570
570
  /**
571
571
  * @description 过滤不可以用
572
- * 当前项目未H5时,过滤所有小程序应用
573
- * 当前项目未小程序时,过滤所有非当前小程序应用
572
+ * 当前项目为H5时,过滤所有小程序应用
573
+ * 当前项目为小程序时,过滤所有非当前小程序应用
574
574
  * 站外地址直接返回
575
575
  * 站内地址未选值直接返回
576
576
  * 预览模式全过
577
577
  * @param url {object}
578
578
  */
579
579
  checkUrlIsValid(url){
580
+ let projectAttr = this.$root.projectAttr;
581
+ //url = '{"dir":"wtxsaas","host":"sandbox-website-05.jufubao.cn","path":"\/main\/order\/detail","appType":"h5","site_id":"17928cc37788be02","site_url":"https:\/\/sandbox-website-05.jufubao.cn\/wtxsaas\/main\/order\/detail","frontPath":"\/wtxsaas\/main\/order\/detail","fixed_business_code":""}'
580
582
  if(!url) return null;
581
583
  try {
584
+ let redirect_data = JSON.parse(url);
585
+ if(!redirect_data['appType']) redirect_data['appType']= 'h5';
586
+
587
+ //#ifdef H5
588
+ if(redirect_data['appType'] === 'wxmp') return null;
589
+ else {
590
+ if(redirect_data.dir === projectAttr.deploy_dir) {
591
+ return redirect_data.path
592
+ }
593
+ else {
594
+ return `//${projectAttr.host}/${redirect_data.frontPath}`
595
+ }
596
+
597
+ }
598
+ //#endif
582
599
 
600
+ //#ifdef MP-WEIXIN
601
+
602
+ let dir = this.getUrlHasSpStrDIR(redirect_data.path);
603
+ if(redirect_data['appType'] === 'wxmp'){
604
+ if(projectAttr.deploy_dir === dir) return redirect_data.path;
605
+ else return null;
606
+ }
607
+ else if(redirect_data['appType'] === 'h5'){
608
+
609
+ }
610
+ else return null;
611
+ //#endif
583
612
  }catch (e){
613
+ console.error(e);
584
614
  return null;
585
615
  }
586
616
  // let content = list.filter(item=>{
@@ -0,0 +1,122 @@
1
+ 'use strict';
2
+
3
+ export default {
4
+ methods:{
5
+ /**
6
+ * @description 过滤不可以用
7
+ * 当前项目未H5时,过滤所有小程序应用
8
+ * 当前项目未小程序时,过滤所有非当前小程序应用
9
+ * 站外地址直接返回
10
+ * 站内地址未选值直接返回
11
+ * 预览模式全过
12
+ */
13
+ posterFilterNoUseData(list = []){
14
+ let content = this.$xdUniHelper.cloneDeep(list).filter(item=>{
15
+ //预览模式
16
+ if( this.$configProject.isPreview) return true;
17
+
18
+ //非内部应用
19
+ if(item.redirect_type !== 'INN') return true
20
+
21
+ //没有配置链接
22
+ if(!item.redirect_data) return true;
23
+
24
+ //内部应用
25
+ else {
26
+ let redirect_data;
27
+ try {
28
+ redirect_data = JSON.parse(item.redirect_data);
29
+ if(!item['app_type']) item['app_type']= 'h5';
30
+
31
+ //#ifdef H5
32
+ return item['app_type'] !== 'wxmp';
33
+ //#endif
34
+
35
+ //#ifdef MP-WEIXIN
36
+ let actDir = this.$parent['projectAttr']['deploy_dir'];
37
+ let dir = this.getPosterPathDir(redirect_data.page);
38
+ if(item['app_type'] === 'wxmp'){
39
+ return actDir === dir;
40
+ }
41
+ else if(item['app_type'] === 'h5') return true;
42
+ else return true
43
+ //#endif
44
+ }
45
+ catch (e) {
46
+ return true
47
+ }
48
+ }
49
+ });
50
+ console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
51
+ return content;
52
+
53
+ },
54
+
55
+ getPosterPathDir(pathDir){
56
+ if(pathDir.indexOf('@site_domain@/') === 0) {
57
+ return pathDir.replace('@site_domain@/','').split('/')[0]
58
+ }
59
+ return ''
60
+ },
61
+
62
+ handlePosterClick(item) {
63
+ if(!item.redirect_data) {
64
+ console.warn(`未配置链接地址: ${item.redirect_data}`);
65
+ console.error(`未配置链接地址: ${item.redirect_data}`);
66
+ return
67
+ }
68
+
69
+ //内部链接跳转地址
70
+ if (item.redirect_type === 'INN') {
71
+ try {
72
+ let url = JSON.parse(item.redirect_data);
73
+ let params = '';
74
+ if(url.page) {
75
+ if (item['redirect_params']) params = `?${item['redirect_params']}`;
76
+ this.$xdUniHelper.navigateTo({url: url.page + params})
77
+ }
78
+ else {
79
+ console.error(`应用链接配置错误: ${url.page}`)
80
+ }
81
+ } catch (e) {
82
+ console.error(`应用链接配置错误: ${item.redirect_data}`)
83
+ }
84
+ }
85
+
86
+ //外部链接
87
+ if (item.redirect_type === 'URL') {
88
+ let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
89
+ let spReg = /(-apiuri\/v)/;
90
+ //#ifdef MP-WEIXIN
91
+ try {
92
+ let url = JSON.parse(item.redirect_data);
93
+ if (reg.test(url.url) || spReg.test(url.url)) {
94
+ console.warn(`广告跳转外站: ${url.url}`)
95
+ this.$xdUniHelper.navigateTo(url);
96
+ } else {
97
+ console.error(`广告跳转外站配置错误: ${url.url}`)
98
+ }
99
+ } catch (e) {
100
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
101
+ }
102
+ //#endif
103
+ //#ifdef H5
104
+ try {
105
+ let url = JSON.parse(item.redirect_data);
106
+ console.warn(`广告跳转外站: ${url.url}`);
107
+ this.$xdUniHelper.redirectTo(url, false)
108
+ } catch (e) {
109
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
110
+ }
111
+ //#endif
112
+
113
+ }
114
+
115
+ //无跳转地址
116
+ if(item.redirect_type === 'EMP') {
117
+ console.warn(`无跳转地址`);
118
+ }
119
+ },
120
+ },
121
+ }
122
+