fix: 修复优惠券管理时间问题

This commit is contained in:
zhangds 2022-11-17 14:52:04 +08:00
parent 27ccc88f71
commit 5d1a3e765a
1 changed files with 19 additions and 15 deletions

View File

@ -246,6 +246,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
(async function init() {
let KeyPcType = sessionStorage.getItem("KeyPcType");
console.log("KeyPcType UseCouponAddEdit 1编辑 2复制 3新增 =>", KeyPcType);
console.log("editData =>", editData);
// 1. couponType
if (couponType === 0) {
//
@ -259,13 +260,18 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
plan_row !== undefined &&
plan_row !== "undefined"
) {
sessionStorage.setItem(
"datetime",
JSON.stringify(plan_row.key.dateTime)
);
setForm_info_data({
plan_id: plan_row,
});
sessionStorage.setItem(
"knockGold_effectDate",
JSON.stringify({
begin_time: plan_row.key.dateTime[0],
end_time: plan_row.key.dateTime[1],
})
);
// 1.4
getResellerFun(plan_row.key.reseller_id);
// 1.5 key
@ -310,11 +316,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
statusDisabledFun(editData.status);
} else {
//
let deDateTime = sessionStorage.getItem("datetime");
let deDateTime = sessionStorage.getItem("knockGold_effectDate");
if (deDateTime) {
let times = JSON.parse(deDateTime);
setForm_info_data({
date_time: [times[0], times[1]],
date_time: [times.begin_time, times.end_time],
});
}
}
@ -325,14 +331,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
//
const editFun = () => {
try {
sessionStorage.setItem(
"knockGold_effectDate",
JSON.stringify({
begin_time: editData.begin_time,
end_time: editData.end_time,
})
);
//
setForm_info_data({
title: editData.title,
@ -768,7 +766,13 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
// select
const changePlan = async (e) => {
sessionStorage.setItem("datetime", JSON.stringify(e.key.dateTime));
sessionStorage.setItem(
"knockGold_effectDate",
JSON.stringify({
begin_time: e.key.dateTime[0],
end_time: e.key.dateTime[1],
})
);
setForm_info_data({
plan_id: e,
key_batch_id: "",