标签:width load his ext none close img spi param
<div class="m-wrapper03" id="app" v-cloak>
<div class="close-hosmain close-pf">
<div class="mycloose">
<i class="mycloose-img" @click="getHospitalListBy"></i>
<input type="text" placeholder="搜索医院" class="" style="width: 100%; background: none; font-size: 14px;" @input="searchHospital($event)">
</div>
</div>
</div>
<script type="text/javascript">
var vm = new Vue({
el: ‘#app‘,
data: function () {
return {
name: ‘福州市‘,
provinceCode: 350000,
cityCode: 350100,
hospitalList: [],
prefixList: [],
totalCount: 0,
timeoutId: -1
}
},
methods: {
getHospitalListBy: function () {
var that = this
showLoading();
let param = {
"provinceCode": this.provinceCode,
‘cityCode‘: this.cityCode,
}
getHospitalListBy(param).then(function (res) {
that.totalCount = res.total
if (res.result) {
var result = res.result
if (result.length > 0) {
that.hospitalList = result;
for (var item of result) {
that.prefixList.push(item.prefix)
}
}
}
})
},
searchHospital: function (e) {
this.prefixList = []
this.hospitalList = []
var that = this;
var searchHosName = e.target.value
showLoading();
let param = {
"provinceCode": this.provinceCode,
‘cityCode‘: this.cityCode,
}
if (that.timeoutId != -1) {
clearTimeout(that.timeoutId)
}
if (searchHosName && searchHosName.trim() != ‘‘) {
param[‘hosName‘] = searchHosName
}
that.timeoutId = setTimeout(function () {
getHospitalListBy(param).then(function (res) {
that.totalCount = res.total
if (res.result) {
var result = res.result
if (result.length > 0) {
that.hospitalList = result;
for (var item of result) {
that.prefixList.push(item.prefix)
}
}
}
})
}, 500)
}
}
})
</script>
标签:width load his ext none close img spi param
原文地址:https://www.cnblogs.com/longma-ling/p/14831870.html