Jelajahi Sumber

重写登录界面

xieyunhui 4 tahun lalu
induk
melakukan
3dd957cc4e
2 mengubah file dengan 100 tambahan dan 75 penghapusan
  1. 98 73
      pages/login/login.vue
  2. 2 2
      utils/requestUrl.js

+ 98 - 73
pages/login/login.vue

@@ -1,25 +1,17 @@
 <template>
 	<view class="login-page">
-		<view class="com-model">
-			<view class="top-box">
-				<image class="pic" src="/static/images/shade.png"></image>
-				<text class="title-top" @click="openModal">你好,</text>
-				<text class="title-buttom">欢迎使用追踪方法学系统</text>
-			</view>
-			<view class="main-content">
-				<input class="uni-input-box"
-				  placeholder="请输入账号"
-					placeholder-style="color: #A1A7B3"
-					v-model="username" />
-				<input class="uni-input-box"
-				    placeholder="请输入密码"
-					placeholder-style="color: #A1A7B3"
-					password
-					v-model="password" />
-				<com-button class="login-button"
-					:width="998" :height="120" :fontSize="48" :background="isLogin?'#A3B1CC':''" btnText="登录" @btnClick="login" />
-			</view>
+		<image class="bgImage" src="/static/images/shade.png"></image>
+		<text class="titleOne row" @click="openModal">你好,</text>
+		<view class="titleTwo row">欢迎使用追踪方法学系统</view>
+		<view class="inputArea">
+	       <input class="inputTag" type="text" placeholder="请输入账号" placeholder-class="inputTagHolderPlace" v-model="username"  />
 		</view>
+		<view class="inputArea pwd">
+		   <input class="inputTag" password="true" type="text" placeholder="请输入密码" placeholder-class="inputTagHolderPlace"  v-model="password" />
+		</view>
+		
+		<button :class="[isInput?'loginBtn on':'loginBtn']" type="default" @click="login" >登录</button>
+		
 		<tm-modal v-if="showInputModal" @click="clickModalhandle">
 			<view class="checkItemResultModal">
 				 <view class="modalContent">
@@ -54,6 +46,11 @@
 				]
 			}
 		},
+		computed:{
+			isInput:function(){
+				return (this.username.length>0&&this.password.length>0)?true:false
+			}
+		},
 		onLoad({ hospSign }){
 			  this.hospSign = hospSign;
 			  // #ifdef APP-PLUS
@@ -62,7 +59,7 @@
 			  // #endif
 		},
 		mounted(){
-
+            console.log(this.username);
 		},
 		methods: {
 			openScanner(){
@@ -142,20 +139,94 @@
 					}
 				}
 			}
-		},
-		computed:{
-			//判断是否输入了用户名和密码
-			isLogin(){
-				return !this.username || !this.password;
-			}
 		}
 	}
 </script>
 
 <style lang="less" scoped>
 	.login-page {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
 		height:100vh;
+		padding: 0 62.5rpx;
+		padding-bottom: 100rpx;
 		background-color: #FFFFFF;
+		.bgImage {
+			position: absolute;
+			right: 0;
+			top:0;
+			width: 430rpx;
+			height: 281.25rpx;
+		}
+		.row {
+			font-size: 45rpx;
+			font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+			font-weight: bold;
+			color: #2E2F33;
+			line-height: 67.5rpx;
+		}
+		.titleTwo {
+			margin-bottom: 75rpx;
+		}
+		.inputArea {
+			height: 80rpx;
+			margin-bottom: 37.5rpx;
+			border-bottom: 1.25rpx solid #E6EAF2;
+			input {
+				-webkit-box-shadow: 0 0 0 1000px white inset;
+			}
+			.inputTag {
+				height: 100%;
+				width: 100%;
+				font-size: 30rpx;
+				font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+				font-weight: 500;
+				color: #292C33;
+				
+				// &.-internal-autofill-selected {
+				// 	background-color:#FFFFFF;
+				// }
+			}
+			// /deep/.inputTag .uni-input-input {
+			// 	font-size: 30rpx;
+			// 	font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+			// 	font-weight: 500;
+			// 	color: #292C33;
+			// 	box-shadow: 0 0 0 54rpx #fff inset;
+			// }
+			.inputTagHolderPlace {
+				font-size: 30rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #B8BECC;
+			}
+			// /deep/.inputTag .uni-input-placeholder {
+			// 	font-size: 30rpx;
+			// }
+			&.pwd {
+				margin-bottom: 62.5rpx;
+			}
+		}
+		.loginBtn {
+			display: block;
+			width: 100%;
+			height: 75rpx;
+			text-align: center;
+			line-height: 75rpx;
+			font-size: 30rpx;
+			font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+			font-weight: 400;
+			color: #FFFFFF;
+			background: #A3B1CC;
+			border-radius: 37.5rpx;
+			border:none;
+			background-color: #A3B1CC;
+			&.on {
+				background: linear-gradient(90deg, #3377FF 0%, #4D97FF 100%);
+			}
+		}
+		
 		.checkItemResultModal {
 			  display: flex;
 			  height: 100%;
@@ -202,53 +273,7 @@
 				   }
 			  }
 		}
-		.top-box {
-			display: flex;
-			flex-direction: column;
-			padding-left: 62.5rpx;
-			.pic{
-				position: absolute;
-				top: 0;
-				right: 0;
-			    width: 430rpx;
-				height: 281.25rpx;
-			}
-			.title-top{
-				height: 45rpx;
-				font-size: 45rpx;
-				font-weight: bold;
-				margin-top: 250rpx;
-				font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-				color: #2E2F33;
-			}
-			.title-buttom{
-				 margin-top: 40rpx;
-				 height: 45rpx;
-				 font-size: 45rpx;
-				 font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-				 font-weight: bold;
-				 color: #2E2F33;
-			}
-		}
-		.main-content{
-			 margin-top: 37.5rpx;
-			 float: left;
-		}
-		.uni-input-box{
-			 width: 625rpx;
-			 float: left;
-			 margin-left: 62.5rpx;
-			 margin-top: 62.5rpx;
-			 font-size: 30rpx;
-			 padding-bottom: 25rpx;
-			 border-bottom:1.25rpx solid #E6EAF2 ;
-		}
-		.login-button{
-			  float: left;
-			  margin-left: 62.5rpx;
-			  margin-top: 62.5rpx;
-			  background-color: #A3B1CC;
-		}
+
   }
 
 </style>

+ 2 - 2
utils/requestUrl.js

@@ -8,11 +8,11 @@
  */
 // const base = '192.168.51.80:8801/imed/pfm/';
 // export const URL = '192.168.51.80:8801/imed/pfm/'; // 本地
-export const URL = '112.124.59.133:8802/imed/pfm/'; //线上测试
+// export const URL = '112.124.59.133:8802/imed/pfm/'; //线上测试
 // export const URL = '192.168.38.174:8088/imed/pfm/';
 // export const URL = '192.168.1.45:8088/imed/pfm/'; //内网
 // export const URL = 's1.nsloop.com:5137/imed/pfm/';  // 外网
-// export const URL = '121.43.139.179:8801/imed/pfm/';  // 云端服务1
+export const URL = '121.43.139.179:8801/imed/pfm/';  // 云端服务1
 // export const URL = '172.18.116.20:8801/imed/pfm/';  // 云端服务2
 
 // export const URL = '172.18.116.20:9002/imed/pfm/';  // 云端服务2