|
|
@@ -11,7 +11,7 @@
|
|
|
</view>
|
|
|
<scroll-view scroll-y="true" :style="{ height: height }" class="item-wrapper" @scrolltolower="loadDate">
|
|
|
<!-- <view class="item-wrapper"> -->
|
|
|
- <empty v-if="list.length === 0 "></empty>
|
|
|
+ <empty v-if="loaded && list.length === 0 "></empty>
|
|
|
<template>
|
|
|
<view class="item flex" v-for="item in list" @click="join(item.id)" :key="item.id">
|
|
|
<view class="item-left">
|
|
|
@@ -75,7 +75,7 @@
|
|
|
loadingType: 'more',
|
|
|
page: 1,
|
|
|
loaded: false,
|
|
|
- limit: 5
|
|
|
+ limit: 10,
|
|
|
// showList: []
|
|
|
};
|
|
|
},
|
|
|
@@ -106,12 +106,12 @@
|
|
|
this.loadingType = 'more'
|
|
|
this.loaded = false
|
|
|
this.select_area = this.areas[e.target.value].id;
|
|
|
+ this.list = []
|
|
|
+ this.loadDate()
|
|
|
+ }else {
|
|
|
+
|
|
|
}
|
|
|
- this.list = []
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中...'
|
|
|
- })
|
|
|
- this.loadDate()
|
|
|
+
|
|
|
|
|
|
|
|
|
},
|
|
|
@@ -123,22 +123,14 @@
|
|
|
this.loadingType = 'more'
|
|
|
this.loaded = false
|
|
|
this.select_status = this.statuss[e.target.value].id;
|
|
|
+ this.list = []
|
|
|
+
|
|
|
+ this.loadDate()
|
|
|
+ }else {
|
|
|
+
|
|
|
}
|
|
|
- this.list = []
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中...'
|
|
|
- })
|
|
|
- this.loadDate()
|
|
|
- // if (this.status !== this.statuss[e.target.value]) {
|
|
|
- // this.status = this.statuss[e.target.value];
|
|
|
- // if(this.status == '全部') {
|
|
|
- // this.showList = this.list
|
|
|
- // }else if(this.status == '进行中'){
|
|
|
- // this.showList = this.list.map( item => {
|
|
|
- // return item
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
join(id) {
|
|
|
console.log(id);
|
|
|
@@ -148,9 +140,10 @@
|
|
|
console.log('dddddddddd');
|
|
|
},
|
|
|
loadDate() {
|
|
|
- if (this.loadingType === 'noMore') {
|
|
|
+ if (this.loadingType === 'noMore' || this.loadingType == 'loading') {
|
|
|
return
|
|
|
}
|
|
|
+ this.loadingType = 'loading'
|
|
|
getProjectList({
|
|
|
project_area: this.select_area,
|
|
|
page: this.page,
|
|
|
@@ -164,24 +157,27 @@
|
|
|
this.page++;
|
|
|
// console.log(this.page)
|
|
|
let list = [];
|
|
|
- list = data.list.map(item => {
|
|
|
- getProjectInfo({
|
|
|
- id: item.id
|
|
|
- }).then(res => {
|
|
|
- // let data = JSON.parse(res.msg);
|
|
|
- let data = res.data
|
|
|
- console.log(res, '9999999999999999999999999999999999999999')
|
|
|
- item.project_progress = data.project_progress;
|
|
|
- item.info = item.info.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, '')
|
|
|
- .replace(/<[^>]+>/g, '');
|
|
|
- console.log(item);
|
|
|
- this.list.push(item);
|
|
|
- console.log(this.list, '/////////////////////////////////////');
|
|
|
- return item;
|
|
|
- });
|
|
|
- });
|
|
|
+ if(data.list.length !=0) {
|
|
|
+ list = data.list.map(item => {
|
|
|
+ getProjectInfo({
|
|
|
+ id: item.id
|
|
|
+ }).then(res => {
|
|
|
+ // let data = JSON.parse(res.msg);
|
|
|
+ let data = res.data
|
|
|
+ console.log(res, '9999999999999999999999999999999999999999')
|
|
|
+ item.project_progress = data.project_progress;
|
|
|
+ item.info = item.info.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, '')
|
|
|
+ .replace(/<[^>]+>/g, '');
|
|
|
+ console.log(item);
|
|
|
+ this.list.push(item);
|
|
|
+ console.log(this.list, '/////////////////////////////////////');
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// this.list.push(list)
|
|
|
- uni.hideLoading()
|
|
|
+
|
|
|
console.log(this.list.length, '5555555');
|
|
|
|
|
|
if (this.limit == data.list.length) {
|