sunChengjie 11 months ago
parent
commit
bc3b4885b9
8 changed files with 171 additions and 56 deletions
  1. 8 1
      src/App.vue
  2. 9 0
      src/api/login.js
  3. 44 8
      src/pages/express.vue
  4. 22 5
      src/pages/inexpress.vue
  5. 37 13
      src/pages/myaddressbook.vue
  6. 2 2
      src/pages/setting.vue
  7. 29 25
      src/pages/sytk.vue
  8. 20 2
      src/utils/request.js

+ 8 - 1
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,9 +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('scanUrl', location.href.split('#')[0])
         const res = await getWxConfig({
-            url:window.location.href
+            url: window.location.href
         })
         //发送成功
         var timestamp = res.wxConfig.timestamp;

+ 9 - 0
src/api/login.js

@@ -17,4 +17,13 @@ export function getWxConfig(data) {
         data: data,
         emulateJSON: true
     })
+}
+
+// 登录校验
+export function checkIsLogin() {
+    return request({
+        url: '/tianzong/appSysUser/isLogin',
+        method: 'post',
+        emulateJSON: true
+    })
 }

+ 44 - 8
src/pages/express.vue

@@ -11,11 +11,14 @@
 		<div class="jjinfo">
 			<div>
 				<div class="jj">
-					<div class="jjaddress">
-						<p>寄</p>
+					<div class="jjaddress" style="width: 100vw;">
+						<p style="flex: none;">寄</p>
 						<div>
-							<van-field readonly v-model="SendInfoValue.address" label="地址" name="pattern"
-								placeholder="自动填充" />
+
+							<div class="address">
+								<div class="address_label">地址</div>
+								<div class="address_text">{{ SendInfoValue.address }}</div>
+							</div>
 							<van-field v-model="SendInfoValue.phone" label="手机号" name="pattern" placeholder="自动填充" />
 						</div>
 					</div>
@@ -26,7 +29,7 @@
 				</div>
 				<div class="jj" style="border-top:.01rem solid #ededed">
 					<div class="jjaddress">
-						<p style="background: #fa9c22;">收</p>
+						<p style="background: #fa9c22; flex:none;">收</p>
 						<div>
 							<van-field v-model="transmitMessageVlaue.addresseeName" name="" label="姓名"
 								placeholder="自动填充" />
@@ -586,7 +589,7 @@ export default {
 
 			.jj {
 				display: flex;
-				justify-content: space-between;
+				// justify-content: space-between;
 				padding: .2rem 0rem;
 
 				.jjaddress {
@@ -621,9 +624,8 @@ export default {
 					}
 
 					div {
-						//font-weight: bold;
-						max-width: 4.2rem;
 
+						//font-weight: bold;
 						p:nth-of-type(1) {
 							font-size: .24rem;
 							color: #333;
@@ -640,6 +642,7 @@ export default {
 					text-align: center;
 					border-left: .01rem solid #ededed;
 					padding-left: .3rem;
+					width: 36px;
 
 					img {
 						width: .39rem;
@@ -840,6 +843,39 @@ export default {
 	}
 }
 
+.address {
+	display: flex;
+	font-size: 14px;
+	line-height: 24px;
+	position: relative;
+
+	.address_label {
+		flex: none;
+		width: 6.2em;
+		margin-right: 12px;
+		color: #646566;
+		text-align: left;
+		word-wrap: break-word;
+	}
+
+	.address_text {
+		color: #323233;
+	}
+
+	&::after {
+		position: absolute;
+		box-sizing: border-box;
+		content: ' ';
+		pointer-events: none;
+		right: 16px;
+		bottom: 0;
+		left: 16px;
+		border-bottom: 1px solid #ebedf0;
+		-webkit-transform: scaleY(0.5);
+		transform: scaleY(0.5);
+	}
+}
+
 .whrite_add {
 	width: 6.6rem;
 	padding: .4rem .2rem;

+ 22 - 5
src/pages/inexpress.vue

@@ -1,8 +1,8 @@
 <template>
 	<div class="content">
 		<div class="jjinfo">
-			<van-field :value="recipientsName" @focus="onFocus" name="phone" label="收件人姓名" placeholder="请输入收件人姓名"
-				:rules="[{ required: true }]" />
+			<van-field ref="searchRef" :value="recipientsName" @focus="onFocus" name="phone" label="收件人姓名"
+				placeholder="请输入收件人姓名" :rules="[{ required: true }]" />
 			<van-field :value="recipientsPhone" @focus="onFocusPhone" name="phone" label="收件人手机号"
 				placeholder="请输入手机号后四位" :rules="[{ required: true }]" />
 			<van-field :value="groupValue.departmentName" readonly name="phone" label="收件人部门" placeholder="自动填充" />
@@ -78,7 +78,8 @@
 		<!-- 姓名输入后弹出 -->
 		<van-popup v-model="nameShowA" :style="{ height: '100%', width: '100%', }">
 			<div style="display: flex; justify-content: space-between;">
-				<van-search style="width: 100%;" @search="searchCrux" v-model="searchKey" placeholder="请输入搜索关键词" />
+				<van-search ref="searchNameRef" style="width: 100%;" @search="searchCrux" v-model="searchKey"
+					placeholder="请输入搜索关键词" />
 			</div>
 			<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
 				<van-cell-group class="vanPopup" @click="onGroup(item)" v-for="(item, index) in searchNameList"
@@ -94,13 +95,13 @@
 		<!-- 手机号输入后弹出 -->
 		<van-popup v-model="nameShowB" :style="{ height: '100%', width: '100%', }">
 			<div style="display: flex; justify-content: space-between;">
-				<van-search style="width: 100%;" @search="searchCruxPhone" v-model="searchKeyPhone"
+				<van-search ref="searchPhoneRef" style="width: 100%;" @search="searchCruxPhone" v-model="searchKeyPhone"
 					placeholder="请输入手机后四位" />
 			</div>
 			<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
 				<van-cell-group class="vanPopup" @click="onGroupPhone(item)"
 					v-for="(item, index) in searchNameListPhone" :key="index" inset>
-					<van-cell :value="item.departmentName">{{ item.name }}- {{ item.departmentName }} - {{ item.seatNo
+					<van-cell :value="item.departmentName">{{ item.name }}- {{ item.phone }} - {{ item.departmentName
 						}}</van-cell>
 				</van-cell-group>
 			</div>
@@ -192,15 +193,31 @@ export default {
 		this.userId = localStorage.getItem("userId");
 		this.accountType = localStorage.getItem("accountType")
 	},
+	mounted() {
+		// this.$refs.searchRef.focus();
+	},
 	methods: {
 
 		//姓名点击聚焦
 		onFocus() {
 			this.nameShowA = true
+			this.$nextTick(() => {
+				if (this.$refs.searchNameRef) {
+					const inputEle = this.$refs.searchNameRef.querySelector("input")
+					inputEle.focus()
+				}
+			})
 		},
 		// 手机号点击聚焦
 		onFocusPhone() {
 			this.nameShowB = true
+			this.$nextTick(() => {
+				if (this.$refs.searchPhoneRef) {
+					const inputEle = this.$refs.searchPhoneRef.querySelector("input")
+					inputEle.focus()
+				}
+			})
+
 		},
 		// 搜索关键
 		async searchCrux() {

+ 37 - 13
src/pages/myaddressbook.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="content">
 		<!-- 收件人 -->
-		<div style="margin-top: 20px;">
+		<div class="list">
 			<div class="jjinfo" v-for="item in addressList" :key="item.id">
 				<div>
 					<div class="jj">
@@ -30,11 +30,13 @@
 					</div>
 				</div>
 			</div>
-			<!-- 寄件 -->
-			<div class="btn-jj">
-				<van-button type="info" @click=" link(2)">添加收件人</van-button>
-			</div>
 		</div>
+
+		<!-- 寄件 -->
+		<div class="btn">
+			<van-button type="info" @click=" link(2)">添加收件人</van-button>
+		</div>
+
 	</div>
 </template>
 
@@ -152,10 +154,38 @@ export default {
 
 
 .content {
+	height: 100vh;
+	width: 100vw;
+	display: flex;
+	flex-direction: column;
+	overflow: hidden;
+
+	.list {
+		flex: auto;
+		overflow: hidden;
+		overflow-y: auto;
+		padding: 15px .33rem 0px;
+
+	}
+
+	.btn {
+		// height: 100vh;
+		width: 100vw;
+		display: flex;
+
+		// padding: .0rem .33rem 0.33rem;
+
+		button {
+			width: 100%;
+			margin: .33rem;
+		}
+
+	}
+
 	.tab {
 		font-size: .36rem;
 		color: #00c4b8;
-		padding: .33rem;
+
 
 		div {
 			display: flex;
@@ -179,7 +209,7 @@ export default {
 	.jjinfo {
 		font-size: .36rem;
 		color: #999999;
-		padding: .0rem .33rem 0.33rem;
+		padding: .0rem .0rem 0.33rem;
 		word-break: break-word;
 
 		>div {
@@ -258,12 +288,6 @@ export default {
 
 
 
-	.btn-jj {
-		padding: .33rem;
 
-		button {
-			width: 100%;
-		}
-	}
 }
 </style>

+ 2 - 2
src/pages/setting.vue

@@ -5,9 +5,9 @@
 			<router-link to="/Forgetpassword">
 				<span>修改密码</span>
 			</router-link>
-			<router-link to="">
+			<!-- <router-link to="">
 				<span>关于</span>
-			</router-link>
+			</router-link> -->
 			<router-link to="/Sytk">
 				<span>使用条款</span>
 			</router-link>

File diff suppressed because it is too large
+ 29 - 25
src/pages/sytk.vue


+ 20 - 2
src/utils/request.js

@@ -1,11 +1,13 @@
 // 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: 5000 // 设置请求超时时间  
+  timeout: 50000 // 设置请求超时时间  
 });
 
 // 设置请求拦截器  
@@ -14,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;
   },
@@ -26,6 +38,12 @@ instance.interceptors.request.use(
 // 设置响应拦截器  
 instance.interceptors.response.use(
   response => {
+    if (quqe > 0) {
+      quqe = quqe - 1;
+      if (quqe === 0 && $toast) {
+        $toast.clear()
+      }
+    }
     // 对接口返回的数据进行处理,如统一处理错误码、格式化数据等  
     return response.data;
   },