diff --git a/src/components/knockGold/mobileComponent.jsx b/src/components/knockGold/mobileComponent.jsx index c6c00c97..0d93f919 100644 --- a/src/components/knockGold/mobileComponent.jsx +++ b/src/components/knockGold/mobileComponent.jsx @@ -1,44 +1,40 @@ -import { Placeholder } from "zent"; -import { useEffect, useState } from "react"; -import { useSetState } from "ahooks"; -import "./index.less"; -import { sortWeeks } from "@/utils"; -const widths = [ - 24, 100, 100, 100, 80, 24, 100, 100, 100, 80, 100, 100, 100, 80, -]; +import { Placeholder } from "zent" +import { useEffect, useState } from "react" +import "./index.less" +import { sortWeeks } from "@/utils" +const widths = [24, 100, 100, 100, 80, 24, 100, 100, 100, 80, 100, 100, 100, 80] export default ({ data, keyType }) => { - const [newWeek, setNewWeek] = useState([]); + const [newWeek, setNewWeek] = useState([]) useEffect(() => { - setNewWeek(sortWeeks(data.ruleWeek)); - }, [data.ruleWeek]); + setNewWeek(sortWeeks(data.ruleWeek)) + }, [data.ruleWeek]) function couponH5() { return (
-
+ className='foot-mobile-box' + style={{ borderTop: "1px solid #f0f0f0", padding: "10px 0" }}> +
-

+

¥ {data.denomination}

-

共省¥ {data.reduce_amount}

+

共省¥ {data.reduce_amount}

-
立即支付
+
立即支付
- ); + ) } function createElement() { if (data.usable_time === "week") { return ( -
+

可用时间

-
    +
      {newWeek?.map((item) => (
    • {item} @@ -48,18 +44,18 @@ export default ({ data, keyType }) => {

      {item1[0]}~{item1[1]}

      - ); + ) })}
    • ))}
- ); + ) } else if (data.usable_time === "irregular") { return ( -
+

可用时间

-
    +
      {data.irregularDate?.map((item) => (
    • {item.join(" 至 ")} @@ -69,32 +65,31 @@ export default ({ data, keyType }) => {

      {item1[0]}~{item1[1]}

      - ); + ) })}
    • ))}
- ); + ) } } return ( -
-
-
-

+

+
+
+

{data.reduce_amount ? data.reduce_amount : "0.00"}

-

+

满{data.denomination ? data.denomination : "0.00"}可用

-
+

+ className={data.batch_goods_name.length < 20 ? "title" : "isTitle"}> {data.batch_goods_name ? data.batch_goods_name : "xxx"}

@@ -105,7 +100,7 @@ export default ({ data, keyType }) => { : "xxx xxx xxx"}{" "} 可用

-

+

有效期: {data?.entry_time ? data.entry_time[0] : "xxxx-xx-xx xx:xx:xx"}至 {data?.entry_time ? data.entry_time[1] : "xxxx-xx-xx xx:xx:xx"} @@ -116,17 +111,17 @@ export default ({ data, keyType }) => { {keyType === 2 ? (

) : ( -
立即领取
+
立即领取
)} -
+

- {data.batch_goods_name ? data.batch_goods_name : "xxx"}兑换说明 -

{createElement()} {data.instruction ? ( <> -
+

使用须知

1、在{data.channel === "1" ? "支付宝" : "微信"} @@ -137,18 +132,17 @@ export default ({ data, keyType }) => { 里立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人

-
+

使用规则

+ __html: data.instruction + }}>
) : ( { {keyType && keyType === 2 ? couponH5() : null}
- ); -}; + ) +}