From bb6aebd55fc9a8039e1c199ae1ea8af4eb547b1b Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Wed, 30 Dec 2020 10:32:41 +0800
Subject: [PATCH] gx

---
 hive-app/pages/login/index.vue |   95 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 61 insertions(+), 34 deletions(-)

diff --git a/hive-app/pages/login/index.vue b/hive-app/pages/login/index.vue
index 83a4788..a7614f8 100644
--- a/hive-app/pages/login/index.vue
+++ b/hive-app/pages/login/index.vue
@@ -4,22 +4,31 @@
 		<!-- #ifndef H5 -->
 		<view class="status_bar"></view>
 		<!-- #endif -->
-		<view class="login-header flex flex-v align-center">
-			<view class="login-img"></view>
-			<text class="font-20 white mt-10">蜂巢美业</text>
+		<view class="login-header">
+			<view class="logo"></view>
+			<text>蜂巢美业</text>
 		</view>
-		<view class="login-box center">
-			<text class="font-20 blue font-bold">登录</text>
-			<input v-model="username" placeholder="请输入账号" placeholder-class="placeholder" class="input-group-row left mt-20" maxlength="60"/>
+		<view class="login-box">
+			<text class="title">登录</text>
 			<view class="input-group-row">
-				<input v-model="password" placeholder="请输入密码" placeholder-class="placeholder" class="input-left" maxlength="60"/>
-				<text class="iconfont iconyanjing font-14 gray"></text>
+				<input v-model="username" type="text" maxlength="60"  placeholder="请输入账号" placeholder-class='placeholder'/>
 			</view>
-			<view class="right mt-5">
-				<text class="font-14 blue">忘记密码?</text>
+			<template v-if="isHidePwd">
+				<view class="input-group-row mt-10">
+					<input v-model="password" type="password" maxlength="60" placeholder="请输入密码" placeholder-class="placeholder" />
+					<text @click="isHidePwd=false" class="iconfont iconyanjing font-18 gray"></text>
+				</view>
+			</template>
+			<template v-else>
+				<view class="input-group-row mt-10">
+					<input v-model="password" type="text" maxlength="60" placeholder="请输入密码" placeholder-class="placeholder" />
+					<text @click="isHidePwd=true" class="iconfont iconyanjing1 gray"></text>
+				</view>
+			</template>
+			<view class="forget-pwd">
+				<text>忘记密码?</text>
 			</view>
-			
-			<button :disabled="isDisabled" class="blue-btn mt-20" @click="login">登录</button>
+			<button :disabled="isDisabled" class="blue-btn" @click="login">登录</button>
 		</view>
 	</view>
 </template>
@@ -30,10 +39,25 @@
 			return {
 				username: '',
 				password: '',
-				isDisabled: false
+				isDisabled: false,
+				isHidePwd: true
+			}
+		},
+		onLoad(options) {
+			if(!options || options.isNotLogin != 1){
+				this.isLogin();
 			}
 		},
 		methods:{
+			isLogin(){
+				let token = this.$httpUtils.getToken();
+				console.log(token)
+				if(token){
+					uni.switchTab({
+						url: '../workbench/index'
+					})
+				}
+			},
 			valid(){
 				if(!this.username.trim()){
 					this.$toast.info('请输入账号');
@@ -84,43 +108,46 @@
 	}
 	.login-header{
 		background: #518EFF;
-		border-bottom-left-radius: 20px;
-		border-bottom-right-radius: 20px;
-		padding: 60px 0 80px;
+		padding: 60px 0 110px;
+		border-radius: 0 0 20px 20px;
+		text-align: center;
+		font-size: 20px;
+		color: #FFFFFF;
 	}
-	.login-img{
+	.logo{
+		display: block;
 		width: 72px;
 		height: 72px;
 		background: #FFFFFF;
 		border-radius: 8px;
+		margin: 0 auto 10px;
 	}
 	.login-box{
+		margin: -50px 10px 0;
+		padding: 30px 20px;
 		background: #FFFFFF;
-		padding:20px;
-		box-sizing: border-box;
-		position: absolute;
-		left: 10px;
-		right: 10px;
-		bottom: 150px;
 		border: 1px solid #EDEAF4;
 		border-radius: 4px;
 		box-shadow:0 6px 6px rgba(237,234,244,0.5);
 	}
-	/* .login-input{
-		border: 1px solid #ABB1CC;
-		border-radius: 20px;
+	.login-box .title{
+		display: block;
+		font-size: 20px;
+		font-weight: bold;
+		color: #518EFF;
 		text-align: center;
-		padding: 10px 0;
-		font-size: 14px;
-	} */
-	.input-left{
+	}
+	.input-group-row input{
 		text-align: left;
 	}
+	.forget-pwd{
+		text-align: right;
+		margin-top: 5px;
+		font-size: 14px;
+		color: #518EFF;
+	}
 	.blue-btn{
-		background: #2483ff;
-		border-radius: 20px;
-		color: #FFFFFF;
-		font-size: 16px;
+		margin-top: 30px;
 	}
 	uni-button[disabled]:not([type]), uni-button[disabled][type=default]{
 		color: #FFFFFF;

--
Gitblit v1.9.1