|
@@ -59,6 +59,9 @@
|
|
<view v-if='position.name!="未设置"' class='distance Regular'>{{item._metre}}</view>
|
|
<view v-if='position.name!="未设置"' class='distance Regular'>{{item._metre}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view v-show="isLoadMore">
|
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
|
+ </view>
|
|
<view style='padding:10px;text-align:center;' v-if='datalist.length==0'>
|
|
<view style='padding:10px;text-align:center;' v-if='datalist.length==0'>
|
|
当前暂无数据
|
|
当前暂无数据
|
|
</view>
|
|
</view>
|
|
@@ -90,6 +93,8 @@
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
releaseInfo:[],
|
|
releaseInfo:[],
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
|
|
+ isLoadMore: false, //是否加载中
|
|
|
|
+ loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
searchTypes: [{
|
|
searchTypes: [{
|
|
name: '全部',
|
|
name: '全部',
|
|
value: '0'
|
|
value: '0'
|
|
@@ -127,10 +132,19 @@
|
|
},
|
|
},
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
this.getList()
|
|
this.getList()
|
|
|
|
+ this.isLoadMore = false
|
|
|
|
+ this.loadStatus = 'loading'
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
uni.stopPullDownRefresh(); //关闭下拉刷新
|
|
uni.stopPullDownRefresh(); //关闭下拉刷新
|
|
}, 1000);
|
|
}, 1000);
|
|
},
|
|
},
|
|
|
|
+ onReachBottom() { //上拉触底函数
|
|
|
|
+ if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
|
|
+ this.isLoadMore = true
|
|
|
|
+ this.currentPage += 1
|
|
|
|
+ this.getData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onShow(val) {
|
|
onShow(val) {
|
|
this.getList()
|
|
this.getList()
|
|
uni.hideKeyboard()
|
|
uni.hideKeyboard()
|
|
@@ -149,7 +163,6 @@
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
if (option.position){
|
|
if (option.position){
|
|
this.position = option.position
|
|
this.position = option.position
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -167,7 +180,8 @@
|
|
})
|
|
})
|
|
this.getInfo()
|
|
this.getInfo()
|
|
},
|
|
},
|
|
- getInfo(){
|
|
|
|
|
|
+ getData(){
|
|
|
|
+ var that = this
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title:"正在加载"
|
|
title:"正在加载"
|
|
})
|
|
})
|
|
@@ -177,6 +191,51 @@
|
|
currentPage: this.currentPage,
|
|
currentPage: this.currentPage,
|
|
pcFlag: 2,
|
|
pcFlag: 2,
|
|
searchType: 2
|
|
searchType: 2
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ var data = res.data.data.records
|
|
|
|
+ if(data.length > 0){
|
|
|
|
+ this.datalist = this.datalist.concat(data)
|
|
|
|
+ console.log(this.position)
|
|
|
|
+ let lat2 =this.position.location.split(',')[1];
|
|
|
|
+ let lng2 = this.position.location.split(',')[0];
|
|
|
|
+ for(var i=0;i<this.datalist.length;i++){
|
|
|
|
+ this.datalist[i]._metre=this.utils.getDistance(this.datalist[i].latitude,this.datalist[i].longitude,lat2,lng2)
|
|
|
|
+ }
|
|
|
|
+ if(this.currentPage==1&&this.datalist.length==0){
|
|
|
|
+ this.notlist=true
|
|
|
|
+ }else{
|
|
|
|
+ this.notlist=false
|
|
|
|
+ }
|
|
|
|
+ console.log(this.datalist)
|
|
|
|
+ that.isLoadMore=false
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ if(that.currentPage>1){that.currentPage-=1}
|
|
|
|
+ that.isLoadMore=true
|
|
|
|
+ that.loadStatus = 'nomore'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // let _metre = this.utils.getDistance(lat1,lng1,lat2,lng2) +"千米"
|
|
|
|
+ }
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ }).catch(res => {
|
|
|
|
+ that.isLoadMore=false
|
|
|
|
+ that.loadStatus = 'nomore'
|
|
|
|
+ if(that.currentPage>1){that.currentPage=1}
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getInfo(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title:"正在加载"
|
|
|
|
+ })
|
|
|
|
+ this.$api.doRequest('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
|
|
|
|
+ mainBusinessType: this.mainBusinessType,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pcFlag: 2,
|
|
|
|
+ searchType: 2
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
this.datalist = res.data.data.records
|
|
this.datalist = res.data.data.records
|