|
@@ -327,9 +327,9 @@ export default class BaseInfo extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
- if (prevState.cur_apply_type !== this.state.cur_apply_type) {
|
|
|
- this.initData()
|
|
|
- }
|
|
|
+ // if (prevState.cur_apply_type !== this.state.cur_apply_type) {
|
|
|
+ // this.initData()
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -342,7 +342,8 @@ export default class BaseInfo extends Component {
|
|
|
};
|
|
|
|
|
|
handleApplyType = (val) => {
|
|
|
- this.setState({ cur_apply_type: val });
|
|
|
+ this.initData(val)
|
|
|
+ // this.setState({ cur_apply_type: val });
|
|
|
};
|
|
|
|
|
|
//上传图片 key name ,info
|
|
@@ -360,13 +361,14 @@ export default class BaseInfo extends Component {
|
|
|
};
|
|
|
|
|
|
//初始化页面数据
|
|
|
- initData = async () => {
|
|
|
+ initData = (curApplyType) => {
|
|
|
let { cur_apply_type, apply_type, personal_base_info, personal_front_card_img, personal_back_card_img, company_base_info, business_license_img, legal_front_card_img, legal_back_card_img, replenish_1_img, replenish_2_img, replenish_3_img, show_apply_type_flag } = this.state;
|
|
|
let tmp_data = getSettleData('baseInfo');
|
|
|
+ const new_cur_apply_type = curApplyType ?? tmp_data.enterType ?? cur_apply_type;
|
|
|
const localVendorMobile = getSettleData('user_info')?.vendorMobile || getSettleData('vendorMobile');
|
|
|
if (!tmp_data) {
|
|
|
- this.setState({ show_apply_type_flag: true });
|
|
|
- if (cur_apply_type === 0) {
|
|
|
+ this.setState({ show_apply_type_flag: true, cur_apply_type: new_cur_apply_type });
|
|
|
+ if (new_cur_apply_type === 0) {
|
|
|
personal_base_info.forEach(item => {
|
|
|
if (item.name === 'contactPhone') {
|
|
|
item.initialValue = localVendorMobile;
|
|
@@ -379,96 +381,116 @@ export default class BaseInfo extends Component {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
- cur_apply_type = tmp_data.enterType;
|
|
|
- apply_type[0].initialValue = cur_apply_type;
|
|
|
- if (cur_apply_type == 0) {
|
|
|
+ apply_type[0].initialValue = new_cur_apply_type;
|
|
|
+ if (new_cur_apply_type == 0) {
|
|
|
//个人入驻
|
|
|
- personal_base_info.map(item => {
|
|
|
+ personal_base_info.forEach(item => {
|
|
|
item.initialValue = tmp_data[item.name];
|
|
|
+ if (item.name === 'contactPhone') {
|
|
|
+ item.initialValue = localVendorMobile;
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
|
|
|
//身份证正面图片
|
|
|
- personal_front_card_img[0].fileList.push({
|
|
|
- response: {
|
|
|
- data: {
|
|
|
- path: tmp_data.personCardUp,
|
|
|
- url: tmp_data.personCardUpUrl,
|
|
|
+ if (!personal_front_card_img[0].fileList.length) {
|
|
|
+ personal_front_card_img[0].fileList.push({
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ path: tmp_data.personCardUp,
|
|
|
+ url: tmp_data.personCardUpUrl,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- name: tmp_data.personCardUp,
|
|
|
- uid: tmp_data.personCardUp,
|
|
|
- status: 'done',
|
|
|
- thumbUrl: tmp_data.personCardUpUrl,
|
|
|
- });
|
|
|
+ name: tmp_data.personCardUp,
|
|
|
+ uid: tmp_data.personCardUp,
|
|
|
+ status: 'done',
|
|
|
+ thumbUrl: tmp_data.personCardUpUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//身份证反面图片
|
|
|
- personal_back_card_img[0].fileList.push({
|
|
|
- response: {
|
|
|
- data: {
|
|
|
- path: tmp_data.personCardDown,
|
|
|
- url: tmp_data.personCardDownUrl,
|
|
|
+ if (!personal_back_card_img[0].fileList.length) {
|
|
|
+ personal_back_card_img[0].fileList.push({
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ path: tmp_data.personCardDown,
|
|
|
+ url: tmp_data.personCardDownUrl,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- name: tmp_data.personCardDown,
|
|
|
- uid: tmp_data.personCardDown,
|
|
|
- status: 'done',
|
|
|
- thumbUrl: tmp_data.personCardDownUrl,
|
|
|
- });
|
|
|
+ name: tmp_data.personCardDown,
|
|
|
+ uid: tmp_data.personCardDown,
|
|
|
+ status: 'done',
|
|
|
+ thumbUrl: tmp_data.personCardDownUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
} else {
|
|
|
//企业入驻
|
|
|
|
|
|
company_base_info.map(item => {
|
|
|
item.initialValue = tmp_data[item.name];
|
|
|
+ if (item.name === 'contactPhone') {
|
|
|
+ item.initialValue = localVendorMobile;
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
//营业执照图片
|
|
|
- business_license_img[0].fileList.push({
|
|
|
- response: {
|
|
|
- data: {
|
|
|
- path: tmp_data.businessLicenseImage,
|
|
|
- url: tmp_data.businessLicenseImageUrl,
|
|
|
+ if (!business_license_img[0].fileList.length) {
|
|
|
+ business_license_img[0].fileList.push({
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ path: tmp_data.businessLicenseImage,
|
|
|
+ url: tmp_data.businessLicenseImageUrl,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- name: tmp_data.businessLicenseImage,
|
|
|
- uid: tmp_data.businessLicenseImage,
|
|
|
- status: 'done',
|
|
|
- thumbUrl: tmp_data.businessLicenseImageUrl,
|
|
|
- });
|
|
|
+ name: tmp_data.businessLicenseImage,
|
|
|
+ uid: tmp_data.businessLicenseImage,
|
|
|
+ status: 'done',
|
|
|
+ thumbUrl: tmp_data.businessLicenseImageUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//法人身份证正面图片
|
|
|
- legal_front_card_img[0].fileList.push({
|
|
|
- response: {
|
|
|
- data: {
|
|
|
- path: tmp_data.personCardUp,
|
|
|
- url: tmp_data.personCardUpUrl,
|
|
|
+ if (!legal_front_card_img[0].fileList.length) {
|
|
|
+ legal_front_card_img[0].fileList.push({
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ path: tmp_data.personCardUp,
|
|
|
+ url: tmp_data.personCardUpUrl,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- name: tmp_data.personCardUp,
|
|
|
- uid: tmp_data.personCardUp,
|
|
|
- status: 'done',
|
|
|
- thumbUrl: tmp_data.personCardUpUrl,
|
|
|
- });
|
|
|
+ name: tmp_data.personCardUp,
|
|
|
+ uid: tmp_data.personCardUp,
|
|
|
+ status: 'done',
|
|
|
+ thumbUrl: tmp_data.personCardUpUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//法人身份证反面图片
|
|
|
- legal_back_card_img[0].fileList.push({
|
|
|
- response: {
|
|
|
- data: {
|
|
|
- path: tmp_data.personCardDown,
|
|
|
- url: tmp_data.personCardDownUrl,
|
|
|
+ if (!legal_back_card_img[0].fileList.length) {
|
|
|
+ legal_back_card_img[0].fileList.push({
|
|
|
+ response: {
|
|
|
+ data: {
|
|
|
+ path: tmp_data.personCardDown,
|
|
|
+ url: tmp_data.personCardDownUrl,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- name: tmp_data.personCardDown,
|
|
|
- uid: tmp_data.personCardDown,
|
|
|
- status: 'done',
|
|
|
- thumbUrl: tmp_data.personCardDownUrl,
|
|
|
- });
|
|
|
+ name: tmp_data.personCardDown,
|
|
|
+ uid: tmp_data.personCardDown,
|
|
|
+ status: 'done',
|
|
|
+ thumbUrl: tmp_data.personCardDownUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//补充认证1图片
|
|
|
- if (tmp_data.moreQualification1) {
|
|
|
+ if (tmp_data.moreQualification1 && !replenish_1_img[0].fileList.length) {
|
|
|
replenish_1_img[0].fileList.push({
|
|
|
response: {
|
|
|
data: {
|
|
@@ -484,7 +506,7 @@ export default class BaseInfo extends Component {
|
|
|
}
|
|
|
|
|
|
//补充认证2图片
|
|
|
- if (tmp_data.moreQualification2) {
|
|
|
+ if (tmp_data.moreQualification2 && !replenish_2_img[0].fileList.length) {
|
|
|
replenish_2_img[0].fileList.push({
|
|
|
response: {
|
|
|
data: {
|
|
@@ -500,7 +522,7 @@ export default class BaseInfo extends Component {
|
|
|
}
|
|
|
|
|
|
//补充认证3图片
|
|
|
- if (tmp_data.moreQualification3) {
|
|
|
+ if (tmp_data.moreQualification3 && !replenish_3_img[0].fileList.length) {
|
|
|
replenish_3_img[0].fileList.push({
|
|
|
response: {
|
|
|
data: {
|
|
@@ -517,7 +539,7 @@ export default class BaseInfo extends Component {
|
|
|
|
|
|
}
|
|
|
this.setState({
|
|
|
- cur_apply_type,
|
|
|
+ cur_apply_type: new_cur_apply_type,
|
|
|
apply_type,
|
|
|
personal_base_info,
|
|
|
personal_front_card_img,
|