Browse Source

登录长者模式

zhupeng 3 năm trước cách đây
mục cha
commit
5995e202f0
1 tập tin đã thay đổi với 57 bổ sung5 xóa
  1. 57 5
      pages/login/login.vue

+ 57 - 5
pages/login/login.vue

@@ -11,14 +11,14 @@
 				<view class="login-form-item">
 					<view class="title">手机号</view>
 					<view class="input">
-						<u-input v-model="form.telephone" type="number" placeholder="请输入手机号" placeholder-style="font-size:16px;color:#ccc;"/>
+						<u-input :customStyle="placeholderStyle" :placeholderStyle="placeholderStyle" v-model="form.telephone" type="number" placeholder="请输入手机号" placeholder-style="font-size:16px;color:#ccc;"/>
 					</view>
 					<view class="tips">未注册的手机号验证后将自动注册</view>
 				</view>
 				<view class="login-form-item">
 					<view class="title">验证码</view>
 					<view class="input">
-						<u-input v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
+						<u-input :customStyle="placeholderStyle" :placeholderStyle="placeholderStyle" v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
 						<view class="code" @click="getCode">{{codeTips}}</view>
 					</view>
 					<view style="width: 350px;">
@@ -49,6 +49,10 @@
 	export default {
 		data() {
 			return {
+				elderMode:false,
+				placeholderStyle:{
+					'font-size':'28rpx'
+				},
 				form: {
 					telephone: '',
 					verifyCode: '',
@@ -104,8 +108,33 @@
 			}
 			
 			
+		},
+		onReady() {
+			this.elderMode = this.carhelp.get('getElderModeClass')  == '长辈模式';
+			if(this.elderMode)
+				this.theme('elder')
+			else
+				this.theme('standard')
 		},
 		methods: {
+			theme(type) {
+			  if(type == 'elder')	
+			  {
+				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
+				 let data = { 
+				 	"font-size":'32rpx', 
+				 };
+				 this.placeholderStyle = data;
+			  }
+			  else
+			  {
+				document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
+				  let data  ={ 
+				  	"font-size":'28rpx', 
+				  };
+				  this.placeholderStyle = data;
+			  } 
+			},
 			codeChange(text) {
 				this.codeTips = text;
 			},
@@ -244,8 +273,17 @@
 	}
 </style>
 <style lang="scss" scoped>
+	@import "@/_theme.scss";
+	.all{
+		@include themeify{
+			font-size: themed('font-size2');
+		}
+	}
 .wrap {
-	font-size: 28rpx;
+	@include themeify{
+		font-size: themed('font-size2');
+	}
+/*	font-size: 28rpx;*/
 	.login {
 		width: 600rpx;
 		padding-top: 80rpx;
@@ -253,7 +291,10 @@
 		.login-title {
 			text-align: left;
 			h3{
-				font-size: 48rpx;
+				@include themeify{
+					font-size: themed('font-size7');
+				}
+/*				font-size: 48rpx;*/
 				font-weight: normal;
 			}
 			p{
@@ -265,6 +306,11 @@
 			margin-top: 40px;
 			.title{
 				margin-bottom: 8px;
+				@include themeify{
+					font-size: themed('font-size2');
+					font-weight: themed('fontWeight');
+					letter-spacing: themed('letterSpacing');
+				}
 			}
 			.input {
 				border-bottom: 1px solid #f7f7f7;
@@ -279,7 +325,10 @@
 			.tips {
 				color: $u-type-info;
 				margin-top: 12px;
-				font-size: 12px;
+				@include themeify{
+					font-size: themed('font-size1');
+				}
+/*				font-size: 12px;*/
 				span{
 					color:#3fbd70;
 				}
@@ -289,6 +338,9 @@
 		.login-btn {
 			margin-top: 40px;
 			background-color: #a7dbc2;
+			@include themeify{
+				font-size: themed('font-size3');
+ 			}
 		}
 		.alternative {
 			color: $u-tips-color;