🐛 fix: 修复红包组件数据初始化bug

This commit is contained in:
wangsongsole 2023-05-25 11:10:43 +08:00
parent f09d2983cc
commit 998e70a753
2 changed files with 47 additions and 45 deletions

View File

@ -41,8 +41,7 @@ export default class addKnockGold extends Component {
constructor(props) {
super(props);
this.state = {
...model,
isEdit: !!this.props.data?.id /* 是否为编辑 */
...model(this.props)
};
}

View File

@ -31,7 +31,8 @@ export const week = [
export const earlyPerList = ['70', '50', '30', '20'];
/* 表单数据 */
export const model = {
export function model(props) {
return {
model: {
channel: '1', // 渠道
redPackets_type: '1', // 红包类型
@ -73,5 +74,7 @@ export const model = {
],
//预警人数据
userSelectList: [],
form_data: {}
};
form_data: {},
isEdit: !!props.data?.id /* 是否为编辑 */
};
}