sunran 3 年之前
父节点
当前提交
a2fb19d815

+ 3 - 0
src/views/weibao/router/router.js

@@ -73,6 +73,9 @@ const routes = [{
     {
         path: '/loveHelp/index',
         name: 'loveHelp',
+        meta: {
+            keepAlive: true
+        },
         component: () => import('../views/loveHelp/index.vue')
     },
     {

+ 7 - 10
src/views/weibao/views/home/index.vue

@@ -88,13 +88,12 @@ export default {
     }
   },
   created() {
-    this.onLoad()
+    this.pageNotice()
     this.homeData()
   },
   methods: {
     async homeData() {
       const res = await homeData({ operatorId: 1 })
-      console.log(res)
       this.homeList = res.data
     },
     async pageNews() {
@@ -103,14 +102,13 @@ export default {
       if (this.newsform.pageNum == 1) {
         this.newsList = res.data.records
       } else {
-        console.log(this.newsList, '1')
         this.newsList = this.newsList.concat(res.data.records)
       }
-      this.newsform.pageNum = this.newsform.pageNum + 1
+
       if (this.newsList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.newsform.pageNum = this.newsform.pageNum + 1
       }
     },
     async pageNotice() {
@@ -121,11 +119,10 @@ export default {
       } else {
         this.noticeList = this.noticeList.concat(res.data.records)
       }
-      this.noticeform.pageNum = this.noticeform.pageNum + 1
       if (this.noticeList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.noticeform.pageNum = this.noticeform.pageNum + 1
       }
     },
     async pagePolicy() {
@@ -134,14 +131,12 @@ export default {
       if (this.policyform.pageNum == 1) {
         this.policyList = res.data.records
       } else {
-        console.log(this.policyList, '1')
         this.policyList = this.policyList.concat(res.data.records)
       }
-      this.policyform.pageNum = this.policyform.pageNum + 1
       if (this.policyList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.policyform.pageNum = this.policyform.pageNum + 1
       }
     },
     onLoad() {
@@ -154,6 +149,8 @@ export default {
       }
     },
     changeTab() {
+      this.loading = false
+      this.finished = false
       if (this.active == 0) {
         this.noticeform.pageNum = 1
         this.pageNotice()

+ 5 - 8
src/views/weibao/views/loveHelp/index.vue

@@ -38,32 +38,30 @@ export default {
       dataList: [],
       form: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 20,
       },
     }
   },
-  created() {
+  activated() {
     this.lovingHelpPage()
   },
   methods: {
     async lovingHelpPage() {
       const res = await lovingHelpPage(this.form)
-      this.loading = false
+      console.log(this.form.pageNum == 1, 'this.form.pageNum == 1')
       if (this.form.pageNum == 1) {
         this.dataList = res.data.records
       } else {
         this.dataList = this.dataList.concat(res.data.records)
       }
-      this.form.pageNum = this.form.pageNum + 1
       if (this.dataList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.form.pageNum = this.form.pageNum + 1
       }
+      this.loading = false
     },
     onLoad() {
-      this.loading = true
-      this.finished = false
       this.lovingHelpPage()
     },
     onSearch() {
@@ -77,7 +75,6 @@ export default {
       arr.forEach((item, index) => {
         if (item.indexOf('.jpg') || item.indexOf('.png')) {
           url = arr[index]
-          console.log(url, 'url')
           return
         }
       })

+ 2 - 3
src/views/weibao/views/reporting/index.vue

@@ -4,7 +4,7 @@
     <div class="box" v-if="roleIdStr==14||roleIdStr==15">
       <van-tabs v-model="active" @change="changetabs" sticky offset-top="46">
         <van-tab title="发起报告">
-          <initiateConsultation  @changactive="changactive"></initiateConsultation>
+          <initiateConsultation @changactive="changactive"></initiateConsultation>
         </van-tab>
         <van-tab title="历史报告">
           <div class="casebox">
@@ -72,7 +72,6 @@ export default {
   },
   methods: {
     onLoad() {
-      this.historyform.pageNum++
       this.mandatoryPage()
     },
     changactive(v) {
@@ -92,7 +91,7 @@ export default {
       if (this.historyList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.historyform.pageNum++
       }
     },
     getpics(item) {

+ 8 - 7
src/views/weibao/views/specialServices/index.vue

@@ -48,7 +48,9 @@ export default {
   },
   activated() {
     this.loading = true
-    this.pageAppProject()
+    if (this.roleIdStr == 21) {
+      this.pageAppProject()
+    }
     this.pageProjectHistory()
   },
   methods: {
@@ -61,15 +63,14 @@ export default {
         this.active = 1
       }
       if (this.active == 0) {
-        this.planform.pageNum = this.planform.pageNum + 1
         this.pageAppProject()
       } else if (this.active == 1) {
-        this.historyform.pageNum = this.historyform.pageNum + 1
         this.pageProjectHistory()
       }
     },
     changetabs() {
-      this.loading = true
+      this.loading = false
+      this.finished = false
       if (this.active == 0) {
         this.planform.pageNum = 1
         this.pageAppProject()
@@ -89,12 +90,11 @@ export default {
       if (this.planformList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.planform.pageNum = this.planform.pageNum + 1
       }
     },
     async pageProjectHistory() {
       const res = await pageProjectHistory(this.historyform)
-      this.loading = false
       if (this.historyform.pageNum == 1) {
         this.historyList = res.data.records
       } else {
@@ -103,8 +103,9 @@ export default {
       if (this.historyList.length >= res.data.total) {
         this.finished = true
       } else {
-        this.finished = false
+        this.historyform.pageNum = this.historyform.pageNum + 1
       }
+      this.loading = false
     },
   },
 }