From d3fd4b0ab851bab89c30c199e27245f7f45f1c0e Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 08 十一月 2025 08:01:12 +0800
Subject: [PATCH] feat:实现了微信上传图片

---
 app/pages/login.vue |  137 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 114 insertions(+), 23 deletions(-)

diff --git a/app/pages/login.vue b/app/pages/login.vue
index eddda11..94efe80 100644
--- a/app/pages/login.vue
+++ b/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" class="round-checkbox" 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: false,
         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 === "") {
@@ -108,6 +125,8 @@
       loginSuccess(result) {
         // 璁剧疆鐢ㄦ埛淇℃伅
         this.$store.dispatch('GetInfo').then(res => {
+          // 瑙﹀彂鐧诲綍鎴愬姛浜嬩欢锛屽惎鍔ㄦ秷鎭疆璇�
+          uni.$emit('user-login')
           this.$tab.reLaunch('/pages/index')
         })
       }
@@ -242,24 +261,96 @@
         }
       }
       
-      .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;
+          }
+          
+          // 鍦嗗舰澶嶉�夋鏍峰紡
+          .round-checkbox {
+            border-radius: 50% !important;
+          }
+          
+          // 閽堝寰俊灏忕▼搴忕殑鍦嗗舰鏍峰紡
+          ::v-deep .uni-checkbox-input,
+          ::v-deep .wx-checkbox-input {
+            border-radius: 50% !important;
+          }
+          
+          // 閽堝H5鐨勫渾褰㈡牱寮�
+          ::v-deep input[type="checkbox"] {
+            border-radius: 50% !important;
+            -webkit-appearance: none;
+            appearance: none;
+            width: 36rpx;
+            height: 36rpx;
+            border: 2rpx solid #d1d1d1;
+            background-color: #fff;
+            position: relative;
+            
+            &:checked {
+              background-color: #007AFF;
+              border-color: #007AFF;
+              
+              &::after {
+                content: '';
+                position: absolute;
+                top: 50%;
+                left: 50%;
+                transform: translate(-50%, -50%);
+                width: 12rpx;
+                height: 12rpx;
+                background-color: #fff;
+                border-radius: 50%;
+              }
+            }
+          }
+          
+          .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;
+            }
+          }
         }
       }
     }

--
Gitblit v1.9.1