|
@@ -30,7 +30,7 @@
|
|
|
<!-- 筛选框end -->
|
|
|
|
|
|
<!-- 站点列表start -->
|
|
|
- <view class="site-items" style="margin-top:0;height: calc(100vh - 380rpx);">
|
|
|
+ <view class="site-items" style="margin-top:0;height: calc(100vh - 380rpx)">
|
|
|
<view class="cu-list menu-avatar">
|
|
|
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
|
|
|
v-for="(item,index) in siteList" :key="index" @touchstart="ListTouchStart"
|
|
@@ -54,13 +54,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="!siteList.length&&siteListRes==1" class="text-center margin-top"> 暂无数据</view>
|
|
|
+ <view v-show="isLoadMore&&this.currentPage>1">
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 站点列表end -->
|
|
|
|
|
|
<!-- 新增按钮start -->
|
|
|
- <view class="plus">
|
|
|
- <image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
|
|
|
+ <view style="width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0px;
|
|
|
+ right: 0px;
|
|
|
+ height: 64px;
|
|
|
+ background: #fff;">
|
|
|
+ <view class="plus">
|
|
|
+ <image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
<!-- 新增按钮end -->
|
|
|
</view>
|
|
|
|
|
@@ -96,19 +107,45 @@
|
|
|
|
|
|
siteItemDataOrigin: [],
|
|
|
siteItemData: [],
|
|
|
+
|
|
|
+ currentPage: 1,
|
|
|
+ size: 10,
|
|
|
+ loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
|
+ isLoadMore: false, //是否加载中
|
|
|
|
|
|
};
|
|
|
},
|
|
|
+ onReachBottom() { //上拉触底函数
|
|
|
+ if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
|
+ this.isLoadMore = true
|
|
|
+ this.currentPage += 1;
|
|
|
+ this.loadData()
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
onLoad: function(option) {
|
|
|
|
|
|
//站点列表渲染
|
|
|
- this.getSiteList()
|
|
|
+ this.loadData()
|
|
|
this.getRoutrBox()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+
|
|
|
+ //筛选
|
|
|
+ searchSiteList() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ loadData(){
|
|
|
+ this.getSiteList({
|
|
|
+ "siteName": this.siteName,
|
|
|
+ "route_name": this.formMess.siteName,
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ size: this.size,
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
//线路名称下拉数据请求
|
|
|
async getRoutrBox(params = {}) {
|
|
@@ -147,13 +184,7 @@
|
|
|
-1);
|
|
|
},
|
|
|
|
|
|
- //筛选
|
|
|
- searchSiteList() {
|
|
|
- this.getSiteList({
|
|
|
- "siteName": this.siteName,
|
|
|
- "route_name": this.formMess.siteName
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
//编辑
|
|
|
editItem(item) {
|
|
@@ -235,8 +266,19 @@
|
|
|
data: ming
|
|
|
})
|
|
|
this.siteListRes = 1;
|
|
|
- this.siteList = res.data.data
|
|
|
- console.log(res.data.data);
|
|
|
+
|
|
|
+ if (res.data.total) {
|
|
|
+ this.siteList = this.siteList.concat(res.data.data)
|
|
|
+ if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
|
|
+ this.isLoadMore = true
|
|
|
+ this.loadStatus = 'nomore'
|
|
|
+ } else {
|
|
|
+ this.isLoadMore = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isLoadMore = true
|
|
|
+ this.loadStatus = 'nomore'
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 新增跳转
|