Blame view

pages/login/login.vue 5.75 KB
4dfe89e4   monkeyhouyi   初始化
1
2
3
  <template>
  	<view class="page">
  		<view style="display: flex;justify-content: space-between;padding: 20px;height: 64px;">
c62ab6f2   杨鑫   1
4
  			<view @click="goHome"><image :src="$imgUrl('/right2.png')"  style="width: 20px;height: 20px; transform: rotate(180deg);"></image></view>
4dfe89e4   monkeyhouyi   初始化
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  			<view>登录</view>
  			<view class="">
  			</view>
  		</view>
  		<view class="container flex-items-plus flex-column" v-if="denglu==false">
  		
  			<view class="login-logoBox">
  				<text style="color:#3f9b6a;font-weight:bold;font-size:30px;">锦江绿道</text>
  			</view>
  			<view class="loginTitle-text flex-column-plus flex-items font-color-666 fs26">
  				<text style="display: block;">为了给您提供更好的服务</text>
  				<text style="display:block;	">我们需要您的授权哦~</text>
  			</view>
  			<view>
  				<view class="loginBut" @click="goLogin">手机号登录</view>
  			</view>
19e734d2   杨鑫   场地,登录页,隐私政策
21
  			<!-- <view class="flex-row-plus mar-top-30" style="margin-top: 30rpx;">
4dfe89e4   monkeyhouyi   初始化
22
23
  				<text class="font-color-C5AA7B">还没有账号,</text>
  				<text class="register-text" @click="goRegister">去注册</text>
19e734d2   杨鑫   场地,登录页,隐私政策
24
25
26
27
28
29
30
31
32
  			</view> -->
  			<view style="margin-top:10px;">
  					<u-checkbox-group @change="checkboxGroupChange"  shape="circle" :label-disabled="true">
  							<u-checkbox 
  							active-color="#3f9b6a"
  								v-model="checked" 
  								name="tongyi"
  							>我已阅读并同意<span style="color:#3f9b6a;" @click="goyinsi">《隐私政策》</span></u-checkbox>
  						</u-checkbox-group>
4dfe89e4   monkeyhouyi   初始化
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  			</view>
  		</view>
  		
  	<view class="" v-if="denglu">
  		<!-- 填写区 -->
  		<view class="input-info">
  			<view class="login-logoBox" style="margin-bottom: 20px;text-align: center;">
  				<text style="color:#3f9b6a;font-weight:bold;font-size:30px;">锦江绿道</text>
  			</view>
  			<view class="info">
  				
  				<input type="tel" maxlength="11" v-model="form.username" placeholder="请输入账号">
  				<view class="more"></view>
  			</view>
  			
  			<view class="info" >
  				<input :password='!isPassword' v-model="form.password" maxlength="26" placeholder="请输入您的密码">
  			<!-- 	<view class="more" @click="isPassword = !isPassword">
  					<image src="../../static/login4.png"></image>
  				</view> -->
  			</view>
  		</view>
  		<!-- 按钮 -->
  		<view class="btn-info">
  			<view class="btn" @click="register">
  				<text>登录</text>
  			</view>
  		</view>
  	</view>
  
  	</view>
  </template>
  
  <script>
4dfe89e4   monkeyhouyi   初始化
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  	export default {
  		data() {
  			return {
  				isLogin: false,
  				isLoginWay: false,
  				isPassword: false,
  				denglu:false,
  				// 表单
  				
  				form: {
  				username: '',
  				password: '',
  				rememberMe: false
  				},
  				ischange: false,
  				isTrue: false,
  				num: 60,
  				time: null,
  				// cid
19e734d2   杨鑫   场地,登录页,隐私政策
86
87
  				checked:null,
  				showTong:'',
4dfe89e4   monkeyhouyi   初始化
88
89
90
91
92
93
94
95
96
  				push_clientid:''
  			};
  		},
  		onShow(option) {
  		console.log(option)
  		
  		},
  		methods: {
  			goLogin(){
19e734d2   杨鑫   场地,登录页,隐私政策
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  				
  				if(this.showTong == 'tongyi'){
  					this.denglu = true
  				}else{
  					uni.showToast({
  						icon: 'none',
  						title: '请阅读并同意隐私政策'
  					})
  				}
  			},
  			goRegister(){
  				
  			},
  			goyinsi(){
19e734d2   杨鑫   场地,登录页,隐私政策
111
112
113
  				uni.navigateTo({
  					url: '/pages/privacy/privacy'
  				});
4dfe89e4   monkeyhouyi   初始化
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
  			},
  			register() {
  					if (this.form.phone == '') {
  						uni.showToast({
  							icon: 'none',
  							title: '请输入账号'
  						})
  						return
  					}
  					if (this.form.password == '') {
  						uni.showToast({
  							icon: 'none',
  							title: '请输入密码'
  						})
  						return
  					}
  				const data = {
c62ab6f2   杨鑫   1
131
132
133
134
  				  // username: JM.encrypt(this.form.username),
  				  // password: JM.encrypt(this.form.password),
  				  // rememberMe: this.form.rememberMe
  				  
4dfe89e4   monkeyhouyi   初始化
135
  				}
c62ab6f2   杨鑫   1
136
  				this.$http.sendRequest('/business/login', 'POST',this.form,2).then(res => {
4dfe89e4   monkeyhouyi   初始化
137
138
139
140
  					if(res.data.code == ''){
  						uni.setStorageSync('token', res.data.data.token);
  						uni.setStorageSync('shopId', res.data.data.shopId);
  						uni.switchTab({
354e3811   杨鑫   '验收'
141
  								url: '/pages/home/home'
4dfe89e4   monkeyhouyi   初始化
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  						})
  					}else{
  						uni.showToast({
  							icon: 'none',
  							title: res.data.message
  						})
  					}
  					
  					
  					
  				})
  			},
  			change() {
  				this.ischange = !this.ischange
  			},
  					
  			goHome(){
  				uni.switchTab({
  					url: '/pages/home/home'
  				})
  			},
  			/**
  			 * 登录点击
  			 */
19e734d2   杨鑫   场地,登录页,隐私政策
166
167
168
169
170
  			onLogin() {},
  			checkboxGroupChange(val){	
  				this.showTong = val[0]
  				console.log(this.showTong)
  			}
4dfe89e4   monkeyhouyi   初始化
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
  		},
  		watch: {
  			form: {
  				handler(newValue, oldValue) {
  					// 验证码
  					if (this.isLoginWay) {
  						this.isLogin = newValue.newPassword && newValue.phone ? true : false;
  					}
  					// 账号密码
  					if (!this.isLoginWay) {
  						this.isLogin = newValue.password && newValue.phone ? true : false;
  					}
  				},
  				deep: true
  			},
  			num() {
  				if (this.num == 0) {
  					clearInterval(this.time)
  					this.isTrue = false
  				}
  			}
  		}
  		
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'login.scss';
  	.container {
  		background-color: #FFFFFF;
  		height: calc(100vh - 64px);
  		display: flex;
  		flex-direction: column;
  		    align-items: center;
  	justify-content: center;
  		.login-logoBox {
  			// margin-top: -200rpx;
  	
  			.login-logo {
  				width: 200rpx;
  				height: 167rpx;
  			}
  		}
  	
  		.loginTitle-text {
  			margin-top: 100rpx;
  			
  		}
  	
  		.goToHome {
  			background: none;
  			border: none;
  			width: auto;
  			margin-top: 50rpx;
  			color: #999999;
  			text-decoration: underline;
  	
  			&:after {
  				display: none;
  			}
  		}
  	
  		.loginWxBut {
  			background: #3f9b6a;
  			color: #FFEBC4;
  			height: 88rpx;
  			width: 600rpx;
  			text-align: center;
  			line-height: 88rpx;
  			margin-top: 49rpx;
  		}
  	
  		.loginBut {
  			background-color: #3f9b6a;
  			color: #FFEBC4;
  			height: 88rpx;
  			width: 600rpx;
  			text-align: center;
  			line-height: 88rpx;
  			margin-top: 30rpx;
  		}
  	
  		.register-text {
  			color: #C5AA7B;
  		}
  		.font-color-C5AA7B{
  			color: #C5AA7B;
  		}
  		.font-color-666{
  			color: #666666;
  			font-size: 12px;
  		}
  	}
  </style>
  
  <style scoped>
  	.loginWxBut::after {
  		border-radius: 0 !important;
  	}
  </style>