| | |
| | | <image :src="codeUrl" @click="getCode" class="login-code-img" mode="aspectFit"></image> |
| | | </view> |
| | | </view> |
| | | <view class="agreement-checkbox"> |
| | | <checkbox-group @change="onAgreementChange"> |
| | | <label class="checkbox-label"> |
| | | <checkbox :checked="agreedToPolicy" value="agreed" color="#007AFF" style="margin-top: 0;" /> |
| | | <text class="agreement-text"> |
| | | <text class="text-grey1">同意</text> |
| | | <text @click.stop="handleUserAgrement" class="text-blue agreement-link">《用户协议》</text> |
| | | <text class="text-grey1">和</text> |
| | | <text @click.stop="handlePrivacy" class="text-blue agreement-link">《隐私政策》</text> |
| | | </text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | |
| | | <view class="action-btn"> |
| | | <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button> |
| | | </view> |
| | | |
| | | <view class="xieyi text-center"> |
| | | <text class="text-grey1">登录即代表同意</text> |
| | | <text @click.stop="handleUserAgrement" class="text-blue agreement-link">《用户协议》</text> |
| | | <text class="text-grey1">和</text> |
| | | <text @click.stop="handlePrivacy" class="text-blue agreement-link">《隐私协议》</text> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | |
| | | captchaEnabled: true, |
| | | // 用户注册开关 |
| | | register: false, |
| | | // 隐私政策同意状态(默认选中) |
| | | agreedToPolicy: true, |
| | | globalConfig: getApp().globalData.config, |
| | | loginForm: { |
| | | username: "", |
| | |
| | | handleUserAgrement() { |
| | | this.$tab.navigateTo('/pages/mine/user-agreement/index') |
| | | }, |
| | | // 协议同意状态变更 |
| | | onAgreementChange(e) { |
| | | this.agreedToPolicy = e.detail.value.length > 0 |
| | | }, |
| | | // 获取图形验证码 |
| | | getCode() { |
| | | getCodeImg().then(res => { |
| | |
| | | }, |
| | | // 登录方法 |
| | | async handleLogin() { |
| | | if (!this.agreedToPolicy) { |
| | | this.$modal.msgError("请先阅读并同意用户协议和隐私政策") |
| | | return |
| | | } |
| | | if (this.loginForm.username === "") { |
| | | this.$modal.msgError("请输入您的账号") |
| | | } else if (this.loginForm.password === "") { |
| | |
| | | loginSuccess(result) { |
| | | // 设置用户信息 |
| | | this.$store.dispatch('GetInfo').then(res => { |
| | | // 触发登录成功事件,启动消息轮询 |
| | | uni.$emit('user-login') |
| | | this.$tab.reLaunch('/pages/index') |
| | | }) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | .xieyi { |
| | | .agreement-checkbox { |
| | | margin: 50rpx 0 30rpx 0; |
| | | padding: 20rpx 0; |
| | | line-height: 2; |
| | | |
| | | .text-grey1 { |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | padding: 20rpx; |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: left; |
| | | |
| | | checkbox-group { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .agreement-link { |
| | | color: #007AFF; |
| | | font-size: 24rpx; |
| | | padding: 10rpx 8rpx; |
| | | margin: 0 5rpx; |
| | | display: inline-block; |
| | | position: relative; |
| | | z-index: 10; |
| | | |
| | | .checkbox-label { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | |
| | | checkbox { |
| | | margin-right: 15rpx; |
| | | transform: scale(1.2); |
| | | flex-shrink: 0; |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .agreement-text { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | line-height: 1.5; |
| | | font-size: 26rpx; |
| | | text-align: left; |
| | | justify-content: flex-start; |
| | | |
| | | .text-grey1 { |
| | | color: #666; |
| | | font-size: 26rpx; |
| | | line-height: 1.5; |
| | | } |
| | | |
| | | .text-blue { |
| | | color: #007AFF; |
| | | font-size: 26rpx; |
| | | padding: 8rpx 10rpx; |
| | | margin: 0 5rpx; |
| | | display: inline-block; |
| | | position: relative; |
| | | z-index: 10; |
| | | line-height: 1.5; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |