jufubao-base 1.0.169-beta1 → 1.0.169-beta11
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/JfbBaseHeader/JfbBaseHeader.vue +2 -2
- package/src/components/JfbBaseLogin/Attr.js +54 -16
- package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
- package/src/components/JfbBaseOrderDetail/Api.js +12 -7
- package/src/components/JfbBaseOrderDetail/Attr.js +28 -14
- package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +68 -18
- package/src/components/JfbBaseOrderDetail/Mock.js +3 -1
- package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
- package/src/components/JfbBaseTfkCardBind/Attr.js +61 -10
- package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +169 -9
- package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
- package/src/components/JfbBaseTfkCardDetail/Api.js +26 -0
- package/src/components/JfbBaseTfkCardDetail/Attr.js +336 -9
- package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +241 -36
- package/src/components/JfbBaseTfkCardDetail/Mock.js +2 -2
- package/src/components/JfbBaseTfkCardLogin/Attr.js +301 -5
- package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +317 -158
- package/src/components/JfbBaseTfkCardLogin/Mock.js +2 -46
- package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +271 -0
- package/src/components/JfbBaseTfkSearch/AllList.vue +232 -0
- package/src/components/JfbBaseTfkSearch/Api.js +11 -42
- package/src/components/JfbBaseTfkSearch/Attr.js +225 -33
- package/src/components/JfbBaseTfkSearch/ContentCinema.vue +157 -0
- package/src/components/JfbBaseTfkSearch/ContentFilm.vue +180 -0
- package/src/components/JfbBaseTfkSearch/ContentProduct.vue +308 -0
- package/src/components/JfbBaseTfkSearch/ContentShop.vue +184 -0
- package/src/components/JfbBaseTfkSearch/CusAttr.js +213 -0
- package/src/components/JfbBaseTfkSearch/CustomList.vue +402 -0
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +230 -26
- package/src/components/JfbBaseTfkSearch/Mock.js +90 -11
- package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +45 -0
- package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +109 -0
- package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +246 -0
- package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +81 -0
- package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
- package/src/components/JfbBaseTfkSearch/listMixins.js +153 -0
- package/src/components/JfbBaseTfkSearch/search.js +293 -0
- package/src/mixins/colorCardMixins.js +71 -9
- package/src/mixins/componentsMixins.js +346 -23
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="custom-list">
|
|
3
|
+
<view v-if="dataList === null">
|
|
4
|
+
<view :class="{productBoxCell2: type_other === 2 }">
|
|
5
|
+
<view
|
|
6
|
+
v-for="item in skeletonCount"
|
|
7
|
+
class="skeleton-wrap"
|
|
8
|
+
:class="{productItemCell2: type_other === 2 }"
|
|
9
|
+
:key="item"
|
|
10
|
+
:style="{
|
|
11
|
+
marginBottom:$parentVm.outSpacing + 'rpx',
|
|
12
|
+
padding:contMarginComp,
|
|
13
|
+
borderRadius:$parentVm.contRradius+ 'rpx',
|
|
14
|
+
boxShadow:'0 0 10rpx rgba(0,0,0,0.1)',
|
|
15
|
+
width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
|
|
16
|
+
}"
|
|
17
|
+
>
|
|
18
|
+
<skeleton-product
|
|
19
|
+
:cell="type_other"
|
|
20
|
+
v-if="$parentVm.productConfig !== null && type_code === 'product'"
|
|
21
|
+
:product-config="$parentVm.productConfig"
|
|
22
|
+
:out-spacing="$parentVm.outSpacing"
|
|
23
|
+
:height="outItemProduct"
|
|
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>
|
|
27
|
+
<skeleton-cinema v-if="type_code === 'cinema'"></skeleton-cinema>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
</view>
|
|
31
|
+
<view class="custom-list-data" v-else>
|
|
32
|
+
<template v-if="type_other !== 2">
|
|
33
|
+
<view
|
|
34
|
+
v-for="item in dataList"
|
|
35
|
+
:key="item.id"
|
|
36
|
+
:style="{
|
|
37
|
+
marginBottom:$parentVm.outSpacing + 'rpx',
|
|
38
|
+
padding:contMarginComp,
|
|
39
|
+
borderRadius:$parentVm.contRradius+ 'rpx',
|
|
40
|
+
border: $parentVm.contBorder,
|
|
41
|
+
boxShadow:$parentVm.contShadow,
|
|
42
|
+
width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
|
|
43
|
+
height: heightRpx,
|
|
44
|
+
backgroundColor: $parentVm.contBgColor
|
|
45
|
+
}">
|
|
46
|
+
<content-film
|
|
47
|
+
type="hot"
|
|
48
|
+
v-if="type_code === 'film'"
|
|
49
|
+
style="width: 100%; height: 100%"
|
|
50
|
+
:keyword="keyword"
|
|
51
|
+
:item="item"
|
|
52
|
+
:out-spacing="$parentVm.outSpacing"
|
|
53
|
+
:color="$parentVm.mainColor"
|
|
54
|
+
:border-radius="$parentVm.imgRradius"
|
|
55
|
+
@on-film-detail="(film_id)=>{$parentVm.handleFilmDetail(film_id, dataConfig)}"
|
|
56
|
+
@on-buy="(film_id)=>{$parentVm.handleBuy(film_id, dataConfig)}"
|
|
57
|
+
></content-film>
|
|
58
|
+
<content-cinema
|
|
59
|
+
v-if="type_code === 'cinema'"
|
|
60
|
+
style="width: 100%;height: 100%"
|
|
61
|
+
type="list"
|
|
62
|
+
:keyword="keyword"
|
|
63
|
+
: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)}"
|
|
70
|
+
></content-cinema>
|
|
71
|
+
<content-shop
|
|
72
|
+
v-if="type_code === 'shop'"
|
|
73
|
+
style="width: 100%; height: 100%"
|
|
74
|
+
:keyword="keyword"
|
|
75
|
+
:out-spacing="$parentVm.outSpacing"
|
|
76
|
+
: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)}"
|
|
82
|
+
></content-shop>
|
|
83
|
+
<content-product
|
|
84
|
+
v-if="$parentVm.productConfig !== null && type_code === 'product'"
|
|
85
|
+
style="width: 100%; height: 100%"
|
|
86
|
+
:product-config="$parentVm.productConfig"
|
|
87
|
+
:out-spacing="$parentVm.outSpacing"
|
|
88
|
+
:item="item"
|
|
89
|
+
:brand-color="$parentVm.brandColor"
|
|
90
|
+
:color="$parentVm.mainColor"
|
|
91
|
+
:border-radius="$parentVm.imgRradius"
|
|
92
|
+
:cell="type_other"
|
|
93
|
+
@on-product-detail="(product)=>{$parentVm.handleProductDetail(product,dataConfig)}"
|
|
94
|
+
></content-product>
|
|
95
|
+
</view>
|
|
96
|
+
</template>
|
|
97
|
+
<view v-else class="productBox2">
|
|
98
|
+
<view v-for="(value, listKey) in productTowList" :key="listKey">
|
|
99
|
+
<view
|
|
100
|
+
v-if="productTowList[listKey] !== null"
|
|
101
|
+
v-for="item in productTowList[listKey]"
|
|
102
|
+
:key="item.id"
|
|
103
|
+
:style="{
|
|
104
|
+
marginBottom:$parentVm.outSpacing + 'rpx',
|
|
105
|
+
padding:contMarginComp,
|
|
106
|
+
borderRadius:$parentVm.contRradius+ 'rpx',
|
|
107
|
+
border: $parentVm.contBorder,
|
|
108
|
+
boxShadow:$parentVm.contShadow,
|
|
109
|
+
width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
|
|
110
|
+
height: heightRpx,
|
|
111
|
+
backgroundColor: $parentVm.contBgColor
|
|
112
|
+
}"
|
|
113
|
+
>
|
|
114
|
+
<content-product
|
|
115
|
+
v-if="$parentVm.productConfig !== null"
|
|
116
|
+
style="width: 100%; height: 100%"
|
|
117
|
+
:product-config="$parentVm.productConfig"
|
|
118
|
+
:out-spacing="$parentVm.outSpacing"
|
|
119
|
+
:item="item"
|
|
120
|
+
:height="outItemProduct"
|
|
121
|
+
:color="$parentVm.mainColor"
|
|
122
|
+
:brand-color="$parentVm.brandColor"
|
|
123
|
+
:border-radius="$parentVm.imgRradius"
|
|
124
|
+
:cell="type_other"
|
|
125
|
+
@on-product-detail="(product)=>{$parentVm.handleProductDetail(product,dataConfig)}"
|
|
126
|
+
></content-product>
|
|
127
|
+
</view>
|
|
128
|
+
</view>
|
|
129
|
+
</view>
|
|
130
|
+
|
|
131
|
+
</view>
|
|
132
|
+
</view>
|
|
133
|
+
</template>
|
|
134
|
+
|
|
135
|
+
<script>
|
|
136
|
+
import {mapState} from "vuex";
|
|
137
|
+
import SkeletonFilm from "./SkeletonFilm.vue";
|
|
138
|
+
import SkeletonCinema from "./SkeletonCinema.vue";
|
|
139
|
+
import SkeletonShop from "./SkeletonShop.vue";
|
|
140
|
+
import SkeletonProduct from "./SkeletonProduct.vue";
|
|
141
|
+
import ContentFilm from "./ContentFilm.vue";
|
|
142
|
+
import ContentCinema from "./ContentCinema.vue";
|
|
143
|
+
import ContentShop from "./ContentShop.vue";
|
|
144
|
+
import ContentProduct from "./ContentProduct.vue";
|
|
145
|
+
|
|
146
|
+
export default {
|
|
147
|
+
name: "CustomList",
|
|
148
|
+
components: {
|
|
149
|
+
ContentProduct,
|
|
150
|
+
SkeletonProduct,
|
|
151
|
+
SkeletonCinema,
|
|
152
|
+
SkeletonFilm,
|
|
153
|
+
SkeletonShop,
|
|
154
|
+
ContentFilm,
|
|
155
|
+
ContentCinema,
|
|
156
|
+
ContentShop,
|
|
157
|
+
},
|
|
158
|
+
props:{
|
|
159
|
+
keyword:{
|
|
160
|
+
type:String,
|
|
161
|
+
default:'',
|
|
162
|
+
},
|
|
163
|
+
tabId:{
|
|
164
|
+
type:String,
|
|
165
|
+
required:true
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
computed:{
|
|
170
|
+
...mapState({
|
|
171
|
+
stateCity: state => state.cityLocation.city,
|
|
172
|
+
stateLocation: (state) => state.cityLocation.location || {},
|
|
173
|
+
}),
|
|
174
|
+
getParams(){
|
|
175
|
+
let params = {
|
|
176
|
+
search_range: this.search_range,
|
|
177
|
+
page_token: this.page_token,
|
|
178
|
+
page_size: this.page_size,
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
//关键字
|
|
182
|
+
if(this.keyword) params['keyword'] = this.keyword;
|
|
183
|
+
|
|
184
|
+
//设置城市
|
|
185
|
+
if(this.stateCity && this.stateCity.city_code) {
|
|
186
|
+
params['city_code'] = this.stateCity.city_code;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//设置经纬度
|
|
190
|
+
if(this.stateLocation &&
|
|
191
|
+
(this.stateLocation.latitude && this.stateLocation.longitude)
|
|
192
|
+
){
|
|
193
|
+
params['latitude'] = this.stateLocation.latitude;
|
|
194
|
+
params['longitude'] = this.stateLocation.longitude;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return params
|
|
198
|
+
},
|
|
199
|
+
contMarginComp(){
|
|
200
|
+
let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
|
|
201
|
+
str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
|
|
202
|
+
str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
|
|
203
|
+
str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20)}rpx`;
|
|
204
|
+
return str
|
|
205
|
+
},
|
|
206
|
+
outItemProduct(){
|
|
207
|
+
//获取每列元素最大宽度
|
|
208
|
+
let num = (750 - 3 * Number(this.$parentVm.outSpacing))/2;
|
|
209
|
+
num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
|
|
210
|
+
return num - this.$parentVm.contBorderWidth * 2
|
|
211
|
+
},
|
|
212
|
+
heightRpx(){
|
|
213
|
+
let h = 'auto'
|
|
214
|
+
if(this.type_code === 'film') h = '240rpx'
|
|
215
|
+
if(this.type_code === 'cinema') h = 'auto';
|
|
216
|
+
if(this.type_code === 'shop') h = '200rpx';
|
|
217
|
+
return h;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
data(){
|
|
221
|
+
return {
|
|
222
|
+
$parentVm:null,
|
|
223
|
+
parentStatus: false,
|
|
224
|
+
skeletonCount: 6,
|
|
225
|
+
hasNoData: false,
|
|
226
|
+
|
|
227
|
+
page_token:'1',
|
|
228
|
+
page_size: 20,
|
|
229
|
+
|
|
230
|
+
//参数
|
|
231
|
+
type_code:'',
|
|
232
|
+
search_range:'',
|
|
233
|
+
type_other:null,
|
|
234
|
+
is_open_city:'N',
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
//列表数据
|
|
238
|
+
dataList: null,
|
|
239
|
+
timer:null,
|
|
240
|
+
dataConfig: null,
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
//商品两列功能
|
|
244
|
+
productTowList:{
|
|
245
|
+
left:null,
|
|
246
|
+
right:null,
|
|
247
|
+
},
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
watch:{
|
|
252
|
+
keyword(){
|
|
253
|
+
if(this.timer) {
|
|
254
|
+
clearTimeout(this.timer);
|
|
255
|
+
this.timer = null;
|
|
256
|
+
}
|
|
257
|
+
this.timer = setTimeout(()=>{
|
|
258
|
+
this.onCusReloadList();
|
|
259
|
+
},500)
|
|
260
|
+
},
|
|
261
|
+
tabId(){
|
|
262
|
+
this.parseTab()
|
|
263
|
+
this.onCusReloadList();
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
stateCity(n, o){
|
|
267
|
+
if(n && JSON.stringify(n) !== JSON.stringify(o)){
|
|
268
|
+
this.onCusReloadList()
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
created() {
|
|
274
|
+
this.getParentMV();
|
|
275
|
+
this.parseTab();
|
|
276
|
+
this.onCusReloadList();
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
methods:{
|
|
280
|
+
|
|
281
|
+
parseTab(){
|
|
282
|
+
let tabs = this.tabId.split('@');
|
|
283
|
+
this.type_code = tabs[1];
|
|
284
|
+
this.search_range = tabs[0]
|
|
285
|
+
this.is_open_city = tabs[2];
|
|
286
|
+
if(this.type_code === 'product'){
|
|
287
|
+
this.type_other = Number(tabs[3]);
|
|
288
|
+
if(this.type_other === 2) this.skeletonCount = 12
|
|
289
|
+
else this.skeletonCount = 6
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
this.skeletonCount = 6;
|
|
293
|
+
this.type_other = null
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
handleClear(){
|
|
298
|
+
this.is_open_city = 'N';
|
|
299
|
+
this.dataConfig = null;
|
|
300
|
+
this.page_token = '1';
|
|
301
|
+
this.dataList = null;
|
|
302
|
+
this.productTowList = {
|
|
303
|
+
left:null,
|
|
304
|
+
right:null,
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
getParentMV(){
|
|
309
|
+
this.$emit('on-parent-vm', ($vm)=>{
|
|
310
|
+
this.$parentVm = $vm;
|
|
311
|
+
this.parentStatus = true;
|
|
312
|
+
})
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
onCusReachBottom(){
|
|
316
|
+
if(!this.page_token) return false;
|
|
317
|
+
this.getList();
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
//重新加载数据
|
|
321
|
+
onCusReloadList(params ={}){
|
|
322
|
+
this.handleClear();
|
|
323
|
+
this.getList();
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
getList(){
|
|
328
|
+
//无关键字不搜索
|
|
329
|
+
if(this.keyword === '') {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
//this.$xdShowLoading({});
|
|
333
|
+
this.$emit('on-list', {
|
|
334
|
+
params:this.getParams,
|
|
335
|
+
cb:(res)=>{
|
|
336
|
+
|
|
337
|
+
//无数据处理
|
|
338
|
+
if(res === null){
|
|
339
|
+
this.hasNoData = true;
|
|
340
|
+
this.dataList = [];
|
|
341
|
+
this.page_token = ''
|
|
342
|
+
this.$xdHideLoading();
|
|
343
|
+
return
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
//正常数据处理
|
|
347
|
+
this.dataConfig = res;
|
|
348
|
+
|
|
349
|
+
//整理为统一ID
|
|
350
|
+
res.items = res.items.map((item,index)=>{
|
|
351
|
+
if(!item.id){
|
|
352
|
+
item.id = item.product_id || item.resource_shop_id || item.cinema_id
|
|
353
|
+
}
|
|
354
|
+
//item.list_title = `${index} - ${ item.list_title}`
|
|
355
|
+
return item;
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
//商品模式并且为两列功能
|
|
359
|
+
if(this.type_code === 'product' && this.type_other === 2){
|
|
360
|
+
let right = [], left=[];
|
|
361
|
+
res.items.map((item,index) =>{
|
|
362
|
+
item.testiIndex = index
|
|
363
|
+
if(index%2===0) left.push(item);
|
|
364
|
+
else right.push(item);
|
|
365
|
+
})
|
|
366
|
+
this.productTowList = {
|
|
367
|
+
left:(this.productTowList.left ||[]).concat(left),
|
|
368
|
+
right:(this.productTowList.right ||[]).concat(right)
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
this.dataList = (this.dataList||[]).concat(res.items);
|
|
372
|
+
this.page_token = res.next_page_token
|
|
373
|
+
this.hasNoData = false;
|
|
374
|
+
this.$xdHideLoading();
|
|
375
|
+
}
|
|
376
|
+
})
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
</script>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
<style scoped lang="less">
|
|
385
|
+
.productBoxCell2 {
|
|
386
|
+
display: flex;
|
|
387
|
+
justify-content: space-between;
|
|
388
|
+
align-items: center;
|
|
389
|
+
flex-flow: wrap;
|
|
390
|
+
}
|
|
391
|
+
.productItemCell2 {
|
|
392
|
+
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.productBox2 {
|
|
396
|
+
display: flex;
|
|
397
|
+
justify-content: space-between;
|
|
398
|
+
align-items: flex-start;
|
|
399
|
+
flex-flow: wrap;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
</style>
|