1.优惠券管理列表=>编辑=>新增立减金时间问题-完成
2.优惠券=>商品、立减金h5模版恢复 -完成 3.优惠券编辑,开始时间不能修改-完成
This commit is contained in:
parent
3395cfc61a
commit
e644424f09
|
@ -168,7 +168,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
setup1_title: "基本信息",
|
setup1_title: "基本信息",
|
||||||
setup2_title: "发放规则",
|
setup2_title: "发放规则",
|
||||||
setup3_title: "商品范围",
|
setup3_title: "商品范围",
|
||||||
time_disabled: false,
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
tableHeight: 500,
|
tableHeight: 500,
|
||||||
page: 1,
|
page: 1,
|
||||||
|
@ -279,6 +278,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
} else {
|
} else {
|
||||||
// 1.3 计划的优惠券编辑
|
// 1.3 计划的优惠券编辑
|
||||||
if (editData && editData !== "") {
|
if (editData && editData !== "") {
|
||||||
|
setState({ isEdit: true });
|
||||||
editFun();
|
editFun();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,6 +288,13 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
// 编辑处理函数
|
// 编辑处理函数
|
||||||
const editFun = () => {
|
const editFun = () => {
|
||||||
try {
|
try {
|
||||||
|
sessionStorage.setItem(
|
||||||
|
"knockGold_effectDate",
|
||||||
|
JSON.stringify({
|
||||||
|
begin_time: editData.begin_time,
|
||||||
|
end_time: editData.end_time,
|
||||||
|
})
|
||||||
|
);
|
||||||
// 基本信息
|
// 基本信息
|
||||||
setForm_info_data({
|
setForm_info_data({
|
||||||
title: editData.title,
|
title: editData.title,
|
||||||
|
@ -715,6 +722,14 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
scopePopType: "addProduct",
|
scopePopType: "addProduct",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 设置立减金时间
|
||||||
|
sessionStorage.setItem(
|
||||||
|
"knockGold_effectDate",
|
||||||
|
JSON.stringify({
|
||||||
|
begin_time: form_info_data.date_time[0],
|
||||||
|
end_time: form_info_data.date_time[1],
|
||||||
|
})
|
||||||
|
);
|
||||||
setState({
|
setState({
|
||||||
product_title: "新增立减金",
|
product_title: "新增立减金",
|
||||||
addGoldBtnLoading: true,
|
addGoldBtnLoading: true,
|
||||||
|
@ -1042,7 +1057,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
defaultTime: [moment().format("HH:mm:ss"), "23:59:59"],
|
defaultTime: [moment().format("HH:mm:ss"), "23:59:59"],
|
||||||
}}
|
}}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
disabled={[state.time_disabled, false]}
|
disabled={[state.isEdit, false]}
|
||||||
value={form_info_data.date_time}
|
value={form_info_data.date_time}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
onChangeCombinedDate(e);
|
onChangeCombinedDate(e);
|
||||||
|
|
|
@ -1,40 +1,43 @@
|
||||||
import { Placeholder } from "zent"
|
import { Placeholder } from "zent";
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react";
|
||||||
import "./index.less"
|
import "./index.less";
|
||||||
import { sortWeeks } from "@/utils"
|
import { sortWeeks } from "@/utils";
|
||||||
const widths = [24, 100, 100, 100, 80, 24, 100, 100, 100, 80, 100, 100, 100, 80]
|
const widths = [
|
||||||
|
24, 100, 100, 100, 80, 24, 100, 100, 100, 80, 100, 100, 100, 80,
|
||||||
|
];
|
||||||
export default ({ data, keyType }) => {
|
export default ({ data, keyType }) => {
|
||||||
const [newWeek, setNewWeek] = useState([])
|
const [newWeek, setNewWeek] = useState([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setNewWeek(sortWeeks(data.ruleWeek))
|
setNewWeek(sortWeeks(data.ruleWeek));
|
||||||
}, [data.ruleWeek])
|
}, [data.ruleWeek]);
|
||||||
|
|
||||||
function couponH5() {
|
function couponH5() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
className='foot-mobile-box'
|
className="foot-mobile-box"
|
||||||
style={{ borderTop: "1px solid #f0f0f0", padding: "10px 0" }}>
|
style={{ borderTop: "1px solid #f0f0f0", padding: "10px 0" }}
|
||||||
<div className='mobile-center'>
|
>
|
||||||
|
<div className="mobile-center">
|
||||||
<div>
|
<div>
|
||||||
<p className='mobile-money foot-money'>
|
<p className="mobile-money foot-money">
|
||||||
<span style={{ fontSize: "14px" }}>¥</span> {data.denomination}
|
<span style={{ fontSize: "14px" }}>¥</span> {data.denomination}
|
||||||
</p>
|
</p>
|
||||||
<p className='foot-mobile-infos'>共省¥ {data.reduce_amount}</p>
|
<p className="foot-mobile-infos">共省¥ {data.reduce_amount}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='mobile-pay-btn'>立即支付</div>
|
<div className="mobile-pay-btn">立即支付</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createElement() {
|
function createElement() {
|
||||||
if (data.usable_time === "week") {
|
if (data.usable_time === "week") {
|
||||||
return (
|
return (
|
||||||
<div className='available_time'>
|
<div className="available_time">
|
||||||
<h3>可用时间</h3>
|
<h3>可用时间</h3>
|
||||||
<ul className='timeList'>
|
<ul className="timeList">
|
||||||
{newWeek?.map((item) => (
|
{newWeek?.map((item) => (
|
||||||
<li>
|
<li>
|
||||||
{item}
|
{item}
|
||||||
|
@ -44,18 +47,18 @@ export default ({ data, keyType }) => {
|
||||||
<p style={{ textAlign: "center", marginTop: "5px" }}>
|
<p style={{ textAlign: "center", marginTop: "5px" }}>
|
||||||
{item1[0]}~{item1[1]}
|
{item1[0]}~{item1[1]}
|
||||||
</p>
|
</p>
|
||||||
)
|
);
|
||||||
})}
|
})}
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
} else if (data.usable_time === "irregular") {
|
} else if (data.usable_time === "irregular") {
|
||||||
return (
|
return (
|
||||||
<div className='available_time'>
|
<div className="available_time">
|
||||||
<h3>可用时间</h3>
|
<h3>可用时间</h3>
|
||||||
<ul className='timeList flex'>
|
<ul className="timeList flex">
|
||||||
{data.irregularDate?.map((item) => (
|
{data.irregularDate?.map((item) => (
|
||||||
<li>
|
<li>
|
||||||
{item.join(" 至 ")}
|
{item.join(" 至 ")}
|
||||||
|
@ -65,31 +68,32 @@ export default ({ data, keyType }) => {
|
||||||
<p style={{ marginTop: "5px" }}>
|
<p style={{ marginTop: "5px" }}>
|
||||||
{item1[0]}~{item1[1]}
|
{item1[0]}~{item1[1]}
|
||||||
</p>
|
</p>
|
||||||
)
|
);
|
||||||
})}
|
})}
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id='reduceKnockGold' className='mobile'>
|
<div id="reduceKnockGold" className="mobile">
|
||||||
<div className='couponShow'>
|
<div className="couponShow">
|
||||||
<div className='coupon-left'>
|
<div className="coupon-left">
|
||||||
<p className='coupon_money'>
|
<p className="coupon_money">
|
||||||
<span>¥</span>
|
<span>¥</span>
|
||||||
{data.reduce_amount ? data.reduce_amount : "0.00"}
|
{data.reduce_amount ? data.reduce_amount : "0.00"}
|
||||||
</p>
|
</p>
|
||||||
<p className='full_money'>
|
<p className="full_money">
|
||||||
满{data.denomination ? data.denomination : "0.00"}可用
|
满{data.denomination ? data.denomination : "0.00"}可用
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className='coupon-right'>
|
<div className="coupon-right">
|
||||||
<p
|
<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"}
|
{data.batch_goods_name ? data.batch_goods_name : "xxx"}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -100,7 +104,7 @@ export default ({ data, keyType }) => {
|
||||||
: "xxx xxx xxx"}{" "}
|
: "xxx xxx xxx"}{" "}
|
||||||
可用
|
可用
|
||||||
</p>
|
</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[0] : "xxxx-xx-xx xx:xx:xx"}至
|
||||||
{data?.entry_time ? data.entry_time[1] : "xxxx-xx-xx xx:xx:xx"}
|
{data?.entry_time ? data.entry_time[1] : "xxxx-xx-xx xx:xx:xx"}
|
||||||
|
@ -108,20 +112,21 @@ export default ({ data, keyType }) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{keyType === 2 ? (
|
{/* {keyType === 2 ? (
|
||||||
<div style={{ height: "20px" }}></div>
|
<div style={{ height: "20px" }}></div>
|
||||||
) : (
|
) : (
|
||||||
<div className='receiveBtn'>立即领取</div>
|
<div className='receiveBtn'>立即领取</div>
|
||||||
)}
|
)} */}
|
||||||
|
<div className="receiveBtn">立即领取</div>
|
||||||
|
|
||||||
<div className='coupon_explain'>
|
<div className="coupon_explain">
|
||||||
<h1>
|
<h1>
|
||||||
- {data.batch_goods_name ? data.batch_goods_name : "xxx"}兑换说明 -
|
- {data.batch_goods_name ? data.batch_goods_name : "xxx"}兑换说明 -
|
||||||
</h1>
|
</h1>
|
||||||
{createElement()}
|
{createElement()}
|
||||||
{data.instruction ? (
|
{data.instruction ? (
|
||||||
<>
|
<>
|
||||||
<div className='content'>
|
<div className="content">
|
||||||
<h3>使用须知</h3>
|
<h3>使用须知</h3>
|
||||||
<p>
|
<p>
|
||||||
1、在{data.channel === "1" ? "支付宝" : "微信"}
|
1、在{data.channel === "1" ? "支付宝" : "微信"}
|
||||||
|
@ -132,17 +137,18 @@ export default ({ data, keyType }) => {
|
||||||
里立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人
|
里立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className='content'>
|
<div className="content">
|
||||||
<h3>使用规则</h3>
|
<h3>使用规则</h3>
|
||||||
<div
|
<div
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: data.instruction
|
__html: data.instruction,
|
||||||
}}></div>
|
}}
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Placeholder.TextBlock
|
<Placeholder.TextBlock
|
||||||
className='TextBlock'
|
className="TextBlock"
|
||||||
animate
|
animate
|
||||||
widths={widths}
|
widths={widths}
|
||||||
rows={14}
|
rows={14}
|
||||||
|
@ -151,7 +157,7 @@ export default ({ data, keyType }) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{keyType && keyType === 2 ? couponH5() : null}
|
{/* {keyType && keyType === 2 ? couponH5() : null} */}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
|
@ -34,12 +34,6 @@ const CouponAddEdit = () => {
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 获取 计划
|
|
||||||
const getPlanList = () => {};
|
|
||||||
|
|
||||||
// 编辑-复制流程
|
|
||||||
const initEditAndCopy = () => {};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="coupon-add-edit">
|
<div className="coupon-add-edit">
|
||||||
{state.isShow ? (
|
{state.isShow ? (
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -772,10 +772,10 @@ export default class adduserinfo extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
{/* {this.props.keyType && this.props.keyType === 2
|
||||||
{this.props.keyType && this.props.keyType === 2
|
|
||||||
? this.couponH5()
|
? this.couponH5()
|
||||||
: this.exchangecodeH5()}
|
: this.exchangecodeH5()} */}
|
||||||
|
{this.exchangecodeH5()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue