|
@@ -15,15 +15,16 @@ import ShareModal from "../../shareModal";
|
15
|
15
|
import joinStoreBg from "../../../images/index/jionStore.png";
|
16
|
16
|
import joinStoreAc from "../../../images/index/joinStoreAc.png";
|
17
|
17
|
import saveMoneyBg from "../../../images/index/save-money.png";
|
|
18
|
+import buy from "../../../images/index/buy.png";
|
18
|
19
|
import shareEarnBg from "../../../images/index/share-earn.png";
|
19
|
20
|
import seckillIcon from "../../../images/seckill/seckillIcon.png";
|
20
|
|
-import { isDebounce } from '../../../common/debounce';
|
|
21
|
+import { isDebounce } from "../../../common/debounce";
|
21
|
22
|
const ProductList = forwardRef((props, ref) => {
|
22
|
23
|
const {
|
23
|
24
|
productList, // 商品列表数据
|
24
|
25
|
loading, // 加载状态
|
25
|
26
|
isSeckill, // 是否秒杀页面使用
|
26
|
|
- isHighCommission, // 是否高佣金页面使用
|
|
27
|
+ isHighCommission, // 是否高佣金��面使用
|
27
|
28
|
isManagement, // 是否管理页面使用
|
28
|
29
|
isManagementStatus, // 是否管理状态
|
29
|
30
|
isProductClassify, // 是否分类页面使用
|
|
@@ -32,6 +33,7 @@ const ProductList = forwardRef((props, ref) => {
|
32
|
33
|
onDeleteProductSelect, // 删除商品选中id数组
|
33
|
34
|
isNoMore, // 是否没有更多
|
34
|
35
|
shareUserId, // 分享用户id
|
|
36
|
+ isEmpty, // 是否为空
|
35
|
37
|
} = props;
|
36
|
38
|
|
37
|
39
|
const [selectedProducts, setSelectedProducts] = useState([]); // 商品选择状态
|
|
@@ -169,11 +171,11 @@ const ProductList = forwardRef((props, ref) => {
|
169
|
171
|
<View key={product.id}>
|
170
|
172
|
<View onClick={() => toDetail(product.id)} className="product-item">
|
171
|
173
|
{isManagement && isManagementStatus && (
|
172
|
|
- <View
|
173
|
|
- className="checkbox-wrapper"
|
|
174
|
+ <View
|
|
175
|
+ className="checkbox-wrapper"
|
174
|
176
|
onClick={(e) => {
|
175
|
177
|
e.stopPropagation();
|
176
|
|
- selectProduct(product.id); // 直接调用 selectProduct
|
|
178
|
+ selectProduct(product.id); // 直接调用 selectProduct
|
177
|
179
|
}}
|
178
|
180
|
>
|
179
|
181
|
<AtCheckbox
|
|
@@ -239,19 +241,26 @@ const ProductList = forwardRef((props, ref) => {
|
239
|
241
|
)}
|
240
|
242
|
</View>
|
241
|
243
|
<View className="profit-line">
|
242
|
|
- <View className="save-money">
|
243
|
|
- <Image className="bg" src={saveMoneyBg} mode="aspectFit" />
|
244
|
|
- <View className="content">
|
|
244
|
+ {Number(product.estimated_commission_buy) > 0 ? (
|
|
245
|
+ <View className="save-money">
|
|
246
|
+ <Image
|
|
247
|
+ className="bg"
|
|
248
|
+ src={saveMoneyBg}
|
|
249
|
+ mode="aspectFit"
|
|
250
|
+ />
|
|
251
|
+ <View className="content">
|
245
|
252
|
<Text className="label">自购省</Text>
|
246
|
253
|
<Text className="money">
|
247
|
|
- ¥{product.estimated_commission_promotion}
|
|
254
|
+ ¥{product.estimated_commission_buy}
|
248
|
255
|
</Text>
|
|
256
|
+ </View>
|
249
|
257
|
</View>
|
250
|
|
- </View>
|
251
|
|
- {/* <View className="save-money">
|
252
|
|
- <Image className="bg" src={saveMoneyBg} mode="aspectFit" />
|
253
|
|
- <View className="content">立 即 购 买</View>
|
254
|
|
- </View> */}
|
|
258
|
+ ) : (
|
|
259
|
+ <View className="buy">
|
|
260
|
+ <Image className="bg" src={buy} mode="aspectFit" />
|
|
261
|
+ <View className="content">立 即 购 买</View>
|
|
262
|
+ </View>
|
|
263
|
+ )}
|
255
|
264
|
<View className="share-earn">
|
256
|
265
|
<Image className="bg" src={shareEarnBg} mode="aspectFit" />
|
257
|
266
|
<View className="content">
|
|
@@ -260,7 +269,7 @@ const ProductList = forwardRef((props, ref) => {
|
260
|
269
|
>
|
261
|
270
|
<Text className="label">分享赚</Text>
|
262
|
271
|
<Text className="money">
|
263
|
|
- ¥{product.estimated_commission_buy}
|
|
272
|
+ ¥{product.estimated_commission_promotion}
|
264
|
273
|
</Text>
|
265
|
274
|
</Button>
|
266
|
275
|
</View>
|
|
@@ -284,14 +293,17 @@ const ProductList = forwardRef((props, ref) => {
|
284
|
293
|
/>
|
285
|
294
|
</View>
|
286
|
295
|
)}
|
287
|
|
- {isNoMore && <View className="no-more">没有更多了~</View>}
|
|
296
|
+ {isNoMore && !isEmpty && <View className="no-more">没有更多了~</View>}
|
288
|
297
|
{/* 分享弹窗 */}
|
289
|
298
|
<ShareModal
|
290
|
299
|
onClose={() => {
|
291
|
300
|
setShareModalOpened(false);
|
292
|
|
- setCurrentShareProduct(null);
|
293
|
|
- setShareTitle("");
|
294
|
|
- setShareLink("");
|
|
301
|
+ // 添加延时,等待关闭动画完成后再重置其他状态
|
|
302
|
+ setTimeout(() => {
|
|
303
|
+ setCurrentShareProduct(null);
|
|
304
|
+ setShareTitle("");
|
|
305
|
+ setShareLink("");
|
|
306
|
+ }, 300); // 300ms 或根据实际动画时长调整
|
295
|
307
|
}}
|
296
|
308
|
isOpened={shareModalOpened}
|
297
|
309
|
product={currentShareProduct}
|
|
@@ -312,6 +324,7 @@ ProductList.defaultProps = {
|
312
|
324
|
isSelectAll: false,
|
313
|
325
|
isNoMore: false,
|
314
|
326
|
shareUserId: "",
|
|
327
|
+ isEmpty: false, // 是否为空
|
315
|
328
|
onAddProduct: () => {}, // 添加商品方法
|
316
|
329
|
onDeleteProductSelect: () => {}, // 删除商品选中id数组
|
317
|
330
|
};
|