| | |
| | | <image :src="codeUrl" @click="getCode" class="login-code-img"></image> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 协议同意 --> |
| | | <view class="agreement-section"> |
| | | <checkbox-group @change="handleAgreementChange"> |
| | | <label class="agreement-label"> |
| | | <checkbox value="agreed" :checked="agreedToTerms" color="#007AFF" style="margin-top: 0;" /> |
| | | <text class="agreement-text"> |
| | | 我已阅读并同意 |
| | | <text class="agreement-link" @click.stop="handleUserAgreement">《用户服务协议》</text> |
| | | 和 |
| | | <text class="agreement-link" @click.stop="handlePrivacy">《隐私政策》</text> |
| | | </text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | |
| | | <view class="action-btn"> |
| | | <button @click="handleRegister()" class="register-btn cu-btn block bg-blue lg round">注册</button> |
| | | </view> |
| | |
| | | return { |
| | | codeUrl: "", |
| | | captchaEnabled: true, |
| | | agreedToTerms: true, // 默认选中 |
| | | globalConfig: getApp().globalData.config, |
| | | registerForm: { |
| | | username: "", |
| | |
| | | // 用户登录 |
| | | handleUserLogin() { |
| | | this.$tab.navigateTo(`/pages/login`) |
| | | }, |
| | | // 协议选择变更 |
| | | handleAgreementChange(e) { |
| | | this.agreedToTerms = e.detail.value.length > 0 |
| | | }, |
| | | // 用户协议 |
| | | handleUserAgreement() { |
| | | this.$tab.navigateTo('/pages/mine/user-agreement/index') |
| | | }, |
| | | // 隐私政策 |
| | | handlePrivacy() { |
| | | this.$tab.navigateTo('/pages/mine/privacy-policy/index') |
| | | }, |
| | | // 获取图形验证码 |
| | | getCode() { |
| | |
| | | this.$modal.msgError("两次输入的密码不一致") |
| | | } else if (this.registerForm.code === "" && this.captchaEnabled) { |
| | | this.$modal.msgError("请输入验证码") |
| | | } else if (!this.agreedToTerms) { |
| | | this.$modal.msgError("请先阅读并同意用户服务协议和隐私政策") |
| | | } else { |
| | | this.$modal.loading("注册中,请耐心等待...") |
| | | this.register() |
| | |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .agreement-section { |
| | | margin: 50rpx 0 30rpx 0; |
| | | padding: 20rpx; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | |
| | | checkbox-group { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .agreement-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; |
| | | font-size: 26rpx; |
| | | color: #666; |
| | | line-height: 1.5; |
| | | text-align: right; |
| | | justify-content: flex-end; |
| | | |
| | | .agreement-link { |
| | | color: #007AFF; |
| | | text-decoration: none; |
| | | padding: 8rpx 10rpx; |
| | | margin: 0 5rpx; |
| | | display: inline-block; |
| | | position: relative; |
| | | z-index: 10; |
| | | border-bottom: 1px solid #007AFF; |
| | | line-height: 1.5; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .login-code { |
| | | height: 38px; |
| | | float: right; |