瀏覽代碼

1.改登录页

guo 3 年之前
父節點
當前提交
fee58199d9
共有 1 個文件被更改,包括 128 次插入119 次删除
  1. 128 119
      operatingCompany/pages/logIn/logIn.vue

+ 128 - 119
operatingCompany/pages/logIn/logIn.vue

@@ -1,49 +1,54 @@
 <template>
-	<view class="content">
-		
-		<view class="logInView">
-			<view style="color: #3C3C3C; font-size: 36rpx; font-weight: bold; padding-left: 40rpx; padding-top: 30rpx;">选择角色</view>
-			
-			<!-- 选择角色 -->
-			<view class="roleSelect">
-				<view class="role_S" v-if="roleType == 1" @click="roleTypeFirst">运营陪伴</view>
-				<view class="role_N" v-else @click="roleTypeFirst">运营陪伴</view>
-			
-				<view class="role_S" v-if="roleType == 2" @click="roleTypeSecond">连锁门店</view>
-				<view class="role_N" v-else @click="roleTypeSecond">连锁门店</view>
-			</view>
-		
-		<!-- 手机号 -->
-		<view class="phoneView">
-			<image src="../../static/img/icon_shouji@2x.png" class="icon"></image>
-			<!-- 手机号 -->
-			<input type="text" class="phone" placeholder="请输入手机号" v-model="phoneValue" @confirm="phoneDone" />
-			
-		</view>
-		
-		<!-- 验证码 -->
-		<view class="phoneView">
-			<image src="../../static/img/icon_yanheng@2x.png" class="icon"></image>
-			<!-- 验证码 -->
-			<view class="codeBg">
-				<input type="text" class="code" placeholder="请输入验证码" v-model="codeValue" @confirm="codeDone" />
-				<view @click="send" v-if="phoneValue.length == 11 && code_time == 0" style="color: #FF4F00; font-size: 28rpx;">获取验证码</view>
-				<view style="color: #999999; font-size: 28rpx;" v-if="phoneValue.length != 11 && code_time == 0">获取验证码</view>
-				<view style="color: #999999; font-size: 28rpx;" v-if="code_time > 0">重新获取({{code_time}}s)</view>
-				
-			</view>
-			
-		</view>
-		
-		<!-- 登录 -->
-		<view class="logInBtn_S" @click="logIn" v-if="phoneValue.length == 11 && codeValue != ''">登录</view>
-		<view class="logInBtn_N" v-else>登录</view>
-		<!-- 取消登录 -->
-		<view class="logOutBtn" @click="goIndex">取消登录</view>
-		
-		</view>
-		
-	
+	<view class="black">
+		<view class="content">
+
+			<view class="logInView">
+				<view
+					style="color: #3C3C3C; font-size: 36rpx; font-weight: bold; padding-left: 40rpx; padding-top: 30rpx;">
+					选择角色</view>
+
+				<!-- 选择角色 -->
+				<view class="roleSelect">
+					<view class="role_S" v-if="roleType == 1" @click="roleTypeFirst">运营陪伴</view>
+					<view class="role_N" v-else @click="roleTypeFirst">运营陪伴</view>
+
+					<view class="role_S" v-if="roleType == 2" @click="roleTypeSecond">连锁门店</view>
+					<view class="role_N" v-else @click="roleTypeSecond">连锁门店</view>
+				</view>
+
+				<!-- 手机号 -->
+				<view class="phoneView">
+					<image src="../../static/img/icon_shouji@2x.png" class="icon"></image>
+					<!-- 手机号 -->
+					<input type="text" class="phone" placeholder="请输入手机号" v-model="phoneValue" @confirm="phoneDone" />
+
+				</view>
+
+				<!-- 验证码 -->
+				<view class="phoneView">
+					<image src="../../static/img/icon_yanheng@2x.png" class="icon"></image>
+					<!-- 验证码 -->
+					<view class="codeBg">
+						<input type="text" class="code" placeholder="请输入验证码" v-model="codeValue" @confirm="codeDone" />
+						<view @click="send" v-if="phoneValue.length == 11 && code_time == 0"
+							style="color: #FF4F00; font-size: 28rpx;">获取验证码</view>
+						<view style="color: #999999; font-size: 28rpx;"
+							v-if="phoneValue.length != 11 && code_time == 0">获取验证码</view>
+						<view style="color: #999999; font-size: 28rpx;" v-if="code_time > 0">重新获取({{code_time}}s)</view>
+
+					</view>
+
+				</view>
+
+				<!-- 登录 -->
+				<view class="logInBtn_S" @click="logIn" v-if="phoneValue.length == 11 && codeValue != ''">登录</view>
+				<view class="logInBtn_N" v-else>登录</view>
+				<!-- 取消登录 -->
+				<view class="logOutBtn" @click="goIndex">取消登录</view>
+
+			</view>
+
+		</view>
 
 	</view>
 </template>
@@ -55,12 +60,12 @@
 				roleType: 1, //1 运营陪伴 2 连锁门店
 				phoneValue: '',
 				codeValue: '',
-				code_time: 0 ,// 倒计时
-				iStatusBarHeight:'',
+				code_time: 0, // 倒计时
+				iStatusBarHeight: '',
 			}
-		},
-		onLoad() {
-			 this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
+		},
+		onLoad() {
+			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 		},
 		methods: {
 			roleTypeFirst() {
@@ -78,32 +83,32 @@
 				this.codeValue = e.target.value;
 			},
 			// 发送验证码
-			send() {
+			send() {
 				console.log('发送验证码');
 				this.$http('accompany/superusers/sendSms', {
 					phone: this.phoneValue,
 
-				}, 'GET').then(res => {
-					if(res.code!=0){
-							uni.showModal({
-								title: '提示',
-								content: res.msg,
-								success: function (res) {
-									
-								}
-							})
-						} else {
-							this.code_time = 60
-							let coder = setInterval(() => {
-								if (this.code_time > 0) {
-									this.code_time--
-								}
-								if (this.code_time == 0) {
-									clearInterval(coder)
-								}
-							}, 1000)
-						}
-					})
+				}, 'GET').then(res => {
+					if (res.code != 0) {
+						uni.showModal({
+							title: '提示',
+							content: res.msg,
+							success: function(res) {
+
+							}
+						})
+					} else {
+						this.code_time = 60
+						let coder = setInterval(() => {
+							if (this.code_time > 0) {
+								this.code_time--
+							}
+							if (this.code_time == 0) {
+								clearInterval(coder)
+							}
+						}, 1000)
+					}
+				})
 
 			},
 			logIn() {
@@ -116,13 +121,13 @@
 					code: this.codeValue,
 					type: this.roleType,
 				}, 'POST').then(res => {
-
-					uni.setStorage({
-						key: 'logInData',
-						data: res.data,
-						success: function() {
-					
-						}
+
+					uni.setStorage({
+						key: 'logInData',
+						data: res.data,
+						success: function() {
+
+						}
 					})
 					uni.setStorage({
 						key: 'userInfo',
@@ -131,34 +136,37 @@
 
 						}
 					})
-                    if(this.roleType==1){
+					if (this.roleType == 1) {
 						uni.navigateTo({
 							url: '../index/index'
 						})
-					}else{
+					} else {
 						uni.navigateTo({
 							url: '../shop/shopIndex/index'
 						})
 					}
-					
+
+				})
+			}
+
+			,
+			goIndex() {
+				uni.navigateTo({
+					url: '../logIn/home'
 				})
 			}
-			
-			,goIndex(){
-				uni.navigateTo({
-					url: '../logIn/home'
-				})
-			}
 		}
 	}
 </script>
 
-<style>
+<style>
+	.black{
+		background-color: #140B0A;
+	}
 	.content {
-		background-color: #FF8700;
-		min-height: 100vh;
-		background: url('http://phone.66km.cn:8088/marketing/home_yypb1.png') no-repeat;
-		background-size: 100% 100%;
+		min-height: 100vh;
+		background: url('http://phone.66km.cn:8088/marketing/home_yypb1.png') no-repeat;
+		background-size: 100%;
 	}
 
 	/* #ifdef H5 */
@@ -169,14 +177,14 @@
 
 	/* #endif */
 
-	.logInView{
-		position: fixed;
-		top: 374rpx;
-		left: 60rpx;
-		width: 630rpx;
-		height: 588rpx;
-		background-color: #FFFFFF;
-		border-radius: 20rpx;
+	.logInView {
+		position: fixed;
+		top: 374rpx;
+		left: 60rpx;
+		width: 630rpx;
+		height: 588rpx;
+		background-color: #FFFFFF;
+		border-radius: 20rpx;
 	}
 
 	.roleSelect {
@@ -202,22 +210,23 @@
 		/* width: 41%; */
 		line-height: 66rpx;
 	}
-
-	.phoneView{
-		display: flex;
-		justify-content: flex-start;
-		margin: 0rpx 40rpx;
-		height: 106rpx;
-		border-bottom: 1rpx #CCCCCC solid;
-		
-	}
-	.icon{
-		width: 44rpx;
-		height: 44rpx;
-		margin-right: 20rpx;
-		padding-top: 44rpx;
-		padding-bottom: 22rpx;
-	}
+
+	.phoneView {
+		display: flex;
+		justify-content: flex-start;
+		margin: 0rpx 40rpx;
+		height: 106rpx;
+		border-bottom: 1rpx #CCCCCC solid;
+
+	}
+
+	.icon {
+		width: 44rpx;
+		height: 44rpx;
+		margin-right: 20rpx;
+		padding-top: 44rpx;
+		padding-bottom: 22rpx;
+	}
 
 	.phone,
 	.codeBg {
@@ -230,7 +239,7 @@
 
 	.codeBg {
 		display: flex;
-		justify-content: space-between;
+		justify-content: space-between;
 		width: 100%;
 	}
 
@@ -261,7 +270,7 @@
 	}
 
 	.logOutBtn {
-		margin-bottom: 30rpx;
+		margin-bottom: 30rpx;
 		margin-left: 258rpx;
 		width: 112rpx;
 		height: 40rpx;