Browse Source

新增公共功能/代码优化

fanghuisheng 1 year ago
parent
commit
83d8d90d6c

+ 0 - 38
src/components/pages-harder/index.vue

@@ -1,38 +0,0 @@
-<template>
-  <view :style="{ paddingTop: statusBarHeight + 'px' }"></view>
-  <view v-if="navbarShow" style="margin-bottom: 44px">
-    <u-navbar leftText="返回" :title="navbar_title" :safeAreaInsetTop="true">
-      <template #left>
-        <view class="u-nav-slot" style="display: flex">
-          <u-icon name="arrow-left" size="19"></u-icon>
-          <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
-          <u-icon name="home" size="20"></u-icon>
-        </view>
-      </template>
-    </u-navbar>
-  </view>
-</template>
-<script setup>
-import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
-
-const props = defineProps({
-  navbarShow: {
-    type: Boolean,
-    default: false,
-  },
-  navbarTitle: {
-    type: String,
-    default: "",
-  },
-});
-
-const navbar_title = ref(props.navbarTitle);
-const navbar_show = ref(props.navbarShow);
-const statusBarHeight = ref(0);
-
-onLoad((option) => {
-  let systemInfo = uni.getSystemInfoSync();
-  statusBarHeight.value = systemInfo.statusBarHeight; //获取刘海屏高度
-});
-</script>

+ 8 - 0
src/pages.json

@@ -125,6 +125,14 @@
             "navigationBarTitleText": "续费提醒",
             "enablePullDownRefresh": false
           }
+        },
+        {
+          "path": "success/index",
+          "style": {
+            "navigationBarTitleText": "提交成功",
+            "navigationStyle": "custom",
+            "enablePullDownRefresh": false
+          }
         }
       ]
     },

+ 6 - 2
src/pages/common/invoicing/index.vue

@@ -295,7 +295,7 @@ function handleSubmit(value) {
     .then((res) => {
       uni.$u.toast("校验通过");
 
-      crmInvoiceInfo({
+      page({
         current: 1,
         size: 10,
         invoiceTitle: form.value.invoiceTitle,
@@ -319,7 +319,11 @@ function handleSubmit(value) {
               sendAddress: form.value.sendAddress, //邮寄地址
               paymentReceipt: form.value.paymentReceipt, //付款回执
             };
-            crmInvoiceInfo(param).then((requset) => {});
+            crmInvoiceInfo(param).then((requset) => {
+              if (requset.status === "SUCCESS") {
+                proxy.$tab.navigateTo("/pages/common/success/index");
+              }
+            });
           }
         }
       });

+ 74 - 0
src/pages/common/success/index.vue

@@ -0,0 +1,74 @@
+<template>
+  <view id="success-container" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
+    <view>
+      <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>
+
+    <view class="app-button-fixed">
+      <u-button class="app-buttom" type="primary" @click="navigateTo()" shape="circle"> 返回 </u-button>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import config from "@/config";
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
+import { publicStores, useStores } from "@/store/modules/index";
+import { getToken, setToken, removeToken } from "@/utils/auth";
+
+const publicStore = publicStores();
+
+const { proxy } = getCurrentInstance();
+
+/**
+ * @跳转登录
+ */
+function navigateTo() {
+  proxy.$tab.navigateBack(1);
+}
+
+onLoad((options) => {});
+</script>
+
+<style lang="scss" scoped>
+#success-container {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 1;
+  width: 100%;
+  padding: 0 15px;
+  margin: auto;
+  padding-top: 20%;
+  background-color: #ffffff;
+
+  .top {
+  }
+
+  .content {
+    display: flex;
+    margin: 30px 0;
+
+    .title {
+      margin: auto auto auto 0;
+      color: #000;
+      font-size: 18px;
+    }
+
+    .icons {
+      margin: auto 5px auto 0;
+    }
+
+    .setting {
+      color: #2a98ff;
+      margin: auto 0;
+    }
+  }
+}
+</style>

+ 9 - 4
src/pages/index.vue

@@ -105,7 +105,6 @@
 
 <script setup>
 import searchSelect from "@/components/searchSelect/searchSelect.vue";
-import pagesHarder from "@/components/pages-harder/index.vue";
 
 import * as jwx from "@/utils/jssdk.js"; //引入js sdk的封装
 
@@ -288,9 +287,15 @@ function navItemClick(item) {
 
     uni.setStorageSync(useStore.$state.name + useStore.$state.tenantId, arrayList.recentlyUsed);
 
-    uni.navigateTo({
-      url: item.path,
-    });
+    if (item.path.indexOf("http") != -1) {
+      uni.navigateTo({
+        url: "/pages/common/webview/index?url=" + item.path,
+      });
+    } else {
+      uni.navigateTo({
+        url: item.path,
+      });
+    }
   } else {
     uni.showModal({
       title: "Tips",

+ 2 - 1
src/permission.js

@@ -12,7 +12,8 @@ const whiteList = [
   "/pages/common/textview/index1",
   "/pages/common/webview/index",
   "/pages/business/mhxf/unitInfoCollection/index",
-  "/pages/common/invoicing/index"
+  "/pages/common/invoicing/index",
+  "/pages/common/success/index"
 ];
 
 // 检查地址白名单

+ 7 - 3
src/static/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3620854 */
-  src: url('https://at.alicdn.com/t/c/font_3620854_wi2cj933ahr.woff2?t=1688110591021') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_3620854_wi2cj933ahr.woff?t=1688110591021') format('woff'),
-       url('https://at.alicdn.com/t/c/font_3620854_wi2cj933ahr.ttf?t=1688110591021') format('truetype');
+  src: url('https://at.alicdn.com/t/c/font_3620854_xb9fkqucr3.woff2?t=1688535027394') format('woff2'),
+       url('https://at.alicdn.com/t/c/font_3620854_xb9fkqucr3.woff?t=1688535027394') format('woff'),
+       url('https://at.alicdn.com/t/c/font_3620854_xb9fkqucr3.ttf?t=1688535027394') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.ucicon-chenggong:before {
+  content: "\e609";
+}
+
 .ucicon-a-shangchuan:before {
   content: "\e605";
 }

BIN
src/static/iconfont/iconfont.ttf