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
@@ -0,0 +1,391 @@
1
+ <template>
2
+ <view class="price-box" :style="[priceMLComp]">
3
+ <view :class="{ schedule: type === 'schedule' }">
4
+ <view v-for="(item, index) in uiShowPrice" :key="index">
5
+ <!--售价价格(普通价格)-->
6
+ <view class="price-group">
7
+ <template v-if="item.t === 'S'">
8
+ <view class="price-group-price">
9
+ <xd-unit
10
+ :isShowIcon="isShowIcon"
11
+ :range="item.a || range"
12
+ :colorNew="salePriceColor"
13
+ :iconSize="iconSize"
14
+ :fontSize="salePriceSizeStyle"
15
+ :price="item.p"
16
+ :isOld="false"
17
+ ></xd-unit>
18
+ </view>
19
+ <!--节省显示-->
20
+ <view class="save-price price-group-save" v-if="savePrice">
21
+ <text v-if="savePrice.n">{{ savePrice.n }}</text>
22
+ <text>¥</text>
23
+ <text>{{ divisionPrice(savePrice.p) }}</text>
24
+ </view>
25
+ <!--节省显示-->
26
+ </template>
27
+ <!--文本显示-->
28
+ <view
29
+ class="save-price price-group-text"
30
+ :class="{noPrice: !isPrice, hasPrice:isPrice}"
31
+ v-if="['S','CUS'].includes(item.t) && textInfo && textInfo.length > 0 "
32
+ >
33
+ <view
34
+ class="price-group-item"
35
+ v-for="text in textInfo"
36
+ :key="text.n"
37
+ :class="{textTag:text.s === 't'}"
38
+ >
39
+ <view>{{ text.n }}</view>
40
+ <view v-if="text.a">{{ text.a}}</view>
41
+ </view>
42
+ </view>
43
+ <!--文本显示-->
44
+ </view>
45
+ <!--售价价格(普通价格)-->
46
+ <!--在线选择(排期)-->
47
+ <!--节省显示-->
48
+ <view class="save-price" style="margin: 4rpx 0;" v-if="item.t === 'E' && type==='schedule'">
49
+ <text v-if="item.n">{{ item.n }}</text>
50
+ <text>¥</text>
51
+ <text>{{ divisionPrice(item.p) }}</text>
52
+ </view>
53
+ <!--节省显示-->
54
+ <!--在线选择(排期)-->
55
+ <!--划线价格 活动价格与划线价格二选一-->
56
+ <view
57
+ v-if="item.t === 'U'"
58
+ class="line_one_delete"
59
+ :class="{ threeFontSize: type === 'three' }"
60
+ :style="[originalPriceSizeStyle]"
61
+ >
62
+
63
+ <text v-if="item.n">{{ item.n }}:</text>
64
+ <text>¥</text>
65
+ <text>{{ divisionPrice(item.p) }}</text>
66
+ </view>
67
+ <!--划线价格-->
68
+ <!--活动价格(plus,秒杀)-->
69
+ <view
70
+ v-if="item.t === 'D' && isPlus"
71
+ class="price-box-vip"
72
+ :class="{ three: type === 'three' }"
73
+ >
74
+ <view :style="[vipPriceSizeStyle]" class="price-box-vip-name">{{item.n }}</view>
75
+ <view :style="[vipPriceSizeStyle]" class="price-box-vip-price">{{divisionPrice(item.p)}}</view>
76
+ </view>
77
+ <view
78
+ :style="[activityStyle]"
79
+ v-if="item.t === 'D' && !isPlus && type === 'info' "
80
+ class="price-box-activity"
81
+ >{{ item.n }} <text v-if="item.n">:</text>{{ divisionPrice(item.p) }}</view>
82
+ <!--活动价格-->
83
+ </view>
84
+ </view>
85
+ </view>
86
+ </template>
87
+ <script>
88
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
89
+ import XdUnit from "@/components/XdUnit/XdUnit.vue";
90
+ import Color from "color";
91
+
92
+ export default {
93
+ name: "CusPrice",
94
+ components: {
95
+ XdFontIcon,
96
+ XdUnit,
97
+ },
98
+ props: {
99
+ //1列(one)、2列(two)、3列(three)、商品详情(info)、订单(order)、在线选座排期(schedule),普通模式(normal)
100
+ type: {
101
+ type: String,
102
+ default: "one",
103
+ },
104
+ iconSize: {
105
+ type: Number | String,
106
+ default: "0.3",
107
+ },
108
+ //原价颜色
109
+ originalPriceColor: {
110
+ type: String,
111
+ default: "#999",
112
+ },
113
+ //原价字体大小
114
+ originalPriceFontSize: {
115
+ type: String,
116
+ default: "",
117
+ },
118
+ //售价颜色
119
+ salePriceColor: {
120
+ type: String,
121
+ default: "",
122
+ },
123
+ salePriceFontSize: {
124
+ type: String,
125
+ default: "",
126
+ },
127
+ //活动售价颜色
128
+ activitySalePriceColor: {
129
+ type: String,
130
+ default: "#fff",
131
+ },
132
+ //活动售价字体大小
133
+ activitySalePriceSize: {
134
+ type: String,
135
+ default: "",
136
+ },
137
+ //是否是plus站点
138
+ isPlus: {
139
+ type: Boolean,
140
+ default: false,
141
+ },
142
+ showPrice: {
143
+ type: Array,
144
+ default: [],
145
+ },
146
+ range: {
147
+ type: String,
148
+ default: "",
149
+ },
150
+ isShowIcon: {
151
+ type: Boolean | String,
152
+ default: "",
153
+ },
154
+ textFontSize:{
155
+ type: String|Number,
156
+ default: "24",
157
+ },
158
+ normalPriceFontSize:{
159
+ type: String|Number,
160
+ default: "22",
161
+ },
162
+ },
163
+ data() {
164
+ return {
165
+ isPrice: false,
166
+ savePrice: null,
167
+ textInfo: null,
168
+ uiShowPrice: null,
169
+ };
170
+ },
171
+ watch: {
172
+ showPrice:{
173
+ handler(value){
174
+ this.init();
175
+ },
176
+ deep: true
177
+ },
178
+ },
179
+ computed: {
180
+ vipPriceSizeStyle() {
181
+ let fontSize = this.type === "info" ? "24rpx" : "20rpx";
182
+ let minWidth = this.type === "info" ? "60rpx" : "59rpx";
183
+ return {
184
+ fontSize,
185
+ minWidth,
186
+ };
187
+ },
188
+ salePriceSizeStyle() {
189
+ let fontSize = "40";
190
+ switch (this.type) {
191
+ case "one":
192
+ fontSize = "40";
193
+ break;
194
+ case "two":
195
+ fontSize = "40";
196
+ break;
197
+ case "three":
198
+ fontSize = "24";
199
+ break;
200
+ case "normal":
201
+ fontSize = this.normalPriceFontSize;
202
+ break;
203
+ case "info":
204
+ fontSize = "48";
205
+ break;
206
+ case "order":
207
+ fontSize = "40";
208
+ break;
209
+ case "schedule":
210
+ fontSize = "32";
211
+ break;
212
+ }
213
+ if (this.salePriceFontSize) fontSize = this.salePriceFontSize;
214
+ return fontSize;
215
+ },
216
+ priceMLComp(){
217
+ return {
218
+ '--price-unit-style-ml': this.salePriceSizeStyle * .5 * this.$rpxNum + 'px',
219
+ "--price-unit-style-c":`rgba(${Color('#FF2C18').alpha(0.2).array().join(',')})`,
220
+ "--price-unit-style-ts": this.textFontSize * this.$rpxNum + 'px'
221
+ }
222
+ },
223
+ originalPriceSizeStyle() {
224
+ let fontSize =
225
+ this.type === "info" || this.type === "order" ? "28rpx" : "24rpx";
226
+ if (this.type === "three") fontSize = "20rpx";
227
+ if (this.originalPriceFontSize)
228
+ fontSize = `${this.originalPriceFontSize}rpx`;
229
+ return {
230
+ fontSize,
231
+ color: this.originalPriceColor,
232
+ };
233
+ },
234
+ activityStyle() {
235
+ let fontSize = "24rpx";
236
+ if (this.activitySalePriceSize) fontSize = `${this.activitySalePriceSize}rpx`;
237
+ return {
238
+ color: this.activitySalePriceColor,
239
+ fontSize,
240
+ };
241
+ },
242
+ },
243
+ created() {
244
+ this.init();
245
+ },
246
+ methods: {
247
+ init(){
248
+ let showPrice = this.$xdUniHelper.cloneDeep(this.showPrice);
249
+
250
+ //三列(不显示文本信息和省信息), 排期(上下排列信息)
251
+ if(!['three', 'schedule'].includes(this.type)) {
252
+ this.savePrice = showPrice.find(item => item.t === 'E');
253
+ this.textInfo = showPrice.filter(item => item.t === 'T');
254
+ this.isPrice = !!(showPrice.find(item => item.t === 'S'));
255
+ //过滤掉T和E模式
256
+ this.uiShowPrice = showPrice.filter(item=>{
257
+ return !(item.t === 'T' || item.t === 'E')
258
+ });
259
+
260
+ //不显示价格时候,需要创建一字符串对象(因为T模式已经被过滤掉了)
261
+ if(this.textInfo.length > 0 && !this.isPrice) {
262
+ this.uiShowPrice = [{t: 'CUS'}]
263
+ }
264
+
265
+ }
266
+ else this.uiShowPrice = showPrice;
267
+ },
268
+ divisionPrice(price) {
269
+ return this.$xdUniHelper.divisionFloatNumber(price, 100);
270
+ },
271
+ },
272
+ };
273
+ </script>
274
+
275
+
276
+
277
+ <style scoped lang="less">
278
+ .schedule {
279
+ display: flex;
280
+ flex-direction: column;
281
+ align-items: center;
282
+ justify-content: center;
283
+ }
284
+ .price-group{
285
+ display: flex;
286
+ align-items: center;
287
+ flex-flow: wrap;
288
+ justify-content: flex-start;
289
+
290
+ &-item {
291
+ margin-right: var(--price-unit-style-ml);
292
+ height: 40rpx;
293
+ line-height: 40rpx;
294
+ box-sizing: border-box;
295
+ font-size: var(--price-unit-style-ts);
296
+ display: flex;
297
+ justify-content: flex-start;
298
+ align-items: center;
299
+
300
+ & > view {
301
+ color: #FF2C18;
302
+ }
303
+
304
+ &.textTag {
305
+ border: 2rpx solid var(--price-unit-style-c);
306
+ border-radius: 6rpx;
307
+ padding: 0 8rpx;
308
+ }
309
+ }
310
+ &-save {
311
+ font-size: var(--price-unit-style-ts);
312
+ margin-left: var(--price-unit-style-ml);
313
+ color: #FF2C18;
314
+ }
315
+ &-text {
316
+ &.noPrice {
317
+ & > view:last-child {
318
+ margin-right: 0!important;
319
+ }
320
+ }
321
+ &.hasPrice {
322
+ margin-left: var(--price-unit-style-ml);
323
+ & > view:last-child {
324
+ margin-right: 0!important;
325
+ }
326
+ }
327
+ }
328
+ }
329
+ .price-box {
330
+ position: relative;
331
+
332
+
333
+ &-activity {
334
+ font-size: 24rpx;
335
+ font-weight: 500;
336
+ // position: relative;
337
+ // bottom: 5px;
338
+ }
339
+
340
+ &-vip {
341
+ display: flex;
342
+ justify-content: flex-start;
343
+
344
+ &-name {
345
+ background: linear-gradient(
346
+ 90deg,
347
+ rgba(102, 86, 70, 1) 0%,
348
+ rgba(71, 61, 52, 1) 52.05%,
349
+ rgba(43, 38, 35, 1) 100%
350
+ );
351
+ color: #efd5c3;
352
+ text-align: center;
353
+ flex-wrap: nowrap;
354
+ padding: 8rpx 12rpx;
355
+ border-radius: 80rpx 0 0 80rpx;
356
+ }
357
+
358
+ &-price {
359
+ background: linear-gradient(270deg, #fcd6b8 0%, #fcedd7 100%);
360
+ color: #615850;
361
+ font-weight: 700;
362
+ flex-wrap: nowrap;
363
+ text-align: center;
364
+ padding: 8rpx 12rpx;
365
+ border-radius: 0 80rpx 80rpx 0;
366
+ }
367
+ }
368
+
369
+ &-vip.three {
370
+ & .price-box-vip-name {
371
+ padding: 0 4rpx 0 8rpx !important;
372
+ border-radius: 15rpx 0 0 15rpx;
373
+ line-height: 30rpx;
374
+ }
375
+ & .price-box-vip-price {
376
+ padding: 0 8rpx 0 4rpx !important;
377
+ border-radius: 0 15rpx 15rpx 0;
378
+ line-height: 30rpx;
379
+ }
380
+ }
381
+ }
382
+
383
+ .line_one_delete {
384
+ text-decoration: line-through;
385
+ font-weight: normal;
386
+ }
387
+
388
+ .threeFontSize {
389
+ font-size: 20rpx;
390
+ }
391
+ </style>