|
@@ -59,9 +59,13 @@
|
|
|
<view v-if='position.name!="未设置"' class='distance Regular'>{{item._metre}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
<view style='padding:10px;text-align:center;' v-if='datalist.length==0'>
|
|
|
当前暂无数据
|
|
|
</view>
|
|
|
+ <view v-else-if="isLoadMore" >
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="enter" @click="enterUrl">
|
|
|
<image style='width:56.5px;height:28px;' src="../../static/img/liangmai/ruzhu.png" mode=""></image>
|
|
@@ -90,6 +94,8 @@
|
|
|
pageSize: 10,
|
|
|
releaseInfo:[],
|
|
|
currentPage: 1,
|
|
|
+ isLoadMore: false, //是否加载中
|
|
|
+ loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
|
searchTypes: [{
|
|
|
name: '全部',
|
|
|
value: '0'
|
|
@@ -127,12 +133,20 @@
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.getList()
|
|
|
+ this.isLoadMore = false
|
|
|
+ this.loadStatus = 'loading'
|
|
|
setTimeout(function () {
|
|
|
uni.stopPullDownRefresh(); //关闭下拉刷新
|
|
|
}, 1000);
|
|
|
},
|
|
|
+ onReachBottom() { //上拉触底函数
|
|
|
+ if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
|
+ this.isLoadMore = true
|
|
|
+ this.currentPage += 1
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
+ },
|
|
|
onShow(val) {
|
|
|
- this.getList()
|
|
|
uni.hideKeyboard()
|
|
|
uni.getStorage({
|
|
|
key: 'setLocaltion',
|
|
@@ -143,13 +157,39 @@
|
|
|
// key: 'setLocaltion'
|
|
|
// })
|
|
|
},
|
|
|
-
|
|
|
})
|
|
|
+ if(this.position.name == "未设置"){
|
|
|
+ let that = this;
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ geocode: true,
|
|
|
+ success: function(res) {
|
|
|
+ console.log('获取位置数据:', res);
|
|
|
+ console.log('当前位置的经度:' + res.longitude);
|
|
|
+ console.log('当前位置的纬度:' + res.latitude);
|
|
|
+ //拼接当前定位回显地址
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ that.position.name = res.address.poiName
|
|
|
+ that.position.location = res.longitude + "," + res.latitude
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'setLocaltion',
|
|
|
+ data: that.position
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ that.getList()
|
|
|
+ },
|
|
|
+ fail:function(req){
|
|
|
+ console.log(req)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
if (option.position){
|
|
|
this.position = option.position
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -167,7 +207,8 @@
|
|
|
})
|
|
|
this.getInfo()
|
|
|
},
|
|
|
- getInfo(){
|
|
|
+ getData(){
|
|
|
+ var that = this
|
|
|
uni.showLoading({
|
|
|
title:"正在加载"
|
|
|
})
|
|
@@ -177,6 +218,51 @@
|
|
|
currentPage: this.currentPage,
|
|
|
pcFlag: 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",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 => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.datalist = res.data.data.records
|