wlzboy
2025-10-27 559b2e34c983f615b6d6747f52c801022c561803
app/pages/login.vue
@@ -21,15 +21,22 @@
          <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>
@@ -45,6 +52,8 @@
        captchaEnabled: true,
        // 用户注册开关
        register: false,
        // 隐私政策同意状态(默认选中)
        agreedToPolicy: true,
        globalConfig: getApp().globalData.config,
        loginForm: {
          username: "",
@@ -70,6 +79,10 @@
      handleUserAgrement() {
        this.$tab.navigateTo('/pages/mine/user-agreement/index')
      },
      // 协议同意状态变更
      onAgreementChange(e) {
        this.agreedToPolicy = e.detail.value.length > 0
      },
      // 获取图形验证码
      getCode() {
        getCodeImg().then(res => {
@@ -82,6 +95,10 @@
      },
      // 登录方法
      async handleLogin() {
        if (!this.agreedToPolicy) {
          this.$modal.msgError("请先阅读并同意用户协议和隐私政策")
          return
        }
        if (this.loginForm.username === "") {
          this.$modal.msgError("请输入您的账号")
        } else if (this.loginForm.password === "") {
@@ -242,24 +259,56 @@
        }
      }
      
      .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;
            }
          }
        }
      }
    }