Commit 1e8dd4eb authored by wangzhujun's avatar wangzhujun

123

parent f6af237e
......@@ -35,17 +35,17 @@
// https://activity.m.duiba.com.cn/customShare/share?id=Did1NjA5Mjc
CFG.loginUrl = 'https://98570-activity.m.dexfu.cn/customShare/share?id=Did1NjA5ODM'
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/index-D6bF73oX.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/vendor-Bn2sybru.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/index-zd4CQsfW.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/index-CE3ye31C.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/vendor-IGo-bpnJ.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/index-Cu14Ivgm.css">
<script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head>
<body>
<div id="root"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747383634140/assets/index-legacy-BIi_i9W4.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747383980058/assets/index-legacy-DaUKh4_N.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
......
......@@ -46,21 +46,25 @@ class Selectmodal extends React.Component<SelectModalProps, SelectModalState> {
// getParentCode
async componentDidMount() {
//获取省
await this.getCodeList(null, "provinceList");
//获取市
await this.getCodeList(null, "provinceList", async () => { //获取市
const { provinceList, provinceCode } = this.state;
await this.getCodeList(provinceList[0]?.adCode, "cityList");
//获取区
await this.getCodeList(provinceList[0]?.adCode, "cityList", async () => {//获取区
const { cityList, cityCode } = this.state;
await this.getCodeList(cityList[0]?.adCode, "areaList");
await this.getCodeList(cityList[0]?.adCode, "areaList", async () => {
//获取街道
const { areaList, areaCode } = this.state;
await this.getCodeList(areaList[0]?.adCode, "streetList");
await this.getCodeList(areaList[0]?.adCode, "streetList", async () => { });
});
});
});
}
/**获取省市区接口 */
async getCodeList(parentCode, type) {
async getCodeList(parentCode, type, callback) {
const params: GetParentCodeParams = {};
if (parentCode) {
params.parentCode = parentCode;
......@@ -69,7 +73,9 @@ class Selectmodal extends React.Component<SelectModalProps, SelectModalState> {
if (success) {
this.setState({
[type]: data,
} as Pick<SelectModalState, typeof type>);
} as Pick<SelectModalState, typeof type>, () => {
callback && callback()
});
}
}
......@@ -90,11 +96,11 @@ class Selectmodal extends React.Component<SelectModalProps, SelectModalState> {
async () => {
//获取市
const { provinceList } = this.state;
await this.getCodeList(provinceList[swiper.activeIndex]?.adCode, "cityList");
await this.getCodeList(provinceList[swiper.activeIndex]?.adCode, "cityList", async () => {
//获取区
const { cityList, cityCode } = this.state;
await this.getCodeList(cityList[0]?.adCode, "areaList");
await this.getCodeList(cityList[0]?.adCode, "areaList", async () => { });
});
}
);
this.swiperRef?.slideTo(0);
......@@ -116,7 +122,7 @@ class Selectmodal extends React.Component<SelectModalProps, SelectModalState> {
async () => {
//获取区
const { cityList } = this.state;
await this.getCodeList(cityList[swiper.activeIndex]?.adCode, "areaList");
await this.getCodeList(cityList[swiper.activeIndex]?.adCode, "areaList", async () => { });
}
);
this.swiperRef2?.slideTo(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment