|
|
@ -12,7 +12,7 @@ |
|
|
<div :class="show?'triangle_border_top':'triangle_border_down'"> |
|
|
<div :class="show?'triangle_border_top':'triangle_border_down'"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<el-input style="border-left: 1px solid #c1c1c1;" placeholder="请输入小区名称" type="search" v-model="communityName" @keyup.enter.native="searchByName" @clear="clear" clearable> |
|
|
|
|
|
|
|
|
<el-input style="border-left: 1px solid #c1c1c1;" placeholder="请输入小区名称" v-model="communityName" @keyup.enter.native="searchByName" @clear="clear" clearable> |
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i> |
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</div> |
|
|
</div> |
|
|
@ -33,7 +33,7 @@ |
|
|
<div class="title"> |
|
|
<div class="title"> |
|
|
<span class="f-ml15 f-font-14 f-text-666">附近小区</span> |
|
|
<span class="f-ml15 f-font-14 f-text-666">附近小区</span> |
|
|
</div> |
|
|
</div> |
|
|
<div v-for="item in communityList" :key="item.housingEstateId" v-if="item.housingEstateId != estateId" class="f-flex f-flex-justify f-h60 f-ml15 f-mr15" style="border-bottom: 1px solid #f3f3f3;" @click="chooseCommunity(item)"> |
|
|
|
|
|
|
|
|
<div v-for="item in communityList" :key="item.housingEstateId" v-if="item.housingEstateId != estateId" class="f-flex f-flex-justify f-h60 f-ml15 f-mr15" style="border-bottom: 1px solid #f3f3f3;" @click="chooseCommunity(item)"> |
|
|
<div> |
|
|
<div> |
|
|
<div class="f-text-333 f-font-16">{{item.housingEstateName}}</div> |
|
|
<div class="f-text-333 f-font-16">{{item.housingEstateName}}</div> |
|
|
<div class="f-text-666 f-font-12">{{item.prefixAddress}}</div> |
|
|
<div class="f-text-666 f-font-12">{{item.prefixAddress}}</div> |
|
|
@ -42,7 +42,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 无限加载 --> |
|
|
<!-- 无限加载 --> |
|
|
<div :class="loadMoreHide ? 'load-more-hide' : 'load-more-normal'" v-infinite-scroll="fetchCommunityList" infinite-scroll-disabled="busy" infinite-scroll-distance="10" > |
|
|
|
|
|
|
|
|
<div :class="loadMoreHide ? 'load-more-hide' : 'load-more-normal'" v-infinite-scroll="fetchCommunityList" infinite-scroll-disabled="busy" infinite-scroll-distance="10"> |
|
|
<span class="load-more-tips f-flex f-flex-center" v-show="!noRecords && loadMoreTips" style="padding-top:4px">没有更多了</span> |
|
|
<span class="load-more-tips f-flex f-flex-center" v-show="!noRecords && loadMoreTips" style="padding-top:4px">没有更多了</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -52,7 +52,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import myScroll from '@/utils/scroll' |
|
|
|
|
|
|
|
|
import myScroll from "@/utils/scroll"; |
|
|
import chooseCommunityApi from "../models/choose-community"; |
|
|
import chooseCommunityApi from "../models/choose-community"; |
|
|
import homeApi from "../models/home-model.js"; |
|
|
import homeApi from "../models/home-model.js"; |
|
|
import { Alert, Toast, Loading } from "vux"; |
|
|
import { Alert, Toast, Loading } from "vux"; |
|
|
@ -86,7 +86,7 @@ export default { |
|
|
communityName: "", |
|
|
communityName: "", |
|
|
communityList: [], |
|
|
communityList: [], |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
pageNum: 1, |
|
|
|
|
|
|
|
|
pageNum: 0, |
|
|
isRequesting: false, |
|
|
isRequesting: false, |
|
|
loadMoreHide: false, |
|
|
loadMoreHide: false, |
|
|
loadMoreTips: false, |
|
|
loadMoreTips: false, |
|
|
@ -97,9 +97,9 @@ export default { |
|
|
showLoading: false |
|
|
showLoading: false |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
|
|
from.meta.keepAlive = false |
|
|
|
|
|
next() |
|
|
|
|
|
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
|
|
from.meta.keepAlive = false; |
|
|
|
|
|
next(); |
|
|
}, |
|
|
}, |
|
|
mixins: [myScroll], |
|
|
mixins: [myScroll], |
|
|
methods: { |
|
|
methods: { |
|
|
@ -172,8 +172,10 @@ export default { |
|
|
// localStorage.setItem("cityName", list); |
|
|
// localStorage.setItem("cityName", list); |
|
|
this.show = false; |
|
|
this.show = false; |
|
|
this.pageNum = 1; |
|
|
this.pageNum = 1; |
|
|
this.communityName =""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.busy = false; |
|
|
|
|
|
this.loadMoreHide = false; |
|
|
|
|
|
this.loadMoreTips = false; |
|
|
|
|
|
this.communityList = []; |
|
|
this.fetchCommunityList(); |
|
|
this.fetchCommunityList(); |
|
|
}, |
|
|
}, |
|
|
cancel() { |
|
|
cancel() { |
|
|
@ -190,25 +192,37 @@ export default { |
|
|
"440100000&广州市", |
|
|
"440100000&广州市", |
|
|
"440106000&天河区&2" |
|
|
"440106000&天河区&2" |
|
|
]; |
|
|
]; |
|
|
|
|
|
this.pageNum = 0; |
|
|
|
|
|
this.busy = false; |
|
|
|
|
|
this.loadMoreHide = false; |
|
|
|
|
|
this.loadMoreTips = false; |
|
|
|
|
|
this.communityList = []; |
|
|
this.fetchCommunityList(); |
|
|
this.fetchCommunityList(); |
|
|
} |
|
|
} |
|
|
this.show = false; |
|
|
this.show = false; |
|
|
}, |
|
|
}, |
|
|
clear() { |
|
|
clear() { |
|
|
|
|
|
console.log("communityName11:"+this.communityName) |
|
|
// 清除搜索条件 |
|
|
// 清除搜索条件 |
|
|
this.showFlag = false; |
|
|
this.showFlag = false; |
|
|
this.communityName = ""; |
|
|
this.communityName = ""; |
|
|
this.busy = false; |
|
|
this.busy = false; |
|
|
this.pageNum++; |
|
|
|
|
|
this.loadMoreHide = false; |
|
|
|
|
|
this.loadMoreTips = false; |
|
|
|
|
|
this.communityList = []; |
|
|
|
|
|
|
|
|
this.pageNum = 0; |
|
|
|
|
|
this.loadMoreHide = false; |
|
|
|
|
|
this.loadMoreTips = false; |
|
|
|
|
|
this.communityList = []; |
|
|
|
|
|
|
|
|
this.fetchCommunityList(); |
|
|
this.fetchCommunityList(); |
|
|
}, |
|
|
}, |
|
|
searchByName(event) { |
|
|
searchByName(event) { |
|
|
this.showFlag = false; |
|
|
this.showFlag = false; |
|
|
if (event.keyCode === 13) { |
|
|
if (event.keyCode === 13) { |
|
|
event.preventDefault(); // 禁止键盘默认事件 |
|
|
event.preventDefault(); // 禁止键盘默认事件 |
|
|
|
|
|
this.pageNum = 0; |
|
|
|
|
|
this.busy = false; |
|
|
|
|
|
this.loadMoreHide = false; |
|
|
|
|
|
this.loadMoreTips = false; |
|
|
|
|
|
this.communityList = []; |
|
|
this.fetchCommunityList(); |
|
|
this.fetchCommunityList(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -218,7 +232,8 @@ export default { |
|
|
} |
|
|
} |
|
|
this.isRequesting = true; |
|
|
this.isRequesting = true; |
|
|
//this.busy = true; |
|
|
//this.busy = true; |
|
|
var _this = this |
|
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
console.log("communityName:" + this.communityName); |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
var params = { |
|
|
var params = { |
|
|
pageNo: this.pageNum, |
|
|
pageNo: this.pageNum, |
|
|
@ -235,7 +250,7 @@ export default { |
|
|
if (res.code == 0) { |
|
|
if (res.code == 0) { |
|
|
_this.communityList = _this.communityList.concat(res.dataList); |
|
|
_this.communityList = _this.communityList.concat(res.dataList); |
|
|
if (!_this.communityList.length) _this.noRecords = true; |
|
|
if (!_this.communityList.length) _this.noRecords = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_this.pageSize > res.dataList.length) { |
|
|
if (_this.pageSize > res.dataList.length) { |
|
|
_this.busy = true; // 已经是最后一页了,不需要再触发滚动加载了 |
|
|
_this.busy = true; // 已经是最后一页了,不需要再触发滚动加载了 |
|
|
_this.loadMoreHide = true; |
|
|
_this.loadMoreHide = true; |
|
|
@ -261,7 +276,10 @@ export default { |
|
|
item.districtId + "&" + item.districtName + "&" + item.merchantNo |
|
|
item.districtId + "&" + item.districtName + "&" + item.merchantNo |
|
|
]; |
|
|
]; |
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
localStorage.setItem("estate", item.housingEstateId + "&" + item.housingEstateName); |
|
|
|
|
|
|
|
|
localStorage.setItem( |
|
|
|
|
|
"estate", |
|
|
|
|
|
item.housingEstateId + "&" + item.housingEstateName |
|
|
|
|
|
); |
|
|
this.estateId = item.housingEstateId; |
|
|
this.estateId = item.housingEstateId; |
|
|
this.countPartner(); |
|
|
this.countPartner(); |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
|