sunChengjie 1 年之前
父節點
當前提交
907737aee5

+ 8 - 7
src/App.vue

@@ -6,6 +6,7 @@
 
 <script>
 import { getWxConfig } from './api/index'
+import { checkIsLogin } from "./api/login"
 import wx from "weixin-jsapi";
 export default {
 	name: 'App',
@@ -21,15 +22,15 @@ export default {
 	},
 
 	async created() {
+		if (this.$route.path !== "/Login") {
+			const res = await checkIsLogin();
+			if (res.msg !== "success") {
+				this.$router.push({ path: '/Login' })
+			}
+		}
 		window.localStorage.setItem('CourierScanUrl', location.href.split('#')[0])
-		// this.$http.post(this.$store.state.host + "/weixin/getWxConfig", {
-		// 	url: window.location.href.split('#')[0]
-		// }, {
-		// 	emulateJSON: true
-		// })
-
 		const res = await getWxConfig({
-            url:window.location.href
+			url: window.location.href
 		})
 
 		//发送成功

+ 9 - 0
src/api/login.js

@@ -1,5 +1,14 @@
 import request from '../utils/request'
 
+// 登录校验
+export function checkIsLogin() {
+    return request({
+        url: '/tianzong/appSysUser/isLogin',
+        method: 'post',
+        emulateJSON: true
+    })
+}
+
 export function getWxUserInfo(data) {
     return request({
         url: '/tianzong/weixin/getWxUserInfo',

+ 3 - 2
src/pages/components/Sented.vue

@@ -30,7 +30,7 @@
                 <div class="batch-middel-text">
                     <div class="batch-middel-text-style" style="width: 100%; margin-left: -4px;margin-top: 0px;">【{{
                         item.expressCompany
-                        }}】运单号:{{
+                    }}】运单号:{{
                             item.expressNo }}</div>
                     <div class="batch-middel-text-style">收件人:{{ item.recipient }}</div>
                     <div class="batch-middel-text-style">部门:{{ item.departmentId }}</div>
@@ -53,6 +53,7 @@
                             item.signatureTime.time.minute }}:{{ item.signatureTime == undefined ? '' :
                             item.signatureTime.time.second }} -->
                     </div>
+                    <van-image class="batch-middel-text-style" width="100" height="100" :src="item.signEnclosureImg" />
                 </div>
                 <div style="display: flex; padding-top: 5px;">
                 </div>
@@ -88,7 +89,7 @@ export default {
                 ..._params
 
             }
-            const res = await appOutboundInquiry({ ...parmas }, { emulateJSON: true })
+            const res = await appOutboundInquiry({ ...parmas }, { emulateJSON: true, loading: true, message: "查询中..." })
             res.data = res.data.map((item) => {
                 // const date = item.signatureTime.date
                 // const time = item.signatureTime.time

+ 4 - 3
src/pages/components/Waitsent.vue

@@ -36,9 +36,10 @@
                                     <div style="display: flex;" class="batch-middel-text-style">联系方式:{{ unfold.phone }}
 
                                         <a :href="'tel:' + unfold.phone" style="padding-left: 6px;" type="info" plain
-                                            size="mini"><van-icon size="14" name="phone-o" /></a>
+                                            size="mini"><van-icon color="#359cc6" size="14" name="phone-o" /></a>
                                     </div>
-                                    <div class="batch-middel-text-style" style="width: 100%;">滞留原因:{{ unfold.sendRemark
+                                    <div v-if="unfold.expressStatus == '4' || unfold.expressStatus == '2'"
+                                        class="batch-middel-text-style" style="width: 100%;">滞留原因:{{ unfold.sendRemark
                                         }}</div>
                                 </div>
                             </div>
@@ -340,7 +341,7 @@ export default {
             }
 
             .jindu {
-                color: #169bd5
+                color: #4fc1f1
             }
         }
 

+ 2 - 2
src/pages/login.vue

@@ -33,7 +33,7 @@
 
 
 <script>
-import { Toast, Dialog } from 'vant'
+import { Toast, Dialog, Loading } from 'vant'
 import { solicLogin } from '../api/index'
 export default {
 	data() {
@@ -58,7 +58,7 @@ export default {
 				return;
 			}
 			// this.$http.post(this.$store.state.host+"/appSysUser/solic_login",{USERNAME:this.name,PASSWORD:this.password},{emulateJSON:true})
-			const res = await solicLogin({ USERNAME: this.name, PASSWORD: this.password }, { emulateJSON: true })
+			const res = await solicLogin({ USERNAME: this.name, PASSWORD: this.password }, { emulateJSON: true, loading: true, message: '登录中...' })
 			console.log(res, 'res')
 
 			if (res.result == 'success') {

+ 10 - 2
src/pages/new/removal.vue

@@ -1,8 +1,10 @@
 <template>
     <div>
         <div class="container" v-if="isRemoval">
-            <van-search v-model="keyWorld" @search="onSearch" placeholder="请输入快递单号" />
-            <img @click="onImg" src="@/assets/user/u4.png" alt="">
+            <div>
+                <van-search class="search" v-model="keyWorld" @search="onSearch" placeholder="请输入快递单号" />
+                <img @click="onImg" src="@/assets/user/u4.png" alt="">
+            </div>
             <div class="middelBox" style="height: calc(100vh - 79px);overflow-y: auto;" v-if="show">
                 <div style="margin-bottom: 10px;">已添加快件:</div>
                 <van-cell-group v-for="item in codes" :key="item">
@@ -166,4 +168,10 @@ export default {
     bottom: 60px;
     right: 10px;
 }
+
+.search {
+    /deep/ .van-icon-clear.van-field__clear {
+        margin-right: 22px;
+    }
+}
 </style>

+ 2 - 2
src/pages/new/storage.vue

@@ -111,7 +111,7 @@ import wx from "weixin-jsapi";
 export default {
     data() {
         return {
-            printNo:'',// 打印面单号
+            printNo: '',// 打印面单号
             isPrint: false,//是否需要打印
             expressInfo: {},// 快件信息
             gfg: {},
@@ -274,7 +274,7 @@ export default {
                 value.senderDepartmentId = this.expressInfo.send_dept_name
             }
             const _params = { ...params, ...value, departmentId: this.onGroupObject.departmentName }
-            const res = await appSaveExpressRecord(_params, { emulateJSON: true })
+            const res = await appSaveExpressRecord(_params, { emulateJSON: true, loading: true })
             this.value14 = this.object.value4
             if (res.msg == 'success') {
                 this.$toast('入库成功')

+ 21 - 1
src/utils/request.js

@@ -1,9 +1,12 @@
 // api/request.js  
 import axios from 'axios';
-import qs from "qs"
+import { Toast } from 'vant';
 // 创建请求实例  
+let quqe = 0;
+let $toast;
 const instance = axios.create({
   // baseURL: 'http://47.101.145.23/tianzong', // 设置接口基础路径  
+  // baseURL: process.env.VUE_APP_BASE_API, // 设置接口基础路径  
   timeout: 50000 // 设置请求超时时间  
 });
 
@@ -13,6 +16,16 @@ instance.interceptors.request.use(
     if (config.emulateJSON) {
       config.headers["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8"
     }
+    if (quqe === 0 && config.loading) {
+      $toast = Toast.loading({
+        message: config.message ? config.message : '加载中...',
+        forbidClick: true,
+        duration: 0
+      })
+      quqe++;
+    } else if (config.loading && $toast) {
+      $toast.message = config.message ? config.message : '加载中...';
+    }
     // 在请求发送前进行一些操作,如设置请求头、处理请求参数等  
     return config;
   },
@@ -25,6 +38,13 @@ instance.interceptors.request.use(
 // 设置响应拦截器  
 instance.interceptors.response.use(
   response => {
+    if (quqe > 0) {
+      quqe = quqe - 1;
+      if (quqe === 0 && $toast) {
+        $toast.clear()
+        $toast = null
+      }
+    }
     // 对接口返回的数据进行处理,如统一处理错误码、格式化数据等  
     return response.data;
   },