cb-biz-ui 1.5.4 → 1.5.5
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.
|
@@ -25,9 +25,8 @@
|
|
|
25
25
|
<view class="goods-card_info">
|
|
26
26
|
<view class="goods-card_info_title">
|
|
27
27
|
<ui-overflow-hidden size="24rpx">
|
|
28
|
-
<text class="text" :style="{ fontSize: textFontSize.title }"
|
|
29
|
-
|
|
30
|
-
}}
|
|
28
|
+
<text class="text" :style="{ fontSize: textFontSize.title }"
|
|
29
|
+
>{{ entity.name }}
|
|
31
30
|
</text>
|
|
32
31
|
</ui-overflow-hidden>
|
|
33
32
|
</view>
|
|
@@ -66,11 +65,26 @@
|
|
|
66
65
|
</ui-tag>
|
|
67
66
|
</view>
|
|
68
67
|
</view>
|
|
68
|
+
<view class="rebate-box" v-if="entity.skuCommonExt.enableRebate">
|
|
69
|
+
<view class="rebate-box_title"> 购买返利 </view>
|
|
70
|
+
<view class="rebate-box_content">
|
|
71
|
+
<text class="rebate-box_content_text">约¥1.01</text>
|
|
72
|
+
<view class="rebate-box_content_icon">
|
|
73
|
+
(
|
|
74
|
+
<text class="rebate-box_content_icon_text">11111</text>
|
|
75
|
+
<image
|
|
76
|
+
class="rebate-icon"
|
|
77
|
+
src="https://edu-cdn.yunzhuxue.com/edub1429d21xcfds/img/cd9fd828b1b047aa8ac91f020b8452e9@.png@.webp"
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
</view>
|
|
81
|
+
</view>
|
|
82
|
+
</view>
|
|
69
83
|
<view class="goods-card_info_sales-volume">
|
|
70
84
|
<text
|
|
71
85
|
class="goods-card_info_sales-volume_text"
|
|
72
86
|
:style="{ fontSize: textFontSize.salesVolume }"
|
|
73
|
-
|
|
87
|
+
>销量{{ ` ` }}{{ entity.saleCnt || 0 }}
|
|
74
88
|
</text>
|
|
75
89
|
</view>
|
|
76
90
|
<view class="goods-card_info_price">
|
|
@@ -78,14 +92,14 @@
|
|
|
78
92
|
class="goods-card_info_price_preferential-price"
|
|
79
93
|
:style="{ fontSize: textFontSize.preferentialPrice }"
|
|
80
94
|
>
|
|
81
|
-
¥{{ price }}/{{ entity?.unitTitle ||
|
|
95
|
+
¥{{ price }}/{{ entity?.unitTitle || '件' }}
|
|
82
96
|
</text>
|
|
83
97
|
<text
|
|
84
98
|
class="goods-card_info_price_price"
|
|
85
99
|
v-if="entity.hasDiscount"
|
|
86
100
|
:style="{ fontSize: textFontSize.price }"
|
|
87
101
|
>
|
|
88
|
-
¥{{ entity.marketPriceShow }}/{{ entity.unitTitle ||
|
|
102
|
+
¥{{ entity.marketPriceShow }}/{{ entity.unitTitle || '件' }}
|
|
89
103
|
</text>
|
|
90
104
|
</view>
|
|
91
105
|
<view class="goods-card_info_status" v-if="errStatusText">
|
|
@@ -149,8 +163,8 @@
|
|
|
149
163
|
</template>
|
|
150
164
|
|
|
151
165
|
<script setup lang="ts">
|
|
152
|
-
import { onMounted, reactive, computed } from
|
|
153
|
-
import type { GoodsDataType, changeValueType } from
|
|
166
|
+
import { onMounted, reactive, computed } from 'vue';
|
|
167
|
+
import type { GoodsDataType, changeValueType } from '../interface/types';
|
|
154
168
|
|
|
155
169
|
interface IProps {
|
|
156
170
|
entity: GoodsDataType;
|
|
@@ -161,19 +175,19 @@ interface IProps {
|
|
|
161
175
|
goodMin?: number;
|
|
162
176
|
imagePlaceholder?: string;
|
|
163
177
|
imageMode?:
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
178
|
+
| 'scaleToFill'
|
|
179
|
+
| 'aspectFit'
|
|
180
|
+
| 'aspectFill'
|
|
181
|
+
| 'widthFix'
|
|
182
|
+
| 'top'
|
|
183
|
+
| 'bottom'
|
|
184
|
+
| 'center'
|
|
185
|
+
| 'left'
|
|
186
|
+
| 'right'
|
|
187
|
+
| 'top left'
|
|
188
|
+
| 'top right'
|
|
189
|
+
| 'bottom left'
|
|
190
|
+
| 'bottom right';
|
|
177
191
|
textFontSize?: {
|
|
178
192
|
title: string;
|
|
179
193
|
tag: string;
|
|
@@ -186,35 +200,35 @@ interface IProps {
|
|
|
186
200
|
}
|
|
187
201
|
|
|
188
202
|
const props = withDefaults(defineProps<IProps>(), {
|
|
189
|
-
imgWidth:
|
|
190
|
-
imgHeight:
|
|
203
|
+
imgWidth: '225rpx',
|
|
204
|
+
imgHeight: '225rpx',
|
|
191
205
|
goodMin: 0,
|
|
192
206
|
goodsCount: 0,
|
|
193
207
|
bezier: true,
|
|
194
208
|
imagePlaceholder:
|
|
195
|
-
|
|
196
|
-
imageMode:
|
|
209
|
+
'https://shop-cdn.cbyzx.com/shop23n05y18abcd/img/3544375090854cd099d72edb09dce492.png',
|
|
210
|
+
imageMode: 'aspectFill',
|
|
197
211
|
textFontSize: {
|
|
198
|
-
title:
|
|
199
|
-
tag:
|
|
200
|
-
salesVolume:
|
|
201
|
-
preferentialPrice:
|
|
202
|
-
price:
|
|
203
|
-
numberBoxBg:
|
|
212
|
+
title: '24rpx',
|
|
213
|
+
tag: '18rpx',
|
|
214
|
+
salesVolume: '20rpx',
|
|
215
|
+
preferentialPrice: '24rpx',
|
|
216
|
+
price: '20rpx',
|
|
217
|
+
numberBoxBg: '#fff'
|
|
204
218
|
},
|
|
205
219
|
entity: {
|
|
206
|
-
goodSrc:
|
|
207
|
-
title:
|
|
220
|
+
goodSrc: '',
|
|
221
|
+
title: '',
|
|
208
222
|
preferentialPrice: 0,
|
|
209
223
|
status: 0,
|
|
210
|
-
unit:
|
|
224
|
+
unit: '份'
|
|
211
225
|
},
|
|
212
226
|
addBtnBgColor: 'rgba(255, 82, 79, 1)'
|
|
213
227
|
});
|
|
214
228
|
|
|
215
229
|
const emit = defineEmits<{
|
|
216
|
-
(e:
|
|
217
|
-
(e:
|
|
230
|
+
(e: 'countChange', value: changeValueType, entity: GoodsDataType): void;
|
|
231
|
+
(e: 'handleClick', entity: GoodsDataType): void;
|
|
218
232
|
}>();
|
|
219
233
|
|
|
220
234
|
const price = computed(() => {
|
|
@@ -224,12 +238,12 @@ const price = computed(() => {
|
|
|
224
238
|
});
|
|
225
239
|
const errStatusText = computed(() => {
|
|
226
240
|
if (props.entity.saleStatus === 20) {
|
|
227
|
-
return
|
|
241
|
+
return '已失效';
|
|
228
242
|
}
|
|
229
243
|
if (!props.entity.existInventory) {
|
|
230
|
-
return
|
|
244
|
+
return '无货';
|
|
231
245
|
}
|
|
232
|
-
return
|
|
246
|
+
return '';
|
|
233
247
|
});
|
|
234
248
|
|
|
235
249
|
const state = reactive({
|
|
@@ -247,13 +261,13 @@ const change = (val: changeValueType) => {
|
|
|
247
261
|
// if (val > props.entity.inventoryCapacity) {
|
|
248
262
|
// triggerMax();
|
|
249
263
|
// }
|
|
250
|
-
emit(
|
|
264
|
+
emit('countChange', val, props.entity);
|
|
251
265
|
};
|
|
252
266
|
|
|
253
267
|
const triggerMax = () => {
|
|
254
268
|
uni.showModal({
|
|
255
|
-
title:
|
|
256
|
-
content:
|
|
269
|
+
title: '提示',
|
|
270
|
+
content: '库存不足,最大库存为' + props.entity.inventoryCapacity,
|
|
257
271
|
showCancel: false
|
|
258
272
|
});
|
|
259
273
|
};
|
|
@@ -265,7 +279,7 @@ const load = () => {
|
|
|
265
279
|
};
|
|
266
280
|
|
|
267
281
|
const itemTap = () => {
|
|
268
|
-
emit(
|
|
282
|
+
emit('handleClick', props.entity);
|
|
269
283
|
};
|
|
270
284
|
|
|
271
285
|
onMounted(() => {
|
|
@@ -275,7 +289,7 @@ onMounted(() => {
|
|
|
275
289
|
const addClick = () => {
|
|
276
290
|
change({
|
|
277
291
|
value: props.goodsCount + 1,
|
|
278
|
-
type:
|
|
292
|
+
type: 'plus',
|
|
279
293
|
index: 0,
|
|
280
294
|
custom: {}
|
|
281
295
|
});
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
<view class="off-shelf" v-if="data.saleStatus === 20">
|
|
18
18
|
<text class="text">已下架</text>
|
|
19
19
|
</view>
|
|
20
|
+
<view
|
|
21
|
+
class="rebate"
|
|
22
|
+
v-if="data.saleStatus == 10 && data.skuCommonExt.enableRebate"
|
|
23
|
+
>
|
|
24
|
+
<text class="text">购后返利:¥{{ data.skuCommonExt.rebateVal }}</text>
|
|
25
|
+
</view>
|
|
20
26
|
</view>
|
|
21
27
|
<view class="text-box">
|
|
22
28
|
<view class="header">
|
|
@@ -60,6 +66,11 @@ interface dataType {
|
|
|
60
66
|
marketPriceShow: string; // 市场价
|
|
61
67
|
saleCnt: number; // 销量
|
|
62
68
|
distributionCommissionRate: string; // 佣金率
|
|
69
|
+
skuCommonExt: {
|
|
70
|
+
rebateVal: number;
|
|
71
|
+
enableRebate: boolean;
|
|
72
|
+
rebateType: string;
|
|
73
|
+
};
|
|
63
74
|
}
|
|
64
75
|
interface IProps {
|
|
65
76
|
data: dataType;
|
|
@@ -31,7 +31,16 @@ export interface GoodsDataType {
|
|
|
31
31
|
marketPriceShow: string;
|
|
32
32
|
existInventory: boolean; // 是否有库存
|
|
33
33
|
saleCnt: number; // 销量
|
|
34
|
-
purchaseLimitNum: number // 限购数量
|
|
34
|
+
purchaseLimitNum: number; // 限购数量
|
|
35
|
+
skuCommonExt: {
|
|
36
|
+
distributionCommissionRate: string; // 分销佣金比例
|
|
37
|
+
enableDistribution: number; // 是否开启分销
|
|
38
|
+
enableRebate: boolean; // 是否开启购后返利
|
|
39
|
+
rebateContractId: number; // 返利合同id
|
|
40
|
+
rebateContractSnapshotId: number; // 返利合同快照id
|
|
41
|
+
rebateType: string; // 返利类型
|
|
42
|
+
rebateVal: string; // 返利金额
|
|
43
|
+
};
|
|
35
44
|
}
|
|
36
45
|
export interface changeValueType {
|
|
37
46
|
value: number;
|
|
@@ -58,7 +67,7 @@ export interface skuInfoType {
|
|
|
58
67
|
/**是否无限库存 */
|
|
59
68
|
unlimitedInventory: boolean;
|
|
60
69
|
existInventory: boolean; // 是否有库存
|
|
61
|
-
purchaseLimitNum: number // 是否限购 -1 不限购
|
|
70
|
+
purchaseLimitNum: number; // 是否限购 -1 不限购
|
|
62
71
|
}
|
|
63
72
|
export interface cartItemListType {
|
|
64
73
|
/** 买家id */
|
package/libs/css/goods-card.scss
CHANGED
|
@@ -66,6 +66,37 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
.rebate-box {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
font-size: 18rpx;
|
|
73
|
+
border: 1px solid rgba(255, 82, 79, 1);
|
|
74
|
+
border-radius: 10rpx;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
|
|
77
|
+
.rebate-box_title {
|
|
78
|
+
font-size: 20rpx;
|
|
79
|
+
color: rgb(1, 1, 1);
|
|
80
|
+
background-color: rgba(255, 82, 79, 1);
|
|
81
|
+
padding: 25rpx 20rpx;
|
|
82
|
+
}
|
|
83
|
+
.rebate-box_content {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
padding: 25rpx 10rpx;
|
|
87
|
+
color: rgba(255, 82, 79, 1);
|
|
88
|
+
.rebate-box_content_icon {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
color: rgba(102, 102, 102, 1);
|
|
92
|
+
.rebate-icon {
|
|
93
|
+
width: 30rpx;
|
|
94
|
+
height: 30rpx;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
69
100
|
.goods-card_info_sales-volume {
|
|
70
101
|
width: 100%;
|
|
71
102
|
display: flex;
|
|
@@ -152,4 +183,4 @@
|
|
|
152
183
|
z-index: 21;
|
|
153
184
|
}
|
|
154
185
|
}
|
|
155
|
-
}
|
|
186
|
+
}
|
|
@@ -33,6 +33,24 @@
|
|
|
33
33
|
font-size: 26rpx;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
.rebate {
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
background: rgba(49, 48, 48, 0.73);
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
padding: 10rpx 0;
|
|
47
|
+
font-size: 20rpx;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
.text {
|
|
50
|
+
color: #bfbfbf;
|
|
51
|
+
font-size: 20rpx;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
36
54
|
}
|
|
37
55
|
|
|
38
56
|
.text-box {
|
|
@@ -77,22 +95,28 @@
|
|
|
77
95
|
align-items: center;
|
|
78
96
|
font-size: 26rpx;
|
|
79
97
|
width: 100%;
|
|
98
|
+
|
|
80
99
|
.money {
|
|
81
100
|
width: 150rpx;
|
|
82
101
|
font-weight: bold;
|
|
102
|
+
|
|
83
103
|
.symbol {
|
|
84
104
|
font-size: 20rpx;
|
|
85
105
|
}
|
|
106
|
+
|
|
86
107
|
.value {
|
|
87
108
|
color: #FF0000;
|
|
88
109
|
}
|
|
89
110
|
}
|
|
90
|
-
|
|
111
|
+
|
|
112
|
+
.rate {
|
|
91
113
|
display: flex;
|
|
92
114
|
align-items: center;
|
|
115
|
+
|
|
93
116
|
.label {
|
|
94
117
|
color: #666666;
|
|
95
118
|
}
|
|
119
|
+
|
|
96
120
|
.value {
|
|
97
121
|
color: #FF0000;
|
|
98
122
|
}
|
|
@@ -100,4 +124,4 @@
|
|
|
100
124
|
}
|
|
101
125
|
}
|
|
102
126
|
}
|
|
103
|
-
}
|
|
127
|
+
}
|