fix: 修复编辑、复制、新增落地页白名单数据
This commit is contained in:
parent
0318356dfa
commit
4fc4bbdbeb
|
@ -64,7 +64,6 @@ export default class add extends React.Component {
|
||||||
whiteStyle: false,
|
whiteStyle: false,
|
||||||
keyStyle: 1,
|
keyStyle: 1,
|
||||||
direct_reseller_id: 0,
|
direct_reseller_id: 0,
|
||||||
keyType: 1, // 1兑换码 2优惠券
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +274,9 @@ export default class add extends React.Component {
|
||||||
|
|
||||||
// 获取落地页
|
// 获取落地页
|
||||||
getStep3Theme() {
|
getStep3Theme() {
|
||||||
this.refs.step3.getThemeData();
|
if (this.state.card_visible) {
|
||||||
|
this.refs.step3.getThemeData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
send(e) {
|
send(e) {
|
||||||
|
@ -410,8 +411,6 @@ export default class add extends React.Component {
|
||||||
this.onStyleChange(e);
|
this.onStyleChange(e);
|
||||||
}}
|
}}
|
||||||
getStep3Theme={() => this.getStep3Theme()}
|
getStep3Theme={() => this.getStep3Theme()}
|
||||||
changeKeyType={(e) => this.setState({ keyType: e })}
|
|
||||||
keyType={this.state.keyType}
|
|
||||||
keyStyle={this.state.keyStyle}
|
keyStyle={this.state.keyStyle}
|
||||||
isload={this.state.isload}
|
isload={this.state.isload}
|
||||||
curstep={this.state.curstep}
|
curstep={this.state.curstep}
|
||||||
|
|
|
@ -216,7 +216,9 @@ export default class add extends React.Component {
|
||||||
|
|
||||||
// 获取落地页
|
// 获取落地页
|
||||||
getStep3Theme() {
|
getStep3Theme() {
|
||||||
this.refs.step3.getThemeData();
|
if (this.state.card_visible) {
|
||||||
|
this.refs.step3.getThemeData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 转译 */
|
/* 转译 */
|
||||||
|
@ -224,9 +226,6 @@ export default class add extends React.Component {
|
||||||
// 需要转译的类型
|
// 需要转译的类型
|
||||||
let type = Number(req.keys[0].bind_object[0]);
|
let type = Number(req.keys[0].bind_object[0]);
|
||||||
sessionStorage.setItem("keyType", type);
|
sessionStorage.setItem("keyType", type);
|
||||||
this.setState({
|
|
||||||
keyType: Number(type),
|
|
||||||
});
|
|
||||||
if (type === 2) {
|
if (type === 2) {
|
||||||
// 优惠券的转译-弹窗已做了优化
|
// 优惠券的转译-弹窗已做了优化
|
||||||
return req.keys;
|
return req.keys;
|
||||||
|
@ -679,13 +678,8 @@ export default class add extends React.Component {
|
||||||
this.onStyleChange(e);
|
this.onStyleChange(e);
|
||||||
}}
|
}}
|
||||||
is_Edit={true}
|
is_Edit={true}
|
||||||
changeKeyType={(e) => {
|
|
||||||
sessionStorage.setItem("keyType", e);
|
|
||||||
this.setState({ keyType: e });
|
|
||||||
}}
|
|
||||||
getStep3Theme={() => this.getStep3Theme()}
|
getStep3Theme={() => this.getStep3Theme()}
|
||||||
curstep={this.state.curstep}
|
curstep={this.state.curstep}
|
||||||
keyType={this.state.keyType}
|
|
||||||
whiteStyle={this.state.whiteStyle}
|
whiteStyle={this.state.whiteStyle}
|
||||||
keyStyle={this.state.keyStyle}
|
keyStyle={this.state.keyStyle}
|
||||||
isload={this.state.isload}
|
isload={this.state.isload}
|
||||||
|
|
|
@ -94,7 +94,6 @@ export default class add extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
componentDidMount(e) {
|
componentDidMount(e) {
|
||||||
sessionStorage.setItem("white", 3);
|
|
||||||
sessionStorage.setItem("plan_id", "");
|
sessionStorage.setItem("plan_id", "");
|
||||||
let plan_id_copy = sessionStorage.getItem("plan_id_copy");
|
let plan_id_copy = sessionStorage.getItem("plan_id_copy");
|
||||||
this.setState({ plan_id_detail: plan_id_copy });
|
this.setState({ plan_id_detail: plan_id_copy });
|
||||||
|
@ -159,9 +158,7 @@ export default class add extends React.Component {
|
||||||
tranFormData(req) {
|
tranFormData(req) {
|
||||||
// 需要转译的类型
|
// 需要转译的类型
|
||||||
let type = Number(req.keys[0].bind_object[0]);
|
let type = Number(req.keys[0].bind_object[0]);
|
||||||
this.setState({
|
sessionStorage.setItem("keyType", type);
|
||||||
keyType: Number(type),
|
|
||||||
});
|
|
||||||
if (type === 2) {
|
if (type === 2) {
|
||||||
// 优惠券的转译-弹窗已做了优化
|
// 优惠券的转译-弹窗已做了优化
|
||||||
return req.keys;
|
return req.keys;
|
||||||
|
@ -214,7 +211,9 @@ export default class add extends React.Component {
|
||||||
|
|
||||||
// 获取落地页
|
// 获取落地页
|
||||||
getStep3Theme() {
|
getStep3Theme() {
|
||||||
this.refs.step3.getThemeData();
|
if (this.state.card_visible) {
|
||||||
|
this.refs.step3.getThemeData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onConfirm(e) {
|
onConfirm(e) {
|
||||||
|
@ -520,11 +519,6 @@ export default class add extends React.Component {
|
||||||
this.onStyleChange(e);
|
this.onStyleChange(e);
|
||||||
}}
|
}}
|
||||||
keyStyle={this.state.keyStyle}
|
keyStyle={this.state.keyStyle}
|
||||||
changeKeyType={(e) => {
|
|
||||||
sessionStorage.setItem("keyType", e);
|
|
||||||
this.setState({ keyType: e });
|
|
||||||
}}
|
|
||||||
keyType={this.state.keyType}
|
|
||||||
getStep3Theme={() => this.getStep3Theme()}
|
getStep3Theme={() => this.getStep3Theme()}
|
||||||
curstep={this.state.curstep}
|
curstep={this.state.curstep}
|
||||||
isCopy={true}
|
isCopy={true}
|
||||||
|
|
|
@ -210,6 +210,9 @@ export default class acclist extends React.Component {
|
||||||
width: "auto",
|
width: "auto",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
keyType: sessionStorage.getItem("keyType")
|
||||||
|
? Number(sessionStorage.getItem("keyType"))
|
||||||
|
: 1,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +233,7 @@ export default class acclist extends React.Component {
|
||||||
submit() {
|
submit() {
|
||||||
let valide = false;
|
let valide = false;
|
||||||
// 兑换码
|
// 兑换码
|
||||||
if (this.props.keyType === 1) {
|
if (this.state.keyType === 1) {
|
||||||
if (this.refs.form1.validator()) {
|
if (this.refs.form1.validator()) {
|
||||||
/* 处理数据 区分立减金和商品 开始 2022-05-30 13:40*/
|
/* 处理数据 区分立减金和商品 开始 2022-05-30 13:40*/
|
||||||
const dataCopy = this.refs.tempdata.getSelectData();
|
const dataCopy = this.refs.tempdata.getSelectData();
|
||||||
|
@ -257,7 +260,7 @@ export default class acclist extends React.Component {
|
||||||
data.batch_name = this.state.model.batch_name;
|
data.batch_name = this.state.model.batch_name;
|
||||||
data.style = this.state.model.style;
|
data.style = this.state.model.style;
|
||||||
data.quantity = this.state.model.quantity;
|
data.quantity = this.state.model.quantity;
|
||||||
data.bind_object = [this.props.keyType];
|
data.bind_object = [this.state.keyType];
|
||||||
data.allow_repetition = this.state.model.allow_repetition;
|
data.allow_repetition = this.state.model.allow_repetition;
|
||||||
data.allow_loss = this.state.model.allow_loss;
|
data.allow_loss = this.state.model.allow_loss;
|
||||||
data.merge_stock = this.state.model.merge_stock;
|
data.merge_stock = this.state.model.merge_stock;
|
||||||
|
@ -274,7 +277,7 @@ export default class acclist extends React.Component {
|
||||||
data.batch_name = this.state.model.batch_name;
|
data.batch_name = this.state.model.batch_name;
|
||||||
data.style = this.state.model.style;
|
data.style = this.state.model.style;
|
||||||
data.quantity = this.state.model.quantity;
|
data.quantity = this.state.model.quantity;
|
||||||
data.bind_object = [this.props.keyType];
|
data.bind_object = [this.state.keyType];
|
||||||
data.allow_repetition = this.state.model.allow_repetition;
|
data.allow_repetition = this.state.model.allow_repetition;
|
||||||
data.allow_loss = this.state.model.allow_loss;
|
data.allow_loss = this.state.model.allow_loss;
|
||||||
data.merge_stock = this.state.model.merge_stock;
|
data.merge_stock = this.state.model.merge_stock;
|
||||||
|
@ -292,9 +295,12 @@ export default class acclist extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onCheckChange = ({ target }) => {
|
onCheckChange = ({ target }) => {
|
||||||
this.props.changeKeyType(target.value);
|
|
||||||
sessionStorage.setItem("keyType", target.value);
|
sessionStorage.setItem("keyType", target.value);
|
||||||
if (this.props.getStep3Theme && this.props.curstep === 3) {
|
this.setState({
|
||||||
|
keyType: target.value,
|
||||||
|
});
|
||||||
|
// 获取落地页 select
|
||||||
|
if (this.props.getStep3Theme) {
|
||||||
this.props.getStep3Theme();
|
this.props.getStep3Theme();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -308,17 +314,19 @@ export default class acclist extends React.Component {
|
||||||
model2.style = e.target.value;
|
model2.style = e.target.value;
|
||||||
model2.quantity = 0;
|
model2.quantity = 0;
|
||||||
this.setState({ model: model2 });
|
this.setState({ model: model2 });
|
||||||
|
|
||||||
if (e.target.value == 6) {
|
if (e.target.value == 6) {
|
||||||
sessionStorage.setItem("white", 1);
|
sessionStorage.setItem("white", 1);
|
||||||
console.log("this.props.curstep =>", this.props.curstep);
|
|
||||||
if (this.props.getStep3Theme && this.props.curstep === 3) {
|
|
||||||
this.props.getStep3Theme();
|
|
||||||
}
|
|
||||||
this.setState({ white_visible: true });
|
this.setState({ white_visible: true });
|
||||||
} else {
|
} else {
|
||||||
sessionStorage.setItem("white", 3);
|
sessionStorage.setItem("white", 3);
|
||||||
this.setState({ white_visible: false });
|
this.setState({ white_visible: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取落地页 select
|
||||||
|
if (this.props.getStep3Theme) {
|
||||||
|
this.props.getStep3Theme();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRepetitionChange(e) {
|
onRepetitionChange(e) {
|
||||||
|
@ -555,7 +563,7 @@ export default class acclist extends React.Component {
|
||||||
|
|
||||||
codeSubmit() {
|
codeSubmit() {
|
||||||
// 优惠券数据
|
// 优惠券数据
|
||||||
if (this.props.keyType === 2) {
|
if (this.state.keyType === 2) {
|
||||||
let coupon_validator = this.refs.addEditCouponEl.submit();
|
let coupon_validator = this.refs.addEditCouponEl.submit();
|
||||||
if (coupon_validator) {
|
if (coupon_validator) {
|
||||||
let param = this.refs.addEditCouponEl.getModel();
|
let param = this.refs.addEditCouponEl.getModel();
|
||||||
|
@ -654,7 +662,7 @@ export default class acclist extends React.Component {
|
||||||
let text = e.target.value;
|
let text = e.target.value;
|
||||||
text = text.replace(/[^\d]/g, "");
|
text = text.replace(/[^\d]/g, "");
|
||||||
|
|
||||||
if (this.props.keyType === 1) {
|
if (this.state.keyType === 1) {
|
||||||
this.state.distdata[index].restrict = text;
|
this.state.distdata[index].restrict = text;
|
||||||
this.setState({ distdata: this.state.distdata });
|
this.setState({ distdata: this.state.distdata });
|
||||||
} else {
|
} else {
|
||||||
|
@ -735,7 +743,10 @@ export default class acclist extends React.Component {
|
||||||
this.setState({ mobile_excel: data.mobile_excel });
|
this.setState({ mobile_excel: data.mobile_excel });
|
||||||
this.setState({ mobile_repeat: data.mobile_repeat });
|
this.setState({ mobile_repeat: data.mobile_repeat });
|
||||||
if (model.style == 6) {
|
if (model.style == 6) {
|
||||||
|
sessionStorage.setItem("white", 1);
|
||||||
this.setState({ white_visible: true });
|
this.setState({ white_visible: true });
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem("white", 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ model: model });
|
this.setState({ model: model });
|
||||||
|
@ -765,7 +776,10 @@ export default class acclist extends React.Component {
|
||||||
this.setState({ mobile_excel: data.mobile_excel });
|
this.setState({ mobile_excel: data.mobile_excel });
|
||||||
this.setState({ mobile_repeat: data.mobile_repeat });
|
this.setState({ mobile_repeat: data.mobile_repeat });
|
||||||
if (model.style == 6) {
|
if (model.style == 6) {
|
||||||
|
sessionStorage.setItem("white", 1);
|
||||||
this.setState({ white_visible: true });
|
this.setState({ white_visible: true });
|
||||||
|
} else {
|
||||||
|
sessionStorage.setItem("white", 3);
|
||||||
}
|
}
|
||||||
this.setState({ model: model });
|
this.setState({ model: model });
|
||||||
|
|
||||||
|
@ -873,7 +887,7 @@ export default class acclist extends React.Component {
|
||||||
|
|
||||||
rowItemClick(row, rowIndex) {
|
rowItemClick(row, rowIndex) {
|
||||||
// 兑换码
|
// 兑换码
|
||||||
if (this.props.keyType === 1) {
|
if (this.state.keyType === 1) {
|
||||||
let codeInfo = {
|
let codeInfo = {
|
||||||
//数据模型不可少
|
//数据模型不可少
|
||||||
code_name: row.title,
|
code_name: row.title,
|
||||||
|
@ -1346,7 +1360,7 @@ export default class acclist extends React.Component {
|
||||||
) : null}
|
) : null}
|
||||||
<FormItem labelname="绑定类型" prop="bind_object" id="bind_object">
|
<FormItem labelname="绑定类型" prop="bind_object" id="bind_object">
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={this.props.keyType}
|
value={this.state.keyType}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
this.onCheckChange(e);
|
this.onCheckChange(e);
|
||||||
}}
|
}}
|
||||||
|
@ -1361,7 +1375,7 @@ export default class acclist extends React.Component {
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem labelname="" prop="btn" required={false}>
|
<FormItem labelname="" prop="btn" required={false}>
|
||||||
{this.props.keyType === 1 ? (
|
{this.state.keyType === 1 ? (
|
||||||
<Button
|
<Button
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
this.checkIndex(0);
|
this.checkIndex(0);
|
||||||
|
@ -1386,12 +1400,12 @@ export default class acclist extends React.Component {
|
||||||
isShowPageBar={false}
|
isShowPageBar={false}
|
||||||
spliteColor={"#fff"}
|
spliteColor={"#fff"}
|
||||||
tableData={
|
tableData={
|
||||||
this.props.keyType === 1
|
this.state.keyType === 1
|
||||||
? this.state.distdata
|
? this.state.distdata
|
||||||
: this.state.couponData
|
: this.state.couponData
|
||||||
}
|
}
|
||||||
Column={
|
Column={
|
||||||
this.props.keyType === 1
|
this.state.keyType === 1
|
||||||
? this.state.Column
|
? this.state.Column
|
||||||
: this.state.Column_coupon
|
: this.state.Column_coupon
|
||||||
}
|
}
|
||||||
|
@ -1418,7 +1432,7 @@ export default class acclist extends React.Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 优惠券范围
|
// 优惠券范围
|
||||||
if (com === "product" && this.props.keyType === 2) {
|
if (com === "product" && this.state.keyType === 2) {
|
||||||
return coupon_range(rowData.product);
|
return coupon_range(rowData.product);
|
||||||
}
|
}
|
||||||
if (com == "edit") {
|
if (com == "edit") {
|
||||||
|
@ -1497,7 +1511,7 @@ export default class acclist extends React.Component {
|
||||||
}}
|
}}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
>
|
>
|
||||||
{this.props.keyType === 1 ? (
|
{this.state.keyType === 1 ? (
|
||||||
<div className="draw">
|
<div className="draw">
|
||||||
<Card
|
<Card
|
||||||
style={{ width: "95%", margin: "10px auto" }}
|
style={{ width: "95%", margin: "10px auto" }}
|
||||||
|
@ -1626,7 +1640,7 @@ export default class acclist extends React.Component {
|
||||||
this.onRankChange(e);
|
this.onRankChange(e);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{this.props.keyType === 1 ? (
|
{this.state.keyType === 1 ? (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
|
@ -45,16 +45,16 @@ export default class acclist extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getThemeData() {
|
getThemeData() {
|
||||||
console.log("编辑 -1");
|
|
||||||
let params = {};
|
let params = {};
|
||||||
|
|
||||||
// 第一步:判断是否优惠券
|
// 第一步:判断是否优惠券
|
||||||
let white = sessionStorage.getItem("white");
|
let white = sessionStorage.getItem("white");
|
||||||
let keyType = sessionStorage.getItem("keyType");
|
let keyType = sessionStorage.getItem("keyType");
|
||||||
|
console.log("white =>", white);
|
||||||
|
console.log("keyType =>", keyType);
|
||||||
// 2 优惠券
|
// 2 优惠券
|
||||||
if (keyType == 2) {
|
if (keyType == 2) {
|
||||||
// 并且是 白名单
|
|
||||||
if (white == 1) {
|
if (white == 1) {
|
||||||
|
// 并且是 白名单
|
||||||
params.page = 8;
|
params.page = 8;
|
||||||
} else {
|
} else {
|
||||||
params.page = 4;
|
params.page = 4;
|
||||||
|
@ -62,10 +62,10 @@ export default class acclist extends React.Component {
|
||||||
} else {
|
} else {
|
||||||
// 兑换码
|
// 兑换码
|
||||||
if (white == 1) {
|
if (white == 1) {
|
||||||
params.page = 3;
|
|
||||||
} else {
|
|
||||||
// 并且是 白名单
|
// 并且是 白名单
|
||||||
params.page = 1;
|
params.page = 1;
|
||||||
|
} else {
|
||||||
|
params.page = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getThemeChoice(params).then((res) => {
|
getThemeChoice(params).then((res) => {
|
||||||
|
|
Loading…
Reference in New Issue