Bladeren bron

新增提交成功页面

fanghuisheng 2 jaren geleden
bovenliggende
commit
e18ca31a6a

+ 19 - 7
src/pages/business/mhxf/unitInfoCollection/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view id="unitInfoCollection">
+  <view id="unitInfoCollection" v-if="!successBool">
     <view>
       <u-notice-bar :text="noticeBarText" :duration="7000" color="#FF0000" bgColor="#FFFFFF"></u-notice-bar>
     </view>
@@ -169,6 +169,13 @@
       </view>
     </u-modal>
   </view>
+
+  <view v-else>
+    <view style="display: flex">
+      <image style="width: 120px; height: 120px; margin: 50px auto 20px auto" src="@/static/images/unitInfoCollection/success.png" />
+    </view>
+    <view style="text-align: center; font-weight: 600">提交成功</view>
+  </view>
 </template>
 
 <script setup>
@@ -328,6 +335,7 @@ const { form, baseBuildListForm, rules, baseBuildListRules, noticeBarText, pagin
 const uForm = ref(null);
 const uForm1 = ref(null);
 const newCompanyName = ref("");
+const successBool = ref(false);
 
 /**
  * @单位名称
@@ -449,12 +457,16 @@ function handleSubmitApi(value) {
 
       addBaseCompany(param).then((res) => {
         if (res.status == "SUCCESS") {
-          uni.showToast({
-            title: "提交成功",
-          });
-          setTimeout(() => {
-            proxy.$tab.reLaunch("/pages/index");
-          }, 2000);
+          if (getToken()) {
+            uni.showToast({
+              title: "提交成功",
+            });
+            setTimeout(() => {
+              proxy.$tab.reLaunch("/pages/index");
+            }, 2000);
+          } else {
+            successBool.value = true;
+          }
         }
       });
     })

BIN
src/static/images/unitInfoCollection/success.png