|
|
@@ -5,65 +5,65 @@ import { useState, useEffect, useCallback } from "react";
|
|
|
import PriceModal from "./popup/PriceModal";
|
|
|
|
|
|
// 价格组件复用你项目自带的Price
|
|
|
-import { Price } from "@components/theme/ui/Price";
|
|
|
+// import { Price } from "@components/theme/ui/Price";
|
|
|
|
|
|
// SVG图标:左侧对话图标、右侧下拉箭头
|
|
|
-const ChatSvg = () => (
|
|
|
- <svg
|
|
|
- xmlns="http://www.w3.org/2000/svg"
|
|
|
- width="24"
|
|
|
- height="24"
|
|
|
- viewBox="0 0 24 24"
|
|
|
- fill="none"
|
|
|
- >
|
|
|
- <path
|
|
|
- d="M22 12C22 17.5229 17.5229 22 12 22C9.01325 22 2 22 2 22C2 22 2 14.5361 2 12C2 6.47715 6.47717 2 12 2C17.5229 2 22 6.47715 22 12Z"
|
|
|
- stroke="rgba(0, 0, 0, 1)"
|
|
|
- stroke-width="1.5"
|
|
|
- stroke-linejoin="round"
|
|
|
- stroke-linecap="round"
|
|
|
- ></path>
|
|
|
- <path
|
|
|
- stroke="rgba(0, 0, 0, 1)"
|
|
|
- stroke-width="1.5"
|
|
|
- stroke-linejoin="round"
|
|
|
- stroke-linecap="round"
|
|
|
- d="M7 9L16 9"
|
|
|
- ></path>
|
|
|
- <path
|
|
|
- stroke="rgba(0, 0, 0, 1)"
|
|
|
- stroke-width="1.5"
|
|
|
- stroke-linejoin="round"
|
|
|
- stroke-linecap="round"
|
|
|
- d="M7 13L16 13"
|
|
|
- ></path>
|
|
|
- <path
|
|
|
- stroke="rgba(0, 0, 0, 1)"
|
|
|
- stroke-width="1.5"
|
|
|
- stroke-linejoin="round"
|
|
|
- stroke-linecap="round"
|
|
|
- d="M7 17L12 17"
|
|
|
- ></path>
|
|
|
- </svg>
|
|
|
-);
|
|
|
+// const ChatSvg = () => (
|
|
|
+// <svg
|
|
|
+// xmlns="http://www.w3.org/2000/svg"
|
|
|
+// width="24"
|
|
|
+// height="24"
|
|
|
+// viewBox="0 0 24 24"
|
|
|
+// fill="none"
|
|
|
+// >
|
|
|
+// <path
|
|
|
+// d="M22 12C22 17.5229 17.5229 22 12 22C9.01325 22 2 22 2 22C2 22 2 14.5361 2 12C2 6.47715 6.47717 2 12 2C17.5229 2 22 6.47715 22 12Z"
|
|
|
+// stroke="rgba(0, 0, 0, 1)"
|
|
|
+// stroke-width="1.5"
|
|
|
+// stroke-linejoin="round"
|
|
|
+// stroke-linecap="round"
|
|
|
+// ></path>
|
|
|
+// <path
|
|
|
+// stroke="rgba(0, 0, 0, 1)"
|
|
|
+// stroke-width="1.5"
|
|
|
+// stroke-linejoin="round"
|
|
|
+// stroke-linecap="round"
|
|
|
+// d="M7 9L16 9"
|
|
|
+// ></path>
|
|
|
+// <path
|
|
|
+// stroke="rgba(0, 0, 0, 1)"
|
|
|
+// stroke-width="1.5"
|
|
|
+// stroke-linejoin="round"
|
|
|
+// stroke-linecap="round"
|
|
|
+// d="M7 13L16 13"
|
|
|
+// ></path>
|
|
|
+// <path
|
|
|
+// stroke="rgba(0, 0, 0, 1)"
|
|
|
+// stroke-width="1.5"
|
|
|
+// stroke-linejoin="round"
|
|
|
+// stroke-linecap="round"
|
|
|
+// d="M7 17L12 17"
|
|
|
+// ></path>
|
|
|
+// </svg>
|
|
|
+// );
|
|
|
|
|
|
-const ArrowDownSvg = () => (
|
|
|
- <svg
|
|
|
- xmlns="http://www.w3.org/2000/svg"
|
|
|
- width="24"
|
|
|
- height="24"
|
|
|
- viewBox="0 0 24 24"
|
|
|
- fill="none"
|
|
|
- >
|
|
|
- <path
|
|
|
- stroke="rgba(0, 0, 0, 1)"
|
|
|
- stroke-width="1.5"
|
|
|
- stroke-linejoin="round"
|
|
|
- stroke-linecap="square"
|
|
|
- d="M18 9L12 15L6 9"
|
|
|
- ></path>
|
|
|
- </svg>
|
|
|
-);
|
|
|
+// const ArrowDownSvg = () => (
|
|
|
+// <svg
|
|
|
+// xmlns="http://www.w3.org/2000/svg"
|
|
|
+// width="24"
|
|
|
+// height="24"
|
|
|
+// viewBox="0 0 24 24"
|
|
|
+// fill="none"
|
|
|
+// >
|
|
|
+// <path
|
|
|
+// stroke="rgba(0, 0, 0, 1)"
|
|
|
+// stroke-width="1.5"
|
|
|
+// stroke-linejoin="round"
|
|
|
+// stroke-linecap="square"
|
|
|
+// d="M18 9L12 15L6 9"
|
|
|
+// ></path>
|
|
|
+// </svg>
|
|
|
+// );
|
|
|
|
|
|
// 价格数据类型定义,从父组件传入
|
|
|
type VariantPriceInfo = {
|
|
|
@@ -103,9 +103,9 @@ export function ProductAddToCart({
|
|
|
}, [handleScroll]);
|
|
|
|
|
|
// 解构价格数据
|
|
|
- const { totalNowPrice, totalLinePrice, save } = priceInfo;
|
|
|
+ // const { totalNowPrice, totalLinePrice, save } = priceInfo;
|
|
|
// 是否有折扣(原价≠现价)
|
|
|
- const hasDiscount = totalLinePrice !== totalNowPrice;
|
|
|
+ // const hasDiscount = totalLinePrice !== totalNowPrice;
|
|
|
|
|
|
return (
|
|
|
<div
|