删除多余代码
This commit is contained in:
parent
2da317b0a4
commit
2887ed778f
|
@ -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 (
|
||||
<div>
|
||||
<div
|
||||
className="foot-mobile-box"
|
||||
style={{ borderTop: "1px solid #f0f0f0", padding: "10px 0" }}
|
||||
>
|
||||
<div className="mobile-center">
|
||||
className='foot-mobile-box'
|
||||
style={{ borderTop: "1px solid #f0f0f0", padding: "10px 0" }}>
|
||||
<div className='mobile-center'>
|
||||
<div>
|
||||
<p className="mobile-money foot-money">
|
||||
<p className='mobile-money foot-money'>
|
||||
<span style={{ fontSize: "14px" }}>¥</span> {data.denomination}
|
||||
</p>
|
||||
<p className="foot-mobile-infos">共省¥ {data.reduce_amount}</p>
|
||||
<p className='foot-mobile-infos'>共省¥ {data.reduce_amount}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mobile-pay-btn">立即支付</div>
|
||||
<div className='mobile-pay-btn'>立即支付</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function createElement() {
|
||||
if (data.usable_time === "week") {
|
||||
return (
|
||||
<div className="available_time">
|
||||
<div className='available_time'>
|
||||
<h3>可用时间</h3>
|
||||
<ul className="timeList">
|
||||
<ul className='timeList'>
|
||||
{newWeek?.map((item) => (
|
||||
<li>
|
||||
{item}
|
||||
|
@ -48,18 +44,18 @@ export default ({ data, keyType }) => {
|
|||
<p style={{ textAlign: "center", marginTop: "5px" }}>
|
||||
{item1[0]}~{item1[1]}
|
||||
</p>
|
||||
);
|
||||
)
|
||||
})}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
} else if (data.usable_time === "irregular") {
|
||||
return (
|
||||
<div className="available_time">
|
||||
<div className='available_time'>
|
||||
<h3>可用时间</h3>
|
||||
<ul className="timeList flex">
|
||||
<ul className='timeList flex'>
|
||||
{data.irregularDate?.map((item) => (
|
||||
<li>
|
||||
{item.join(" 至 ")}
|
||||
|
@ -69,32 +65,31 @@ export default ({ data, keyType }) => {
|
|||
<p style={{ marginTop: "5px" }}>
|
||||
{item1[0]}~{item1[1]}
|
||||
</p>
|
||||
);
|
||||
)
|
||||
})}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div id="reduceKnockGold" className="mobile">
|
||||
<div className="couponShow">
|
||||
<div className="coupon-left">
|
||||
<p className="coupon_money">
|
||||
<div id='reduceKnockGold' className='mobile'>
|
||||
<div className='couponShow'>
|
||||
<div className='coupon-left'>
|
||||
<p className='coupon_money'>
|
||||
<span>¥</span>
|
||||
{data.reduce_amount ? data.reduce_amount : "0.00"}
|
||||
</p>
|
||||
<p className="full_money">
|
||||
<p className='full_money'>
|
||||
满{data.denomination ? data.denomination : "0.00"}可用
|
||||
</p>
|
||||
</div>
|
||||
<div className="coupon-right">
|
||||
<div className='coupon-right'>
|
||||
<p
|
||||
className={data.batch_goods_name.length < 20 ? "title" : "isTitle"}
|
||||
>
|
||||
className={data.batch_goods_name.length < 20 ? "title" : "isTitle"}>
|
||||
{data.batch_goods_name ? data.batch_goods_name : "xxx"}
|
||||
</p>
|
||||
<p>
|
||||
|
@ -105,7 +100,7 @@ export default ({ data, keyType }) => {
|
|||
: "xxx xxx xxx"}{" "}
|
||||
可用
|
||||
</p>
|
||||
<p className="validity">
|
||||
<p className='validity'>
|
||||
有效期:
|
||||
{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 ? (
|
||||
<div style={{ height: "20px" }}></div>
|
||||
) : (
|
||||
<div className="receiveBtn">立即领取</div>
|
||||
<div className='receiveBtn'>立即领取</div>
|
||||
)}
|
||||
|
||||
<div className="coupon_explain">
|
||||
<div className='coupon_explain'>
|
||||
<h1>
|
||||
- {data.batch_goods_name ? data.batch_goods_name : "xxx"}兑换说明 -
|
||||
</h1>
|
||||
{createElement()}
|
||||
{data.instruction ? (
|
||||
<>
|
||||
<div className="content">
|
||||
<div className='content'>
|
||||
<h3>使用须知</h3>
|
||||
<p>
|
||||
1、在{data.channel === "1" ? "支付宝" : "微信"}
|
||||
|
@ -137,18 +132,17 @@ export default ({ data, keyType }) => {
|
|||
里立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人
|
||||
</p>
|
||||
</div>
|
||||
<div className="content">
|
||||
<div className='content'>
|
||||
<h3>使用规则</h3>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: data.instruction,
|
||||
}}
|
||||
></div>
|
||||
__html: data.instruction
|
||||
}}></div>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<Placeholder.TextBlock
|
||||
className="TextBlock"
|
||||
className='TextBlock'
|
||||
animate
|
||||
widths={widths}
|
||||
rows={14}
|
||||
|
@ -159,5 +153,5 @@ export default ({ data, keyType }) => {
|
|||
|
||||
{keyType && keyType === 2 ? couponH5() : null}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue