|
@@ -36,13 +36,14 @@ import "taro-ui/dist/style/components/input.scss";
|
|
|
import "taro-ui/dist/style/components/search-bar.scss";
|
|
|
|
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
|
-import { industry, channelTypeList, yearList } from '../../utils/tools/config';
|
|
|
+import { industry, channelTypeList, yearList, addressList } from '../../utils/tools/config';
|
|
|
import { getChannel } from "../../utils/tools";
|
|
|
import Superior from "../../components/common/superior";
|
|
|
import CheckboxPicker from "../../components/common/CheckboxPicker";
|
|
|
import AddressPicker from "../../components/common/addressPicker"
|
|
|
import InteractList from "./components/InteractList";
|
|
|
import CustomerProjectSelect from '../../components/common/CustomerProjectSelect';
|
|
|
+import address from '../../utils/tools/city.js'
|
|
|
|
|
|
class CustomerProfile extends Component {
|
|
|
$instance = getCurrentInstance();
|
|
@@ -119,6 +120,31 @@ class CustomerProfile extends Component {
|
|
|
return newNum.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
|
|
}
|
|
|
|
|
|
+ openAddressPicker() {
|
|
|
+ const { dtails } = this.state;
|
|
|
+ let currAddress = [];
|
|
|
+ if (dtails.locationProvince && dtails.locationCity && dtails.locationArea) {
|
|
|
+ let provIdx = 0, cityIdx = 0, areaIdx = 0;
|
|
|
+ addressList.map((provItem, idx1) => {
|
|
|
+ if (provItem.id == dtails.locationProvince) {
|
|
|
+ provIdx = idx1;
|
|
|
+ provItem.cityList.map((cityItem, idx2) => {
|
|
|
+ if (cityItem.id == dtails.locationCity) {
|
|
|
+ cityIdx = idx2;
|
|
|
+ cityItem.areaList.map((areaItem, idx3) => {
|
|
|
+ if (areaItem.id == dtails.locationArea) {
|
|
|
+ areaIdx = idx3;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ currAddress = [provIdx, cityIdx, areaIdx];
|
|
|
+ }
|
|
|
+ this.setState({ addressPickerShow: true, currAddress })
|
|
|
+ }
|
|
|
+
|
|
|
toggleAddressPicker(e) {
|
|
|
if (!Object.keys(e).length) {
|
|
|
this.setState({ addressPickerShow: false });
|
|
@@ -954,13 +980,7 @@ class CustomerProfile extends Component {
|
|
|
<View className="item-title">企业所在地省市区:</View>
|
|
|
<View className="item-value">
|
|
|
|
|
|
- <View className="link" onClick={() => {
|
|
|
- let currAddress = [];
|
|
|
- if (dtails.locationProvince && dtails.locationCity && dtails.locationArea) {
|
|
|
- currAddress = [dtails.locationProvince, dtails.locationCity, dtails.locationArea];
|
|
|
- }
|
|
|
- this.setState({ addressPickerShow: true, currAddress })
|
|
|
- }}>
|
|
|
+ <View className="link" onClick={() => this.openAddressPicker()}>
|
|
|
{dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : '请选择'}
|
|
|
</View>
|
|
|
|
|
@@ -1098,13 +1118,7 @@ class CustomerProfile extends Component {
|
|
|
<View className="item">
|
|
|
<View className="item-title">企业所在地省市区:</View>
|
|
|
<View className="item-value">
|
|
|
- <View className="link" onClick={() => {
|
|
|
- let currAddress = [];
|
|
|
- if (dtails.locationProvince && dtails.locationCity && dtails.locationArea) {
|
|
|
- currAddress = [dtails.locationProvince, dtails.locationCity, dtails.locationArea];
|
|
|
- }
|
|
|
- this.setState({ addressPickerShow: true, currAddress })
|
|
|
- }}>
|
|
|
+ <View className="link" onClick={() => this.openAddressPicker()}>
|
|
|
{dtails.locationProvince ? `${dtails.locationProvinceName}-${dtails.locationCityName}-${dtails.locationAreaName}` : '请选择'}
|
|
|
</View>
|
|
|
</View>
|
|
@@ -2146,6 +2160,7 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
{/* 省市区选择器 */}
|
|
|
<AddressPicker
|
|
|
+ value={this.state.currAddress}
|
|
|
pickerShow={this.state.addressPickerShow}
|
|
|
onHandleToggleShow={this.toggleAddressPicker.bind(this)}
|
|
|
/>
|