From 95809b417c79622743d7a622f5db25e2187d3650 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 28 五月 2024 16:36:40 +0800
Subject: [PATCH] ''

---
 h5/pages/applicationRecord/applicationRecord.vue |   78 ++++++++++++++++++++++++++++++++-------
 1 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/h5/pages/applicationRecord/applicationRecord.vue b/h5/pages/applicationRecord/applicationRecord.vue
index 4c6b390..c10e776 100644
--- a/h5/pages/applicationRecord/applicationRecord.vue
+++ b/h5/pages/applicationRecord/applicationRecord.vue
@@ -2,14 +2,39 @@
   <view class="box">
     <scroll-view scroll-x class="box_head">
       <view class="box_head_list">
-        <view class="box_head_item active">鍏ㄩ儴</view>
-        <view class="box_head_item">寰呭鏍�</view>
-        <view class="box_head_item">瀹℃牳閫氳繃</view>
-        <view class="box_head_item">瀹℃牳椹冲洖</view>
+        <view
+          class="box_head_item"
+          :class="{ active: status == '' }"
+          @click="tabsClick('')"
+          >鍏ㄩ儴</view
+        >
+        <view
+          class="box_head_item"
+          @click="tabsClick('0')"
+          :class="{ active: status == '0' }"
+          >寰呭鏍�</view
+        >
+        <view
+          class="box_head_item"
+          @click="tabsClick('2')"
+          :class="{ active: status == '2' }"
+          >瀹℃牳閫氳繃</view
+        >
+        <view
+          class="box_head_item"
+          @click="tabsClick('3')"
+          :class="{ active: status == '3' }"
+          >瀹℃牳椹冲洖</view
+        >
       </view>
     </scroll-view>
     <view class="box_list">
-      <view @click="handleDetail(item.id)" class="box_list_item" v-for="(item, index) in list" :key="index">
+      <view
+        @click="handleDetail(item.id)"
+        class="box_list_item"
+        v-for="(item, index) in list"
+        :key="index"
+      >
         <view class="box_list_item_head">
           <text>{{ item.name }}鐨勫姵鍔″叆鍘傜敵璇�</text>
           <text class="loading">{{ statusMap[item.status] }}</text>
@@ -17,7 +42,11 @@
         <view class="box_list_item_nr">
           <view class="box_list_item_nr_item">
             <text>琚闂汉锛�</text>
-            <text>{{ item.receptMemberDepartment }}-{{ item.receptMemberName }}</text>
+            <text
+              >{{ item.receptMemberDepartment }}-{{
+                item.receptMemberName
+              }}</text
+            >
           </view>
           <view class="box_list_item_nr_item">
             <text>杩涘巶鏃堕棿锛�</text>
@@ -49,6 +78,8 @@
         capacity: 10
       },
       list: [],
+      total: 0,
+      status: '',
 
       statusMap: {
         0: '寰呭鏍�',
@@ -64,22 +95,41 @@
   onLoad() {
     this.getList()
   },
+  onReachBottom() {
+    if (this.total > 10) {
+      this.getList()
+    }
+
+  },
   methods: {
     handleDetail(id) {
       uni.navigateTo({
-      	url: "/pages/appointmentDetails/appointmentDetails?id="+ id
+        url: "/pages/appointmentDetails/appointmentDetails?id=" + id
       })
     },
+    tabsClick(val) {
+      this.pagination.page = 0
+      this.status = val
+      this.getList()
+    },
     getList() {
-      const { pagination } = this
+      const { pagination, status, list } = this
+      pagination.page = pagination.page + 1
       getVisitedRecord({
-         ...pagination,
-         model: {
-          openid: this.$store.state.openId
-         } ,
-         
+        ...pagination,
+        model: {
+          openid: this.$store.state.openId,
+          status
+        },
       }).then(res => {
-        this.list = res.data.records || []
+        if (res.data.records.length > 0) {
+          if(pagination.page === 1){
+            this.list = res.data.records
+          }else{
+            this.list = [...list, ...res.data.records]
+          }
+          this.total = res.data.total
+        }
       })
     }
 

--
Gitblit v1.9.3