jufubao-base 1.0.174-beta1 → 1.0.174-beta10

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.
@@ -1,78 +1,81 @@
1
1
  <template>
2
2
  <view class="search_all_list" >
3
- <view class="module_item" v-for="parent in list" :key="parent.setting_id"
4
- :style="moduleItemStyle"
5
- >
6
- <view class="module_title" :style="moduleItemTitleStyle">{{ parent.name }}</view>
7
- <view v-if="parent.type !== 'product'" class="module_cont">
8
- <view v-for="(item, i) in parent.items" :key="item.key"
9
- class="module_cont_inner"
10
- :style="moduleItemContStyle"
11
- >
12
- <content-cinema v-if="parent.type === 'cinema'"
13
- style="width: 100%; height: 100%"
14
- :keyword="keyword"
15
- :item="item"
16
- :out-spacing="listItemStyle.outSpacing"
17
- :color="{SEAT:listItemStyle.mainColor,CODE:listItemStyle.subMainColor,SELL:listItemStyle.successColor}"
18
- :border-radius="listItemStyle.imgRradius"
19
- :brand-color="listItemStyle.brandColor"
20
- @on-schedule="handleFilmDetail"
21
- @on-cashier-detail="handleCashierDetail"
22
- @on-code-detail="handleCodeDetail"
23
- ></content-cinema>
24
- <content-film v-if="parent.type === 'film'"
25
- type="hot"
26
- style="width: 100%; height: 100%"
27
- :keyword="keyword"
28
- :item="item"
29
- :out-spacing="listItemStyle.outSpacing"
30
- :color="listItemStyle.mainColor"
31
- :border-radius="listItemStyle.imgRradius"
32
- :brand-color="listItemStyle.brandColor"
33
- @on-film-detail="handleFilmDetail"
34
- @on-buy="handleBuy"
35
- ></content-film>
36
- <content-shop v-if="parent.type === 'shop'"
37
- style="width: 100%; height: 100%"
38
- :keyword="keyword"
39
- :item="item"
40
- :out-spacing="listItemStyle.outSpacing"
41
- :color="listItemStyle.mainColor"
42
- :border-radius="listItemStyle.imgRradius"
43
- :brand-color="listItemStyle.brandColor"
44
- :is-echange="'Y' || listItemStyle.isShowExchange"
45
- @on-shop-jhd="handleShopJhd"
46
- @on-shop-detail="handleShopDetail"
47
- ></content-shop>
3
+ <template v-if="!loadingList">
4
+ <view class="module_item" v-for="(parent, pi) in list" :key="parent.setting_id"
5
+ :style="moduleItemStyle"
6
+ >
7
+ <view class="module_title" :style="moduleItemTitleStyle">{{ parent.name }}</view>
8
+ <view v-if="parent.type !== 'product'" class="module_cont">
9
+ <view v-for="(item, i) in parent.items" :key="item.key"
10
+ class="module_cont_inner"
11
+ :style="[moduleItemContStyle]"
12
+ >
13
+ <content-cinema v-if="parent.type === 'cinema'"
14
+ style="width: 100%; height: 100%"
15
+ :keyword="keyword"
16
+ :item="item"
17
+ :out-spacing="listItemStyle.outSpacing"
18
+ :color="{SEAT:listItemStyle.mainColor,CODE:listItemStyle.subMainColor,SELL:listItemStyle.successColor}"
19
+ :border-radius="listItemStyle.imgRradius"
20
+ :brand-color="listItemStyle.brandColor"
21
+ @on-schedule="data => handleSchedule(data, parent)"
22
+ @on-cashier-detail="data => handleCashierDetail(data, parent)"
23
+ @on-code-detail="data => handleCodeDetail(data, parent)"
24
+ ></content-cinema>
25
+ <content-film v-if="parent.type === 'film'"
26
+ type="hot"
27
+ style="width: 100%; height: 100%"
28
+ :keyword="keyword"
29
+ :item="item"
30
+ :out-spacing="listItemStyle.outSpacing"
31
+ :color="listItemStyle.mainColor"
32
+ :border-radius="listItemStyle.imgRradius"
33
+ :brand-color="listItemStyle.brandColor"
34
+ @on-film-detail="data => handleFilmDetail(data, parent)"
35
+ @on-buy="data => handleBuy(data, parent)"
36
+ ></content-film>
37
+ <content-shop v-if="parent.type === 'shop'"
38
+ style="width: 100%; height: 100%"
39
+ :keyword="keyword"
40
+ :item="item"
41
+ :out-spacing="listItemStyle.outSpacing"
42
+ :color="listItemStyle.mainColor"
43
+ :border-radius="listItemStyle.imgRradius"
44
+ :brand-color="listItemStyle.brandColor"
45
+ :is-echange="productConfig.isShowExchange"
46
+ @on-shop-jhd="data => handleShopJhd(data, parent)"
47
+ @on-shop-detail="data => handleShopDetail(data, parent)"
48
+ ></content-shop>
49
+ </view>
48
50
  </view>
49
- </view>
50
- <view v-else class="module_cont product_wrap">
51
- <view v-for="(item, i) in parent.items" :key="item.key"
52
- class="module_cont_inner"
53
- :style="[moduleItemContStyle, {
54
- width: getProductCell(parent.tab) == 2 ? `calc(50% - ${listItemStyle.outSpacing/2}rpx)`: '100%',
55
- }]"
56
- >
57
- <content-product v-if="parent.type === 'product'"
58
- style="width: 100%; height: 100%"
59
- :keyword="keyword"
60
- :item="item"
61
- :height="outItemProduct"
62
- :product-config="productConfig"
63
- :out-spacing="listItemStyle.outSpacing"
64
- :color="listItemStyle.mainColor"
65
- :brand-color="listItemStyle.brandColor"
66
- :border-radius="listItemStyle.imgRradius"
67
- :cell="getProductCell(parent.tab)"
68
- @on-product-detail="handleProductDetail"
69
- ></content-product>
51
+ <view v-else class="module_cont product_wrap">
52
+ <view v-for="(item, i) in parent.items" :key="item.key"
53
+ class="module_cont_inner"
54
+ :style="[moduleItemContStyle, {
55
+ width: getProductCell(parent.tab) == 2 ? `calc(50% - ${listItemStyle.outSpacing/2}rpx)`: '100%',
56
+ }]"
57
+ >
58
+ <content-product v-if="parent.type === 'product'"
59
+ style="width: 100%; height: 100%"
60
+ :keyword="keyword"
61
+ :item="item"
62
+ :height="outItemProduct"
63
+ :product-config="productConfig"
64
+ :out-spacing="listItemStyle.outSpacing"
65
+ :color="listItemStyle.mainColor"
66
+ :brand-color="listItemStyle.brandColor"
67
+ :border-radius="listItemStyle.imgRradius"
68
+ :cell="getProductCell(parent.tab)"
69
+ @on-product-detail="data => handleProductDetail(data, parent)"
70
+ ></content-product>
71
+ </view>
72
+ </view>
73
+ <view class="module_more">
74
+ <view class="more_inner" :style="moduleMoreStyle" @click="switchMenu(pi)">查看全部</view>
70
75
  </view>
71
76
  </view>
72
- <view class="module_more">
73
- <view class="more_inner" :style="moduleMoreStyle" @click="switchMenu(parent)">查看全部</view>
74
- </view>
75
- </view>
77
+ <xd-no-data v-if="list && list.length ===0" height="60vh" icon-type="search">商品正在上架中</xd-no-data>
78
+ </template>
76
79
  </view>
77
80
  </template>
78
81
 
@@ -82,13 +85,15 @@
82
85
  import ContentShop from "./ContentShop.vue"
83
86
  import ContentProduct from "./ContentProduct.vue"
84
87
  import {mapState} from "vuex";
88
+ import XdNoData from "@/components/XdNoData/XdNoData"
85
89
  export default{
86
90
  name: "SearchAllList",
87
91
  components: {
88
92
  ContentCinema,
89
93
  ContentFilm,
90
94
  ContentShop,
91
- ContentProduct
95
+ ContentProduct,
96
+ XdNoData,
92
97
  },
93
98
  props: {
94
99
  keyword:{
@@ -152,19 +157,19 @@
152
157
  },
153
158
  moduleItemContStyle(){
154
159
  const { contBgColor, contShadow, contBorder, contMargin, contRradius, outSpacing } = this.listItemStyle;
155
-
160
+
156
161
  let padding = `${this.checkValue(contMargin.top, 20)}rpx`;
157
162
  padding = `${padding} ${this.checkValue(contMargin.right, 20)}rpx`;
158
163
  padding = `${padding} ${this.checkValue(contMargin.bottom, 20)}rpx`;
159
164
  padding = `${padding} ${this.checkValue(contMargin.left, 20)}rpx`;
160
- return this.styleObjectToString({
165
+ return {
161
166
  padding: padding,
162
167
  border: contBorder,
163
168
  borderRadius: contRradius + 'rpx',
164
169
  boxShadow: contShadow,
165
170
  marginBottom: outSpacing + 'rpx',
166
171
  background: contBgColor,
167
- })
172
+ }
168
173
  },
169
174
  moduleMoreStyle(){
170
175
  const { allModuleMoreStyle } = this.allStyle;
@@ -202,11 +207,13 @@
202
207
  getParent:null,
203
208
  $parentVm:null,
204
209
  parentStatus: false,
210
+ loadingList: true,
205
211
 
206
212
  list: [],
207
213
  }
208
214
  },
209
215
  created(){
216
+ this.loadingList = true;
210
217
  this.getParentMV();
211
218
  this.getList();
212
219
  },
@@ -243,6 +250,7 @@
243
250
  this.$emit('on-list', {
244
251
  params: params,
245
252
  cb:(list)=>{
253
+ this.loadingList = false;
246
254
  this.list = (list || []).map(parent => {
247
255
  parent.items = parent.items.map(item => {
248
256
  item['key'] = item.product_id || item.resource_shop_id || item.cinema_id || item.film_id;
@@ -254,41 +262,43 @@
254
262
  }
255
263
  })
256
264
  },
257
- switchMenu(item){
265
+ switchMenu(index){
266
+ let item = this.list[index];
267
+ // console.log('switchMenu', item, pi);
258
268
  this.$emit('on-switch', {...item, value: item.tab});
259
269
  },
260
270
 
261
271
 
262
272
  //影片
263
- handleFilmDetail(film){
264
- this.getParent().handleFilmDetail(film, this.dataConfig)
273
+ handleFilmDetail(film, dataConfig){
274
+ this.getParent().handleFilmDetail(film, dataConfig)
265
275
  },
266
- handleBuy(film){
267
- this.getParent().handleBuy(film, this.dataConfig)
276
+ handleBuy(film, dataConfig){
277
+ this.getParent().handleBuy(film, dataConfig)
268
278
  },
269
279
 
270
280
  //影院
271
- handleSchedule(cinema){
272
- this.getParent().handleSchedule(cinema, this.dataConfig)
281
+ handleSchedule(cinema, dataConfig){
282
+ this.getParent().handleSchedule(cinema, dataConfig)
273
283
  },
274
- handleCashierDetail(cinema){
275
- this.getParent().handleCashierDetail(cinema, this.dataConfig)
284
+ handleCashierDetail(cinema, dataConfig){
285
+ this.getParent().handleCashierDetail(cinema, dataConfig)
276
286
  },
277
- handleCodeDetail(cinema){
278
- this.getParent().handleCodeDetail(cinema, this.dataConfig)
287
+ handleCodeDetail(cinema, dataConfig){
288
+ this.getParent().handleCodeDetail(cinema, dataConfig)
279
289
  },
280
290
 
281
291
  //门店
282
- handleShopJhd(shop){
283
- this.getParent().handleShopJhd(shop, this.dataConfig)
292
+ handleShopJhd(shop, dataConfig){
293
+ this.getParent().handleShopJhd(shop, dataConfig)
284
294
  },
285
- handleShopDetail(shop){
286
- this.getParent().handleShopDetail(shop, this.dataConfig)
295
+ handleShopDetail(shop, dataConfig){
296
+ this.getParent().handleShopDetail(shop, dataConfig)
287
297
  },
288
298
 
289
299
  //商品
290
- handleProductDetail(product){
291
- this.getParent().handleProductDetail(product, this.dataConfig)
300
+ handleProductDetail(product, dataConfig){
301
+ this.getParent().handleProductDetail(product, dataConfig)
292
302
  },
293
303
  }
294
304
  }
@@ -114,6 +114,8 @@
114
114
  margin-bottom: 20rpx;
115
115
  color: #333;
116
116
  font-weight: 500;
117
+ word-wrap: break-word;
118
+ word-break: break-all;
117
119
  }
118
120
  .address {
119
121
  font-size: 24rpx;
@@ -9,7 +9,7 @@
9
9
  </view>
10
10
  <view class="middle">
11
11
  <view class="top">
12
- <view class="name">{{item['show_name']}}</view>
12
+ <view class="name" v-html="cusName"></view>
13
13
  <view class="score">
14
14
  <template v-if="item['remark']">
15
15
  <text>评分:</text><text :style="{color:color}">{{item['remark']}}</text>
@@ -61,12 +61,17 @@
61
61
 
62
62
  <script>
63
63
  import XdButton from "@/components/XdButton/XdButton.vue";
64
+ import handleKeyword from "./handleKeyword";
64
65
  export default {
65
66
  name:'ContentItem',
66
67
  components:{
67
68
  XdButton
68
69
  },
69
70
  props:{
71
+ keyword:{
72
+ type:String,
73
+ default:''
74
+ },
70
75
  item:Object,
71
76
  outSpacing: {
72
77
  type: Number|String,
@@ -86,6 +91,11 @@
86
91
  }
87
92
 
88
93
  },
94
+ computed:{
95
+ cusName(){
96
+ return handleKeyword(this, this.item['show_name'], this.keyword)
97
+ },
98
+ },
89
99
  data(){
90
100
  return {
91
101
  errorImage: 'https://img.jufubao.cn/common/error_movie.png?v20',
@@ -100,12 +110,12 @@
100
110
  this.errorStatus = true;
101
111
  },
102
112
  handleDetail(item){
103
- console.log('handleDetail.item',item,item.id);
104
- this.$emit('on-film-detail',item.id);
113
+ console.log('handleDetail.item',item,item);
114
+ this.$emit('on-film-detail',item);
105
115
  },
106
116
  handleBuy(item){
107
- console.log('handleDetail.item',item,item.id);
108
- this.$emit('on-buy',item.id);
117
+ console.log('handleDetail.item',item,item);
118
+ this.$emit('on-buy',item);
109
119
  }
110
120
  }
111
121
  }
@@ -143,6 +153,8 @@
143
153
  font-weight: 600;
144
154
  .uni-max-cut(2, 90);
145
155
  line-height: 45rpx;
156
+ word-wrap: break-word;
157
+ word-break: break-all;
146
158
  }
147
159
  & >view:nth-child(2) {
148
160
  flex-shrink: 0;
@@ -10,13 +10,15 @@
10
10
  borderRadius: borderRadius + 'rpx',
11
11
  }"
12
12
  >
13
- <image :src="imageUrl" :alt="item['product_name']"></image>
13
+ <image v-if="errorStatus" :src="errorImage" :alt="item['product_name']" ></image>
14
+ <image v-if="!errorStatus" :src="imageUrl" :alt="item['product_name']" @error="handleError()"></image>
15
+ <xd-product-status :status="item['status']"></xd-product-status>
14
16
  </view>
15
17
  <view class="prodcut-content" :style="{marginTop:cell === 1? 0: (outSpacing + 'rpx') }">
16
18
  <view class="prodcut-content-info">
17
19
  <view class="name" v-html="cusName" :class="{showOne: isOne}"></view>
18
20
  <view class="brand" v-if="productConfig.is_show_brand==='Y'" :style="{color:brandColor}">{{item['brand_name']}}</view>
19
- <view class="tags" v-if="productConfig.isShowTag === 'Y'">
21
+ <view class="tags" :class="{showTwo:!isOne}" v-if="productConfig.isShowTag === 'Y'">
20
22
  <view
21
23
  v-for="tag in tagsList"
22
24
  :key="tag"
@@ -64,13 +66,15 @@
64
66
  import handleKeyword from "./handleKeyword";
65
67
  import getServiceUrl from "@/common/getServiceUrl";
66
68
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon.vue";
69
+ import XdProductStatus from "@/components/XdProductStatus/XdProductStatus";
67
70
  import XdUnit from "@/components/XdUnit/XdUnit.vue";
68
71
 
69
72
  export default {
70
73
  name: "ContentProduct",
71
74
  components:{
72
75
  XdFontIcon,
73
- XdUnit
76
+ XdUnit,
77
+ XdProductStatus
74
78
  },
75
79
  props:{
76
80
  keyword:{
@@ -153,7 +157,9 @@ export default {
153
157
  data(){
154
158
  return {
155
159
  tagObj: null,
156
- tagObjColor: null
160
+ tagObjColor: null,
161
+ errorStatus: false,
162
+ errorImage:'https://img0.jufubao.cn/common/empty/product.png?v1=1',
157
163
  }
158
164
  },
159
165
  created() {
@@ -161,10 +167,11 @@ export default {
161
167
  this.tagObjColor = this.$colorConfig.productTagsColor;
162
168
  },
163
169
  methods:{
170
+ handleError(){
171
+ this.errorStatus = true;
172
+ },
164
173
  handleDetail(){
165
- if(this.item.status === 'ok') {
166
- this.$emit('on-product-detail', this.item);
167
- }
174
+ this.$emit('on-product-detail', this.item);
168
175
  }
169
176
  }
170
177
  }
@@ -182,6 +189,7 @@ export default {
182
189
 
183
190
  .prodcut-image {
184
191
  flex-shrink: 0;
192
+ position: relative;
185
193
  }
186
194
 
187
195
  .prodcut-content {
@@ -200,6 +208,7 @@ export default {
200
208
  display: flex;
201
209
  justify-content: center;
202
210
  align-items: center;
211
+ position: relative;
203
212
  & > image {
204
213
  height: 100%;
205
214
  width: 100%;
@@ -217,6 +226,7 @@ export default {
217
226
  }
218
227
 
219
228
  &-content {
229
+ overflow: hidden;
220
230
  &-info {
221
231
 
222
232
  }
@@ -274,6 +284,13 @@ export default {
274
284
  margin-bottom: 10rpx;
275
285
  line-height: 40rpx;
276
286
  .uni-max-cut(2,80);
287
+ word-wrap: break-word;
288
+ word-break: break-all;
289
+
290
+ & > text {
291
+ display: inline-block;
292
+
293
+ }
277
294
 
278
295
  &.showOne {
279
296
  .uni-max-cut(1,40);
@@ -295,6 +312,13 @@ export default {
295
312
  margin-bottom: 10rpx;
296
313
  flex-flow: wrap;
297
314
 
315
+ &.showTwo {
316
+ & > view{
317
+ &:nth-child(4),&:nth-child(5),&:nth-child(6){
318
+ margin-top: 8rpx;
319
+ }
320
+ }
321
+ }
298
322
  & > view {
299
323
  padding: 0 14rpx;
300
324
  height: 32rpx;
@@ -307,11 +331,10 @@ export default {
307
331
  &:last-child {
308
332
  margin-right: 0;
309
333
  }
310
- &:nth-child(4),&:nth-child(5),&:nth-child(6){
311
- margin-top: 8rpx;
312
- }
334
+
313
335
  }
314
336
  }
337
+
315
338
  }
316
339
  }
317
340
  </style>
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <view class="content-item" @click="handleDetail(item)">
3
3
  <view class="content-item-image" :style="{marginRight:outSpacing+'rpx',borderRadius:borderRadius+'rpx'}">
4
- <image :src="imageUrl" :alt="item['resource_shop_name']"></image>
4
+ <image v-if="errorStatus" :src="errorImage" :alt="item['resource_shop_name']" ></image>
5
+ <image v-if="!errorStatus" :src="imageUrl+1" :alt="item['resource_shop_name']" @error="handleError()"></image>
5
6
  </view>
6
7
  <view class="content-item-cont">
7
8
  <view class="title">
@@ -77,11 +78,20 @@ export default {
77
78
  return `${sy}${this.item.address}`;
78
79
  },
79
80
  },
81
+ data(){
82
+ return {
83
+ errorStatus: false,
84
+ errorImage:'https://img0.jufubao.cn/common/empty/shop.png?v1=1',
85
+ }
86
+ },
80
87
  created() {
81
88
  // console.log(this.item)
82
89
  // debugger
83
90
  },
84
91
  methods:{
92
+ handleError(){
93
+ this.errorStatus = true;
94
+ },
85
95
  handleJhd(item){
86
96
  this.$emit('on-shop-jhd',item);
87
97
  },
@@ -128,6 +138,8 @@ export default {
128
138
  font-weight: 500;
129
139
  .uni-max-cut(2,80);
130
140
  line-height: 40rpx;
141
+ word-wrap: break-word;
142
+ word-break: break-all;
131
143
 
132
144
  &.one {
133
145
  .uni-max-cut(1,40);
@@ -70,14 +70,14 @@
70
70
  @on-code-detail="handleCodeDetail"
71
71
  ></content-cinema>
72
72
  <content-shop
73
- v-if="type_code === 'shop'"
73
+ v-if="productConfig !== null && type_code === 'shop'"
74
74
  style="width: 100%; height: 100%"
75
75
  :keyword="keyword"
76
76
  :out-spacing="listItemStyle.outSpacing"
77
77
  :item="item"
78
78
  :color="listItemStyle.mainColor"
79
79
  :border-radius="listItemStyle.imgRradius"
80
- :is-echange="listItemStyle.isShowExchange"
80
+ :is-echange="productConfig.isShowExchange"
81
81
  @on-shop-jhd="handleShopJhd"
82
82
  @on-shop-detail="handleShopDetail"
83
83
  ></content-shop>
@@ -94,7 +94,9 @@
94
94
  :cell="type_other"
95
95
  @on-product-detail="handleProductDetail"
96
96
  ></content-product>
97
+
97
98
  </view>
99
+ <view class="hasNoData" v-if="dataList && dataList.length > 0 && page_token === ''">已经到底没有更多数据了</view>
98
100
  </template>
99
101
  <view v-else class="productBox2">
100
102
  <view v-for="(value, listKey) in productTowList" :key="listKey">
@@ -130,6 +132,7 @@
130
132
  ></content-product>
131
133
  </view>
132
134
  </view>
135
+ <view class="hasNoData" v-if="dataList && dataList.length > 0 && page_token === ''">已经到底没有更多数据了</view>
133
136
  </view>
134
137
  </view>
135
138
  </view>
@@ -226,7 +229,7 @@ export default {
226
229
  let h = 'auto'
227
230
  if(this.type_code === 'film') h = '240rpx'
228
231
  if(this.type_code === 'cinema') h = 'auto';
229
- if(this.type_code === 'shop') h = '200rpx';
232
+ if(this.type_code === 'shop') h = '220rpx';
230
233
  return h;
231
234
  }
232
235
  },
@@ -239,7 +242,7 @@ export default {
239
242
  hasNoData: false,
240
243
 
241
244
  page_token:'1',
242
- page_size: 20,
245
+ page_size: 10,
243
246
 
244
247
  //参数
245
248
  type_code:'',
@@ -360,8 +363,16 @@ export default {
360
363
  return
361
364
  }
362
365
 
366
+ // res.items = res.items.map(item=>{
367
+ // if(item.market_tags) {
368
+ // item.market_tags = ['flashsale','hot','new', 'rec']
369
+ // }
370
+ // return item
371
+ // });
372
+
363
373
  //正常数据处理
364
- this.dataConfig = res;
374
+ this.dataConfig = res
375
+
365
376
 
366
377
  //整理为统一ID
367
378
  res.items = res.items.map((item,index)=>{
@@ -450,4 +461,15 @@ export default {
450
461
  flex-flow: wrap;
451
462
  }
452
463
 
464
+ .hasNoData {
465
+ height: 80rpx;
466
+ line-height: 80rpx;
467
+ font-size: 24rpx;
468
+ text-align: center;
469
+ color: #ccc;
470
+ background-color: rgba(255, 255, 255, .05);
471
+ margin: 20rpx 0;
472
+ width: 100%;
473
+ }
474
+
453
475
  </style>