Browse Source

列表如果返回为空停止加载

feature
mk 1 year ago
parent
commit
719fe5aedb
  1. 2
      src/store/modules/app.js
  2. 2
      src/utils/request.js
  3. 18
      src/views/Enjoyableservices/index.vue
  4. 2
      src/views/activity/index.vue
  5. 2
      src/views/appeal/index.vue
  6. 2
      src/views/communityPublicity/index.vue
  7. 2
      src/views/message/index.vue
  8. 2
      src/views/messages/index.vue
  9. 2
      src/views/mine/myActivity/index.vue
  10. 2
      src/views/mine/mySatisfaction/index.vue
  11. 2
      src/views/search/index.vue

2
src/store/modules/app.js

@ -9,7 +9,7 @@ const state = {
} }
const mutations = { const mutations = {
SET_USER_INFO(state, userInfo) { SET_USER_INFO(state, userInfo) {
console.log(userInfo,'seeeeeeeeeeeeeeeee'); console.log(userInfo,'用户信息');
state.userInfo = userInfo; state.userInfo = userInfo;
state.agencyId = userInfo.agencyId; state.agencyId = userInfo.agencyId;
state.realNameFlag = userInfo.realName; state.realNameFlag = userInfo.realName;

2
src/utils/request.js

@ -9,7 +9,7 @@ import { Tips } from '@/utils/index'
const service = axios.create({ const service = axios.create({
baseURL: baseApi, baseURL: baseApi,
withCredentials: true, // send cookies when cross-domain requests withCredentials: true, // send cookies when cross-domain requests
timeout: 50000 // 等待时间 timeout: 80000 // 等待时间
}) })
// request拦截器 request interceptor // request拦截器 request interceptor

18
src/views/Enjoyableservices/index.vue

@ -3,10 +3,13 @@
<div class="container"> <div class="container">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="myCommonsService" class="card" <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="myCommonsService" class="card"
:offset="50"> :offset="50">
<div class="card m-bottom10" v-for="(item,index) in EnjoyableList" :key="index" @click="$router.push({ path: `/detailServices`,query:{id:item.id} })"> <div class="card m-bottom10" v-for="(item, index) in EnjoyableList" :key="index"
@click="$router.push({ path: `/detailServices`, query: { id: item.id } })">
<div class="flex flex-x flex-center2"> <div class="flex flex-x flex-center2">
<van-tag v-if="item.status" color="#EBF1FE" text-color="#3974F6" size="large">{{ item.status? "进行中":"已结束" }}</van-tag> <van-tag v-if="item.status" color="#EBF1FE" text-color="#3974F6" size="large">{{ item.status ?
<van-tag v-if="!item.status" color="#F5F5F5" text-color="#AAAAAA" size="large">{{ item.status? "进行中":"已结束" }}</van-tag> "进行中":"已结束" }}</van-tag>
<van-tag v-if="!item.status" color="#F5F5F5" text-color="#AAAAAA" size="large">{{ item.status ?
"进行中":"已结束" }}</van-tag>
<div class="font-size13 C1 m-left12">{{ item.startDate }}</div> <div class="font-size13 C1 m-left12">{{ item.startDate }}</div>
</div> </div>
<div class="m-top10">{{ item.title }}</div> <div class="m-top10">{{ item.title }}</div>
@ -39,16 +42,17 @@ import { myCommonsService } from '@/api/user'
async myCommonsService() { async myCommonsService() {
let res = await myCommonsService() let res = await myCommonsService()
if (res.code === 0) { if (res.code === 0) {
debugger
this.loading = false; this.loading = false;
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
if(res.data){
this.EnjoyableList = this.EnjoyableList.concat(res.data.list); this.EnjoyableList = this.EnjoyableList.concat(res.data.list);
} }
}
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

2
src/views/activity/index.vue

@ -62,7 +62,7 @@ export default {
console.log(res); console.log(res);
if (res.code === 0) { if (res.code === 0) {
this.loading = false; this.loading = false;
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.activityList = this.activityList.concat(res.data.list); this.activityList = this.activityList.concat(res.data.list);

2
src/views/appeal/index.vue

@ -63,7 +63,7 @@ export default {
let res = await collects(parm) let res = await collects(parm)
if (res.code === 0) { if (res.code === 0) {
this.loading = false; this.loading = false;
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.list = this.list.concat(res.data.list); this.list = this.list.concat(res.data.list);

2
src/views/communityPublicity/index.vue

@ -111,7 +111,7 @@ export default {
item.newContent = this.extractChineseCharactersAndPunctuation(item.content) item.newContent = this.extractChineseCharactersAndPunctuation(item.content)
} }
}) })
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.PublicityList = this.PublicityList.concat(res.data.list); this.PublicityList = this.PublicityList.concat(res.data.list);

2
src/views/message/index.vue

@ -52,7 +52,7 @@ export default {
// //
this.loading = false this.loading = false
// //
if (this.list.length >= this.total) { if (!res.data || this.list.length >= this.total) {
this.finished = true this.finished = true
} else { } else {
this.pageNo++ this.pageNo++

2
src/views/messages/index.vue

@ -84,7 +84,7 @@ export default {
let res = await querystaffmessage(parm) let res = await querystaffmessage(parm)
this.loading = false this.loading = false
if (res.code === 0) { if (res.code === 0) {
if (res.data.length < this.pageSize) { if (!res.data || res.data.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.MessageList = res.data this.MessageList = res.data

2
src/views/mine/myActivity/index.vue

@ -54,7 +54,7 @@ export default {
let res = await communityActivity(parm) let res = await communityActivity(parm)
if (res.code === 0) { if (res.code === 0) {
this.loading = false; this.loading = false;
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.list = this.list.concat(res.data.list); this.list = this.list.concat(res.data.list);

2
src/views/mine/mySatisfaction/index.vue

@ -47,7 +47,7 @@ export default {
let res = await inspRecord(parm) let res = await inspRecord(parm)
if (res.code === 0) { if (res.code === 0) {
this.loading = false; this.loading = false;
if (res.data.list.length < this.pageSize) { if (!res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.list = this.list.concat(res.data.list); this.list = this.list.concat(res.data.list);

2
src/views/search/index.vue

@ -67,7 +67,7 @@ export default {
let res = await keyWordSearch(parm) let res = await keyWordSearch(parm)
this.loading = false this.loading = false
if (res.code === 0) { if (res.code === 0) {
if (res.data.list.length < this.pageSize) { if ( !res.data || res.data.list.length < this.pageSize) {
this.finished = true; this.finished = true;
} }
this.tableList =this.tableList.concat(res.data.list); this.tableList =this.tableList.concat(res.data.list);

Loading…
Cancel
Save