宋飞扬 1 éve
szülő
commit
8af0849c33

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 427 - 2034
pnpm-lock.yaml


+ 13 - 11
src/components/userAgreement/userAgreement.vue

@@ -1,9 +1,19 @@
 <template>
   <view>
     <u-modal :title="title" :show="show" @confirm="handleConfirm" width="500rpx">
-      <view>
-        <!-- 占位 -->
-        <slot></slot>
+      <!-- 如果点击的是用户协议 -->
+      <view v-if="title == '用户协议'">
+        <p>1.1246461456</p>
+        <p>2.1246461456</p>
+        <p>3.1246461456</p>
+      </view>
+      <!-- 否则 也就是点击隐私政策 -->
+      <view v-else>
+        <p>8888888888</p>
+        <p>8888888888</p>
+        <p>8888888888</p>
+        <p>8888888888</p>
+        <p>8888888888</p>
       </view>
     </u-modal>
   </view>
@@ -22,14 +32,6 @@ export default {
       default: '',
     },
   },
-  data() {
-    return {};
-  },
-
-  //组件挂载时触发
-  mounted() {
-    console.log(8888); //看看有没有触发本组件
-  },
 
   methods: {
     //点击弹框内确认

+ 9 - 56
src/pages/login/index.vue

@@ -1,8 +1,11 @@
 <template>
   <view class="container">
+    <!-- 头部logo -->
     <view class="login-logo">
       <image src="@/static/logo.png" mode="scaleToFill" />
     </view>
+
+    <!-- 中间登录注册按钮 -->
     <view class="login-btn-wrap">
       <u-button shape="circle" type="primary" :loading="loading" @tap="login">
         微信用户一键登录
@@ -16,51 +19,17 @@
       </u-button>
     </view>
 
+    <!-- 底部协议 -->
     <view class="agree">
       <u-checkbox-group v-model="checked">
         <u-checkbox shape="circle" name="1" />
       </u-checkbox-group>
       <view>我已阅读并同意</view>
-      <view @click="showUserAgreement">《用户协议》</view>
-      <view @click="showPrivacyPolicy">《隐私政策》</view>
+      <view @click="click('用户协议')">《用户协议》</view>
+      <view @click="click('隐私政策')">《隐私政策》</view>
     </view>
 
-    <!-- <u-modal
-      :show="show"
-      content="请阅读并勾选用户协议"
-      @confirm="confirmUserAgreement"
-      width="500rpx"
-    ></u-modal>
-    <u-modal title="用户协议" :show="showUserAgreementDialog" width="500rpx">
-      <view>
-        用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容用户协议的内容
-      </view>
-      <u-button shape="circle" @click="closeUserAgreementDialog">X</u-button>
-    </u-modal>
-
-    <u-modal title="隐私政策" :show="showPrivacyPolicyDialog" width="500rpx">
-      <view>
-        隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容隐私政策的内容
-      </view>
-      <u-button shape="circle" @click="closePrivacyPolicyDialog">X</u-button>
-    </u-modal> -->
-
-    <userAgreement v-if="show" :title="title" :show="show" @handleConfirm="handleConfirm">
-      <!-- 如果点击的是用户协议 -->
-      <view v-if="isUserAgreement">
-        <p>1.1246461456</p>
-        <p>1.1246461456</p>
-        <p>1.1246461456</p>
-      </view>
-      <!-- 否则 也就是点击隐私政策 -->
-      <view v-else>
-        <p>8888888888</p>
-        <p>8888888888</p>
-        <p>8888888888</p>
-        <p>8888888888</p>
-        <p>8888888888</p>
-      </view>
-    </userAgreement>
+    <userAgreement v-if="show"  :title="title" :show="show" @handleConfirm="handleConfirm"/>
   </view>
 </template>
 
@@ -102,33 +71,17 @@ export default {
       this.$Router.back();
     },
 
-    // showUserAgreement() {
-    //   this.showUserAgreementDialog = true;
-    // },
-
     //点击用户协议
-    showUserAgreement() {
-      this.isUserAgreement = true;
+    click(title) {
       this.show = true; //打开弹框
-      this.title = '用户协议'; //赋值标题
+      this.title = title; //赋值标题
     },
 
     //点击用户协议弹框内的确定
     handleConfirm() {
-      console.log(222);
       this.show = false; //关闭弹框
     },
 
-    // showPrivacyPolicy() {
-    //   this.showPrivacyPolicyDialog = true;
-    // },
-
-    showPrivacyPolicy() {
-      this.isUserAgreement = false;
-      this.show = true; //打开弹框
-      this.title = '隐私政策'; //赋值标题
-    },
-
     //点击微信用户一键登录
     async login() {
       if (this.checked && this.checked.length == 0) {

+ 22 - 3
src/pages/login/phoneLogin.vue

@@ -62,9 +62,9 @@
         </u-checkbox-group>
         <text class="user-agreement-text">
           我已阅读并同意
-          <text class="terms">《用户协议》</text>
-          <text class="terms">《隐私政策》</text>
-          <text class="terms">《商家/车主个人信息保护规则》</text>
+          <view @click="click('用户协议')">《用户协议》</view>
+      <view @click="click('隐私政策')">《隐私政策》</view>
+          <!-- <text class="terms">《商家/车主个人信息保护规则》</text> -->
         </text>
       </view>
     </view>
@@ -87,12 +87,19 @@
         <u-button @click="confirmShow" type="primary" :loading="loading">确认</u-button>
       </u-popup>
     </view>
+
+    <!-- 用户协议弹框 -->
+    <userAgreement v-if="show"  :title="title" :show="show" @handleConfirm="handleConfirm"/>
   </view>
 </template>
 
 <script>
+  import userAgreement from '@/components/userAgreement/userAgreement.vue'
 import { getSmsCodeByPhone, loginByPhoneAndSmsCode, maintainSmsCaptcha } from '@/api/login';
 export default {
+  components: {
+    userAgreement,
+  },
   data() {
     return {
       loginForm: {
@@ -129,6 +136,7 @@ export default {
       },
       seconds: 120,
       tips: '',
+      title: '',
       isChecked: true,
       show: false,
       loading: false,
@@ -166,6 +174,17 @@ export default {
       }
     },
 
+       //点击用户协议
+       click(title) {
+      this.show = true; //打开弹框
+      this.title = title; //赋值标题
+    },
+
+    //点击用户协议弹框内的确定
+    handleConfirm() {
+      this.show = false; //关闭弹框
+    },
+
     //点击登录
     async login() {
       if (!this.isChecked) {

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott