From a11bc1bed7953b88213330582c2085f60b5a73b1 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 12 六月 2024 15:01:56 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit

---
 h5/pages/applicationRecord/applicationRecord.vue |   94 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 74 insertions(+), 20 deletions(-)

diff --git a/h5/pages/applicationRecord/applicationRecord.vue b/h5/pages/applicationRecord/applicationRecord.vue
index 4c6b390..ea490a1 100644
--- a/h5/pages/applicationRecord/applicationRecord.vue
+++ b/h5/pages/applicationRecord/applicationRecord.vue
@@ -2,29 +2,58 @@
   <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>{{ item.name }}鐨勫姵鍔″叆鍥敵璇�</text>
           <text class="loading">{{ statusMap[item.status] }}</text>
         </view>
         <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>
             <text>{{ item.starttime }}</text>
           </view>
           <view class="box_list_item_nr_item">
-            <text>绂诲巶鏃堕棿锛�</text>
+            <text>绂诲洯鏃堕棿锛�</text>
             <text>{{ item.endtime }}</text>
           </view>
           <view class="box_list_item_nr_item">
@@ -34,6 +63,10 @@
           <view class="box_list_item_nr_x"></view>
           <view class="box_list_item_nr_text">{{ item.createDate }} 鎻愪氦</view>
         </view>
+      </view>
+      <view v-if="list.length === 0"  style="text-align: center;">
+        <image src="@/static/empty.png" style="width: 320rpx;margin: 120rpx auto 0" mode="widthFix" />
+        <view class="placeholder9 fs24">鏆傛棤鏁版嵁</view>
       </view>
     </view>
   </view>
@@ -49,6 +82,8 @@
         capacity: 10
       },
       list: [],
+      total: 0,
+      status: '',
 
       statusMap: {
         0: '寰呭鏍�',
@@ -64,29 +99,48 @@
   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.list = []
+      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
+        }
       })
     }
 
   }
 }
 </script>
-<style>
+<style lang="scss">
 page {
   background-color: #f7f7f7 !important;
 }
@@ -109,8 +163,8 @@
       display: flex;
       align-items: center;
       .active {
-        border: 1rpx solid #279baa !important;
-        color: #279baa !important;
+        border: 1rpx solid $uni-color-primary !important;
+        color: $uni-color-primary !important;
       }
       .box_head_item {
         padding: 0 30rpx;
@@ -147,7 +201,7 @@
         align-items: center;
         justify-content: space-between;
         .loading {
-          color: #279baa;
+          color: $uni-color-primary;
         }
         .success {
           color: #03c68f;

--
Gitblit v1.9.3