From 8b005a808d6ab8fae1480ed57bdfd68af2dafcd4 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 01 十一月 2025 23:07:49 +0800
Subject: [PATCH] feat:输入出入地址时,会自动计算距离

---
 app/pages/login.vue |  166 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 85 insertions(+), 81 deletions(-)

diff --git a/app/pages/login.vue b/app/pages/login.vue
index f440b1e..3e85fce 100644
--- a/app/pages/login.vue
+++ b/app/pages/login.vue
@@ -3,7 +3,7 @@
     <view class="logo-content align-center justify-center flex">
       <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
       </image>
-      <text class="title">鑻ヤ緷绉诲姩绔櫥褰�</text>
+      <text class="title">姘戣埅璋冨害绯荤粺</text>
     </view>
     <view class="login-form-content">
       <view class="input-item flex align-center">
@@ -21,23 +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="wechat-login" @click="handleWechatLogin">
-        <view class="wechat-btn">
-          <image class="wechat-icon" src="/static/icons/profile.png"></image>
-          <text class="wechat-text">寰俊涓�閿櫥褰�</text>
-        </view>
-      </view>
-      <view class="reg text-center" v-if="register">
-        <text class="text-grey1">娌℃湁璐﹀彿锛�</text>
-        <text @click="handleUserRegister" class="text-blue">绔嬪嵆娉ㄥ唽</text>
-      </view>
-      <view class="xieyi text-center">
-        <text class="text-grey1">鐧诲綍鍗充唬琛ㄥ悓鎰�</text>
-        <text @click="handleUserAgrement" class="text-blue">銆婄敤鎴峰崗璁��</text>
-        <text @click="handlePrivacy" class="text-blue">銆婇殣绉佸崗璁��</text>
       </view>
     </view>
   </scroll-view>
@@ -53,10 +52,12 @@
         captchaEnabled: true,
         // 鐢ㄦ埛娉ㄥ唽寮�鍏�
         register: false,
+        // 闅愮鏀跨瓥鍚屾剰鐘舵�侊紙榛樿閫変腑锛�
+        agreedToPolicy: true,
         globalConfig: getApp().globalData.config,
         loginForm: {
-          username: "admin",
-          password: "admin123",
+          username: "",
+          password: "",
           code: "",
           uuid: ''
         }
@@ -72,13 +73,15 @@
       },
       // 闅愮鍗忚
       handlePrivacy() {
-        let site = this.globalConfig.appInfo.agreements[0]
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
+        this.$tab.navigateTo('/pages/mine/privacy-policy/index')
       },
       // 鐢ㄦ埛鍗忚
       handleUserAgrement() {
-        let site = this.globalConfig.appInfo.agreements[1]
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
+        this.$tab.navigateTo('/pages/mine/user-agreement/index')
+      },
+      // 鍗忚鍚屾剰鐘舵�佸彉鏇�
+      onAgreementChange(e) {
+        this.agreedToPolicy = e.detail.value.length > 0
       },
       // 鑾峰彇鍥惧舰楠岃瘉鐮�
       getCode() {
@@ -92,6 +95,10 @@
       },
       // 鐧诲綍鏂规硶
       async handleLogin() {
+        if (!this.agreedToPolicy) {
+          this.$modal.msgError("璇峰厛闃呰骞跺悓鎰忕敤鎴峰崗璁拰闅愮鏀跨瓥")
+          return
+        }
         if (this.loginForm.username === "") {
           this.$modal.msgError("璇疯緭鍏ユ偍鐨勮处鍙�")
         } else if (this.loginForm.password === "") {
@@ -102,40 +109,6 @@
           this.$modal.loading("鐧诲綍涓紝璇疯�愬績绛夊緟...")
           this.pwdLogin()
         }
-      },
-      // 寰俊鐧诲綍鏂规硶
-      async handleWechatLogin() {
-        // #ifdef MP-WEIXIN
-        // 寰俊灏忕▼搴忕櫥褰�
-        uni.login({
-          provider: 'weixin',
-          success: (loginRes) => {
-            console.log('寰俊鐧诲綍鎴愬姛', loginRes);
-            // 鑾峰彇鐢ㄦ埛淇℃伅
-            uni.getUserInfo({
-              provider: 'weixin',
-              success: (infoRes) => {
-                console.log('鐢ㄦ埛淇℃伅鑾峰彇鎴愬姛', infoRes);
-                // 璺宠浆鍒板井淇$櫥褰曠‘璁ら〉闈�
-                this.$tab.navigateTo(`/pages/login/wechat?userInfo=${encodeURIComponent(JSON.stringify(infoRes.userInfo))}`);
-              },
-              fail: (error) => {
-                console.error('鑾峰彇鐢ㄦ埛淇℃伅澶辫触', error);
-                this.$modal.msgError("鑾峰彇寰俊鐢ㄦ埛淇℃伅澶辫触");
-              }
-            });
-          },
-          fail: (error) => {
-            console.error('寰俊鐧诲綍澶辫触', error);
-            this.$modal.msgError("寰俊鐧诲綍澶辫触");
-          }
-        });
-        // #endif
-        
-        // #ifndef MP-WEIXIN
-        // H5鎴栧叾浠栧钩鍙版彁绀�
-        this.$modal.msgError("璇峰湪寰俊瀹㈡埛绔腑浣跨敤寰俊鐧诲綍鍔熻兘");
-        // #endif
       },
       // 瀵嗙爜鐧诲綍
       async pwdLogin() {
@@ -152,6 +125,8 @@
       loginSuccess(result) {
         // 璁剧疆鐢ㄦ埛淇℃伅
         this.$store.dispatch('GetInfo').then(res => {
+          // 瑙﹀彂鐧诲綍鎴愬姛浜嬩欢锛屽惎鍔ㄦ秷鎭疆璇�
+          uni.$emit('user-login')
           this.$tab.reLaunch('/pages/index')
         })
       }
@@ -273,31 +248,7 @@
         }
       }
 
-      .wechat-login {
-        margin: 20rpx 0;
-
-        .wechat-btn {
-          display: flex;
-          align-items: center;
-          justify-content: center;
-          background-color: #07c160;
-          height: 90rpx;
-          border-radius: 20px;
-
-          .wechat-icon {
-            width: 40rpx;
-            height: 40rpx;
-            margin-right: 10rpx;
-          }
-
-          .wechat-text {
-            color: white;
-            font-size: 32rpx;
-          }
-        }
-      }
-
-      .reg, .xieyi {
+      .reg {
         margin: 20rpx 0;
 
         .text-grey1 {
@@ -309,6 +260,59 @@
           color: #007AFF;
         }
       }
+      
+      .agreement-checkbox {
+        margin: 50rpx 0 30rpx 0;
+        padding: 20rpx;
+        display: flex;
+        justify-content: flex-start;
+        align-items: left;
+        
+        checkbox-group {
+          display: flex;
+          align-items: center;
+        }
+        
+        .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;
+            }
+          }
+        }
+      }
     }
   }
 </style>
\ No newline at end of file

--
Gitblit v1.9.1