刘洋 1 gadu atpakaļ
vecāks
revīzija
09c0309960

+ 3 - 0
src/assets/styles/base.css

@@ -67,3 +67,6 @@ body {
   opacity: 0;
   opacity: 0;
   transform: scale(1.06);
   transform: scale(1.06);
 }
 }
+.van-pull-refresh {
+  overflow: visible !important;
+}

+ 3 - 0
src/assets/styles/base.less

@@ -84,3 +84,6 @@ body {
   opacity: 0;
   opacity: 0;
   transform: scale(1.06);
   transform: scale(1.06);
 }
 }
+.van-pull-refresh {
+  overflow: visible !important;
+}

+ 14 - 7
src/pages/myHistory.vue

@@ -2,12 +2,14 @@
   <div class="my-history page p-16">
   <div class="my-history page p-16">
     <template v-if="loading"></template>
     <template v-if="loading"></template>
     <template v-else-if="list.length">
     <template v-else-if="list.length">
-      <ApplyItem
-        :item="item"
-        @update="_getMyHistory"
-        v-for="item in list"
-        :key="item.applyId"
-      ></ApplyItem>
+      <van-pull-refresh v-model="pullLoading" @refresh="_getMyHistory(true)">
+        <ApplyItem
+          :item="item"
+          @update="_getMyHistory"
+          v-for="item in list"
+          :key="item.applyId"
+        ></ApplyItem>
+      </van-pull-refresh>
     </template>
     </template>
     <div class="vh-100 text-center flex-h-center" v-else>
     <div class="vh-100 text-center flex-h-center" v-else>
       <div>
       <div>
@@ -28,15 +30,20 @@ import { getMyHistory } from "@/api/user";
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
 const router = useRouter();
 const router = useRouter();
 const list = ref([]);
 const list = ref([]);
+const pullLoading = ref(false);
 const loading = ref(false);
 const loading = ref(false);
-function _getMyHistory() {
+function _getMyHistory(bool) {
   loading.value = true;
   loading.value = true;
   getMyHistory()
   getMyHistory()
     .then((res) => {
     .then((res) => {
       list.value = res || [];
       list.value = res || [];
+      if (bool) {
+        showToast("刷新成功");
+      }
     })
     })
     .finally(() => {
     .finally(() => {
       loading.value = false;
       loading.value = false;
+      pullLoading.value = false;
     });
     });
 }
 }
 _getMyHistory();
 _getMyHistory();

+ 14 - 7
src/pages/tab-pages/index.vue

@@ -2,12 +2,14 @@
   <div class="index tab-page p-16">
   <div class="index tab-page p-16">
     <template v-if="loading"></template>
     <template v-if="loading"></template>
     <template v-else-if="list.length">
     <template v-else-if="list.length">
-      <ApplyItem
-        :item="item"
-        @update="_getIndexList"
-        v-for="item in list"
-        :key="item.applyId"
-      ></ApplyItem>
+      <van-pull-refresh v-model="pullLoading" @refresh="_getIndexList(true)">
+        <ApplyItem
+          :item="item"
+          @update="_getIndexList"
+          v-for="item in list"
+          :key="item.applyId"
+        ></ApplyItem>
+      </van-pull-refresh>
     </template>
     </template>
     <div class="vh-100 text-center flex-h-center" v-else>
     <div class="vh-100 text-center flex-h-center" v-else>
       <div>
       <div>
@@ -30,15 +32,20 @@ import { useRouter } from "vue-router";
 const router = useRouter();
 const router = useRouter();
 
 
 const list = ref([]);
 const list = ref([]);
+const pullLoading = ref(false);
 const loading = ref(false);
 const loading = ref(false);
-function _getIndexList() {
+function _getIndexList(bool) {
   loading.value = true;
   loading.value = true;
   getIndexList()
   getIndexList()
     .then((res) => {
     .then((res) => {
       list.value = res || [];
       list.value = res || [];
+      if (bool) {
+        showToast("刷新成功");
+      }
     })
     })
     .finally(() => {
     .finally(() => {
       loading.value = false;
       loading.value = false;
+      pullLoading.value = false;
     });
     });
 }
 }
 _getIndexList();
 _getIndexList();

+ 1 - 1
src/router/index.js

@@ -20,7 +20,7 @@ const router = createRouter({
 const whiteList = ["Login", "WxLogin"];
 const whiteList = ["Login", "WxLogin"];
 router.beforeEach(async (to, from, next) => {
 router.beforeEach(async (to, from, next) => {
   const appStore = useAppStore();
   const appStore = useAppStore();
-  if (!appStore.globalConfig) {
+  if (!appStore.globalConfig && to.name !== "WxLogin") {
     let config = await appStore.getGlobalConfig();
     let config = await appStore.getGlobalConfig();
     if (((config && !config?.taskTitle) || !config) && to.name !== "Login") {
     if (((config && !config?.taskTitle) || !config) && to.name !== "Login") {
       next({ name: "Login", replace: true });
       next({ name: "Login", replace: true });