DESKTOP-SVI9JE1\muzen преди 2 години
родител
ревизия
dde9a79b2a
променени са 2 файла, в които са добавени 24 реда и са изтрити 6 реда
  1. 2 1
      src/pages.json
  2. 22 5
      src/pages/help/detail.vue

+ 2 - 1
src/pages.json

@@ -29,7 +29,8 @@
 			// 帮助与反馈
 			"path": "pages/help/index",
 			"style": {
-				"navigationStyle": "custom"
+				"navigationStyle": "custom",
+				"onReachBottomDistance": 50
 			}
 		},
 		{ // 我的反馈

+ 22 - 5
src/pages/help/detail.vue

@@ -16,6 +16,9 @@
         </view>
       </view>
     </view>
+    <view class="has-more" v-if="!hasMore">
+      —————— 暂无更多反馈 ——————
+    </view>
   </view>
 </template>
 
@@ -29,8 +32,8 @@ export default {
         pageNum: 1,
         pageSize: 10
       },
-      // 总数据
-      total: 0,
+      // 是否有更多
+      hasMore: false,
       // 列表
       tableData: [],
       // 状态
@@ -43,18 +46,26 @@ export default {
   beforeCreate() {
     document.querySelector('body').setAttribute('style', 'background-color:#FAFAFA;')
   },
-  mounted() {
+  onLoad() {
     this.getDetail()
   },
   methods: {
     getDetail() {
       detail(this.form).then(res => {
         if (res.data.code === 0) {
-          this.tableData = res.data.data.records
-          this.total = res.data.data.total
+          res.data.data.records.map(i => {
+            this.tableData.push(i)
+          })          
+          this.hasMore = res.data.data.hasMore
         }
       })
     }
+  },
+  onReachBottom() {
+    if (this.hasMore) {
+      this.form.pageNum += 1
+      this.getDetail()
+    }
   }
 }
 </script>
@@ -104,5 +115,11 @@ export default {
     padding: 20rpx;
     border-radius: 16rpx;
   }
+
+  .has-more{
+    color: #999;
+    font-size: 24rpx;
+    text-align: center;
+  }
 }
 </style>