cyy-vue-material 7.0.19 → 7.0.21

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/dist/index.js +1 -1
  2. package/package.json +34 -34
  3. package/src/App.vue +149 -149
  4. package/src/api/http.js +16 -16
  5. package/src/api/index.js +21 -21
  6. package/src/api/urlQuery.js +20 -20
  7. package/src/common/js/constant.js +5 -5
  8. package/src/common/js/index.js +1 -1
  9. package/src/components/vop-label.vue +29 -29
  10. package/src/index.dev.js +4 -4
  11. package/src/package/cyy-ArsenalActivity/components/u-cont-down.vue +316 -316
  12. package/src/package/cyy-ArsenalActivity/components/u-line-progress.vue +150 -150
  13. package/src/package/cyy-ArsenalActivity/cyy-ArsenalActivity.vue +820 -820
  14. package/src/package/cyy-ArsenalCarousel/cyy-ArsenalCarousel.vue +137 -137
  15. package/src/package/cyy-ArsenalClass/cyy-ArsenalClass.vue +564 -564
  16. package/src/package/cyy-ArsenalMyNavigation/cyy-ArsenalMyNavigation.vue +128 -125
  17. package/src/package/cyy-ArsenalMyTop/cyy-ArsenalMyTop.vue +211 -211
  18. package/src/package/cyy-ArsenalNavigation/cyy-ArsenalNavigation.vue +236 -236
  19. package/src/package/cyy-ArsenalPicture/cyy-ArsenalPicture.vue +228 -228
  20. package/src/package/cyy-ArsenalPromotion/cyy-ArsenalPromotion.vue +913 -899
  21. package/src/package/cyy-ArsenalRecommend/cyy-ArsenalRecommend.vue +56 -56
  22. package/src/package/cyy-ArsenalTop/cyy-ArsenalTop.vue +328 -328
  23. package/src/package/cyy-collocation/cyy-collocation.vue +639 -639
  24. package/src/package/cyy-goods/cyy-goods.vue +317 -317
  25. package/src/package/cyy-goodsOne/consult.vue +267 -267
  26. package/src/package/cyy-goodsOne/cyy-goodsOne.vue +217 -217
  27. package/src/package/cyy-image/cyy-image.vue +64 -64
  28. package/src/package/cyy-live/cyy-live.vue +196 -196
  29. package/src/package/cyy-new-product/cyy-new-product.vue +834 -834
  30. package/src/package/cyy-notice/cyy-notice.vue +137 -137
  31. package/src/package/cyy-search/cyy-search.vue +57 -57
  32. package/src/package/cyy-slider/cyy-slider.vue +117 -117
  33. package/src/package/cyy-title/cyy-title.vue +38 -38
  34. package/src/package/cyy-video/cyy-video.vue +49 -49
  35. package/src/package/index.js +21 -21
  36. package/src/utils/checkEnv.js +16 -16
  37. package/src/utils/fetchFactory.js +100 -100
  38. package/src/utils/index.js +2 -2
@@ -1,639 +1,639 @@
1
- <template>
2
- <div>
3
- <div v-if="!props.goods" :style="noDataStyle">请选择商品</div>
4
- <div
5
- v-else
6
- :style="{
7
- margin: `${props.marginTop}px 0 ${props.marginBottom}px 0`,
8
- backgroundColor: `${props.backgroundColor}`,
9
- borderRadius: `${props.cornerStyle}px`,
10
- }"
11
- >
12
- <div
13
- class="top"
14
- :class="{ left: props.arrange !== 4 }"
15
- :style="{
16
- background: ruleTitle && props.activityTitleLable[0].lable === 2 ? `${ruleTitleImg}` : '',
17
- }"
18
- v-if="props.arrange !== 4"
19
- >
20
- <div v-if="ruleTitle && props.activityTitleLable[0].lable === 2"></div>
21
- <div class="title" v-else>
22
- <span class="mainTitle" :class="mainTitleColor">{{ ruleTitle ? props.activityTitleLable[0].title : hasNewActivityTitle }}</span
23
- ><span class="subtitle">{{ ruleTitle ? props.activityTitleLable[0].subTitle : hasNewActivitySubtitle }}</span>
24
- </div>
25
- <div class="more" @click="goMoreGoods()" v-if="props.more === 1 && [1, 2, 3].includes(props.arrange)">更多<img src="../../static/arrow.png" /></div>
26
- <div v-else class="more"></div>
27
- </div>
28
- <div class="top" :class="{ center: props.arrange === 4 }" v-else-if="props.arrange === 4">
29
- <div class="title">
30
- <div class="line"></div>
31
- <div class="mainTitle">{{ hasNewActivityTitle }}</div>
32
- <div class="line"></div>
33
- </div>
34
- </div>
35
- <div v-if="selectImgRule('show')" class="mainImage">
36
- <img
37
- :style="{
38
- borderTopLeftRadius: `${props.cornerStyle}px`,
39
- borderTopRightRadius: `${props.cornerStyle}px`,
40
- }"
41
- :src="selectImgRule('url')"
42
- alt="主图"
43
- @click="linkClick(selectImgRule('link'))"
44
- />
45
- </div>
46
-
47
- <div class="goodsList" :class="[`arrange-${props.arrange}`, { isLc: !isLc }]">
48
- <div
49
- class="goodsBox"
50
- :style="{
51
- borderRadius: `${props.cornerStyle}px`,
52
- }"
53
- v-for="(item, index) in goodsList"
54
- :key="item.skuCode"
55
- @click="goGoodsDetail(item)"
56
- >
57
- <div class="goodsImageWrapper" :class="{ spacingStyle: props.spacingStyle === 2 }" style="position: relative">
58
- <img
59
- class="goodsImage"
60
- :style="{ borderRadius: `${props.cornerStyle}px` }"
61
- :src="item.dataPic ? (item.dataPic.indexOf('http') === -1 ? domainNameUrl + item.dataPic : item.dataPic) : ''"
62
- alt="商品图片"
63
- />
64
- <div
65
- v-if="isLc === false && (item.goodsSupplynum <= 0 || item.goodsProperty5 === '1')"
66
- class="imgMarked"
67
- :style="{
68
- borderRadius: props.borderRadius,
69
- }"
70
- >
71
- <div class="maskState">
72
- {{ getMaskState(item.goodsProperty5) }}
73
- </div>
74
- </div>
75
- </div>
76
-
77
- <div class="goodsDescription">
78
- <div class="goodsName"><vopLabel />{{ item.goodsName }}</div>
79
- <section class="footerContent">
80
- <div class="goodsTagList" v-if="props.goodsTag.length > 0 && [2, 4].includes(props.arrange)">
81
- <div v-for="tag in props.goodsTag" :key="tag.id">
82
- <span class="tag">
83
- {{ tag.value }}
84
- </span>
85
- </div>
86
- </div>
87
- <div class="goodsPrice">
88
- <span class="priceUnit">¥</span>{{ item.pricesetNprice }}
89
- <div class="scribing" v-if="props.markedPrice === 1">¥{{ item.pricesetMakeprice }}</div>
90
- </div>
91
- <div class="goodsBuy" @click="handleBuyGoods(item.skuNo)" v-if="props.purchaseIcon === 1">立即购买</div>
92
- </section>
93
- </div>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- </template>
99
-
100
- <script>
101
- import { fetchGoodImpl, isLc, getUrl } from "../../utils/index.js";
102
- import { get } from "lodash-es";
103
- import vopLabel from "../../components/vop-label.vue";
104
-
105
- export default {
106
- name: "cyy-collocation",
107
- props: {
108
- props: {
109
- arrange: Number,
110
- selectImg: String,
111
- selectImgs: Array,
112
- selectGoods: Array,
113
- markedPrice: Number,
114
- purchaseIcon: Number,
115
- more: Number,
116
- activityTitle: String,
117
- activitySubtitle: String,
118
- activityTitleLable: Array,
119
- goodsTag: Array,
120
- backgroundColor: String,
121
- cornerStyle: Number,
122
- spacingStyle: Number,
123
- marginTop: Number,
124
- marginBottom: Number,
125
- },
126
- },
127
- data() {
128
- return {
129
- noDataStyle: {
130
- width: "100%",
131
- height: "180px",
132
- lineHeight: "180px",
133
- fontSize: "30px",
134
- backgroundColor: "#ccc",
135
- color: "#aaa",
136
- textAlign: "center",
137
- },
138
- goodsList: [],
139
- completeGoodsList: [],
140
- domainNameUrl: "",
141
- imgUrl: "",
142
- isLc,
143
- };
144
- },
145
- computed: {
146
- mainTitleColor() {
147
- return {
148
- mainTitleColor: this.props.arrange === 5,
149
- };
150
- },
151
- hasNewActivityTitle(){
152
- if (this.props.activityTitleLable?.length) {
153
- if (this.props.activityTitleLable[0].lable === 2) {
154
- return ''
155
- } else {
156
- return this.props.activityTitleLable[0].title
157
- }
158
- } else {
159
- return this.props.activityTitle
160
- }
161
- },
162
- hasNewActivitySubtitle(){
163
- if (this.props.activityTitleLable?.length) {
164
- if (this.props.activityTitleLable[0].lable === 2) {
165
- return ''
166
- } else {
167
- return this.props.activityTitleLable[0].subTitle
168
- }
169
- } else {
170
- return this.props.activitySubtitle
171
- }
172
- },
173
- ruleTitle() {
174
- if (this.props.arrange === 1) {
175
- if (this.props.activityTitleLable?.length) {
176
- return true;
177
- } else {
178
- return false;
179
- }
180
- } else {
181
- return false;
182
- }
183
- },
184
- ruleTitleImg() {
185
- return this.ruleTitle ? `url(${this.props.activityTitleLable[0]?.imgUrl}) no-repeat` : "";
186
- },
187
- selectImgRule() {
188
- return (params) => {
189
- if (params === "show") {
190
- if (this.props.selectImg || this.props.selectImgs?.length) {
191
- return true;
192
- }
193
- return false;
194
- }
195
- if (params === "url") {
196
- if (this.props.selectImgs?.length) {
197
- return this.props.selectImgs[0].imgUrl;
198
- }
199
- if (this.props.selectImg) {
200
- return this.props.selectImg;
201
- }
202
- return "";
203
- }
204
- if (params === "link") {
205
- if (this.props.selectImgs?.length) {
206
- return this.props.selectImgs[0];
207
- }
208
- return [{ link: "无操作" }];
209
- }
210
- };
211
- },
212
- },
213
- components: {
214
- vopLabel,
215
- },
216
- mounted() {
217
- console.log(this.props, "💛💛");
218
- this.init();
219
- },
220
- methods: {
221
- async init() {
222
- this.domainNameUrl = getUrl(this);
223
- const { goods = [] } = this.props;
224
- const goodsCode = goods.toString();
225
- const paramObj = { goodsCode };
226
- const res = await fetchGoodImpl(this, paramObj);
227
- this.completeGoodsList = get(res, "list", []);
228
- this.completeGoodsList.forEach((item) => {
229
- item.rsGoodsFileDomainList = [];
230
- item.rsSkuDomainList = [];
231
- });
232
- // 具有[更多>]的样式只展示部分商品
233
- if (this.props.arrange === 1) {
234
- this.goodsList = this.completeGoodsList.slice(0, 12);
235
- } else if (this.props.arrange === 2) {
236
- this.goodsList = this.completeGoodsList.slice(0, 2);
237
- } else if (this.props.arrange === 3) {
238
- this.goodsList = this.completeGoodsList.slice(0, 3);
239
- } else if ([4, 5].includes(this.props.arrange)) {
240
- this.goodsList = this.completeGoodsList.slice(0, 60);
241
- }
242
- },
243
-
244
- goGoodsDetail(item) {
245
- if (isLc) {
246
- return;
247
- }
248
- const { skuCode } = item;
249
- let params = {
250
- skuNo: skuCode,
251
- };
252
- this.$routers.push("detail", params);
253
- },
254
-
255
- goMoreGoods() {
256
- if (isLc) {
257
- return;
258
- }
259
- this.$storage.set("goodsList", this.completeGoodsList);
260
- this.$routers.push("/pages/goodsList/main");
261
- },
262
-
263
- getMaskState(state) {
264
- if (state === "1") {
265
- return "预售中";
266
- } else {
267
- return "补货中";
268
- }
269
- },
270
- linkClick(item) {
271
- this.$emit("linkClick", item);
272
- },
273
- },
274
- };
275
- </script>
276
- <style lang="less">
277
- body {
278
- margin: 0px;
279
- }
280
- </style>
281
- <style lang="less" scoped>
282
- .mainTitleColor {
283
- color: #f52b43;
284
- }
285
-
286
- .top {
287
- margin: 0 10px;
288
- padding: 12px 0;
289
-
290
- .mainTitle {
291
- font-size: 16px;
292
- font-weight: 600;
293
- }
294
-
295
- &.left {
296
- display: flex;
297
- justify-content: space-between;
298
- align-items: flex-end;
299
-
300
- .title {
301
- .subtitle {
302
- height: 17px;
303
- line-height: 17px;
304
- font-size: 12px;
305
- font-weight: 400;
306
- color: #333333;
307
- margin-left: 8px;
308
- }
309
- }
310
-
311
- .more {
312
- display: flex;
313
- align-items: center;
314
- height: 18px;
315
- line-height: 18px;
316
- font-size: 12px;
317
- font-weight: 400;
318
- color: #81848c;
319
-
320
- img {
321
- width: 6px;
322
- height: 8px;
323
- }
324
- }
325
- }
326
-
327
- &.center {
328
- padding: 18px 0;
329
-
330
- .title {
331
- display: flex;
332
- justify-content: center;
333
- align-items: center;
334
-
335
- .line {
336
- margin: 0 10px;
337
- background: #d4d4d4;
338
- width: 72px;
339
- height: 1px;
340
- }
341
-
342
- .mainTitle {
343
- text-align: center;
344
- }
345
- }
346
- }
347
- }
348
-
349
- .mainImage {
350
- margin: 0 10px;
351
- max-width: 100%;
352
-
353
- img {
354
- width: 100%;
355
- max-height: 200px;
356
- object-fit: cover;
357
- }
358
- }
359
-
360
- .goodsList {
361
- margin: 8px 10px 0;
362
-
363
- .goodsBox {
364
- background-color: white;
365
-
366
- .imgMarked {
367
- position: absolute;
368
- top: 0;
369
- left: 0;
370
- width: 100%;
371
- height: 100%;
372
- background-color: rgba(0, 0, 0, 0.5);
373
- display: flex;
374
- justify-content: center;
375
- align-items: center;
376
- z-index: 100;
377
-
378
- .maskState {
379
- font-size: 23px;
380
- color: white;
381
- }
382
- }
383
-
384
- .goodsDescription {
385
- .goodsName {
386
- height: 2em;
387
- line-height: 1em;
388
- display: -webkit-box;
389
- -webkit-line-clamp: 2;
390
- -webkit-box-orient: vertical;
391
- overflow: hidden;
392
- text-overflow: ellipsis;
393
- font-size: 12px;
394
- }
395
-
396
- .footerContent {
397
- margin-bottom: 10px;
398
-
399
- .goodsTagList {
400
- display: flex;
401
- margin-top: 6px;
402
- font-size: 12px;
403
-
404
- .tag {
405
- background-color: #fee9ec;
406
- border-radius: 10px;
407
- padding: 0.25em 0.5em;
408
- color: #f52b43;
409
- }
410
-
411
- .tag:not(:last-child) {
412
- margin-right: 8px;
413
- }
414
- }
415
-
416
- .goodsPrice {
417
- color: #f53a50;
418
- font-weight: 600;
419
- font-size: 14px;
420
-
421
- .priceUnit {
422
- font-size: 10px;
423
- }
424
-
425
- .scribing {
426
- display: inline-block;
427
- color: #ccc;
428
- text-decoration: line-through;
429
- font-weight: normal;
430
- font-size: 12px;
431
- }
432
- }
433
-
434
- .goodsBuy {
435
- border: 0;
436
- border-radius: 15px;
437
- background-color: red;
438
- color: white;
439
- font-size: 12px;
440
- line-height: 22px;
441
- width: 5em;
442
- margin-left: auto;
443
- margin-right: auto;
444
- text-align: center;
445
- }
446
- }
447
- }
448
- }
449
- }
450
-
451
- .arrange-1 {
452
- display: flex;
453
- justify-content: space-between;
454
- overflow: hidden;
455
- overflow-x: scroll;
456
-
457
- .goodsBox {
458
- width: 120px;
459
- .goodsImageWrapper {
460
- .goodsImage {
461
- width: 100px;
462
- height: 100px;
463
- }
464
- }
465
- }
466
-
467
- .goodsBox:not(:last-child) {
468
- padding-right: 20px;
469
-
470
- .spacingStyle::after {
471
- content: "";
472
- position: absolute;
473
- right: -10px;
474
- top: 0;
475
- width: 1px;
476
- height: 100%;
477
- background-color: #d3d3d3;
478
- }
479
- }
480
-
481
- .footerContent {
482
- margin-top: 10px;
483
-
484
- .goodsBuy {
485
- text-align: center;
486
- margin-bottom: 10px;
487
- }
488
- }
489
- }
490
-
491
- .arrange-2,
492
- .arrange-4 {
493
- display: flex;
494
- flex-direction: column;
495
- margin: 8px auto;
496
-
497
- .goodsBox {
498
- display: flex;
499
- margin-bottom: 10px;
500
- padding: 10px;
501
-
502
- .goodsImageWrapper {
503
- width: 50%;
504
-
505
- .goodsImage {
506
- width: 100%;
507
- height: 100%;
508
- aspect-ratio: 1;
509
- }
510
- }
511
-
512
- .goodsDescription {
513
- position: relative;
514
- margin-left: 10px;
515
- width: 100%;
516
-
517
- .goodsName {
518
- font-size: 14px;
519
- height: auto;
520
- }
521
-
522
- .footerContent {
523
- .goodsPrice {
524
- display: inline;
525
- position: absolute;
526
- bottom: 0;
527
- left: 0;
528
- font-size: 16px;
529
- }
530
-
531
- .goodsBuy {
532
- display: inline;
533
- position: absolute;
534
- bottom: 0;
535
- right: 0;
536
- margin-bottom: 0;
537
- }
538
- }
539
- }
540
- }
541
- }
542
-
543
- .arrange-3 {
544
- display: flex;
545
- justify-content: space-between;
546
- flex-wrap: wrap;
547
-
548
- .goodsBox {
549
- margin-top: 10px;
550
- background: white;
551
- width: 48%;
552
-
553
- .goodsImage {
554
- width: 100%;
555
- height: 100%;
556
- aspect-ratio: 1;
557
- }
558
-
559
- .goodsDescription {
560
- .goodsName {
561
- margin-top: 10px;
562
- height: 2em;
563
- line-height: 1em;
564
- }
565
-
566
- .footerContent {
567
- margin-top: 5px;
568
- display: flex;
569
- justify-content: space-between;
570
- align-items: flex-end;
571
-
572
- .goodsBuy {
573
- margin: 0;
574
- }
575
- }
576
- }
577
- }
578
-
579
- .goodsBox:nth-child(1) {
580
- width: 100%;
581
-
582
- .goodsImage {
583
- width: 100%;
584
- height: 120px;
585
- object-fit: cover;
586
- }
587
-
588
- .goodsName {
589
- height: auto;
590
- }
591
- }
592
- }
593
-
594
- .arrange-5 {
595
- display: grid;
596
- grid-template-columns: repeat(3, 1fr);
597
- grid-gap: 10px 10px;
598
-
599
- .goodsBox {
600
- background: white;
601
- @media (max-width: 320px) {
602
- width: 100px;
603
- }
604
- @media (min-width: 321px) and (max-width: 375px) {
605
- width: 110px;
606
- }
607
- @media (min-width: 376px) and (max-width: 390px) {
608
- width: 110px;
609
- }
610
- @media (min-width: 391px) and (max-width: 430px) {
611
- width: 120px;
612
- }
613
- @media (min-width: 431px) and (max-width: 1000px) {
614
- width: 120px;
615
- }
616
-
617
- .goodsImage {
618
- width: 100%;
619
- height: 100%;
620
- aspect-ratio: 1 / 1;
621
- }
622
- }
623
-
624
- .goodsDescription {
625
- .footerContent {
626
- margin-bottom: 10px;
627
-
628
- .goodsPrice {
629
- text-align: center;
630
- }
631
-
632
- .goodsBuy {
633
- text-align: center;
634
- margin-bottom: 10px;
635
- }
636
- }
637
- }
638
- }
639
- </style>
1
+ <template>
2
+ <div>
3
+ <div v-if="!props.goods" :style="noDataStyle">请选择商品</div>
4
+ <div
5
+ v-else
6
+ :style="{
7
+ margin: `${props.marginTop}px 0 ${props.marginBottom}px 0`,
8
+ backgroundColor: `${props.backgroundColor}`,
9
+ borderRadius: `${props.cornerStyle}px`,
10
+ }"
11
+ >
12
+ <div
13
+ class="top"
14
+ :class="{ left: props.arrange !== 4 }"
15
+ :style="{
16
+ background: ruleTitle && props.activityTitleLable[0].lable === 2 ? `${ruleTitleImg}` : '',
17
+ }"
18
+ v-if="props.arrange !== 4"
19
+ >
20
+ <div v-if="ruleTitle && props.activityTitleLable[0].lable === 2"></div>
21
+ <div class="title" v-else>
22
+ <span class="mainTitle" :class="mainTitleColor">{{ ruleTitle ? props.activityTitleLable[0].title : hasNewActivityTitle }}</span
23
+ ><span class="subtitle">{{ ruleTitle ? props.activityTitleLable[0].subTitle : hasNewActivitySubtitle }}</span>
24
+ </div>
25
+ <div class="more" @click="goMoreGoods()" v-if="props.more === 1 && [1, 2, 3].includes(props.arrange)">更多<img src="../../static/arrow.png" /></div>
26
+ <div v-else class="more"></div>
27
+ </div>
28
+ <div class="top" :class="{ center: props.arrange === 4 }" v-else-if="props.arrange === 4">
29
+ <div class="title">
30
+ <div class="line"></div>
31
+ <div class="mainTitle">{{ hasNewActivityTitle }}</div>
32
+ <div class="line"></div>
33
+ </div>
34
+ </div>
35
+ <div v-if="selectImgRule('show')" class="mainImage">
36
+ <img
37
+ :style="{
38
+ borderTopLeftRadius: `${props.cornerStyle}px`,
39
+ borderTopRightRadius: `${props.cornerStyle}px`,
40
+ }"
41
+ :src="selectImgRule('url')"
42
+ alt="主图"
43
+ @click="linkClick(selectImgRule('link'))"
44
+ />
45
+ </div>
46
+
47
+ <div class="goodsList" :class="[`arrange-${props.arrange}`, { isLc: !isLc }]">
48
+ <div
49
+ class="goodsBox"
50
+ :style="{
51
+ borderRadius: `${props.cornerStyle}px`,
52
+ }"
53
+ v-for="(item, index) in goodsList"
54
+ :key="item.skuCode"
55
+ @click="goGoodsDetail(item)"
56
+ >
57
+ <div class="goodsImageWrapper" :class="{ spacingStyle: props.spacingStyle === 2 }" style="position: relative">
58
+ <img
59
+ class="goodsImage"
60
+ :style="{ borderRadius: `${props.cornerStyle}px` }"
61
+ :src="item.dataPic ? (item.dataPic.indexOf('http') === -1 ? domainNameUrl + item.dataPic : item.dataPic) : ''"
62
+ alt="商品图片"
63
+ />
64
+ <div
65
+ v-if="isLc === false && (item.goodsSupplynum <= 0 || item.goodsProperty5 === '1')"
66
+ class="imgMarked"
67
+ :style="{
68
+ borderRadius: props.borderRadius,
69
+ }"
70
+ >
71
+ <div class="maskState">
72
+ {{ getMaskState(item.goodsProperty5) }}
73
+ </div>
74
+ </div>
75
+ </div>
76
+
77
+ <div class="goodsDescription">
78
+ <div class="goodsName"><vopLabel />{{ item.goodsName }}</div>
79
+ <section class="footerContent">
80
+ <div class="goodsTagList" v-if="props.goodsTag.length > 0 && [2, 4].includes(props.arrange)">
81
+ <div v-for="tag in props.goodsTag" :key="tag.id">
82
+ <span class="tag">
83
+ {{ tag.value }}
84
+ </span>
85
+ </div>
86
+ </div>
87
+ <div class="goodsPrice">
88
+ <span class="priceUnit">¥</span>{{ item.pricesetNprice }}
89
+ <div class="scribing" v-if="props.markedPrice === 1">¥{{ item.pricesetMakeprice }}</div>
90
+ </div>
91
+ <div class="goodsBuy" @click="handleBuyGoods(item.skuNo)" v-if="props.purchaseIcon === 1">立即购买</div>
92
+ </section>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </template>
99
+
100
+ <script>
101
+ import { fetchGoodImpl, isLc, getUrl } from "../../utils/index.js";
102
+ import { get } from "lodash-es";
103
+ import vopLabel from "../../components/vop-label.vue";
104
+
105
+ export default {
106
+ name: "cyy-collocation",
107
+ props: {
108
+ props: {
109
+ arrange: Number,
110
+ selectImg: String,
111
+ selectImgs: Array,
112
+ selectGoods: Array,
113
+ markedPrice: Number,
114
+ purchaseIcon: Number,
115
+ more: Number,
116
+ activityTitle: String,
117
+ activitySubtitle: String,
118
+ activityTitleLable: Array,
119
+ goodsTag: Array,
120
+ backgroundColor: String,
121
+ cornerStyle: Number,
122
+ spacingStyle: Number,
123
+ marginTop: Number,
124
+ marginBottom: Number,
125
+ },
126
+ },
127
+ data() {
128
+ return {
129
+ noDataStyle: {
130
+ width: "100%",
131
+ height: "180px",
132
+ lineHeight: "180px",
133
+ fontSize: "30px",
134
+ backgroundColor: "#ccc",
135
+ color: "#aaa",
136
+ textAlign: "center",
137
+ },
138
+ goodsList: [],
139
+ completeGoodsList: [],
140
+ domainNameUrl: "",
141
+ imgUrl: "",
142
+ isLc,
143
+ };
144
+ },
145
+ computed: {
146
+ mainTitleColor() {
147
+ return {
148
+ mainTitleColor: this.props.arrange === 5,
149
+ };
150
+ },
151
+ hasNewActivityTitle(){
152
+ if (this.props.activityTitleLable?.length) {
153
+ if (this.props.activityTitleLable[0].lable === 2) {
154
+ return ''
155
+ } else {
156
+ return this.props.activityTitleLable[0].title
157
+ }
158
+ } else {
159
+ return this.props.activityTitle
160
+ }
161
+ },
162
+ hasNewActivitySubtitle(){
163
+ if (this.props.activityTitleLable?.length) {
164
+ if (this.props.activityTitleLable[0].lable === 2) {
165
+ return ''
166
+ } else {
167
+ return this.props.activityTitleLable[0].subTitle
168
+ }
169
+ } else {
170
+ return this.props.activitySubtitle
171
+ }
172
+ },
173
+ ruleTitle() {
174
+ if (this.props.arrange === 1) {
175
+ if (this.props.activityTitleLable?.length) {
176
+ return true;
177
+ } else {
178
+ return false;
179
+ }
180
+ } else {
181
+ return false;
182
+ }
183
+ },
184
+ ruleTitleImg() {
185
+ return this.ruleTitle ? `url(${this.props.activityTitleLable[0]?.imgUrl}) no-repeat` : "";
186
+ },
187
+ selectImgRule() {
188
+ return (params) => {
189
+ if (params === "show") {
190
+ if (this.props.selectImg || this.props.selectImgs?.length) {
191
+ return true;
192
+ }
193
+ return false;
194
+ }
195
+ if (params === "url") {
196
+ if (this.props.selectImgs?.length) {
197
+ return this.props.selectImgs[0].imgUrl;
198
+ }
199
+ if (this.props.selectImg) {
200
+ return this.props.selectImg;
201
+ }
202
+ return "";
203
+ }
204
+ if (params === "link") {
205
+ if (this.props.selectImgs?.length) {
206
+ return this.props.selectImgs[0];
207
+ }
208
+ return [{ link: "无操作" }];
209
+ }
210
+ };
211
+ },
212
+ },
213
+ components: {
214
+ vopLabel,
215
+ },
216
+ mounted() {
217
+ console.log(this.props, "💛💛");
218
+ this.init();
219
+ },
220
+ methods: {
221
+ async init() {
222
+ this.domainNameUrl = getUrl(this);
223
+ const { goods = [] } = this.props;
224
+ const goodsCode = goods.toString();
225
+ const paramObj = { goodsCode };
226
+ const res = await fetchGoodImpl(this, paramObj);
227
+ this.completeGoodsList = get(res, "list", []);
228
+ this.completeGoodsList.forEach((item) => {
229
+ item.rsGoodsFileDomainList = [];
230
+ item.rsSkuDomainList = [];
231
+ });
232
+ // 具有[更多>]的样式只展示部分商品
233
+ if (this.props.arrange === 1) {
234
+ this.goodsList = this.completeGoodsList.slice(0, 12);
235
+ } else if (this.props.arrange === 2) {
236
+ this.goodsList = this.completeGoodsList.slice(0, 2);
237
+ } else if (this.props.arrange === 3) {
238
+ this.goodsList = this.completeGoodsList.slice(0, 3);
239
+ } else if ([4, 5].includes(this.props.arrange)) {
240
+ this.goodsList = this.completeGoodsList.slice(0, 60);
241
+ }
242
+ },
243
+
244
+ goGoodsDetail(item) {
245
+ if (isLc) {
246
+ return;
247
+ }
248
+ const { skuCode } = item;
249
+ let params = {
250
+ skuNo: skuCode,
251
+ };
252
+ this.$routers.push("detail", params);
253
+ },
254
+
255
+ goMoreGoods() {
256
+ if (isLc) {
257
+ return;
258
+ }
259
+ this.$storage.set("goodsList", this.completeGoodsList);
260
+ this.$routers.push("/pages/goodsList/main");
261
+ },
262
+
263
+ getMaskState(state) {
264
+ if (state === "1") {
265
+ return "预售中";
266
+ } else {
267
+ return "补货中";
268
+ }
269
+ },
270
+ linkClick(item) {
271
+ this.$emit("linkClick", item);
272
+ },
273
+ },
274
+ };
275
+ </script>
276
+ <style lang="less">
277
+ body {
278
+ margin: 0px;
279
+ }
280
+ </style>
281
+ <style lang="less" scoped>
282
+ .mainTitleColor {
283
+ color: #f52b43;
284
+ }
285
+
286
+ .top {
287
+ margin: 0 10px;
288
+ padding: 12px 0;
289
+
290
+ .mainTitle {
291
+ font-size: 16px;
292
+ font-weight: 600;
293
+ }
294
+
295
+ &.left {
296
+ display: flex;
297
+ justify-content: space-between;
298
+ align-items: flex-end;
299
+
300
+ .title {
301
+ .subtitle {
302
+ height: 17px;
303
+ line-height: 17px;
304
+ font-size: 12px;
305
+ font-weight: 400;
306
+ color: #333333;
307
+ margin-left: 8px;
308
+ }
309
+ }
310
+
311
+ .more {
312
+ display: flex;
313
+ align-items: center;
314
+ height: 18px;
315
+ line-height: 18px;
316
+ font-size: 12px;
317
+ font-weight: 400;
318
+ color: #81848c;
319
+
320
+ img {
321
+ width: 6px;
322
+ height: 8px;
323
+ }
324
+ }
325
+ }
326
+
327
+ &.center {
328
+ padding: 18px 0;
329
+
330
+ .title {
331
+ display: flex;
332
+ justify-content: center;
333
+ align-items: center;
334
+
335
+ .line {
336
+ margin: 0 10px;
337
+ background: #d4d4d4;
338
+ width: 72px;
339
+ height: 1px;
340
+ }
341
+
342
+ .mainTitle {
343
+ text-align: center;
344
+ }
345
+ }
346
+ }
347
+ }
348
+
349
+ .mainImage {
350
+ margin: 0 10px;
351
+ max-width: 100%;
352
+
353
+ img {
354
+ width: 100%;
355
+ max-height: 200px;
356
+ object-fit: cover;
357
+ }
358
+ }
359
+
360
+ .goodsList {
361
+ margin: 8px 10px 0;
362
+
363
+ .goodsBox {
364
+ background-color: white;
365
+
366
+ .imgMarked {
367
+ position: absolute;
368
+ top: 0;
369
+ left: 0;
370
+ width: 100%;
371
+ height: 100%;
372
+ background-color: rgba(0, 0, 0, 0.5);
373
+ display: flex;
374
+ justify-content: center;
375
+ align-items: center;
376
+ z-index: 100;
377
+
378
+ .maskState {
379
+ font-size: 23px;
380
+ color: white;
381
+ }
382
+ }
383
+
384
+ .goodsDescription {
385
+ .goodsName {
386
+ height: 2em;
387
+ line-height: 1em;
388
+ display: -webkit-box;
389
+ -webkit-line-clamp: 2;
390
+ -webkit-box-orient: vertical;
391
+ overflow: hidden;
392
+ text-overflow: ellipsis;
393
+ font-size: 12px;
394
+ }
395
+
396
+ .footerContent {
397
+ margin-bottom: 10px;
398
+
399
+ .goodsTagList {
400
+ display: flex;
401
+ margin-top: 6px;
402
+ font-size: 12px;
403
+
404
+ .tag {
405
+ background-color: #fee9ec;
406
+ border-radius: 10px;
407
+ padding: 0.25em 0.5em;
408
+ color: #f52b43;
409
+ }
410
+
411
+ .tag:not(:last-child) {
412
+ margin-right: 8px;
413
+ }
414
+ }
415
+
416
+ .goodsPrice {
417
+ color: #f53a50;
418
+ font-weight: 600;
419
+ font-size: 14px;
420
+
421
+ .priceUnit {
422
+ font-size: 10px;
423
+ }
424
+
425
+ .scribing {
426
+ display: inline-block;
427
+ color: #ccc;
428
+ text-decoration: line-through;
429
+ font-weight: normal;
430
+ font-size: 12px;
431
+ }
432
+ }
433
+
434
+ .goodsBuy {
435
+ border: 0;
436
+ border-radius: 15px;
437
+ background-color: red;
438
+ color: white;
439
+ font-size: 12px;
440
+ line-height: 22px;
441
+ width: 5em;
442
+ margin-left: auto;
443
+ margin-right: auto;
444
+ text-align: center;
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+
451
+ .arrange-1 {
452
+ display: flex;
453
+ justify-content: space-between;
454
+ overflow: hidden;
455
+ overflow-x: scroll;
456
+
457
+ .goodsBox {
458
+ width: 120px;
459
+ .goodsImageWrapper {
460
+ .goodsImage {
461
+ width: 100px;
462
+ height: 100px;
463
+ }
464
+ }
465
+ }
466
+
467
+ .goodsBox:not(:last-child) {
468
+ padding-right: 20px;
469
+
470
+ .spacingStyle::after {
471
+ content: "";
472
+ position: absolute;
473
+ right: -10px;
474
+ top: 0;
475
+ width: 1px;
476
+ height: 100%;
477
+ background-color: #d3d3d3;
478
+ }
479
+ }
480
+
481
+ .footerContent {
482
+ margin-top: 10px;
483
+
484
+ .goodsBuy {
485
+ text-align: center;
486
+ margin-bottom: 10px;
487
+ }
488
+ }
489
+ }
490
+
491
+ .arrange-2,
492
+ .arrange-4 {
493
+ display: flex;
494
+ flex-direction: column;
495
+ margin: 8px auto;
496
+
497
+ .goodsBox {
498
+ display: flex;
499
+ margin-bottom: 10px;
500
+ padding: 10px;
501
+
502
+ .goodsImageWrapper {
503
+ width: 50%;
504
+
505
+ .goodsImage {
506
+ width: 100%;
507
+ height: 100%;
508
+ aspect-ratio: 1;
509
+ }
510
+ }
511
+
512
+ .goodsDescription {
513
+ position: relative;
514
+ margin-left: 10px;
515
+ width: 100%;
516
+
517
+ .goodsName {
518
+ font-size: 14px;
519
+ height: auto;
520
+ }
521
+
522
+ .footerContent {
523
+ .goodsPrice {
524
+ display: inline;
525
+ position: absolute;
526
+ bottom: 0;
527
+ left: 0;
528
+ font-size: 16px;
529
+ }
530
+
531
+ .goodsBuy {
532
+ display: inline;
533
+ position: absolute;
534
+ bottom: 0;
535
+ right: 0;
536
+ margin-bottom: 0;
537
+ }
538
+ }
539
+ }
540
+ }
541
+ }
542
+
543
+ .arrange-3 {
544
+ display: flex;
545
+ justify-content: space-between;
546
+ flex-wrap: wrap;
547
+
548
+ .goodsBox {
549
+ margin-top: 10px;
550
+ background: white;
551
+ width: 48%;
552
+
553
+ .goodsImage {
554
+ width: 100%;
555
+ height: 100%;
556
+ aspect-ratio: 1;
557
+ }
558
+
559
+ .goodsDescription {
560
+ .goodsName {
561
+ margin-top: 10px;
562
+ height: 2em;
563
+ line-height: 1em;
564
+ }
565
+
566
+ .footerContent {
567
+ margin-top: 5px;
568
+ display: flex;
569
+ justify-content: space-between;
570
+ align-items: flex-end;
571
+
572
+ .goodsBuy {
573
+ margin: 0;
574
+ }
575
+ }
576
+ }
577
+ }
578
+
579
+ .goodsBox:nth-child(1) {
580
+ width: 100%;
581
+
582
+ .goodsImage {
583
+ width: 100%;
584
+ height: 120px;
585
+ object-fit: cover;
586
+ }
587
+
588
+ .goodsName {
589
+ height: auto;
590
+ }
591
+ }
592
+ }
593
+
594
+ .arrange-5 {
595
+ display: grid;
596
+ grid-template-columns: repeat(3, 1fr);
597
+ grid-gap: 10px 10px;
598
+
599
+ .goodsBox {
600
+ background: white;
601
+ @media (max-width: 320px) {
602
+ width: 100px;
603
+ }
604
+ @media (min-width: 321px) and (max-width: 375px) {
605
+ width: 110px;
606
+ }
607
+ @media (min-width: 376px) and (max-width: 390px) {
608
+ width: 110px;
609
+ }
610
+ @media (min-width: 391px) and (max-width: 430px) {
611
+ width: 120px;
612
+ }
613
+ @media (min-width: 431px) and (max-width: 1000px) {
614
+ width: 120px;
615
+ }
616
+
617
+ .goodsImage {
618
+ width: 100%;
619
+ height: 100%;
620
+ aspect-ratio: 1 / 1;
621
+ }
622
+ }
623
+
624
+ .goodsDescription {
625
+ .footerContent {
626
+ margin-bottom: 10px;
627
+
628
+ .goodsPrice {
629
+ text-align: center;
630
+ }
631
+
632
+ .goodsBuy {
633
+ text-align: center;
634
+ margin-bottom: 10px;
635
+ }
636
+ }
637
+ }
638
+ }
639
+ </style>