fix: 数据填充没有等待

main
Lei OT 11 months ago
parent 908c0dfc84
commit 0a91b85c24

@ -37,7 +37,7 @@
</div>
<div class="form-container" id="main">
<div id="result" v-if="error">
<div id="result" v-if="error || (!cityListPage && isEmptyData)">
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.5-4.5a.5.5 0 0 0-.707 0L8 7.293 5.207 4.5a.5.5 0 0 0-.707.707L7.293 8l-2.793 2.793a.5.5 0 0 0 .707.707L8 8.707l2.793 2.793a.5.5 0 0 0 .707-.707L8.707 8l2.793-2.793a.5.5 0 0 0 0-.707z" />
</svg>
@ -269,6 +269,12 @@
drawWidth() {
return window.innerWidth < 768 ? Math.floor(window.innerWidth-40) : 760; // Adjust the threshold as needed
},
isEmptyData() {
return this.feedbackItem.guide.length === 0
|| this.feedbackItem.driver.length === 0
|| this.feedbackItem.experience.length === 0
|| this.feedbackItem.hotel.length === 0;
},
},
data() {
return {
@ -303,6 +309,7 @@
};
},
created() {
console.clear();
console.log('invoke vue', typeof this);
this.initData();
},
@ -328,14 +335,14 @@
this.debug = !isEmpty(urlPath[4]);
this.resultPage = !isEmpty(urlPath[4]) ? false : !isEmpty(urlPath[3]);
}
console.log(this.param, this.debug);
console.log(this.param, 'debug', this.debug);
if (!(this.param.v && this.param.g)) {
this.error = true;
this.errorMsg = 'Invalid URL';
return false;
}
this.loading = true;
console.log(this.resultPage);
console.log('resultPage', this.resultPage);
this.getCityList();
},
getCityList() {
@ -368,7 +375,7 @@
}
return r.concat(mergeCity[tgid]);
}, []);
// console.log(mergeCityA);
// console.log(mergeCityA, that.error);
that.cityList = mergeCityA;
if (mergeCityA.length === 1) {
that.selectCity(mergeCityA[0]);
@ -397,18 +404,20 @@
for (const iterator of selectedCity.cii_sn_arr) {
this.getData(Object.assign({}, _param, { CITY_SN: iterator }), true);
}
if (this.feedbackItem.guide.length === 0
&& this.feedbackItem.driver.length === 0
&& this.feedbackItem.experience.length === 0
&& this.feedbackItem.hotel.length === 0
) {
this.error = true;
this.errorMsg = 'Data error.';
return false;
}
} else {
this.getData(Object.assign({}, _param, { CITY_SN: selectedCity.cii_sn }));
}
// setTimeout(() => {
// if (this.feedbackItem.guide.length === 0
// && this.feedbackItem.driver.length === 0
// && this.feedbackItem.experience.length === 0
// && this.feedbackItem.hotel.length === 0
// ) {
// this.error = true;
// this.errorMsg = 'Data error.';
// return false;
// }
// }, 1000);
},
initSignature() {
var canvas = document.getElementById('signature-pad');

Loading…
Cancel
Save