HTML 5 <input> disabled 属性

本文详细介绍了HTML5中input元素的disabled属性,解释了如何通过此属性禁用输入字段,以及如何利用JavaScript动态控制输入字段的可用状态。文章还提到了disabled属性的一些限制条件。

定义和用法

disabled 属性规定应该禁用输入字段。

被禁用的输入字段是无法使用和无法点击的。

如果使用该属性,则会禁用输入字段。

可以对 disabled 属性进行设置,使用户在满足某些条件时(比如选中复选框,等等)才能使用输入字段。然后,可使用 JavaScript 来删除 disabled 属性,使该输入字段变为可用的状态。

注释:disabled 属性不适用于 <input type="hidden">。

提示:被禁用的表单元素不会被提交。

HTML 4.01 与 HTML 5 之间的差异

无差别。

语法

<input disabled="disabled">
&lt;!-- * @Description: 海淀智慧物业app- --&gt; &lt;template&gt; &lt;div class="economicdevelopment-page overflow_div page-background scoll_box dashboard-page"&gt; &lt;titlepage v-if="pathStr !== '/'" :title="pathName" :query="query"&gt;&lt;/titlepage&gt; &lt;!-- &lt;div class="top_box" @click.stop="checkboxGroupShowFn"&gt;--&gt; &lt;!-- &lt;div class="right_icon"&gt;--&gt; &lt;!-- &lt;van-icon name="arrow-down" v-if="!checkboxGroupShow" /&gt;--&gt; &lt;!-- &lt;van-icon name="arrow-up" v-if="checkboxGroupShow" /&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- 下拉多选查询 --&gt; &lt;!-- &lt;p v-for="(item,i) of checkboxGroup" :key="i" @click.stop="deleteCheckbox(item)"&gt;--&gt; &lt;!-- &lt;span&gt;{{ item.name }}&lt;/span&gt;--&gt; &lt;!-- &lt;van-icon name="close" style="transform: scale(1.2);" /&gt;--&gt; &lt;!-- &lt;/p&gt;--&gt; &lt;!-- &lt;div v-if="checkboxGroup.length===0" class="placeholder"&gt;请选择小区&lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- 0805 增加查询项--&gt; &lt;div class="userLoginSearch"&gt; &lt;a-row :gutter="10"&gt; &lt;a-col :span="12"&gt; &lt;a-select show-search v-model="pane.szjz" :filterOption="filterOption" style="width: 100%" @change="handleStreetChange" placeholder="街镇"&gt; &lt;a-select-option :value="item.id" v-for="(item, i) in streetColumns" :key="i" :lable="item.departName"&gt; {{ item.departName }} &lt;/a-select-option&gt; &lt;/a-select&gt; &lt;/a-col&gt; &lt;a-col :span="12"&gt; &lt;a-select show-search v-model="pane.sqmc" :filterOption="filterOption" style="width: 100%" @change="handleSQChange" placeholder="社区"&gt; &lt;a-select-option :value="item.id" v-for="(item, i) in townColumns" :key="i" :lable="item.departName"&gt; {{ item.departName }} &lt;/a-select-option&gt; &lt;/a-select&gt; &lt;/a-col&gt; &lt;/a-row&gt; &lt;a-row :gutter="10" style="margin-top: 10px;"&gt; &lt;a-col :span="12"&gt; &lt;a-input v-model="pane.xmmc" placeholder="项目名称" @change="changeXmmc"&gt; &lt;a-icon slot="suffix" type="search" style="color:#3b77b3;" /&gt; &lt;/a-input&gt; &lt;/a-col&gt; &lt;a-col :span="12" style="margin-top: 2px;"&gt; &lt;div class="checkboxContainer"&gt; &lt;span&gt;专业化物业&lt;/span&gt; &lt;a-checkbox v-model="sfwzyhwyValue" @change="changeZyhwy" /&gt; &lt;/div&gt; &lt;/a-col&gt; &lt;/a-row&gt; &lt;/div&gt; &lt;div class="tabBox"&gt; &lt;!-- &lt;van-tabs v-model:active="activeName" color="#1989fa" @change="changeTab"&gt;--&gt; &lt;!-- &lt;van-tab title="所有项目" name="0"&gt;--&gt; &lt;a-spin :spinning="spinning"&gt; &lt;div class="itemBox" v-for="(item, i) in listData" :key="i" @click="showDetail(item.id)"&gt; &lt;div class="contentBox"&gt; &lt;div class="imgBox"&gt; &lt;template v-if="item.imgUrl"&gt; &lt;van-image :src="item.imgUrl" width="50px" height="50px" style="border-radius: 5px;"&gt; &lt;template v-slot:loading&gt; &lt;van-loading type="spinner" size="20" /&gt; &lt;/template&gt; &lt;template v-slot:error&gt;加载失败&lt;/template&gt; &lt;/van-image&gt; &lt;/template&gt; &lt;template v-else&gt; &lt;div style=" width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: #f0f0f0; color: #999; font-size: 12px; " &gt; 暂无图片 &lt;/div&gt; &lt;/template&gt; &lt;/div&gt; &lt;div class="msgBox"&gt; &lt;p&gt;{{ item.xmmc ? item.xmmc : '' }}&lt;/p&gt; &lt;p&gt;物业服务企业:{{ item.wyfwqy ? item.wyfwqy : '暂无企业' }}&lt;/p&gt; &lt;p&gt; 更新时间: {{ item.updateTime ? item.updateTime : '暂无更新时间' }} &lt;/p&gt; &lt;/div&gt; &lt;!-- &lt;van-icon class="iconBox" name="edit" /&gt; --&gt; &lt;/div&gt; &lt;div class="typeBox" v-if="item.fwxz && item.fwxz.length &gt; 0" :class="[ item.fwxz == 1 || item.fwxz == 2 || item.fwxz == 3 || item.fwxz == 4 || item.fwxz == 5 ? 'personalType' : 'publicType' ]" &gt; &lt;span v-for="(item1, i1) in item.fwxz" :key="i1"&gt; &lt;span v-if="item1 == 1"&gt;&nbsp;&nbsp;商品住宅&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 2"&gt;&nbsp;&nbsp;商住两用&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 3"&gt;&nbsp;&nbsp;共有产权&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 4"&gt;&nbsp;&nbsp;保障性住房(经适房、公租房等)&nbsp;)&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 5"&gt;&nbsp;&nbsp;直管公房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 6"&gt;&nbsp;&nbsp;军产房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 7"&gt;&nbsp;&nbsp;三供一业&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 8"&gt;&nbsp;&nbsp;非经资产移交&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 9"&gt;&nbsp;&nbsp;房改售房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 10"&gt;&nbsp;&nbsp;回迁安置房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == -99"&gt;&nbsp;&nbsp;其他&nbsp;&nbsp; &lt;/span&gt; &lt;/span&gt; &lt;/div&gt; &lt;!-- &lt;div v-else&gt;&lt;/div&gt; --&gt; &lt;/div&gt; &lt;a-button class="moreBtn" @click="getprojectListMsg" :disabled="moreDisabled"&gt; {{ moreText }} &lt;van-icon name="arrow-down" /&gt; &lt;/a-button&gt; &lt;!-- 增加一个空div 顶高度--&gt; &lt;div style="height: 100px;width:100%"&gt;&lt;/div&gt; &lt;/a-spin&gt; &lt;!-- &lt;/van-tab&gt;--&gt; &lt;!-- &lt;van-tab title="小区列表" name="1"&gt;--&gt; &lt;!-- &lt;div style="font-size: 14px"&gt;--&gt; &lt;!-- &lt;div class="itemBox" v-for="(item, i) in tab2ListData" :key="i" @click="showDetail(item.id)"&gt;--&gt; &lt;!-- &lt;div class="contentBox"&gt;--&gt; &lt;!-- &lt;div class="imgBox"&gt;--&gt; &lt;!-- &lt;!– &lt;van-image src="" width="50px" height="50px"&gt;--&gt; &lt;!-- &lt;template v-slot:loading&gt;--&gt; &lt;!-- &lt;van-loading type="spinner" size="20" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/van-image&gt; –&gt;--&gt; &lt;!-- &lt;template v-if="item.imgUrl"&gt;--&gt; &lt;!-- &lt;van-image :src="item.imgUrl" width="50px" height="50px"&gt;--&gt; &lt;!-- &lt;template v-slot:loading&gt;--&gt; &lt;!-- &lt;van-loading type="spinner" size="20" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;template v-slot:error&gt;加载失败&lt;/template&gt;--&gt; &lt;!-- &lt;/van-image&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;template v-else&gt;--&gt; &lt;!-- &lt;div--&gt; &lt;!-- style="--&gt; &lt;!-- margin-top: 20px;--&gt; &lt;!-- width: 50px;--&gt; &lt;!-- height: 50px;--&gt; &lt;!-- display: flex;--&gt; &lt;!-- align-items: center;--&gt; &lt;!-- justify-content: center;--&gt; &lt;!-- background: #f0f0f0;--&gt; &lt;!-- color: #999;--&gt; &lt;!-- font-size: 12px;--&gt; &lt;!-- "--&gt; &lt;!-- &gt;--&gt; &lt;!-- 暂无图片--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div class="msgBox"&gt;--&gt; &lt;!-- &lt;p&gt;{{ item.xmmc ? item.xmmc : '' }}&lt;/p&gt;--&gt; &lt;!-- &lt;p&gt;物业服务企业:{{ item.wyfwqy ? item.wyfwqy : '暂无企业' }}&lt;/p&gt;--&gt; &lt;!-- &lt;p&gt;--&gt; &lt;!-- 更新时间:--&gt; &lt;!-- {{ item.updateTime ? item.updateTime : '暂无更新时间' }}--&gt; &lt;!-- &lt;/p&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;!– &lt;van-icon class="iconBox" name="edit" /&gt; –&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div--&gt; &lt;!-- class="typeBox"--&gt; &lt;!-- v-if="item.fwxz"--&gt; &lt;!-- :class="[--&gt; &lt;!-- item.fwxz == 1 || item.fwxz == 2 || item.fwxz == 3 || item.fwxz == 4 || item.fwxz == 5--&gt; &lt;!-- ? 'personalType'--&gt; &lt;!-- : 'publicType'--&gt; &lt;!-- ]"--&gt; &lt;!-- &gt;--&gt; &lt;!-- &lt;span v-for="(item1, i1) in item.fwxz" :key="i1"&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 1"&gt;&nbsp;&nbsp;商品住宅&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 2"&gt;&nbsp;&nbsp;商住两用&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 3"&gt;&nbsp;&nbsp;共有产权&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 4"&gt;&nbsp;&nbsp;保障性住房(经适房、公租房等)&nbsp;)&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 5"&gt;&nbsp;&nbsp;直管公房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 6"&gt;&nbsp;&nbsp;军产房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 7"&gt;&nbsp;&nbsp;三供一业&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 8"&gt;&nbsp;&nbsp;非经资产移交&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 9"&gt;&nbsp;&nbsp;房改售房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 10"&gt;&nbsp;&nbsp;回迁安置房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == -99"&gt;&nbsp;&nbsp;其他&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;/span&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div v-else&gt;&lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;a-button class="moreBtn" @click="getTab2List" :disabled="moreDisabled"&gt;--&gt; &lt;!-- {{ moreText }}--&gt; &lt;!-- &lt;van-icon name="arrow-down" /&gt;--&gt; &lt;!-- &lt;/a-button&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/van-tab&gt;--&gt; &lt;!-- &lt;/van-tabs&gt;--&gt; &lt;/div&gt; &lt;!-- &lt;div class="container"&gt;--&gt; &lt;!-- &lt;div v-for="(item,i) of notifyList" class="project_list_item"&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div class="fixedBox"&gt; 专题 &lt;br /&gt;图层 &lt;/div&gt; --&gt; &lt;!-- 顶部小区查询项弹框 --&gt; &lt;!-- &lt;van-popup--&gt; &lt;!-- v-model="checkboxGroupShow"--&gt; &lt;!-- position="bottom"--&gt; &lt;!-- :style="{ height: '50%',zIndex:9999 }"&gt;--&gt; &lt;!-- &lt;div class="my_checkbox_popup"&gt;--&gt; &lt;!-- &lt;p class="cancel" @click="cancel(true)"&gt;取消&lt;/p&gt;--&gt; &lt;!-- &lt;p class="confirm" @click="comfirm"&gt;确认&lt;/p&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;van-checkbox-group v-model="checkboxGroupIds"&gt;--&gt; &lt;!-- &lt;van-cell-group&gt;--&gt; &lt;!-- &lt;van-cell--&gt; &lt;!-- class="my_checkbox_popup_cell"--&gt; &lt;!-- v-for="(items, index) in dataOption"--&gt; &lt;!-- clickable--&gt; &lt;!-- :key="index"--&gt; &lt;!-- :title="items.name"--&gt; &lt;!-- @click="onSelect(items,index)"&gt;--&gt; &lt;!-- &lt;template #right-icon&gt;--&gt; &lt;!-- &lt;van-checkbox :name="items.id" ref="CoverableCities" class="my_checkbox_popup_item" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/van-cell&gt;--&gt; &lt;!-- &lt;/van-cell-group&gt;--&gt; &lt;!-- &lt;/van-checkbox-group&gt;--&gt; &lt;!-- &lt;/van-popup&gt;--&gt; &lt;/div&gt; &lt;/template&gt; &lt;script&gt; import rolemixins from '@/utils/rolemixins'; import { managerListMsg, xioaquList } from '@/api/comm'; import { getSendRangeData } from '@/api/home'; import { getSqmcData } from '@/api/userState'; export default { name: 'projectList', components: {}, mixins: [rolemixins], data() { return { listData: [], tab2ListData: [], activeName: 'tab1', pathStr: this.$route.path, pathName: this.$route.meta.title ? this.$route.meta.title : '', query: {}, //分页 pane: { pageNo: 1, total: 0, pageSize: 10 }, sfwzyhwyValue: false, moreDisabled: false, moreText: '加载更多', streetColumns: [], townColumns: [], spinning: false, timer: null }; }, created() { }, activated() { }, beforeDestroy() { if (this.timer) { clearTimeout(this.timer); } }, mounted() { // this.initCheckboxGroup(); // this.getData(); this.getprojectListMsg(); this.getStreetData(); }, methods: { // 切换tab changeTab(tab) { this.activeName = tab; // this.getTab2List(); console.log('ffffff', tab); this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.pane.total = 0; this.listData = []; this.tab2ListData = []; if (tab == '0') { this.getprojectListMsg(); } else { this.getTab2List(); } }, // 获取数据列表接口 getData() { let params = { id: 1 }; }, // 获取所有项目 async getprojectListMsg() { this.spinning = true; const res = await managerListMsg(this.pane); if (res.success) { this.pane.total = res.result.total; this.listData = [...this.listData, ...res.result.records]; this.listData.forEach((item) =&gt; { if (item.fwxz && !Array.isArray(item.fwxz)) { item.fwxz = item.fwxz.split(','); } else { item.fwxz = item.fwxz || []; } }); this.$forceUpdate(); if (this.listData.length &gt;= this.pane.total) { this.moreDisabled = true; this.moreText = '没有更多了'; } else { this.moreDisabled = false; this.moreText = '加载更多'; } } this.spinning = false; }, // 获取小区列表 getTab2List() { xioaquList(this.pane).then((res) =&gt; { this.pane.total = res.result.total; this.pane.pageNo = this.pane.pageNo + 1; if (res.code == 200) { if (res.result.records.length &lt; this.pane.pageSize) { this.moreDisabled = true; this.moreText = '没有更多了'; this.tab2ListData = [...this.tab2ListData, ...res.result.records]; this.$forceUpdate(); } else { this.moreDisabled = false; this.moreText = '加载更多'; this.tab2ListData = [...this.tab2ListData, ...res.result.records]; this.$forceUpdate(); } } }); }, // 跳转项目信息详情 filterOption(inputValue, option) { return option.data.attrs.lable ? option.data.attrs.lable.includes(inputValue) : null; }, // 获取街镇数据以及社区数据 getStreetData() { getSendRangeData().then((res) =&gt; { this.streetColumns = res.result; }); }, // 获取社区数据 getTownData(val) { getSqmcData({ id: val }).then((res) =&gt; { this.townColumns = res.result; }); }, handleTownConfirm(val) { this.sqmcName = val.departName; this.pane.sqmc = val.id; this.townPicker = false; }, handleSearch() { console.log(this.pane); this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); }, handleReset() { this.pane = { xmmc: '', szjz: '', sqmc: '', pageNo: 1, pageSize: 10, total: 0 }; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); }, showDetail(id) { this.$router.push({ path: '/listDetail', query: { id: id } }); }, changeZyhwy(e) { this.pane.sfwzyhwy = this.sfwzyhwyValue ? 1 : 0; this.reLoadData(); }, handleStreetChange(val) { // 清空社区 this.pane.sqmc = undefined; this.getTownData(val); this.reLoadData(); }, handleSQChange(val) { this.pane.sqmc = val; this.reLoadData(); }, reLoadData() { this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); }, changeXmmc(e) { if (this.timer) { clearTimeout(this.timer); } this.timer = setTimeout(() =&gt; { this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); }, 1000); } // checkboxGroupShowFn() { // this.checkboxGroupShow = true; // } // initCheckboxGroup() { // this.checkboxGroupIds = []; // this.checkboxGroup = []; // }, // onSelect(items, index) { // this.$refs.CoverableCities[index].toggle(); // }, // comfirm() { // let text = []; // this.dataOption.map((its, i) =&gt; { // if (this.checkboxGroupIds.indexOf(its.id) !== -1) { // text.push(its); // } // }); // this.checkboxGroup = text; // this.$forceUpdate(); // this.cancel(false); // }, // cancel(flag) { // this.$forceUpdate(); // this.checkboxGroupShow = false; // if (flag) { // this.initCheckboxGroup(); // } // }, // deleteCheckbox(item) { // this.checkboxGroup.map((its, index) =&gt; { // if (item.id === its.id) { // this.checkboxGroup.splice(index, 1); // } // }); // this.checkboxGroupIds = this.checkboxGroup.map(its =&gt; { // return its.id; // }); // console.log(this.checkboxGroup, this.checkboxGroupIds, '----deleteCheckbox'); // } } }; &lt;/script&gt; &lt;style scoped lang="less"&gt; @import '~@/assets/css/comm.less'; .economicdevelopment-page { height: 100%; .fixedBox { width: 80px; height: 80px; border-radius: 50%; box-shadow: 5px 5px 5px #ccc, -5px -5px 5px #ccc, 5px -5px 5px #ccc, -5px 5px 5px #ccc; position: absolute; bottom: 20px; right: 20px; background: #fff; font-size: 14px; text-align: center; display: flex; align-items: center; justify-content: center; } .top_box { width: auto; height: 40px; background: #fff; border: 1px solid #3b77b3; position: relative; display: flex; align-items: center; padding: 0 5px; margin: 0 10px; .right_icon { position: absolute; top: 5px; right: 10px; } p { padding: 5px 10px 20px 10px; height: 24px; background: rgba(59, 119, 179, 0.15); border-radius: 12px; border: 1px solid rgba(59, 119, 179, 0.5); color: #3b77b3; font-size: 12px; font-weight: 500; font-family: PingFangSC, PingFang SC; margin: 0 2px; span { display: inline-block; margin-right: 10px; } } div.placeholder { width: 100%; color: #d4d3d3; font-size: 16px; font-weight: normal; text-align: center; } } /deep/ .van-tabs__content { overflow-y: scroll; } .tabBox { width: auto; margin: 0 10px; margin-top: 5px; height: 88vh; overflow: hidden; overflow-y: scroll; .itemBox { width: 100%; //height: 80px; position: relative; font-size: 12px; padding: 10px; background: #fff; margin-bottom: 10px; display: flex; align-items: flex-end; margin-top: 5px; .contentBox { display: flex; justify-content: space-between; text-align: center; width: 100%; .iconBox { font-size: 26px; width: auto; height: 30px; line-height: 60px; } .msgBox { text-align: left; width: 200px; } .imgBox { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; } } .typeBox { position: absolute; height: 20px; line-height: 20px; top: 0; right: 10px; text-align: center; padding: 0 5px; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .personalType { background: #e99d42; } .publicType { background: #a2ef4d; } } } //.container { // height: 100% !important; // padding: 0 12.5px; // //} } .my_checkbox_popup { width: 100%; height: 45px; line-height: 45px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; p { height: 100%; padding: 0 0.42667rem; font-size: 0.37333rem; background-color: transparent; border: none; cursor: pointer; } p.cancel { color: #969799; } p.confirm { color: #576b95; } } .my_checkbox_popup_cell { /deep/ .van-cell__title { padding: 8px 10px; } } .my_checkbox_popup_item { padding: 10px 15px; } .moreBtn { text-align: center; color: #1989fa; border: none; width: 100%; background: #fff; } .userLoginSearch { background-color: #fff; border-radius: 10px; padding: 10px; margin: 10px 0; .checkboxContainer { width: 100%; border-radius: 10px; border: 1px solid #3b77b3; font-size: 14px; padding: 0 8px; height: 32px; line-height: 32px; display: flex; align-items: center; justify-content: space-between; color: #3b77b3; } } ::v-deep .ant-select-selection { border-color: #3b77b3; border-radius: 10px; color: #3b77b3; .ant-select-selection__placeholder { color: #3b77b3; } } ::v-deep .ant-input { border-color: #3b77b3; border-radius: 10px; padding-left: 8px; color: #3b77b3; &::placeholder { color: #3b77b3; } } &lt;/style&gt; 把街镇、社区、项目名称这三个条件变了就搜索的逻辑去掉, 新写一个搜索和重置的按钮在他们三个下面,也是根据这三个变化搜索和重置用vant组件库
08-08
&lt;!-- * @Description: 海淀智慧物业app- --&gt; &lt;template&gt; &lt;div class="economicdevelopment-page overflow_div page-background scoll_box dashboard-page"&gt; &lt;titlepage v-if="pathStr !== '/'" :title="pathName" :query="query"&gt;&lt;/titlepage&gt; &lt;!-- &lt;div class="top_box" @click.stop="checkboxGroupShowFn"&gt;--&gt; &lt;!-- &lt;div class="right_icon"&gt;--&gt; &lt;!-- &lt;van-icon name="arrow-down" v-if="!checkboxGroupShow" /&gt;--&gt; &lt;!-- &lt;van-icon name="arrow-up" v-if="checkboxGroupShow" /&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- 下拉多选查询 --&gt; &lt;!-- &lt;p v-for="(item,i) of checkboxGroup" :key="i" @click.stop="deleteCheckbox(item)"&gt;--&gt; &lt;!-- &lt;span&gt;{{ item.name }}&lt;/span&gt;--&gt; &lt;!-- &lt;van-icon name="close" style="transform: scale(1.2);" /&gt;--&gt; &lt;!-- &lt;/p&gt;--&gt; &lt;!-- &lt;div v-if="checkboxGroup.length===0" class="placeholder"&gt;请选择小区&lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- 0805 增加查询项--&gt; &lt;div class="userLoginSearch"&gt; &lt;a-row :gutter="10"&gt; &lt;a-col :span="12"&gt; &lt;a-select show-search v-model="pane.szjz" :filterOption="filterOption" style="width: 100%" @change="handleStreetChange" placeholder="街镇" &gt; &lt;a-select-option :value="item.id" v-for="(item, i) in streetColumns" :key="i" :lable="item.departName"&gt; {{ item.departName }} &lt;/a-select-option&gt; &lt;/a-select&gt; &lt;/a-col&gt; &lt;a-col :span="12"&gt; &lt;a-select show-search v-model="pane.sqmc" :filterOption="filterOption" style="width: 100%" @change="handleSQChange" placeholder="社区" &gt; &lt;a-select-option :value="item.id" v-for="(item, i) in townColumns" :key="i" :lable="item.departName"&gt; {{ item.departName }} &lt;/a-select-option&gt; &lt;/a-select&gt; &lt;/a-col&gt; &lt;/a-row&gt; &lt;a-row :gutter="10"&gt; &lt;a-col :span="12"&gt; &lt;a-input v-model="pane.xmmc" placeholder="项目名称" @input="handleXmmcInput"&gt; &lt;a-icon slot="suffix" type="search" style="color: #3b77b3" /&gt; &lt;/a-input&gt; &lt;/a-col&gt; &lt;a-col :span="12" style="margin-top: 15px"&gt; &lt;div class="checkboxContainer"&gt; &lt;span&gt;专业化物业&lt;/span&gt; &lt;a-checkbox v-model="sfwzyhwyValue" @change="changeZyhwy" /&gt; &lt;/div&gt; &lt;/a-col&gt; &lt;/a-row&gt; &lt;!-- 新增搜索与重置按钮 --&gt; &lt;div class="search-reset-btns"&gt; &lt;van-button type="default" color="#3B77B3" block @click="reLoadData"&gt;搜索&lt;van-icon style="margin-left: 10px;" name="search" /&gt;&lt;/van-button&gt; &lt;van-button type="default" block @click="handleReset" style="background: #f1f3f3; border-radius: 14px; border: 2px solid #3b77b380; color: #3b77b3;"&gt;重置&lt;van-icon style="margin-left: 10px;" name="replay" /&gt;&lt;/van-button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="tabBox"&gt; &lt;!-- &lt;van-tabs v-model:active="activeName" color="#1989fa" @change="changeTab"&gt;--&gt; &lt;!-- &lt;van-tab title="所有项目" name="0"&gt;--&gt; &lt;a-spin :spinning="spinning"&gt; &lt;div class="itemBox" v-for="(item, i) in listData" :key="i" @click="showDetail(item.id)"&gt; &lt;div class="contentBox"&gt; &lt;template&gt; &lt;div class="economicdevelopment-page overflow_div page-background scoll_box dashboard-page" style="width: 64px; height: 64px" &gt; &lt;!-- 其他页面内容 --&gt; &lt;div class="contentBox"&gt; &lt;!-- 左侧视频封面图,点击播放 --&gt; &lt;div @click.stop="openImage(item)" class="videoThumbnail"&gt; &lt;img v-if="item.sqImg" :src="item.sqImg.split(',')[0]" alt="" style="background-color: white" /&gt; &lt;img v-else src="@/assets/img/suolueErrorImg.png" alt="" style="background-color: white" /&gt; &lt;!-- &lt;van-image :src="item.sqVideo" width="50px" height="50px" style="border-radius: 5px" &gt; &lt;template v-slot:loading&gt; &lt;van-loading type="spinner" size="20" /&gt; &lt;/template&gt; &lt;template v-slot:error &gt;加载失败&lt;/template&gt; &lt;/van-image&gt; --&gt; &lt;/div&gt; &lt;!-- 项目信息 --&gt; &lt;div class="msgBox"&gt; &lt;p&gt;{{ item.xmmc ? item.xmmc : '' }}&lt;/p&gt; &lt;p&gt;物业服务企业:{{ item.wyfwqy ? item.wyfwqy : '暂无企业' }}&lt;/p&gt; &lt;p&gt;更新时间: {{ item.updateTime ? item.updateTime : '暂无更新时间' }}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- 其他页面内容 --&gt; &lt;/div&gt; &lt;/template&gt; &lt;!-- &lt;div class="imgBox"&gt; &lt;template v-if="item.imgUrl"&gt; &lt;van-image :src="item.imgUrl" width="50px" height="50px" style="border-radius: 5px;"&gt; &lt;template v-slot:loading&gt; &lt;van-loading type="spinner" size="20" /&gt; &lt;/template&gt; &lt;template v-slot:error&gt;加载失败&lt;/template&gt; &lt;/van-image&gt; &lt;/template&gt; &lt;template v-else&gt; &lt;div style=" width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: #f0f0f0; color: #999; font-size: 12px; " &gt; 暂无图片 &lt;/div&gt; &lt;/template&gt; &lt;/div&gt; --&gt; &lt;div class="msgBox"&gt; &lt;p&gt;{{ item.xmmc ? item.xmmc : '' }}&lt;/p&gt; &lt;p&gt;物业服务企业:{{ item.wyfwqy ? item.wyfwqy : '暂无企业' }}&lt;/p&gt; &lt;p&gt; 更新时间: {{ item.updateTime ? item.updateTime : '暂无更新时间' }} &lt;/p&gt; &lt;/div&gt; &lt;!-- &lt;van-icon class="iconBox" name="edit" /&gt; --&gt; &lt;/div&gt; &lt;div class="typeBox" v-if="item.fwxz && item.fwxz.length &gt; 0" :class="[ item.fwxz == 1 || item.fwxz == 2 || item.fwxz == 3 || item.fwxz == 4 || item.fwxz == 5 ? 'personalType' : 'publicType' ]" &gt; &lt;span v-for="(item1, i1) in item.fwxz" :key="i1"&gt; &lt;span v-if="item1 == 1"&gt;&nbsp;&nbsp;商品住宅&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 2"&gt;&nbsp;&nbsp;商住两用&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 3"&gt;&nbsp;&nbsp;共有产权&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 4"&gt;&nbsp;&nbsp;保障性住房(经适房、公租房等)&nbsp;)&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 5"&gt;&nbsp;&nbsp;直管公房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 6"&gt;&nbsp;&nbsp;军产房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 7"&gt;&nbsp;&nbsp;三供一业&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 8"&gt;&nbsp;&nbsp;非经资产移交&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 9"&gt;&nbsp;&nbsp;房改售房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == 10"&gt;&nbsp;&nbsp;回迁安置房&nbsp;&nbsp; &lt;/span&gt; &lt;span v-if="item1 == -99"&gt;&nbsp;&nbsp;其他&nbsp;&nbsp; &lt;/span&gt; &lt;/span&gt; &lt;/div&gt; &lt;!-- &lt;div v-else&gt;&lt;/div&gt; --&gt; &lt;/div&gt; &lt;a-button class="moreBtn" @click="getprojectListMsg" :disabled="moreDisabled"&gt; {{ moreText }} &lt;van-icon name="arrow-down" /&gt; &lt;/a-button&gt; &lt;!-- 增加一个空div 顶高度--&gt; &lt;div style="height: 100px; width: 100%"&gt;&lt;/div&gt; &lt;/a-spin&gt; &lt;!-- &lt;/van-tab&gt;--&gt; &lt;!-- &lt;van-tab title="小区列表" name="1"&gt;--&gt; &lt;!-- &lt;div style="font-size: 14px"&gt;--&gt; &lt;!-- &lt;div class="itemBox" v-for="(item, i) in tab2ListData" :key="i" @click="showDetail(item.id)"&gt;--&gt; &lt;!-- &lt;div class="contentBox"&gt;--&gt; &lt;!-- &lt;div class="imgBox"&gt;--&gt; &lt;!-- &lt;!– &lt;van-image src="" width="50px" height="50px"&gt;--&gt; &lt;!-- &lt;template v-slot:loading&gt;--&gt; &lt;!-- &lt;van-loading type="spinner" size="20" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/van-image&gt; –&gt;--&gt; &lt;!-- &lt;template v-if="item.imgUrl"&gt;--&gt; &lt;!-- &lt;van-image :src="item.imgUrl" width="50px" height="50px"&gt;--&gt; &lt;!-- &lt;template v-slot:loading&gt;--&gt; &lt;!-- &lt;van-loading type="spinner" size="20" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;template v-slot:error&gt;加载失败&lt;/template&gt;--&gt; &lt;!-- &lt;/van-image&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;template v-else&gt;--&gt; &lt;!-- &lt;div--&gt; &lt;!-- style="--&gt; &lt;!-- margin-top: 20px;--&gt; &lt;!-- width: 50px;--&gt; &lt;!-- height: 50px;--&gt; &lt;!-- display: flex;--&gt; &lt;!-- align-items: center;--&gt; &lt;!-- justify-content: center;--&gt; &lt;!-- background: #f0f0f0;--&gt; &lt;!-- color: #999;--&gt; &lt;!-- font-size: 12px;--&gt; &lt;!-- "--&gt; &lt;!-- &gt;--&gt; &lt;!-- 暂无图片--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div class="msgBox"&gt;--&gt; &lt;!-- &lt;p&gt;{{ item.xmmc ? item.xmmc : '' }}&lt;/p&gt;--&gt; &lt;!-- &lt;p&gt;物业服务企业:{{ item.wyfwqy ? item.wyfwqy : '暂无企业' }}&lt;/p&gt;--&gt; &lt;!-- &lt;p&gt;--&gt; &lt;!-- 更新时间:--&gt; &lt;!-- {{ item.updateTime ? item.updateTime : '暂无更新时间' }}--&gt; &lt;!-- &lt;/p&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;!– &lt;van-icon class="iconBox" name="edit" /&gt; –&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div--&gt; &lt;!-- class="typeBox"--&gt; &lt;!-- v-if="item.fwxz"--&gt; &lt;!-- :class="[--&gt; &lt;!-- item.fwxz == 1 || item.fwxz == 2 || item.fwxz == 3 || item.fwxz == 4 || item.fwxz == 5--&gt; &lt;!-- ? 'personalType'--&gt; &lt;!-- : 'publicType'--&gt; &lt;!-- ]"--&gt; &lt;!-- &gt;--&gt; &lt;!-- &lt;span v-for="(item1, i1) in item.fwxz" :key="i1"&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 1"&gt;&nbsp;&nbsp;商品住宅&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 2"&gt;&nbsp;&nbsp;商住两用&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 3"&gt;&nbsp;&nbsp;共有产权&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 4"&gt;&nbsp;&nbsp;保障性住房(经适房、公租房等)&nbsp;)&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 5"&gt;&nbsp;&nbsp;直管公房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 6"&gt;&nbsp;&nbsp;军产房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 7"&gt;&nbsp;&nbsp;三供一业&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 8"&gt;&nbsp;&nbsp;非经资产移交&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 9"&gt;&nbsp;&nbsp;房改售房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == 10"&gt;&nbsp;&nbsp;回迁安置房&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;span v-if="item1 == -99"&gt;&nbsp;&nbsp;其他&nbsp;&nbsp; &lt;/span&gt;--&gt; &lt;!-- &lt;/span&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div v-else&gt;&lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;a-button class="moreBtn" @click="getTab2List" :disabled="moreDisabled"&gt;--&gt; &lt;!-- {{ moreText }}--&gt; &lt;!-- &lt;van-icon name="arrow-down" /&gt;--&gt; &lt;!-- &lt;/a-button&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/van-tab&gt;--&gt; &lt;!-- &lt;/van-tabs&gt;--&gt; &lt;/div&gt; &lt;!-- 视频弹窗 --&gt; &lt;!-- &lt;van-popup v-model:show="showVideoPopup" position="center" :style="{ width: '90%', maxHeight: '80%',backGround:'transparent' }" :closeable="true" @close.stop="closeVideo" &gt; &lt;div class="video-popup-content"&gt; &lt;video :src="currentVideoUrl" controls autoplay style="width: 100%; height: 100%; border-radius: 10px"&gt;&lt;/video&gt; &lt;/div&gt; &lt;/van-popup&gt; --&gt; &lt;van-popup v-model:show="showImagePopup" position="center" :style="{ width: '90%', height: '80%' }" :closeable="true" @close="closeImage" &gt; &lt;div class="image-popup-content"&gt; &lt;img :src="currentImageUrls[currentIndex]" alt="查看大图" style="width: 100%; height: auto;" /&gt; &lt;div class="nav-buttons"&gt; &lt;van-button v-if="currentIndex &gt; 0" @click="prevImage"&gt;上一张&lt;/van-button&gt; &lt;van-button v-if="currentIndex &lt; currentImageUrls.length - 1" @click="nextImage"&gt;下一张&lt;/van-button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/van-popup&gt; &lt;!-- &lt;div class="container"&gt;--&gt; &lt;!-- &lt;div v-for="(item,i) of notifyList" class="project_list_item"&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;div class="fixedBox"&gt; 专题 &lt;br /&gt;图层 &lt;/div&gt; --&gt; &lt;!-- 顶部小区查询项弹框 --&gt; &lt;!-- &lt;van-popup--&gt; &lt;!-- v-model="checkboxGroupShow"--&gt; &lt;!-- position="bottom"--&gt; &lt;!-- :style="{ height: '50%',zIndex:9999 }"&gt;--&gt; &lt;!-- &lt;div class="my_checkbox_popup"&gt;--&gt; &lt;!-- &lt;p class="cancel" @click="cancel(true)"&gt;取消&lt;/p&gt;--&gt; &lt;!-- &lt;p class="confirm" @click="comfirm"&gt;确认&lt;/p&gt;--&gt; &lt;!-- &lt;/div&gt;--&gt; &lt;!-- &lt;van-checkbox-group v-model="checkboxGroupIds"&gt;--&gt; &lt;!-- &lt;van-cell-group&gt;--&gt; &lt;!-- &lt;van-cell--&gt; &lt;!-- class="my_checkbox_popup_cell"--&gt; &lt;!-- v-for="(items, index) in dataOption"--&gt; &lt;!-- clickable--&gt; &lt;!-- :key="index"--&gt; &lt;!-- :title="items.name"--&gt; &lt;!-- @click="onSelect(items,index)"&gt;--&gt; &lt;!-- &lt;template #right-icon&gt;--&gt; &lt;!-- &lt;van-checkbox :name="items.id" ref="CoverableCities" class="my_checkbox_popup_item" /&gt;--&gt; &lt;!-- &lt;/template&gt;--&gt; &lt;!-- &lt;/van-cell&gt;--&gt; &lt;!-- &lt;/van-cell-group&gt;--&gt; &lt;!-- &lt;/van-checkbox-group&gt;--&gt; &lt;!-- &lt;/van-popup&gt;--&gt; &lt;/div&gt; &lt;/template&gt; &lt;script&gt; import rolemixins from '@/utils/rolemixins'; import { managerListMsg, xioaquList, xioaquVideoList } from '@/api/comm'; import { getSendRangeData } from '@/api/home'; import { getSqmcData } from '@/api/userState'; export default { name: 'projectList', components: {}, mixins: [rolemixins], data() { return { showVideoPopup: false, currentVideoUrl: null, showImagePopup: false, currentImageUrls: [], currentIndex: 0, listData: [], // 假设 listData 会从接口获取 // currentVideoUrl: 'https://www.w3schools.com/html/mov_bbb.mp4', // 一个测试视频地址 // listData: [ // { // id: 1, // xmmc: '项目A', // imgUrl: 'https://via.placeholder.com/50x50?text=Video+1', // hasVideo: true // 假设这个项目有视频 // }, // { // id: 2, // xmmc: '项目B', // imgUrl: '', // hasVideo: false // 假设这个项目没有视频 // }, // { // id: 3, // xmmc: '项目C', // imgUrl: 'https://via.placeholder.com/50x50?text=Video+2', // hasVideo: true // } // ], tab2ListData: [], activeName: 'tab1', pathStr: this.$route.path, pathName: this.$route.meta.title ? this.$route.meta.title : '', query: {}, //分页 pane: { pageNo: 1, total: 0, pageSize: 10, xmmc: '', // 项目名称 szjz: undefined, // 街镇 sqmc: undefined, // 社区 sfwzyhwy: 1 // 新增字段,1 表示专业化物业选中 }, sfwzyhwyValue: true, moreDisabled: false, moreText: '加载更多', streetColumns: [], townColumns: [], spinning: false, timer: null, }; }, created() {}, activated() {}, beforeDestroy() { if (this.timer) { clearTimeout(this.timer); } }, mounted() { // this.initCheckboxGroup(); // this.getData(); this.getprojectListMsg(); // 获取项目列表 this.getStreetData(); // 假装调用接口成功,使用假数据填充 listData // this.listData = [ // { // id: 1, // xmmc: '项目A', // imgUrl: 'https://via.placeholder.com/50x50?text=Video+1', // hasVideo: true // }, // { // id: 2, // xmmc: '项目B', // imgUrl: '', // hasVideo: false // }, // { // id: 3, // xmmc: '项目C', // imgUrl: 'https://via.placeholder.com/50x50?text=Video+2', // hasVideo: true // } // ]; }, methods: { // 获取单个项目的视频地址 async fetchVideoUrl(item) { try { const res = await xioaquVideoList({ id: item.id }); console.error('1111111==============&gt;', { id: '1839890114125811716' }); // const res = await managerListMsg({ id: '1839890114125811716' }); console.log('接口返回:', res); // 打印调试 const data = res.data || {}; if (data.sqVideo && data.sqVideo.trim()) { item.videoUrl = data.sqVideo; } else { this.$toast('该条目无视频'); } } catch (error) { console.error('获取视频失败:', error); item.videoUrl = null; this.$toast('获取视频失败'); } }, // openVideo(item) { // if (item.sqVideo) { // this.currentVideoUrl = item.sqVideo; // this.showVideoPopup = true; // } else { // this.$toast('暂无视频'); // } // }, openImage(item) { if (item.sqImg) { this.currentImageUrls = item.sqImg.split(',').map(url =&gt; url.trim()).filter(url =&gt; url); this.currentIndex = 0; this.showImagePopup = true; } else { this.$toast('暂无图片'); } }, closeImage() { this.showImagePopup = false; this.currentImageUrls = []; this.currentIndex = 0; }, prevImage() { if (this.currentIndex &gt; 0) { this.currentIndex--; } }, nextImage() { if (this.currentIndex &lt; this.currentImageUrls.length - 1) { this.currentIndex++; } }, closeVideo() { this.currentVideoUrl = null; }, // 切换tab changeTab(tab) { this.activeName = tab; // this.getTab2List(); console.log('ffffff', tab); this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.pane.total = 0; this.listData = []; this.tab2ListData = []; if (tab == '0') { this.getprojectListMsg(); } else { this.getTab2List(); } }, // 获取数据列表接口 getData() { let params = { id: 1 }; }, // 获取所有项目 async getprojectListMsg() { this.spinning = true; const res = await managerListMsg(this.pane); if (res.success) { this.pane.total = res.result.total; this.listData = [...this.listData, ...res.result.records]; this.listData.forEach((item) =&gt; { if (item.fwxz && !Array.isArray(item.fwxz)) { item.fwxz = item.fwxz.split(','); } else { item.fwxz = item.fwxz || []; } }); this.$forceUpdate(); if (this.listData.length &gt;= this.pane.total) { this.moreDisabled = true; this.moreText = '没有更多了'; } else { this.moreDisabled = false; this.moreText = '加载更多'; } this.pane.pageNo += 1; } this.spinning = false; }, // 获取小区列表 getTab2List() { xioaquList(this.pane).then((res) =&gt; { this.pane.total = res.result.total; this.pane.pageNo = this.pane.pageNo + 1; if (res.code == 200) { if (res.result.records.length &lt; this.pane.pageSize) { this.moreDisabled = true; this.moreText = '没有更多了'; this.tab2ListData = [...this.tab2ListData, ...res.result.records]; this.$forceUpdate(); } else { this.moreDisabled = false; this.moreText = '加载更多'; this.tab2ListData = [...this.tab2ListData, ...res.result.records]; this.$forceUpdate(); } } }); }, // 跳转项目信息详情 filterOption(inputValue, option) { return option.data.attrs.lable ? option.data.attrs.lable.includes(inputValue) : null; }, handleXmmcInput(value) { // 延迟请求,避免频繁输入导致频繁搜索 if (this.searchTimer) { clearTimeout(this.searchTimer); } this.searchTimer = setTimeout(() =&gt; { this.pane.pageNo = 1; this.listData = []; this.getprojectListMsg(); // 重新加载数据 }, 500); }, // 获取街镇数据以及社区数据 getStreetData() { getSendRangeData().then((res) =&gt; { this.streetColumns = res.result; }); }, // 获取社区数据 getTownData(val) { getSqmcData({ id: val }).then((res) =&gt; { this.townColumns = res.result; }); }, handleTownConfirm(val) { this.sqmcName = val.departName; this.pane.sqmc = val.id; this.townPicker = false; }, handleSearch() { console.log(this.pane); this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); }, handleReset() { this.pane = { xmmc: '', szjz: undefined, sqmc: undefined, pageNo: 1, pageSize: 10, total: 0 }; this.moreDisabled = false; this.townColumns = []; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.$nextTick(() =&gt; { this.$forceUpdate; }); this.getprojectListMsg(); }, showDetail(id) { this.$router.push({ path: '/listDetail', query: { id: id } }); }, changeZyhwy(e) { this.pane.sfwzyhwy = this.sfwzyhwyValue ? 1 : 0; this.reLoadData(); }, handleStreetChange(val) { // 清空社区 this.pane.sqmc = undefined; this.getTownData(val); // this.reLoadData(); }, handleSQChange(val) { this.pane.sqmc = val; // this.reLoadData(); }, reLoadData() { this.pane.pageNo = 1; this.moreDisabled = false; this.moreText = '加载更多'; this.listData = []; this.getprojectListMsg(); } // changeXmmc(e) { // if (this.timer) { // clearTimeout(this.timer); // } // this.timer = setTimeout(() =&gt; { // this.moreDisabled = false; // this.moreText = '加载更多'; // this.listData = []; // // this.getprojectListMsg(); // }, 1000); // } // checkboxGroupShowFn() { // this.checkboxGroupShow = true; // } // initCheckboxGroup() { // this.checkboxGroupIds = []; // this.checkboxGroup = []; // }, // onSelect(items, index) { // this.$refs.CoverableCities[index].toggle(); // }, // comfirm() { // let text = []; // this.dataOption.map((its, i) =&gt; { // if (this.checkboxGroupIds.indexOf(its.id) !== -1) { // text.push(its); // } // }); // this.checkboxGroup = text; // this.$forceUpdate(); // this.cancel(false); // }, // cancel(flag) { // this.$forceUpdate(); // this.checkboxGroupShow = false; // if (flag) { // this.initCheckboxGroup(); // } // }, // deleteCheckbox(item) { // this.checkboxGroup.map((its, index) =&gt; { // if (item.id === its.id) { // this.checkboxGroup.splice(index, 1); // } // }); // this.checkboxGroupIds = this.checkboxGroup.map(its =&gt; { // return its.id; // }); // console.log(this.checkboxGroup, this.checkboxGroupIds, '----deleteCheckbox'); // } } }; &lt;/script&gt; &lt;style scoped lang="less"&gt; @import '~@/assets/css/comm.less'; ::v-deep .van-popup{ background-color: transparent !important; } .videoError { width: 50px; height: 50px; } .economicdevelopment-page { height: 100%; .fixedBox { width: 80px; height: 80px; border-radius: 50%; box-shadow: 5px 5px 5px #ccc, -5px -5px 5px #ccc, 5px -5px 5px #ccc, -5px 5px 5px #ccc; position: absolute; bottom: 20px; right: 20px; background: #fff; font-size: 14px; text-align: center; display: flex; align-items: center; justify-content: center; } .top_box { width: auto; height: 40px; background: #fff; border: 1px solid #3b77b3; position: relative; display: flex; align-items: center; padding: 0 5px; margin: 0 10px; .right_icon { position: absolute; top: 5px; right: 10px; } p { padding: 5px 10px 20px 10px; height: 24px; background: rgba(59, 119, 179, 0.15); border-radius: 12px; border: 1px solid rgba(59, 119, 179, 0.5); color: #3b77b3; font-size: 12px; font-weight: 500; font-family: PingFangSC, PingFang SC; margin: 0 2px; span { display: inline-block; margin-right: 10px; } } div.placeholder { width: 100%; color: #d4d3d3; font-size: 16px; font-weight: normal; text-align: center; } } /deep/ .van-tabs__content { overflow-y: scroll; } .tabBox { width: auto; margin: 0 10px; margin-top: 5px; height: 65vh; overflow: hidden; overflow-y: scroll; .itemBox { width: 100%; //height: 80px; position: relative; font-size: 12px; padding: 20px 0px 15px 0px; background: #fff; margin-bottom: 10px; display: flex; align-items: flex-end; margin-top: 5px; .contentBox { display: flex; justify-content: space-around; text-align: center; width: 100%; .video-popup-content { // padding: 10px; background: #000; } .iconBox { font-size: 26px; width: auto; height: 30px; line-height: 60px; } .msgBox { text-align: left; width: 200px; } .imgBox { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; } } .typeBox { border-top-right-radius: 15px; border-bottom-left-radius: 15px; position: absolute; height: 20px; line-height: 20px; top: 0; right: 10px; text-align: center; padding: 0 5px; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .personalType { background: #e99d42; } .publicType { background: #a2ef4d; } } } //.container { // height: 100% !important; // padding: 0 12.5px; // //} } .my_checkbox_popup { width: 100%; height: 45px; line-height: 45px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; p { height: 100%; padding: 0 0.42667rem; font-size: 0.37333rem; background-color: transparent; border: none; cursor: pointer; } p.cancel { color: #969799; } p.confirm { color: #576b95; } } .my_checkbox_popup_cell { /deep/ .van-cell__title { padding: 8px 10px; } } .my_checkbox_popup_item { padding: 10px 15px; } .moreBtn { text-align: center; color: #1989fa; border: none; width: 100%; background: #f1f3f3; } .userLoginSearch { // background-color: #fff; border-radius: 10px; padding: 10px; margin: 10px 0; .checkboxContainer { background-color: #f1f3f3; width: 100%; border-radius: 10px; border: 1px solid #3b77b3; font-size: 14px; padding: 0 8px; height: 32px; line-height: 32px; display: flex; align-items: center; justify-content: space-between; color: #3b77b3; } } .search-reset-btns { width: 100%; margin-top: 15px; justify-content: space-between; // background-color: #3c78b1; display: flex; gap: 10px; .van-button { border-radius: 14px; height: 36.69px; // background-color: transparent; flex: 1; font-size: 14px; color: #f1f3f3; img{ width: 20px; height: 20px; margin-left: 11px; } } } ::v-deep .ant-select-selection { border-color: #3b77b3; border-radius: 10px; color: #3b77b3; .ant-select-selection__placeholder { color: #3b77b3; } } ::v-deep .ant-input { border-color: #3b77b3; border-radius: 10px; padding-left: 8px; color: #3b77b3; &::placeholder { color: #3b77b3; } } &lt;/style&gt; 为啥前面的图片有是img图片,出现了一个p标签,里面有字体内容
最新发布
08-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值