miaofuhao лет назад: 3
Родитель
Сommit
b2a5d1268b
2 измененных файлов с 43 добавлено и 7 удалено
  1. 2 2
      anyangWebAPP/pages/login/css/main.css
  2. 41 5
      anyangWebAPP/pages/login/login.vue

+ 2 - 2
anyangWebAPP/pages/login/css/main.css

@@ -11,8 +11,8 @@
11 11
 	height:260rpx;
12 12
 	/* box-shadow:0rpx 0rpx 60rpx 0rpx rgba(0,0,0,0.1); */
13 13
 	/* border-radius:50%; */
14
-	margin-top: 128rpx;
15
-	margin-bottom: 72rpx;
14
+	margin-top: 100rpx;
15
+	margin-bottom: 60rpx;
16 16
 	margin-left: auto;
17 17
 	margin-right: auto;
18 18
 }

+ 41 - 5
anyangWebAPP/pages/login/login.vue

@@ -9,7 +9,9 @@
9 9
       <view class="main">
10 10
         <wInput v-model="phoneData" type="text" maxlength="11" placeholder="用户名" :focus="isFocus"></wInput>
11 11
         <wInput v-model="passData" type="password" maxlength="11" placeholder="密码"></wInput>
12
+				<wInput v-model="verificationData" type="text" maxlength="11" placeholder="验证码" :focus="isFocus"></wInput>
12 13
       </view>
14
+			<wButton class="wbutton" text="获取验证码" :rotate="isVerification" @click="sendVerification"></wButton>
13 15
       <wButton class="wbutton" text="登 录" :rotate="isRotate" @click="startLogin"></wButton>
14 16
 
15 17
     </view>
@@ -31,7 +33,9 @@
31 33
         logoImage: '../../static/login-icon.png',
32 34
         phoneData: '', //用户/电话
33 35
         passData: '', //密码
36
+				verificationData:'',	//验证码
34 37
         isRotate: false, //是否加载旋转
38
+				isVerification:false,
35 39
         isFocus: true // 是否聚焦
36 40
       };
37 41
     },
@@ -69,7 +73,32 @@
69 73
           // error
70 74
         }
71 75
       },
72
-
76
+			sendVerification(){
77
+				this.isVerification = true
78
+				console.log(this.passData)
79
+				console.log(this.encryptPassWord(this.passData).toString())
80
+				const params = {
81
+					"usercode": this.phoneData,
82
+					"Password": this.encryptPassWord(this.passData).toString(),
83
+					"LoginTime": this.$mHelper.CurentTime(),
84
+				}
85
+				this.$http.post("/Login/SendCode", params).then((response) => {
86
+				  if (response.state.toLowerCase() === 'success') {
87
+				    this.isVerification = false
88
+						uni.showModal({
89
+							content: '验证码发送成功',
90
+							showCancel: false
91
+						});
92
+				  }
93
+				}).catch((e) => {
94
+					uni.showModal({
95
+						content: e,
96
+						showCancel: false
97
+					});
98
+				  this.isVerification = false
99
+				  console.log(e)
100
+				})
101
+			},
73 102
       startLogin(e) {
74 103
         //登录
75 104
         if (this.isRotate) {
@@ -97,6 +126,7 @@
97 126
         const params = {
98 127
           "username": this.phoneData,
99 128
           "password": this.encryptPassWord(this.passData).toString(),
129
+					"Code":this.verificationData,
100 130
           "LoginTime": this.$mHelper.CurentTime(),
101 131
         }
102 132
 		
@@ -113,10 +143,10 @@
113 143
             });
114 144
           }
115 145
         }).catch((e) => {
116
-			uni.showModal({
117
-				content: e,
118
-				showCancel: false
119
-			});
146
+					uni.showModal({
147
+						content: e,
148
+						showCancel: false
149
+					});
120 150
           this.isRotate = false
121 151
           console.log(e)
122 152
         })
@@ -142,4 +172,10 @@
142 172
 <style>
143 173
   @import url("../../components/watch-login/css/icon.css");
144 174
   @import url("./css/main.css");
175
+	/deep/ .wbutton{
176
+		margin-top: 20px;
177
+	}
178
+	/deep/ .main-list{
179
+		margin: 10px 0px;
180
+	}
145 181
 </style>