jufubao-mall 2.0.32 → 2.0.34

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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/components/CusCouponChose/CusCouponChose.vue +10 -13
  3. package/src/components/CusEnter/CusEnter.vue +9 -1
  4. package/src/components/CusListItem/CusListItem.vue +141 -0
  5. package/src/components/CusPoster/CusPoster.vue +17 -62
  6. package/src/components/CusPrice/CusPrice.vue +391 -0
  7. package/src/components/CusProduct/CusProduct.vue +576 -184
  8. package/src/components/CusShops/CusShops.vue +409 -209
  9. package/src/components/CusTab/CusTab.vue +159 -22
  10. package/src/components/CusVipList/CusVipList.vue +169 -0
  11. package/src/components/JfbMallConfirm/Api.js +1 -1
  12. package/src/components/JfbMallConfirm/Attr.js +167 -453
  13. package/src/components/JfbMallConfirm/JfbMallConfirm.vue +362 -162
  14. package/src/components/JfbMallConfirm/Mock.js +61 -43
  15. package/src/components/JfbMallConfirm/XdAddrDefault.vue +26 -13
  16. package/src/components/JfbMallConfirm/XdAddrOld.vue +9 -7
  17. package/src/components/JfbMallConfirm/XdListItem.vue +10 -2
  18. package/src/components/JfbMallConfirm/cusAttr/advanced.js +91 -0
  19. package/src/components/JfbMallConfirm/cusAttr/content.js +355 -0
  20. package/src/components/JfbMallConfirm/cusAttr/style.js +628 -0
  21. package/src/components/JfbMallConfirm/shopList.vue +84 -42
  22. package/src/components/JfbMallNetworkMedia/Api.js +94 -0
  23. package/src/components/JfbMallNetworkMedia/Attr.js +20 -0
  24. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMedia.vue +1167 -0
  25. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMediaLess.less +80 -0
  26. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMediaMixin.js +30 -0
  27. package/src/components/JfbMallNetworkMedia/Mock.js +372 -0
  28. package/src/components/JfbMallNetworkMedia/cusAttr/advanced.js +60 -0
  29. package/src/components/JfbMallNetworkMedia/cusAttr/content.js +230 -0
  30. package/src/components/JfbMallNetworkMedia/cusAttr/font.js +123 -0
  31. package/src/components/JfbMallNetworkMedia/cusAttr/icon.js +257 -0
  32. package/src/components/JfbMallNetworkMedia/cusAttr/style.js +12 -0
  33. package/src/components/JfbMallProductInfo/cusAttr/content.js +2 -0
  34. package/src/components/JfbMallProductList/JfbMallProductList.vue +7 -1
  35. package/src/components/JfbMallProductList/XdCateV1.vue +0 -1
  36. package/src/components/JfbMallShop/JfbMallShop.vue +1 -1
  37. package/src/components/JfbMallShop/cusAttr/content.js +1 -1
  38. package/src/components/SkeProduct/SkeProduct.vue +88 -3
@@ -1,12 +1,20 @@
1
1
  <template>
2
- <view class="product" :class="{two: cell >= 2 , one: cell === 1}" @click="handleDetail()">
2
+ <view
3
+ class="product"
4
+ :class="{
5
+ two: cell >= 2 ,
6
+ one: (cell === 1 && columnOneLayout === 'H'),
7
+ oneV: (cell === 1 && columnOneLayout === 'V')
8
+ }"
9
+ @click="handleDetail()"
10
+ >
3
11
  <view
4
12
  class="product-image"
5
13
  :style="{
6
14
  marginRight: (cell === 1 ? (cellSpacing + 'rpx'):0),
7
- marginBottom: (cell === 1 ? 0: (cellSpacing + 'rpx')),
8
- width: (cell === 1 ? '200rpx': '100%'),
9
- height: (cell === 1 ? '200rpx': (height + 'rpx')),
15
+ marginBottom: (cell === 1&& columnOneLayout ==='H' ? 0: (cellSpacing + 'rpx')),
16
+ width: (cell === 1 ? '240rpx': '100%'),
17
+ height: (cell === 1 && columnOneLayout ==='H' ? '240rpx': (height + 'rpx')),
10
18
  backgroundColor: '#f8f8f8',
11
19
  borderRadius: imageRadius + 'rpx',
12
20
  }"
@@ -14,54 +22,75 @@
14
22
  <image v-if="errorStatus" :src="errorImage" :alt="item['product_name']" ></image>
15
23
  <image v-if="!errorStatus" :src="imageUrl" :alt="item['product_name']" @error="handleError(item)"></image>
16
24
  <xd-product-status :status="item['status']"></xd-product-status>
25
+ <view class="tagL" :style="[imgLs.length?imgLs[0]['css']:{},{top:imageRadius + 'rpx'}]" v-if="imgLs.length">{{imgLs[0].label}}</view>
26
+ <view class="tagR" :style="[imgRs.length?imgRs[0]['css']:{},{top:imageRadius + 'rpx'}]" v-if="imgRs.length">{{imgRs[0].label}}</view>
17
27
  </view>
18
28
  <view class="product-content">
19
29
  <view class="product-content-info">
20
-
21
- <view class="name" :style="[nameFont]" v-html="cusName" :class="{showOne: isOne}"></view>
22
30
  <view
23
- class="brand"
24
- v-if="productConfig.is_show_brand==='Y'"
25
- :style="{color:brandColor}"
26
- >{{item['brand_name']}}</view>
27
- <view class="tags" :class="{showTwo:!isOne}">
28
- <view
29
- v-for="tag in tagsList"
30
- :key="tag"
31
- :style="{background:tagObjColor[tag]}"
32
- >{{tagObj[tag]}}</view>
31
+ v-if="cell === 3"
32
+ class="name showThree"
33
+ :style="[nameFontComp,cutStringComp]"
34
+ >
35
+ <view class="nameTags" v-if="beTitles.length > 0">
36
+ <view :key="beTitle.label" :style="[beTitle.css,cusTagComp]" v-for="beTitle in beTitles">{{beTitle.label}}</view>
37
+ </view>
38
+ <view class="nameCont" :style="{fontSize:columnOneLayout !=='H'?'32rpx': '28rpx'}">{{cusName}}</view>
33
39
  </view>
34
- <view class="_tag" v-for="(item,index) in item.postage_tags" :key="index">{{ item }}</view>
35
- </view>
36
- <view class="product-content-btn" v-if="isBtn">
37
- <view :class="{onePrice: onePrice }">
38
- <view v-if="productConfig.isPrice === 'Y'">
39
- <xd-unit
40
- :price="(item['promo_price'] || item['sale_price'])"
41
- :isOld="false"
42
- :iconSize="cell <= 2?0.3:0.26"
43
- :fontSize="cell <= 2?36:26"
44
- />
40
+ <view
41
+ v-else
42
+ class="name"
43
+ :style="[nameFontComp,cutStringComp]"
44
+ :class="{showOne: isOne}"
45
+ >
46
+ <view class="nameTags" :style="{verticalAlign:columnOneLayout ==='V'?'middle':'top'}" v-if="beTitles.length > 0">
47
+ <view :key="beTitle.label" :style="[beTitle.css,cusTagComp]" v-for="beTitle in beTitles">{{beTitle.label}}</view>
45
48
  </view>
49
+ <view class="nameCont" :style="{fontSize:columnOneLayout !=='H'?'32rpx': '28rpx'}">{{cusName}}</view>
50
+ </view>
51
+ <view class="brandBox" v-if="productConfig.is_show_brand==='Y' || params.length > 0">
46
52
  <view
47
- v-if="productConfig.isShowDiscount==='Y' && checkDiscountPrice"
48
- :style="{color:oldPriceColor}" class="oldPrice">
49
- <xd-unit
50
- :price="dividePrice"
51
- :iconSize="0.21"
52
- :fontSize="cell <= 2?24:22"
53
- delete-line
54
- is-gray
55
- />
56
- </view>
53
+ class="brand"
54
+ v-if="productConfig.is_show_brand==='Y'"
55
+ :style="[brandStyle]"
56
+ >{{item['brand_name']}}</view>
57
+ <template v-for="(param,pIndex) in params">
58
+ <view v-if="productConfig.is_show_brand==='Y' || pIndex >= 1" class="brand" :style="[param.css,{padding: '0 6rpx',fontSize: '20rpx'}]">|</view>
59
+ <view class="brand" :style="[param.css]">{{param.label}}</view>
60
+ </template>
61
+ </view>
62
+ <view
63
+ v-if="tags.length > 0"
64
+ class="tags"
65
+ :class="{showTwo:!isOne, showThree: cell === 3}"
66
+ :style="[showThreeTagsStyle]"
67
+ >
68
+ <view
69
+ v-for="(tag,index) in tags"
70
+ :key="index"
71
+ class="_tag"
72
+ :style="[tag.css]"
73
+ >{{tag.label}}</view>
74
+
75
+ </view>
76
+ </view>
77
+ <view class="product-content-btn" v-if="isBtn" :class="{twoThree: isBtnHasMarginTop}">
78
+ <view :class="{onePrice: onePrice, showThree: isPriceTwoRow }">
79
+ <CusPrice v-if="productConfig.isPrice === 'Y'" :type="priceType" :isPlus="isPlus" :key="priceKey" :showPrice="showPriceComp"></CusPrice>
57
80
  </view>
58
- <view>
59
- <view @click.stop="handleDetail('Y')" v-if="productConfig.isAddCart === 'Y'">
81
+ <view
82
+ :class="{'cart-btn-auto': !isIcon}"
83
+ :style="{height:cartSize+'rpx', width: cartSize + 'rpx',position:'absolute',right:0,bottom:'4rpx',zIndex: 300}"
84
+ v-if="isShowCart && colorComp"
85
+ >
86
+ <view @click.stop="handleDetail('Y')">
60
87
  <xd-font-icon
61
- icon="icongouwuche-01"
62
- :color="color"
63
- size="40"
88
+ v-if="isIcon"
89
+ :icon="cartIcon"
90
+ :color="colorComp"
91
+ :size="cartSize"
64
92
  ></xd-font-icon>
93
+ <view v-else :style="[{color: colorComp},iconStyleComp,cartTextSize]" class="cart-btn">{{productConfig.cartName}}</view>
65
94
  </view>
66
95
  </view>
67
96
  </view>
@@ -74,20 +103,30 @@ import getServiceUrl from "@/common/getServiceUrl";
74
103
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon.vue";
75
104
  import XdProductStatus from "@/components/XdProductStatus/XdProductStatus";
76
105
  import XdUnit from "@/components/XdUnit/XdUnit.vue";
77
-
106
+ import Color from "color";
107
+ import CusPrice from '@/components/CusPrice/CusPrice.vue'
108
+ import {getParentsStyles} from "@/utils/xd.base";
109
+ import mpLoadingGVarMixins from "@/mixins/mpLoadingGVarMixins";
78
110
 
79
111
  export default {
80
112
  name: "CusProduct",
81
113
  components:{
82
114
  XdFontIcon,
83
115
  XdUnit,
84
- XdProductStatus
116
+ XdProductStatus,
117
+ CusPrice
85
118
  },
119
+ mixins:[mpLoadingGVarMixins],
86
120
  props:{
87
121
  keyword:{
88
122
  type:String,
89
123
  default:''
90
124
  },
125
+ //一列(水平/垂直)布局
126
+ columnOneLayout:{
127
+ type:String,
128
+ default:'H'
129
+ },
91
130
  nameFont: {
92
131
  type:Object,
93
132
  default(){
@@ -105,16 +144,12 @@ export default {
105
144
  type: Number|String,
106
145
  default: 20
107
146
  },
108
- rowSpacing: {
109
- type: Number|String,
110
- default: 20
111
- },
112
147
  color:{
113
148
  type:String,
114
- default:'red',
149
+ default:'',
115
150
  },
116
151
  brandColor:{
117
- type: String,
152
+ type: String|Object,
118
153
  default: '#999'
119
154
  },
120
155
  oldPriceColor: {
@@ -133,8 +168,138 @@ export default {
133
168
  type:Object|null,
134
169
  default: null
135
170
  },
171
+ isPlus: {
172
+ type: Boolean,
173
+ default: false
174
+ },
136
175
  },
137
176
  computed:{
177
+ cutStringComp(){
178
+ return this.$root.getCutString(this.cell === 3?1:2, this.columnOneLayout !=='H'?32: 28)
179
+ },
180
+ nameFontComp(){
181
+ if(this.$xdUniHelper.isEmpty(this.nameFont)) return {
182
+ color: '#333',
183
+ fontWeight: '500',
184
+
185
+ };
186
+ return {
187
+ color: this.nameFont.color || '#333',
188
+ fontWeight: this.nameFont.fontWeight || '500',
189
+ }
190
+ },
191
+ isBtnHasMarginTop(){
192
+ return !(this.tags.length > 0 || (this.productConfig.is_show_brand === 'Y' || this.params.length > 0));
193
+ },
194
+ showPriceComp(){
195
+ if(this.$configProject['isPreview']) {
196
+ if(this.isPlus) return this.item['show_prices'];
197
+ else {
198
+ return this.item['show_prices'].map(it=>{
199
+ if(it.p > 1000000) it.p = Math.floor(this.$xdUniHelper.divisionFloatNumber(it.p, 10));
200
+ return it
201
+ })
202
+ }
203
+ }
204
+ else return this.item['show_prices']
205
+ },
206
+ isShowCart(){
207
+ if(this.productConfig.isAddCart === 'N') return false;
208
+ else if(this.productConfig.isAddCart === 'Y') {
209
+ return !(this.cell === 3 && this.isPlus);
210
+ }else {
211
+ return false
212
+ }
213
+ },
214
+ cusTagComp(){
215
+ //debugger
216
+ if(this.cell === 1 && this.columnOneLayout !== 'H') {
217
+ return {
218
+ padding: '0 16rpx',
219
+ borderRadius: '12rpx',
220
+ fontSize: '28rpx',
221
+ }
222
+ }
223
+ return {
224
+ padding: '0 16rpx',
225
+ }
226
+ },
227
+ cartSize(){
228
+ let size = '52'
229
+ if(this.cell === 1) {
230
+ if(this.columnOneLayout === 'H') size = '52'
231
+ else size = '64'
232
+ }
233
+ if(this.cell === 3) size = '40'
234
+ return size
235
+ },
236
+ cartTextSize(){
237
+ let size = '24rpx'
238
+ let lh = '44rpx'
239
+ let padding = '0 16rpx 0rpx';
240
+
241
+ if(this.cell === 1) {
242
+ if(this.columnOneLayout === 'H'){
243
+ lh = '44rpx'
244
+ size = '24rpx'
245
+ padding = '0 20rpx 0'
246
+ }
247
+ else {
248
+ size = '32rpx'
249
+ lh = '64rpx'
250
+ padding = '0 32rpx 0'
251
+ }
252
+ }
253
+ return {
254
+ fontSize:size,
255
+ lineHeight: lh,
256
+ padding,
257
+ }
258
+ },
259
+ brandStyle(){
260
+ if(typeof this.brandColor === 'string') return {color:this.brandColor}
261
+ else {
262
+ let isBgColor = true;
263
+ let isBorColor = true;
264
+
265
+ if(!this.brandColor.bgColor ||
266
+ (this.brandColor.bgColor && Color(this.brandColor.bgColor).toString() === 'rgba(0, 0, 0, 0)')
267
+ ) isBgColor = false;
268
+ if(!this.brandColor.borderColor ||
269
+ (this.brandColor.borderColor && Color(this.brandColor.borderColor).toString() === 'rgba(0, 0, 0, 0)')
270
+ ) isBorColor = false;
271
+
272
+ let padding = '0';
273
+ let bgColor = 'rgb(0, 0, 0, 0)';
274
+ let border = '0';
275
+ let borderRadius = 0
276
+ let marginTop = 0;
277
+ if(isBgColor || isBorColor){
278
+ padding = '0 10rpx';
279
+ borderRadius = '10rpx'
280
+ if(isBgColor) bgColor = this.brandColor.bgColor;
281
+ if(isBorColor){
282
+ border = `2rpx solid ${this.brandColor.borderColor}`;
283
+ }
284
+ }
285
+ return {
286
+ border: border,
287
+ backgroundColor: bgColor,
288
+ color: this.brandColor.color,
289
+ padding,
290
+ borderRadius,
291
+ marginTop
292
+ }
293
+ }
294
+ },
295
+ isPriceTwoRow(){
296
+ if(this.cell === 3) {
297
+ if(this.productConfig.isPrice === 'N') return false;
298
+ else if(this.productConfig.isShowDiscount === 'N') return false
299
+ return true;
300
+ }
301
+ return false
302
+ },
138
303
  onePrice(){
139
304
  if(this.cell === 1) return true;
140
305
  if(this.cell === 3) return false;
@@ -149,7 +314,7 @@ export default {
149
314
  },
150
315
  isOne(){
151
316
  let status = false;
152
- if(this.cell === 1) status = false
317
+ if(this.cell === 1 && this.columnOneLayout ==='H') status = false
153
318
  return status
154
319
  },
155
320
  isBtn(){
@@ -158,26 +323,74 @@ export default {
158
323
  dividePrice() {
159
324
  return this.$xdUniHelper.divisionFloatNumber(this.item.market_price, 100);
160
325
  },
161
-
162
- checkDiscountPrice() {
163
- if(this.productConfig.isPrice === 'N') return false
164
- if (this.productConfig.isShowDiscount === 'Y') {
165
- let price = Number(this.item.market_price) - Number(this.item.sale_price);
166
- return this.$xdUniHelper.divisionFloatNumber(price,100) > Number(this.productConfig.differ);
326
+ colorComp(){
327
+ return this.color || this.mainColor
328
+ },
329
+ showThreeTagsStyle() {
330
+ if(this.cell === 3) {
331
+ return {height:'40rpx'}
167
332
  }
168
- return false
333
+ return {}
169
334
  },
170
-
171
- tagsList(){
172
- return (this.item['market_tags']||[]).filter(tag=>{
173
- if(tag === 'flashsale') {
174
- return this.productConfig.showActivityPrice === 'Y'
335
+ priceType(){
336
+ if(this.cell === 3) return 'three'
337
+ if(this.cell === 2) return 'two'
338
+ if(this.cell === 1) return 'one'
339
+ },
340
+ cartIcon(){
341
+ return this.productConfig.cartIcon || 'icongouwuche-01';
342
+ },
343
+ isIcon(){
344
+ return this.cartIcon.indexOf('btn_cart') === -1
345
+ },
346
+ iconStyleComp(){
347
+ if(this.isIcon === false){
348
+ let css = this.cartIcon.split('_')[1];
349
+ let bgColor ='#fff', border = 0, radius = 0, color = this.color || this.m;
350
+ switch (css) {
351
+ case 'cartFPlain':
352
+ border = `1px solid ${color}`;
353
+ break;
354
+ case 'cartFFull':
355
+ color = '#fff'
356
+ bgColor = this.color;
357
+ break;
358
+ case 'cartCPlain':
359
+ border = `1px solid ${color}`;
360
+ radius = '22rpx';
361
+ if(this.cell === 1 && this.columnOneLayout !== 'H') radius = '32rpx';
362
+ break;
363
+ case 'cartCFull':
364
+ color = '#fff'
365
+ bgColor = this.color;
366
+ radius = '22rpx';
367
+ if(this.cell === 1 && this.columnOneLayout !== 'H') radius = '32rpx';
368
+ break;
369
+ default:
370
+ break;
175
371
  }
176
- else {
177
- return this.productConfig.isShowTag === 'Y'
372
+ return {
373
+ color: color,
374
+ backgroundColor: bgColor,
375
+ border,
376
+ borderRadius:radius,
178
377
  }
179
- })
378
+ }
379
+ return {}
380
+ },
381
+ },
382
+ watch:{
383
+ item(){
384
+ this.tags = [];
385
+ this.beTitles = [];
386
+ this.imgRs = [];
387
+ this.imgLs = [];
388
+ this.params = [];
389
+ this.handleTagsInit();
180
390
  },
391
+ showPriceComp() {
392
+ this.priceKey = new Date().getTime();
393
+ }
181
394
  },
182
395
  data(){
183
396
  return {
@@ -185,20 +398,129 @@ export default {
185
398
  tagObjColor: null,
186
399
  errorStatus: false,
187
400
  errorImage:'',
401
+ tags:[],
402
+ beTitles:[],
403
+ imgRs:[],
404
+ imgLs:[],
405
+ params:[],
406
+ mainColor: '',
407
+ priceKey: 'priceKey'
188
408
  }
189
409
  },
190
- created() {
410
+ async created() {
411
+ let style = await getParentsStyles(this.$parent);
412
+ this.mainColor = style.$mainColor;
191
413
  this.tagObj = this.$colorConfig.productTags;
192
414
  this.tagObjColor = this.$colorConfig.productTagsColor;
193
- this.errorImage = getServiceUrl('/common/empty/product.png?v1=1','size4')
415
+ this.errorImage = getServiceUrl('/common/empty/product.png?v1=1','size4');
416
+ this.handleTagsInit();
194
417
  },
195
418
  methods:{
419
+ handleTagsInit(){
420
+ if(this.item.tags && this.item.tags.length > 0) {
421
+ this.item.tags.map(it=>{
422
+ if(it['style']){
423
+ let flag = this.$colorConfig['tagStyle'][it['style']];
424
+ if(flag.radius) {
425
+ it.css = this.btnStyleComp(flag,flag.radius);
426
+ }
427
+ else it.css = this.btnStyleComp(flag);
428
+ }
429
+ else {
430
+ it.css = this.btnStyleComp(this.$colorConfig['tagStyle']['GR4']);
431
+ }
432
+ if(it.pos === 'tag') this.tags.push(it);
433
+ else if(it.pos === 'beTitle') this.beTitles.push(it);
434
+ else if(it.pos === 'imgR') this.imgRs.push(it);
435
+ else if(it.pos === 'imgL') this.imgLs.push(it);
436
+ else if(it.pos === 'param') this.params.push(it);
437
+ else this.tags.push(it);
438
+ })
439
+ }
440
+ },
196
441
  handleError(item){
197
442
  this.errorStatus = true;
198
443
  },
199
444
  handleDetail(type='N'){
200
445
  this.$emit('on-product-detail', {isCart:type,...this.item});
201
- }
446
+ },
447
+ btnStyleComp({style, color, bgColor}, cusRadius='8rpx'){
448
+ let c = '',bgc = '', border = 0, radius = 0, padding='0 10rpx';
449
+ if(style) {
450
+ switch (style) {
451
+ case 'css1':
452
+ c = color || '#999';
453
+ padding = 0;
454
+ break;
455
+ case 'css2':
456
+ c = color || '#999';
457
+ bgc = bgColor;
458
+ radius = cusRadius;
459
+ break;
460
+ case 'css3':
461
+ c = color || '#999';
462
+ bgc = bgColor;
463
+ break;
464
+ case 'css4':
465
+ c = color ||'#999';
466
+ bgc = bgColor ||'#fff';
467
+ radius = cusRadius;
468
+ border = `1px solid rgba(${Color(c).alpha(0.3).array().join(',')})`;
469
+ break;
470
+ case 'css5':
471
+ c = color ||'#999';
472
+ bgc = bgColor ||'#fff';
473
+ radius = '0';
474
+ border = `1px solid rgba(${Color(c).alpha(0.3).array().join(',')})`;
475
+ break;
476
+ case 'css6':
477
+ c = color ||'#999';
478
+ bgc = bgColor || '#fff';
479
+ radius = cusRadius;
480
+ border = `1px solid ${c}`
481
+ break;
482
+ case 'css7':
483
+ c = color ||'#999';
484
+ bgc = bgColor || '#fff';
485
+ radius = '0';
486
+ border = `1px solid ${c}`
487
+ break;
488
+ case 'css8':
489
+ c = color||'#fff';
490
+ bgc = bgColor;
491
+ radius = cusRadius;
492
+ break;
493
+ case 'css9':
494
+ c = color||'#fff';
495
+ bgc = bgColor;
496
+ break;
497
+ case 'cssL':
498
+ c = color;
499
+ bgc = bgColor;
500
+ radius = `0 ${cusRadius} ${cusRadius} 0`;
501
+ padding = '0 20rpx 0 10rpx'
502
+ break;
503
+ case 'cssR':
504
+ c = color;
505
+ bgc = bgColor;
506
+ radius = `${cusRadius} 0 0 ${cusRadius}`;
507
+ padding = '0 10rpx 0 20rpx'
508
+ break;
509
+ default:
510
+ c = color ||'#999'
511
+ padding = 0;
512
+ break;
513
+ }
514
+ return {
515
+ color: c,
516
+ backgroundColor: bgc,
517
+ border,
518
+ borderRadius:radius,
519
+ padding
520
+ }
521
+ }
522
+ else return {}
523
+ },
202
524
  }
203
525
  }
204
526
  </script>
@@ -206,167 +528,237 @@ export default {
206
528
 
207
529
 
208
530
  <style scoped lang="less">
209
- .product {
210
-
211
- &.one {
212
- display: flex;
213
- justify-content: space-between;
214
- align-items: flex-start;
215
- min-height: 200rpx;
531
+ .product {
216
532
 
217
- .product-image {
218
- flex-shrink: 0;
219
- position: relative;
220
- }
533
+ &.oneV {
534
+ .product-image {
535
+ flex-shrink: 0;
536
+ position: relative;
537
+ width: 100%!important;
538
+ }
221
539
 
222
- .product-content {
223
- flex: 1;
224
- min-height: 200rpx;
225
- display: flex;
226
- justify-content: flex-start;
227
- flex-flow: wrap;
228
- align-content: space-between;
229
- }
540
+ .product-content {
230
541
  }
542
+ }
231
543
 
232
- &.two {
233
- .product-image {
234
- width: 100%;
235
- display: flex;
236
- flex-shrink: 0;
237
- justify-content: center;
238
- align-items: center;
239
- position: relative;
240
- & > image {
241
- height: 100%;
242
- width: 100%;
243
- }
244
- }
544
+ &.one {
545
+ display: flex;
546
+ justify-content: space-between;
547
+ align-items: flex-start;
548
+
549
+ .product-image {
550
+ flex-shrink: 0;
551
+ position: relative;
552
+ }
245
553
 
554
+ .product-content {
555
+ flex: 1;
556
+ min-height: 240rpx;
557
+ display: flex;
558
+ justify-content: flex-start;
559
+ flex-flow: wrap;
560
+ align-content: space-between;
246
561
  }
562
+ }
247
563
 
248
- &-image {
249
- overflow: hidden;
564
+ &.two {
565
+ .product-image {
566
+ width: 100%;
567
+ display: flex;
568
+ flex-shrink: 0;
569
+ justify-content: center;
570
+ align-items: center;
571
+ position: relative;
250
572
  & > image {
251
573
  height: 100%;
252
574
  width: 100%;
253
575
  }
254
576
  }
255
577
 
256
- &-content {
257
- overflow: hidden;
258
- &-info {
578
+ }
579
+
580
+ &-image {
581
+ overflow: hidden;
582
+ & > image {
583
+ height: 100%;
584
+ width: 100%;
585
+ }
259
586
 
587
+ & .tagL {
588
+ position: absolute;
589
+ left: 0;
590
+ font-size: 20rpx;
591
+ line-height: 40rpx;
592
+ }
593
+
594
+ & .tagR {
595
+ position: absolute;
596
+ right: 0;
597
+ font-size: 20rpx;
598
+ line-height: 40rpx;
599
+ }
600
+ }
601
+
602
+ &-content {
603
+ overflow: hidden;
604
+ &-info {
605
+
606
+ }
607
+
608
+ &-btn {
609
+ width: 100%;
610
+ display: flex;
611
+ justify-content: space-between;
612
+ align-items: center;
613
+ position: relative;
614
+
615
+ &.twoThree {
616
+ margin-top: 18rpx;
260
617
  }
261
618
 
262
- &-btn {
263
- width: 100%;
619
+ & .showThree {
620
+ height: 72rpx;
264
621
  display: flex;
265
- justify-content: space-between;
622
+ justify-content: flex-start;
266
623
  align-items: center;
624
+ flex-flow: wrap;
625
+ & > view {
626
+ width: 100%;
627
+ flex-shrink: 0;
628
+ }
629
+ }
267
630
 
268
- .onePrice {
269
- display: flex;
270
- justify-content: flex-start;
271
- align-items: center;
631
+ .onePrice {
632
+ display: flex;
633
+ justify-content: flex-start;
634
+ align-items: center;
272
635
 
273
- & > view:nth-child(2) {
274
- margin-left: 20rpx;
275
- }
636
+ & > view:nth-child(2) {
637
+ margin-left: 20rpx;
276
638
  }
639
+ }
277
640
 
641
+ & > view:first-child {
642
+ flex: 1;
278
643
  & > view:first-child {
279
- flex: 1;
280
- & > view:first-child {
281
- height: 40rpx;
282
- display: flex;
283
- justify-content: flex-start;
284
- align-items: center;
285
- overflow: hidden;
286
- }
287
- & > view:nth-child(2) {
288
- line-height: 30rpx;
289
- }
290
- }
291
-
292
-
293
-
294
- & > view:nth-child(2) {
295
- flex-shrink: 0;
296
- width: 40rpx;
297
- height: 40rpx;
298
644
  display: flex;
299
- justify-content: center;
645
+ justify-content: flex-start;
300
646
  align-items: center;
301
- cursor: pointer;
647
+ overflow: hidden;
302
648
  }
303
-
304
- .oldPrice {
305
- margin-left: 6rpx;
649
+ & > view:nth-child(2) {
650
+ line-height: 30rpx;
306
651
  }
307
652
  }
308
653
 
309
- & .name {
310
- margin-bottom: 10rpx;
311
- line-height: 40rpx;
312
- .uni-max-cut(2,80);
313
- word-wrap: break-word;
314
- word-break: break-all;
315
654
 
316
- & > text {
317
- display: inline-block;
318
655
 
319
- }
656
+ & > view:nth-child(2) {
657
+ flex-shrink: 0;
658
+ width: 40rpx;
659
+ height: 40rpx;
660
+ display: flex;
661
+ justify-content: center;
662
+ align-items: center;
663
+ cursor: pointer;
664
+ }
320
665
 
321
- &.showOne {
322
- .uni-max-cut(1,40);
323
- }
666
+ .oldPrice {
667
+ margin-left: 6rpx;
324
668
  }
325
669
 
326
- & .brand {
327
- font-size: 22rpx;
328
- line-height: 30rpx;
329
- .uni-max-cut(1,30);
330
- padding-bottom: 10rpx;
670
+ & .cart-btn-auto {
671
+ width: auto!important;
331
672
  }
673
+ }
332
674
 
333
- .tags {
334
- display: flex;
335
- justify-content: flex-start;
336
- align-content: flex-start;
337
- flex-flow: wrap;
675
+ & .name {
676
+ margin-bottom: 10rpx;
338
677
 
339
- &.showTwo {
340
- & > view{
341
- margin-bottom: 8rpx;
342
- }
343
- }
678
+ & .nameTags {
679
+ display: inline-block;
680
+ vertical-align: top;
344
681
 
345
682
  & > view {
346
- padding: 0 14rpx;
347
- height: 32rpx;
348
- line-height: 31rpx;
349
- font-size: 20rpx;
350
- color:#fff;
351
- border-radius: 16rpx;
683
+ display: inline-block;
684
+ vertical-align: top;
685
+ font-size: 22rpx;
352
686
  margin-right: 10rpx;
687
+ }
688
+ }
353
689
 
354
- &:last-child {
355
- margin-right: 0;
356
- }
690
+ & .nameCont {
691
+ line-height: 1.5;
692
+ display: inline;
693
+ }
694
+
695
+ &.showThree {
696
+ .uni-max-cut(1,40);
697
+ margin-bottom: 10rpx;
698
+ }
699
+ &.showOne {
700
+ .uni-max-cut(1,40);
701
+ }
702
+ }
703
+
704
+
705
+
706
+ & .brandBox {
707
+ width: 100%;
708
+ margin-bottom: 16rpx;
709
+ font-size: 24rpx;
710
+ .uni-max-cut(1,40);
711
+ box-sizing: border-box;
712
+
713
+ & > view {
714
+ height: 36rpx;
715
+ display: inline-block;
716
+ vertical-align: middle;
717
+ line-height: 36rpx;
718
+ box-sizing: border-box;
719
+ overflow: hidden;
720
+ }
721
+
722
+
723
+ }
357
724
 
725
+ & .tags {
726
+ display: flex;
727
+ justify-content: flex-start;
728
+ align-content: flex-start;
729
+ flex-flow: wrap;
730
+ width: 100%;
731
+
732
+ &.showThree {
733
+ overflow: hidden;
734
+ max-height: 40rpx;
735
+ }
736
+
737
+ &.showTwo {
738
+ & > view{
739
+ margin-bottom: 8rpx;
358
740
  }
359
741
  }
360
742
 
743
+ & > view {
744
+ padding: 0 16rpx;
745
+ line-height: 34rpx;
746
+ font-size: 20rpx;
747
+ color:#fff;
748
+ margin-right: 10rpx;
749
+
750
+ &:last-child {
751
+ margin-right: 0;
752
+ }
753
+
754
+ }
361
755
  }
362
- ._tag{
363
- color: #FF661A;
364
- border: 1px solid #FF661A;
365
- border-radius: 8rpx;
366
- font-size: 24rpx;
367
- margin-right: 24rpx;
368
- padding: 0rpx 10rpx;
369
- margin-bottom: 20rpx
756
+
757
+ & .cart-btn {
758
+ padding: 0 .5rem;
759
+ box-sizing: border-box;
370
760
  }
761
+
371
762
  }
763
+ }
372
764
  </style>