Browse Source

feat: 保存

gemercheung 1 year ago
parent
commit
50246c2d6e
2 changed files with 24 additions and 3 deletions
  1. 5 3
      src/store/exhibition.js
  2. 19 0
      src/views/feedback.vue

+ 5 - 3
src/store/exhibition.js

@@ -43,12 +43,13 @@ export const useExhibitionStore = defineStore({
         if (this.pagination.pageNum === 1) {
           this.lists = [];
         }
-        const { records, total, current, page } = data.data;
+        const { records, total, current, pages } = data.data;
         const templists = this.lists.concat(records);
         this.lists = templists;
         this.total = total;
         this.pagination.current = current;
-        this.pagination.page = page;
+        this.pagination.pages = pages;
+        this.isLoadMoreLock = false;
         return Promise.resolve(0);
       } else {
         this.lists = [];
@@ -95,11 +96,12 @@ export const useExhibitionStore = defineStore({
     async loadMore(type) {
       if (!this.isLoadMoreLock && !this.isLast) {
         this.isLoadMoreLock = true;
-        this.pagination.type = type;
+        this.pagination.type = type === "all" ? "" : type;
         const page =
           this.pagination.pageNum < this.pagination.pages
             ? this.pagination.pageNum + 1
             : this.pagination.pages;
+
         this.pagination.pageNum = page;
 
         return await this.fetch();

+ 19 - 0
src/views/feedback.vue

@@ -42,6 +42,18 @@
                 :src="imageCode"
                 @click="handleCodeReload"
               />
+              <svg
+                @click="handleCodeReload"
+                class="icon-refresh"
+                xmlns="http://www.w3.org/2000/svg"
+                xmlns:xlink="http://www.w3.org/1999/xlink"
+                viewBox="0 0 24 24"
+              >
+                <path
+                  d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
+                  fill="currentColor"
+                ></path>
+              </svg>
             </n-space>
             <n-space align="center" justify="center" style="padding: 1.25rem">
               <n-button
@@ -165,6 +177,13 @@ const handleCodeReload = () => {
     vertical-align: middle;
     cursor: pointer;
   }
+  .icon-refresh {
+    color: #000;
+    width: 40px;
+    height: 40px;
+    vertical-align: middle;
+    cursor: pointer;
+  }
 }
 :deep(.detail .info .n-input--textarea) {
   --n-font-size: 1.25rem !important;