jufubao-mall 2.0.29-beta1 → 2.0.31

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.
@@ -29,38 +29,27 @@
29
29
  :style="{ marginBottom: rowMainSpacing + 'rpx', paddingBottom:mainEventSpacing + 'rpx' }"
30
30
  class="jfb-mall-special-product__body-list"
31
31
  >
32
- <view
33
- v-if="is_title === 'Y'"
34
- :style="[titleStyle,{
32
+ <Title
33
+ v-if="is_title === 'Y'&&initStatus"
34
+ :title="Pitem.special_name"
35
+ :moreName="moreName"
36
+ :wrapStyle="[{
35
37
  padding: titlePaddingComp,
36
38
  borderRadius:titleRradius +'rpx',
37
39
  boxShadow: titleShadow,
38
40
  border: titleBorder,
41
+ backgroundColor: titleStyle.backgroundColor,
42
+ backgroundImage: `url(${titleBg})` ,
43
+ backgroundRepeat: 'no-repeat',
44
+ backgroundSize: '100% 100%'
39
45
  }]"
40
- @click="handleTo(Pitem)"
41
- class="jfb-mall-special-product__body-list-title"
42
- >
43
- <view :style="[titleStyle]">{{ Pitem.special_name }}</view>
44
- <view
45
- v-if="isMore === 'Y'"
46
- @click.stop="handleTo(Pitem)"
47
- :style="{
48
- boxShadow: moreShadow,
49
- border: moreBorder,
50
- borderRadius: moreRradius + 'rpx',
51
- backgroundColor: moreBgColor,
52
- color: moreColor,
53
- fontSize: moreFontSize,
54
- fontWeight: moreFontWeight,
55
- padding: '0 .6rem',
56
- lineHeight: '1.4rem'
57
- }"
58
- class="jfb-mall-special-product__body-list-title-more"
59
- >
60
- <text>{{moreName}}</text>
61
- <xd-font-icon icon="iconxiangyou_xian" :size="24"></xd-font-icon>
62
- </view>
63
- </view>
46
+ :titleStyle="titleStyle"
47
+ :moreStyle="moreStyle"
48
+ :isMore="isMore==='Y'"
49
+ :key="titleKey"
50
+ :titleType="title_type"
51
+ @click.native="handleTo(Pitem)"
52
+ ></Title>
64
53
  <!--图片显示-->
65
54
  <view
66
55
  :style="{
@@ -128,13 +117,15 @@
128
117
  :style="[itemProductStyles]"
129
118
  >
130
119
  <cus-product
120
+ :column-one-layout="columnOneLayout"
131
121
  :image-radius="itemImageRadius"
132
- :brand-color="itemBrandColor"
122
+ :brand-color="brandStyleComp"
133
123
  :height="itemProductImageHeight"
134
124
  :cell="row_num"
135
125
  :name-font="itemFont"
136
126
  :product-config="productConfig"
137
127
  :item="item"
128
+ :color="mainColor"
138
129
  :isPlus="is_plus_site"
139
130
  :row-spacing="rowMainSpacing"
140
131
  :cell-spacing="itemSpacing"
@@ -169,9 +160,8 @@
169
160
  enable-flex
170
161
  v-else
171
162
  >
172
- <view class="prodcut-scroll-box">
163
+ <view class="prodcut-scroll-box" v-if="Pitem.products && Pitem.products.length">
173
164
  <view
174
- v-if="Pitem.products && Pitem.products.length"
175
165
  class="prodcut-scroll-item"
176
166
  v-for="item in Pitem.products"
177
167
  :key="item.id"
@@ -180,11 +170,12 @@
180
170
  <cus-product
181
171
  v-if="item.content_type === 'product'"
182
172
  :image-radius="itemImageRadius"
183
- :brand-color="itemBrandColor"
173
+ :brand-color="brandStyleComp"
184
174
  :height="itemProductImageHeight"
185
175
  :cell="row_num"
186
176
  :name-font="itemFont"
187
177
  :product-config="productConfig"
178
+ :color="mainColor"
188
179
  :item="item"
189
180
  :isPlus="is_plus_site"
190
181
  :row-spacing="rowMainSpacing"
@@ -218,15 +209,21 @@ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
218
209
  import XdMore from "@/components/XdMore/XdMore";
219
210
  import { jfbRootExec } from "@/utils/xd.event";
220
211
  import JfbMallSpecialProductMixin from "./JfbMallSpecialProductMixin";
221
- import {getContainerPropsValue, getImageInfo, toProductDetail} from "@/utils/xd.base";
212
+ import {getContainerPropsValue, getImageInfo, toProductDetail,gCPVal} from "@/utils/xd.base";
222
213
  import componentsMixins from "@/mixins/componentsMixins";
223
214
  import extsMixins from "@/mixins/extsMixins";
215
+ import productCompMixins from "@/mixins/productCompMixins";
224
216
  import getServiceUrl from "@/common/getServiceUrl";
225
217
  import XdProductStatus from "@/components/XdProductStatus/XdProductStatus";
226
218
  import XdUnit from "@/components/XdUnit/XdUnit";
227
219
  import SkeProduct from "@/components/SkeProduct/SkeProduct.vue";
228
220
  import CusProduct from "@/components/CusProduct/CusProduct.vue";
229
221
  import XdVideo from "./XdVideo.vue";
222
+ import Title from './components/title.vue'
223
+ import {
224
+ statusShow,
225
+ } from "@/utils/AttrTools";
226
+ const Color = require('color');
230
227
 
231
228
  export default {
232
229
  name: "JfbMallSpecialProduct",
@@ -238,11 +235,13 @@ export default {
238
235
  XdMore,
239
236
  XdProductStatus,
240
237
  XdUnit,
238
+ Title
241
239
  },
242
240
  mixins: [
243
241
  componentsMixins,
244
242
  extsMixins,
245
243
  JfbMallSpecialProductMixin,
244
+ productCompMixins
246
245
  ],
247
246
  data() {
248
247
  return {
@@ -268,11 +267,6 @@ export default {
268
267
  showActivityPrice: "N",
269
268
  differ: 1,
270
269
  row_num: 2,
271
- isShowTag: "Y",
272
- is_show_brand: "N",
273
- isShowDiscount: "Y",
274
- isAddCart: "N",
275
- isPrice: "Y",
276
270
  is_title: "Y",
277
271
  product_limit: 6,
278
272
  mainBgColor:'#f8f8f8',
@@ -287,7 +281,7 @@ export default {
287
281
  titleRradius:'0',
288
282
  titleBorder:0,
289
283
  titleShadow:0,
290
-
284
+ titleBg: '',
291
285
 
292
286
  //标题更多
293
287
  moreBgColor:'',
@@ -312,9 +306,14 @@ export default {
312
306
  itemBorder:0,
313
307
  itemShadow:0,
314
308
  itemShadowOrg:{},
315
- itemBgColor:'#f8f8f8',
309
+ itemBgColor:'',
316
310
  itemFont: {},
317
- is_plus_site: false
311
+ is_plus_site: false,
312
+
313
+ columnOneLayout: 'H', //V=垂直 H=水平
314
+ title_type: '',
315
+ titleKey: 'titleKey',
316
+ initStatus: false
318
317
  };
319
318
  },
320
319
  computed: {
@@ -398,7 +397,25 @@ export default {
398
397
  border: this.itemBorder,
399
398
  backgroundColor: this.itemBgColor,
400
399
  }
401
- }
400
+ },
401
+ //品牌样式
402
+ brandStyleComp(){
403
+ return {
404
+ color: this.itemBrandColor,
405
+ }
406
+ },
407
+ moreStyle() {
408
+ return {
409
+ boxShadow: this.moreShadow,
410
+ border: this.moreBorder,
411
+ borderRadius: this.moreRradius + 'rpx',
412
+ backgroundColor: this.moreBgColor,
413
+ color: this.moreColor,
414
+ fontSize: this.moreFontSize,
415
+ fontWeight: this.moreFontWeight,
416
+ padding: '8rpx 20rpx',
417
+ }
418
+ },
402
419
  },
403
420
  watch: {
404
421
  container(value,oldValue) {
@@ -411,6 +428,21 @@ export default {
411
428
  product_limit(){
412
429
  if (this.$configProject['isPreview']) this.onJfbLoad(this.options)
413
430
  },
431
+ columnOneLayout(){
432
+ this.reHandlePoster()
433
+ },
434
+ row_num(){
435
+ this.reHandlePoster()
436
+ },
437
+ need_show_tags(value,oldValue) {
438
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
439
+ if (this.$configProject['isPreview']){
440
+ this.onJfbLoad(this.options)
441
+ }
442
+ },
443
+ title_type() {
444
+ this.titleKey = new Date().getTime();
445
+ }
414
446
  },
415
447
  created() {
416
448
  this.isPreview = this.$configProject.isPreview;
@@ -423,92 +455,133 @@ export default {
423
455
  * @param container {object} 业务组件对象自己
424
456
  */
425
457
  init(container) {
426
- let showType = getContainerPropsValue(container,'content.showType', 'list');
458
+ let moreBackgeound = Color(this.mainColor).alpha(0.15).toString();
459
+ let titleStyleDefault = [{
460
+ color: '#333',
461
+ fontSize: '28rpx',
462
+ fontWeight: '500',
463
+ bgColor: 'rgba(255, 255, 255, 0)'
464
+ }]
465
+ //content
466
+ this.xnamespace = gCPVal(container, 'xnamespace', this.projectAttr.business_code, {});
467
+ this.is_title = gCPVal(container, "is_title", "Y");
468
+ let showType = gCPVal(container, "showType", "list");
427
469
  if(showType === 'carousel') showType = 'slide';
428
470
  this.showType = showType;
429
-
430
- this.rowMainSpacing = Number(getContainerPropsValue(container, "content.rowMainSpacing", 20));
431
- this.columnMainSpacing = Number(getContainerPropsValue(container, "content.columnMainSpacing", 16));
432
- this.mainEventSpacing = Number(getContainerPropsValue(container, "content.mainEventSpacing", 0));
433
- this.outMargin = getContainerPropsValue(container,'content.outMargin', {})
434
- this.is_show_brand = getContainerPropsValue(container, "content.is_show_brand", "N");
435
- this.is_title = getContainerPropsValue(container, "content.is_title", "Y");
436
- this.isMore = getContainerPropsValue(container,'content.isMore' , 'Y')
437
- this.row_num = Number(getContainerPropsValue(container, "content.row_num", 2));
471
+ this.isMore = gCPVal(container, "isMore", "Y");
472
+ this.moreName = gCPVal(container, "moreName", "更多");
473
+ let compConfig = getContainerPropsValue(container, "content.compConfig", null);
474
+ let tagsKeys= this.getProductTagsKeys(compConfig,container)
475
+ this.need_show_tags = this.getProductTagsParams(compConfig, tagsKeys)
476
+ this.productConfig = this.getProductConfig(container, { cartStyle: 'icongouwuche-01' });
477
+ let product_limit = Number(gCPVal(container, "product_limit", 6));
478
+ if(product_limit >=20) product_limit = 20;
479
+ this.product_limit = product_limit;
480
+ let row_num = gCPVal(container, 'row_num', 2);
481
+ this.row_num = row_num;
482
+ //一列水平
483
+ if (row_num === 1) {
484
+ this.skeNumber = 6;
485
+ this.columnOneLayout = 'H';
486
+ }
487
+ if (row_num === 2) {
488
+ this.skeNumber = 4;
489
+ }
490
+ if (row_num === 3) {
491
+ this.skeNumber = 5;
492
+ this.page_size = 21;
493
+ } else this.page_size = 20;
494
+ //一列垂直
495
+ if(row_num === 4) {
496
+ this.row_num = 1;
497
+ this.columnOneLayout = 'V';
498
+ this.skeNumber = 10;
499
+ this.page_size = 20;
500
+ }
438
501
  if(this.showType === 'slide') {
439
502
  this.row_num = 3;
440
503
  }
441
-
442
- this.isPrice = getContainerPropsValue(container, "content.isPrice", "Y");
443
- this.isShowDiscount = getContainerPropsValue(container, "content.isShowDiscount", "Y");
444
- this.differ = getContainerPropsValue(container, "content.differ", 1);
445
- this.showActivityPrice = getContainerPropsValue(container, "content.showActivityPrice", "N");
446
- this.isShowTag = getContainerPropsValue(container, "content.isShowTag", "Y");
447
- this.isAddCart = getContainerPropsValue(container, "content.isAddCart", "N");
448
- let product_limit = Number(getContainerPropsValue(container, "content.product_limit", 6));
449
- if(product_limit >=20) product_limit = 20;
450
- this.product_limit = product_limit;
451
- this.mainBgColor = getContainerPropsValue(container, "content.mainBgColor", 'rgba(0,0,0,0)');
452
- this.productConfig = {
453
- isShowDiscount: this.isShowDiscount,
454
- isPrice: this.isPrice,
455
- isAddCart: this.isAddCart,
456
- is_show_brand: this.is_show_brand,
457
- showActivityPrice:this.showActivityPrice,
458
- isShowTag : this.isShowTag,
459
- differ: this.differ,
504
+ //商品样式关联属性
505
+ const sValue = "{\"border\":0,\"backgroundColor\":\"#fff\"}";
506
+ let itemBgcColoStyle = this.getRelationStatus(container,'productStyle',{ itemBgColorStatus:['itemBgColor'],itemBorder:['itemBorder', 'bs']},sValue);
507
+ this.itemBgColor = gCPVal(container, 'itemBgColor', '#fff', { sKey: 'itemBgColorStatus', cusFields: ['productStyle', 'backgroundColor', itemBgcColoStyle] });
508
+
509
+ //style
510
+ this.mainBgColor = getContainerPropsValue(container, "mainBgColor", '',{sKey:'mainBgStatus',fields:['mainBgColor']});
511
+ this.outMargin = gCPVal(container, 'outMargin', [16], {sKey:'outMarginStatus', isPMR: true, fields:['outMargin']});
512
+ this.mainEventSpacing = gCPVal(container, 'mainEventSpacing', 0, { sKey: 'mainEventSpacingStatus', fields: ['mainEventSpacing'] });
513
+ this.listBgColor = gCPVal(container, "listBgColor", '',{sKey:'listBgColorStatus',fields:['listBgColor']});
514
+ this.itemMargin = gCPVal(container, 'itemMargin', { top: 16, right: 0, bottom: 0, left: 0 }, {sKey:'itemMarginStatus', isPMR: true, fields:['itemMargin']});
515
+ this.listRadius = gCPVal(container, 'listRadius', [16], { sKey: 'listRadiusStatus', fields: ['listRadius'] }) || 0;
516
+ this.title_type = gCPVal(container, 'title_type', 'default');
517
+ this.titleBg = getServiceUrl(gCPVal(container, 'titleBg', { url: '' }, { sKey: 'titleStyleStatus', fields: ['titleBg'] }).url);
518
+
519
+ if (this.title_type == 'four' || this.title_type == 'five') {
520
+ titleStyleDefault = [{
521
+ color: '#fff',
522
+ fontSize: '28rpx',
523
+ fontWeight: '500',
524
+ bgColor: 'rgba(255, 255, 255, 0)'
525
+ }]
460
526
  }
461
-
462
- //banner
463
- this.bannerRradius = getContainerPropsValue(container, "content.bannerRradius", '0');
464
- this.bannerPadding = getContainerPropsValue(container, 'content.bannerPadding', {})
465
-
466
- //标题设置
467
-
468
- this.titlePadding = getContainerPropsValue(container, "content.titlePadding", {});
469
- this.titleStyle = this.getFontAndBgcStyle(
470
- getContainerPropsValue(container, 'content.titleStyle',{}),
471
- {fontSize: '28rpx',color: '#333',bgColor:'#f1f1f1', fontWeight: 'bold' },
527
+ this.titleStyle = gCPVal(
528
+ container,
529
+ "titleStyle",
530
+ titleStyleDefault,
531
+ {sKey:'titleStyleStatus',fields:['titleStyle'],isMerge: true}
532
+ );
533
+ this.titleStyle.backgroundColor = this.titleStyle.bgColor || '#fff';
534
+ this.titlePadding = gCPVal(container, 'titlePadding', [32], {sKey:'titlePaddingStatus', isPMR: true, fields:['titlePadding']});
535
+ this.titleBorder = gCPVal(container, 'titleBorder', [{color: '#fff',width: 2,style: 'solid'}], {isBorder: true, bsOld:['is_border','is_border_w','is_border_c'], cusFields: ['productStyle','border']});
536
+ this.titleShadow = gCPVal(container, 'titleShadow', [{width:20, color:'rgba(0,0,0,0)'},'none'], {isShadow:true, bsOld:['is_shadow','is_shadow_w','is_shadow_bg']});
537
+ this.titleRradius = gCPVal(container, 'titleRradius', [16], { sKey: 'titleRradiusStatus', fields: ['titleRradius'] }) || 0;
538
+ let moreStyle = gCPVal(
539
+ container,
540
+ "moreStyle",
541
+ [{
542
+ color: this.mainColor,
543
+ fontSize: '24rpx',
544
+ fontWeight: '400',
545
+ bgColor: moreBackgeound
546
+ }],
547
+ {sKey:'moreStyleStatus',fields:['moreStyle'],isMerge: true}
472
548
  );
473
- this.titleRradius = getContainerPropsValue(container, "content.titleRradius", '0');
474
- this.titleShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.titleShadow', {}))
475
- this.titleBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.titleBorder', {}));
476
-
477
- //标题设置
478
- let moreStyle = getContainerPropsValue(container, "content.moreStyle", {});
479
- this.moreName = getContainerPropsValue(container, "content.moreName", '更多');
480
549
  this.moreBgColor = moreStyle.bgColor || ''
481
550
  this.moreColor = moreStyle.color || '#333';
482
551
  this.moreFontSize = moreStyle.fontSize|| '20rpx';
483
552
  this.moreFontWeight = moreStyle.fontWeight || 'normal';
484
- this.moreRradius = getContainerPropsValue(container, "content.moreRradius", '20');
485
- this.moreShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.moreShadow', {}))
486
- this.moreBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.moreBorder', {}));
487
-
488
- //item
489
- this.itemPadding = getContainerPropsValue(container, "content.itemPadding", {});
490
- this.itemRadius = getContainerPropsValue(container, "content.itemRadius", '0');
491
- this.itemImageRadius = getContainerPropsValue(container, "content.itemImageRadius", '0');
492
- this.itemMargin = getContainerPropsValue(container, "content.itemMargin", {});
493
- this.itemSpacing = Number(getContainerPropsValue(container, "content.itemSpacing", '16'));
494
- this.itemBrandColor = getContainerPropsValue(container, "content.itemBrandColor", '#999');
495
- this.itemShadowOrg = getContainerPropsValue(container, 'content.itemShadow', {});
496
- this.itemShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.itemShadow', {}))
497
- this.itemBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.itemBorder', {}));
498
- this.itemBorderOrg = getContainerPropsValue(container, 'content.itemBorder', {});
499
- this.itemBgColor = getContainerPropsValue(container, "content.itemBgColor", '#f8f8f8');
500
- let itemStyle = getContainerPropsValue(container, 'content.itemStyle', {});
553
+ this.moreBorder = gCPVal(container, 'moreBorder', [{color: '#fff',width: 2,style: 'solid'}], {isBorder: true, bsOld:['is_border','is_border_w','is_border_c'], cusFields: ['productStyle','border']});
554
+ this.moreShadow = gCPVal(container, 'moreShadow', [{width:20, color:'rgba(0,0,0,0)'},'none'], {isShadow:true, bsOld:['is_shadow','is_shadow_w','is_shadow_bg']});
555
+ this.moreRradius = gCPVal(container, 'moreRradius', [40], { sKey: 'moreRradiusStatus', fields: ['moreRradius'] }) || 0;
556
+ this.bannerRradius = gCPVal(container, 'bannerRradius', [16], { sKey: 'bannerRradiusStatus', fields: ['bannerRradius'] }) || 0;
557
+ this.bannerPadding = gCPVal(container, 'bannerPadding', {top:16,right:0,bottom:0,left:0}, {sKey:'bannerPaddingStatus', isPMR: true, fields:['bannerPadding']});
558
+ let itemStyle = gCPVal(
559
+ container,
560
+ "itemStyle",
561
+ [{
562
+ color: '#333',
563
+ fontWeight: '500',
564
+ }],
565
+ {sKey:'itemStyleStatus',fields:['itemStyle'],isMerge: true}
566
+ );
501
567
  this.itemFont = {
502
568
  color: itemStyle.color || '#333',
503
- fontSize: itemStyle.fontSize|| '30rpx',
504
569
  fontWeight:itemStyle.fontWeight || 500
505
570
  };
506
- this.listBgColor = getContainerPropsValue(container, 'content.listBgColor', 'rgba(0,0,0,0)');
507
- this.listRadius = getContainerPropsValue(container, 'content.listRadius', '0')
508
-
509
- //高级
571
+ this.itemSpacing = gCPVal(container, 'itemSpacing', '16', { sKey: 'itemStyleStatus', fields: ['itemSpacing'] });
572
+ this.itemBrandColor = gCPVal(container, 'itemBrandColor', '#999', { sKey: 'itemBrandStatus', fields: ['itemBrandColor'] });
573
+ this.itemBorder = gCPVal(container, 'itemBorder', [{ color: '#fff', width: 2, style: 'solid' }], { isBorder: true, bsOld: ['is_border', 'is_border_w', 'is_border_c'], cusFields: ['productStyle', 'border', itemBgcColoStyle] });
574
+ this.itemBorderOrg = gCPVal(container, 'itemBorder', [{ color: '#fff', width: 2, style: 'solid' }], { isBorder: true, bsOld: ['is_border', 'is_border_w', 'is_border_c'], cusFields: ['productStyle', 'border', itemBgcColoStyle] });
575
+ this.itemRadius = gCPVal(container, 'itemRadius', [16], { sKey: 'itemRadiusStatus', fields: ['itemRadius'] }) || 0;
576
+ this.itemImageRadius = gCPVal(container, 'itemImageRadius', [8], { sKey: 'itemImageRadiusStatus', fields: ['itemImageRadius'] }) || 0;
577
+ this.itemShadow = gCPVal(container, 'itemShadow', [{width:20, color:'rgba(0,0,0,0)'},'none'], {isShadow:true, bsOld:['is_shadow','is_shadow_w','is_shadow_bg']});
578
+ this.itemShadowOrg = gCPVal(container, 'itemShadow', [{width:20, color:'rgba(0,0,0,0)'},'none'], {isShadow:true, bsOld:['is_shadow','is_shadow_w','is_shadow_bg']});
579
+ this.rowMainSpacing = Number(gCPVal(container, 'rowMainSpacing', 16, { sKey: 'columnRowStatus', fields: ['rowMainSpacing', 'columnMainSpacing'] }));
580
+ this.columnMainSpacing = Number(gCPVal(container,'columnMainSpacing', 16, {sKey:'columnRowStatus',fields:['rowMainSpacing','columnMainSpacing']}));
581
+ this.itemPadding = gCPVal(container, 'itemPadding', [16], {sKey:'itemPaddingStatus', isPMR: true, fields:['itemPadding']});
582
+ //advanced
510
583
  this.productInfoPath = getContainerPropsValue(container, "content.productInfoPath", { value: "" }).value;
511
- this.xnamespace = getContainerPropsValue(container, "content.xnamespace", this.projectAttr.business_code);
584
+ this.initStatus=true
512
585
  },
513
586
 
514
587
  getSkeleton(cellIndex){
@@ -617,63 +690,75 @@ export default {
617
690
  this.options = options;
618
691
  //设置业务请求代码
619
692
  this.setNameSpace(options);
620
- let data = {
621
- xnamespace: this.xnamespace,
622
- product_limit: this.product_limit,
623
- }
624
- if(this.productConfig.isShowDiscount==='Y'){
625
- data.is_show_uprice=this.$xdUniHelper.multiplyFloatNumber(this.productConfig.differ,100)
626
- } else {
627
- data.is_show_uprice=-1
628
- }
629
- jfbRootExec("getSpecialsProducts", {
630
- vm: this,
631
- data: data,
632
- })
633
- .then(async (res) => {
634
-
635
- res.items = await this.getCategories(res.items);
636
- if (res.items && res.items.length) {
637
- let list = res.items;
638
- this.list = list.map((item) => {
639
- item.special_banner = getServiceUrl(item.special_banner);
640
- if(this.isPreview) {
641
- item.products = item.products.filter((item,index) => {
642
- return index < this.product_limit
643
- }).map((SItem) => {
644
- if(this.productConfig.isPrice==='N'){
645
- SItem.show_prices=[]
646
- }
647
- if(this.productConfig.isShowDiscount==='N'){
648
- SItem.show_prices=SItem.show_prices.filter(item=>item.t!=='U')
649
- }
650
- SItem["thumb"] = getServiceUrl(SItem.thumb);
651
- SItem["content_type"] = 'product';
652
- return SItem;
653
- })
654
- }
655
- else {
656
- item.products = item.products.map((SItem) => {
657
- SItem["thumb"] = getServiceUrl(SItem.thumb);
658
- SItem["content_type"] = 'product';
659
- return SItem;
660
- });
661
-
662
- //滑动模式新增更多按钮
663
- if(this.showType === 'slide') {
664
- item.products.push({
665
- content_type:'more'
693
+ this.getList()
694
+ },
695
+
696
+ getList() {
697
+ let data = {
698
+ xnamespace: this.xnamespace,
699
+ product_limit: this.product_limit,
700
+ need_show_tags: this.need_show_tags.join()
701
+ }
702
+ if(this.productConfig.isShowDiscount==='Y'){
703
+ data.is_show_uprice=this.$xdUniHelper.multiplyFloatNumber(this.productConfig.differ,100)
704
+ } else {
705
+ data.is_show_uprice=-1
706
+ }
707
+ jfbRootExec("getSpecialsProducts", {
708
+ vm: this,
709
+ data: data,
710
+ })
711
+ .then(async (res) => {
712
+
713
+ res.items = await this.getCategories(res.items);
714
+ if (res.items && res.items.length) {
715
+ let list = res.items;
716
+ this.list = list.map((item) => {
717
+ item.special_banner = getServiceUrl(item.special_banner);
718
+ if(this.isPreview) {
719
+ item.products = item.products.filter((item,index) => {
720
+ return index < this.product_limit
721
+ }).map((SItem) => {
722
+ if(this.productConfig.isPrice==='N'){
723
+ SItem.show_prices=[]
724
+ }
725
+ if(this.productConfig.isShowDiscount==='N'){
726
+ SItem.show_prices=SItem.show_prices.filter(Pitem=>Pitem.t!=='U')
727
+ }
728
+ console.log(SItem.show_prices,'show_prices');
729
+
730
+ if(SItem.tags&&SItem.tags.length>0){
731
+ SItem.tags=SItem.tags.filter(tag=>{
732
+ return this.need_show_tags.includes(tag.type)
666
733
  })
667
734
  }
735
+ SItem["thumb"] = getServiceUrl(SItem.thumb);
736
+ SItem["content_type"] = 'product';
737
+ return SItem;
738
+ })
739
+ }
740
+ else {
741
+ item.products = item.products.map((SItem) => {
742
+ SItem["thumb"] = getServiceUrl(SItem.thumb);
743
+ SItem["content_type"] = 'product';
744
+ return SItem;
745
+ });
746
+
747
+ //滑动模式新增更多按钮
748
+ if(this.showType === 'slide') {
749
+ item.products.push({
750
+ content_type:'more'
751
+ })
668
752
  }
669
- return item;
670
- });
671
- this.loadingList = false;
672
- }
673
- })
674
- .catch((err) => {
675
- this.$xdLog.catch(err);
676
- });
753
+ }
754
+ return item;
755
+ });
756
+ this.loadingList = false;
757
+ }
758
+ })
759
+ .catch((err) => {
760
+ this.$xdLog.catch(err);
761
+ });
677
762
  },
678
763
 
679
764
  toDetail({isCart,...prod}) {
@@ -683,16 +768,17 @@ export default {
683
768
 
684
769
 
685
770
  handleTo(item) {
686
- if(this.isPreview) return;
687
- item.special_url = this.checkUrlIsValid(item.special_url);
688
- if(!item.special_url) {
771
+ if (this.isPreview) return;
772
+ let temp = this.$xdUniHelper.cloneDeep(item);
773
+ temp.special_url = this.checkUrlIsValid(temp.special_url);
774
+ if(!temp.special_url) {
689
775
  this.$xdAlert({
690
776
  content:'专题地址配置错误!'
691
777
  })
692
778
  return
693
779
  }
694
780
  this.$xdUniHelper.navigateTo({
695
- url: `${item.special_url}?special_id=${item.special_id}`,
781
+ url: `${temp.special_url}?special_id=${temp.special_id}`,
696
782
  });
697
783
  },
698
784