Blame view

pages/index/index.vue 5.4 KB
2d70f5ed   chenbiao   add gitignore
1
  <template>
2f02d40c   chenbiao   add 登录页面数据接口联调
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  	<view>
  		<view class="login-content">
  			<view>
  				<image class="logo" src="/static/logo.png"></image>
  				<view>
  					<view class="title">{{appName}}</view>
  					<view class="title-msg">{{apptitle}}</view>
  				</view>
  			</view>
  			<view class="uni-common-mt paddinglr30">
  				<view class="uni-form-item uni-column">
  					<input class="uni-input" type="text" v-model="username" placeholder="请输入用户名" />
  				</view>
  				<view class="uni-form-item uni-column">
  					<input class="uni-input" password type="text" v-model="password" placeholder="请输入密码" />
2d70f5ed   chenbiao   add gitignore
17
  				</view>
2d70f5ed   chenbiao   add gitignore
18
  			</view>
e133a83d   chenbiao   add 接口文档更新
19
  
2f02d40c   chenbiao   add 登录页面数据接口联调
20
21
  			<view class="paddinglr30 uni-common-mt">
  				<button type="primary" @click="login">登录</button>
2d70f5ed   chenbiao   add gitignore
22
  			</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
23
24
  			<view class="uni-common-mt login-foot">
  				点击”登录“,即表示你同意《商户用户协议》
e133a83d   chenbiao   add 接口文档更新
25
  			</view>
2d70f5ed   chenbiao   add gitignore
26
  		</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
27
28
29
30
31
32
33
  		<view class="bg-white" v-if="userIsLogin">
  			<view class="index-top">
  				<view>
  					<view style="z-index: 2;">
  						<image src="http://122.152.205.72:88/group1/M00/00/05/CpoxxFw_-5-AFyVyAABLIH8xBTw233.png"
  							class="face"></image>
  						<view class="username">张三</view>
2d70f5ed   chenbiao   add gitignore
34
  					</view>
e133a83d   chenbiao   add 接口文档更新
35
  
2f02d40c   chenbiao   add 登录页面数据接口联调
36
37
38
39
40
41
42
  				</view>
  				<view class="set-wapper">
  					<image src="../../static/me/settings.png" class="settings" @tap="toSetting"></image>
  				</view>
  			</view>
  			<view class="index-menu">
  				<view class="uni-padding-wrap uni-common-mt">
e133a83d   chenbiao   add 接口文档更新
43
  
2f02d40c   chenbiao   add 登录页面数据接口联调
44
45
46
47
48
49
  					<view class="uni-flex uni-row">
  						<view class="flex-item">
  							<view class="">
  								<image src="../../static/me/me-parkrecord.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">停车缴费</view>
2d70f5ed   chenbiao   add gitignore
50
  						</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
51
52
53
54
55
  						<view class="flex-item">
  							<view class="">
  								<image src="../../static/me/me-recoder.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">停车记录</view>
2d70f5ed   chenbiao   add gitignore
56
  						</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
57
58
59
60
61
  						<view class="flex-item">
  							<view class="">
  								<image src="../../static/me/me-balance.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">我的钱包</view>
2d70f5ed   chenbiao   add gitignore
62
  						</view>
e133a83d   chenbiao   add 接口文档更新
63
  
2d70f5ed   chenbiao   add gitignore
64
  					</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
65
66
67
68
69
70
  					<view class="uni-flex uni-row">
  						<view class="flex-item">
  							<view class="">
  								<image src="../../static/me/me-coupon.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">卡券管理</view>
2d70f5ed   chenbiao   add gitignore
71
  						</view>
2f02d40c   chenbiao   add 登录页面数据接口联调
72
73
74
75
76
77
78
79
80
81
82
  						<view class="flex-item" @click="toInvoicePage">
  							<view class="">
  								<image src="../../static/me/me-fapao.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">发票申领</view>
  						</view>
  						<view class="flex-item" @click="toRatingPage">
  							<view class="">
  								<image src="../../static/me/me-aboutus.png" class="index-icon"></image>
  							</view>
  							<view class="index-title">信用等级</view>
1b44ac51   chenbiao   add 信用等级 实名认证form表单
83
  						</view>
1b44ac51   chenbiao   add 信用等级 实名认证form表单
84
  					</view>
2d70f5ed   chenbiao   add gitignore
85
86
  				</view>
  			</view>
e133a83d   chenbiao   add 接口文档更新
87
  
2d70f5ed   chenbiao   add gitignore
88
  		</view>
2d70f5ed   chenbiao   add gitignore
89
  	</view>
e133a83d   chenbiao   add 接口文档更新
90
  
2d70f5ed   chenbiao   add gitignore
91
92
93
  </template>
  
  <script>
2d70f5ed   chenbiao   add gitignore
94
  
2d70f5ed   chenbiao   add gitignore
95
96
97
  	export default {
  		data() {
  			return {
2f02d40c   chenbiao   add 登录页面数据接口联调
98
99
100
  				userIsLogin: false,
  				appName: '江阴慧停车',
  				apptitle: '江阴慧停车·智慧便捷',
e133a83d   chenbiao   add 接口文档更新
101
102
  				username: '',
  				password: '',
2d70f5ed   chenbiao   add gitignore
103
104
105
106
107
108
  			}
  		},
  		onLoad() {
  
  		},
  		methods: {
e133a83d   chenbiao   add 接口文档更新
109
110
  			login() {
  				let that = this;
dd5ecdbd   chenbiao   add 接口文档更新
111
112
113
114
  				let data = {
  					userCode: that.username,
  					userPwd: that.password
  				};
e133a83d   chenbiao   add 接口文档更新
115
116
117
118
119
120
121
122
  				if (that.username.trim() === "" || that.password.trim() === "") {
  					uni.showToast({
  						title: '用户名密码必填',
  						icon: 'error',
  						duration: 2000
  					})
  					return;
  				} else {
dd5ecdbd   chenbiao   add 接口文档更新
123
  
e133a83d   chenbiao   add 接口文档更新
124
  					that.$myRequest({
dd5ecdbd   chenbiao   add 接口文档更新
125
  						url:that.$common.userLogin,
e133a83d   chenbiao   add 接口文档更新
126
  						method: 'POST',
dd5ecdbd   chenbiao   add 接口文档更新
127
  						data: that.$common.requestSign(data)
e133a83d   chenbiao   add 接口文档更新
128
  					}).then(res => {
dd5ecdbd   chenbiao   add 接口文档更新
129
130
131
132
  						var userInfo = res.data.data;
  						// 保存用户信息到全局的缓存中
  						uni.setStorageSync("globalUser", userInfo);
  						that.userIsLogin = true;
e133a83d   chenbiao   add 接口文档更新
133
134
135
136
137
  
  					})
  
  
  				}
2f02d40c   chenbiao   add 登录页面数据接口联调
138
  			},
2d70f5ed   chenbiao   add gitignore
139
140
141
142
143
  			toSetting() {
  				uni.navigateTo({
  					url: '../setting/setting'
  
  				});
7f3bad7f   chenbiao   add 发票抬头:查看 编辑 新增...
144
145
146
147
  			},
  			toInvoicePage() {
  				uni.navigateTo({
  					url: '../invoiceClaim/invoiceClaim'
1b44ac51   chenbiao   add 信用等级 实名认证form表单
148
  
7f3bad7f   chenbiao   add 发票抬头:查看 编辑 新增...
149
  				});
1b44ac51   chenbiao   add 信用等级 实名认证form表单
150
151
152
153
154
155
156
  			},
  			toRatingPage() {
  				uni.navigateTo({
  					url: '../creditRating/creditRating'
  
  				});
  			},
2d70f5ed   chenbiao   add gitignore
157
158
159
160
161
  		}
  	}
  </script>
  
  <style lang="scss">
2f02d40c   chenbiao   add 登录页面数据接口联调
162
163
164
165
166
167
  	.page {
  		width: 100%;
  		height: 100%;
  		display: flex;
  		justify-content: center;
  		position: relative;
e133a83d   chenbiao   add 接口文档更新
168
  
2f02d40c   chenbiao   add 登录页面数据接口联调
169
  	}
e133a83d   chenbiao   add 接口文档更新
170
  
2f02d40c   chenbiao   add 登录页面数据接口联调
171
172
173
174
175
  	.login-content {
  		background-color: #f6f6f6;
  		text-align: center;
  		height: 100vh;
  	}
e133a83d   chenbiao   add 接口文档更新
176
  
2f02d40c   chenbiao   add 登录页面数据接口联调
177
178
179
180
181
  	.logo {
  		height: 200upx;
  		width: 200upx;
  		margin-top: 200upx;
  	}
e133a83d   chenbiao   add 接口文档更新
182
  
2f02d40c   chenbiao   add 登录页面数据接口联调
183
184
185
186
187
  	.title {
  		font-size: 32upx;
  		color: #000;
  		font-weight: 400;
  	}
e133a83d   chenbiao   add 接口文档更新
188
  
2f02d40c   chenbiao   add 登录页面数据接口联调
189
190
191
192
  	.title-msg {
  		font-size: 26upx;
  		color: #8d8d8d;
  	}
e133a83d   chenbiao   add 接口文档更新
193
194
  
  	.login-foot {
2f02d40c   chenbiao   add 登录页面数据接口联调
195
  		font-size: 26upx;
e133a83d   chenbiao   add 接口文档更新
196
  
2f02d40c   chenbiao   add 登录页面数据接口联调
197
  	}
e133a83d   chenbiao   add 接口文档更新
198
  
2f02d40c   chenbiao   add 登录页面数据接口联调
199
  	// 首页
2d70f5ed   chenbiao   add gitignore
200
201
  	.index-top {
  		height: 200upx;
48e03f64   chenbiao   add
202
  		background-color: #2d7bf7;
2d70f5ed   chenbiao   add gitignore
203
204
  		position: relative;
  		text-align: center;
48e03f64   chenbiao   add
205
  		z-index: 2;
2d70f5ed   chenbiao   add gitignore
206
207
208
209
210
211
212
213
214
215
216
  	}
  
  	.index-top:after {
  		width: 140%;
  		height: 300upx;
  		position: absolute;
  		left: -20%;
  		top: 0;
  		z-index: -1;
  		content: '';
  		border-radius: 0 0 50% 50%;
48e03f64   chenbiao   add
217
  		background: linear-gradient(#2d7bf7, #2d7bf7);
2d70f5ed   chenbiao   add gitignore
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
  	}
  
  	.face {
  
  		margin-top: 50upx;
  		width: 100upx;
  		height: 100upx;
  		border-radius: 50%;
  
  	}
  
  	.username {
  		height: 50upx;
  		line-height: 50upx;
  		text-align: center;
  		color: #fff;
48e03f64   chenbiao   add
234
  		z-index: 2;
2d70f5ed   chenbiao   add gitignore
235
236
237
238
239
240
241
  	}
  
  	.set-wapper {
  		height: 40rpx;
  		position: absolute;
  		top: 30upx;
  		right: 50upx;
48e03f64   chenbiao   add
242
  		z-index: 2;
2d70f5ed   chenbiao   add gitignore
243
244
245
246
247
248
249
250
251
  	}
  
  	.settings {
  		width: 40upx;
  		height: 40upx;
  	}
  
  	.index-menu {
  		width: 100%;
48e03f64   chenbiao   add
252
  		height: 440upx;
2d70f5ed   chenbiao   add gitignore
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
  		margin-top: 160upx;
  	}
  
  	.flex-item {
  		width: 33.3%;
  		height: 200upx;
  		text-align: center;
  
  	}
  
  	.index-icon {
  		width: 48upx;
  		height: 48upx;
  		// border: 50%;
  	}
  
  	.index-title {
  		height: 80upx;
  		line-height: 80upx;
  		// width: 80upx;
  	}
  </style>