Ver código fonte

换一换逻辑

黄琪勇 11 meses atrás
pai
commit
f751d27785
1 arquivos alterados com 14 adições e 6 exclusões
  1. 14 6
      src/views/creation/index-share.tsx

+ 14 - 6
src/views/creation/index-share.tsx

@@ -149,9 +149,9 @@ export default defineComponent({
         state.listState.loading = false;
         const result = res.data || {};
         // 处理重复请求数据
-        if (state.list.length > 0 && result.current === 1) {
-          return;
-        }
+        // if (state.list.length > 0 && result.current === 1) {
+        //   return;
+        // }
         state.list = result.rows || [];
         state.listState.finished = result.current >= result.pages;
         state.params.page = result.current + 1;
@@ -163,7 +163,15 @@ export default defineComponent({
         state.isClick = false;
       }
     };
-
+    function handleChangeList() {
+      if(state.listState.finished){
+        state.listState.finished = false
+        state.params.page = 1;
+        getList()
+      }else{
+        getList()
+      }
+    }
     const onDetail = (item: any) => {
       playProgressData.playProgress = 0
       playProgressData.playState = false
@@ -655,9 +663,9 @@ export default defineComponent({
                     ))}
                   </List>
                   {
-                    !state.listState.finished &&
+                    (!state.listState.finished || state.params.page>2) &&
                       <div class={styles.btnImg}>
-                        <img onClick={getList} src={btnImg} />
+                        <img onClick={handleChangeList} src={btnImg} />
                     </div>
                   }
                 </>