hookehuyr

feat(登录页): 添加用户协议组件并更新登录按钮文本

Bob新需求把登录全改成短信登录

- 新增UserAgreement组件用于展示用户协议
- 移除忘记密码和切换登录方式链接
- 将登录按钮文本改为"登录/注册BEHALO宇宙账号"
- 默认使用验证码登录方式
- 在登录表单底部添加用户协议确认提示
...@@ -28,6 +28,7 @@ declare module 'vue' { ...@@ -28,6 +28,7 @@ declare module 'vue' {
28 SummerCampCard: typeof import('./components/ui/SummerCampCard.vue')['default'] 28 SummerCampCard: typeof import('./components/ui/SummerCampCard.vue')['default']
29 TermsPopup: typeof import('./components/ui/TermsPopup.vue')['default'] 29 TermsPopup: typeof import('./components/ui/TermsPopup.vue')['default']
30 UploadVideoPopup: typeof import('./components/ui/UploadVideoPopup.vue')['default'] 30 UploadVideoPopup: typeof import('./components/ui/UploadVideoPopup.vue')['default']
31 + UserAgreement: typeof import('./components/ui/UserAgreement.vue')['default']
31 VanActionSheet: typeof import('vant/es')['ActionSheet'] 32 VanActionSheet: typeof import('vant/es')['ActionSheet']
32 VanButton: typeof import('vant/es')['Button'] 33 VanButton: typeof import('vant/es')['Button']
33 VanCalendar: typeof import('vant/es')['Calendar'] 34 VanCalendar: typeof import('vant/es')['Calendar']
......
1 +<!--
2 + * @Date: 2025-06-05 11:06:42
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2025-06-05 11:08:29
5 + * @FilePath: /mlaj/src/components/ui/UserAgreement.vue
6 + * @Description: 文件描述
7 +-->
8 +<!--
9 + * @Description: 用户协议组件
10 +-->
11 +<template>
12 + <van-popup
13 + v-model:show="show"
14 + round
15 + position="bottom"
16 + :style="{ height: '90%' }"
17 + teleport="body"
18 + >
19 + <div class="p-4">
20 + <div class="text-xl font-bold text-center mb-4">美乐爱觉宇宙用户协议</div>
21 + <div class="agreement-content overflow-y-auto h-[calc(100vh*0.8-120px)] px-2">
22 + <h2 class="text-lg font-semibold mb-3">1. 协议的范围</h2>
23 + <p class="mb-4 text-gray-700">欢迎您使用美乐爱觉宇宙平台服务!为使用美乐爱觉宇宙平台服务,您应当阅读并遵守本《用户协议》。请您务必审慎阅读、充分理解各条款内容。</p>
24 +
25 + <h2 class="text-lg font-semibold mb-3">2. 账号注册</h2>
26 + <p class="mb-4 text-gray-700">您在使用本服务前需要注册一个美乐爱觉宇宙账号。美乐爱觉宇宙账号应当使用手机号码绑定注册,请您使用尚未与美乐爱觉宇宙账号绑定的手机号码,以及未被平台根据本协议封禁的手机号码注册。</p>
27 +
28 + <h2 class="text-lg font-semibold mb-3">3. 用户个人信息保护</h2>
29 + <p class="mb-4 text-gray-700">我们非常重视用户个人信息的保护,保护用户个人信息是我们的基本原则之一。我们将会采取合理的措施保护用户的个人信息。除法律法规规定的情形外,未经用户许可我们不会向第三方公开、透露用户个人信息。</p>
30 +
31 + <h2 class="text-lg font-semibold mb-3">4. 内容规范</h2>
32 + <p class="mb-4 text-gray-700">您在使用本服务时需要遵守法律法规、社会主义制度、国家利益、公民合法权益、公共秩序、社会道德风尚和信息真实性等七条底线。</p>
33 +
34 + <h2 class="text-lg font-semibold mb-3">5. 知识产权</h2>
35 + <p class="mb-4 text-gray-700">美乐爱觉宇宙平台所包含的全部智力成果,包括但不限于平台内容、平台设计、源代码等,均属于平台所有。未经平台许可,任何人不得擅自使用。</p>
36 +
37 + <h2 class="text-lg font-semibold mb-3">6. 服务的变更、中断和终止</h2>
38 + <p class="mb-4 text-gray-700">我们可能会对服务内容进行变更,也可能会中断、中止或终止服务。对于付费服务,我们会在变更前通知您,并向您提供退款等必要的补偿。</p>
39 +
40 + <h2 class="text-lg font-semibold mb-3">7. 违约处理</h2>
41 + <p class="mb-4 text-gray-700">如果您违反本协议约定,我们有权视情况采取预先警示、限制或禁止使用全部或部分服务功能、封禁账号等措施。</p>
42 +
43 + <h2 class="text-lg font-semibold mb-3">8. 其他条款</h2>
44 + <p class="mb-4 text-gray-700">本协议所有条款的标题仅为阅读方便,本身并无实际涵义,不能作为本协议涵义解释的依据。如果本协议中任何一条被视为废止、无效或不可执行,应视为可分的且并不影响任何其余条款的有效性和可执行性。</p>
45 + </div>
46 + <div class="flex justify-center mt-4">
47 + <van-button round type="primary" color="#4CAF50" block @click="handleClose">我已阅读并同意</van-button>
48 + </div>
49 + </div>
50 + </van-popup>
51 +</template>
52 +
53 +<script setup>
54 +import { ref, defineExpose } from 'vue';
55 +
56 +const show = ref(false);
57 +
58 +const handleClose = () => {
59 + show.value = false;
60 +};
61 +
62 +const openAgreement = () => {
63 + show.value = true;
64 +};
65 +
66 +defineExpose({
67 + openAgreement
68 +});
69 +</script>
70 +
71 +<style lang="less" scoped>
72 +.agreement-content {
73 + &::-webkit-scrollbar {
74 + width: 4px;
75 + }
76 + &::-webkit-scrollbar-track {
77 + background: #f1f1f1;
78 + border-radius: 2px;
79 + }
80 + &::-webkit-scrollbar-thumb {
81 + background: #888;
82 + border-radius: 2px;
83 + }
84 + &::-webkit-scrollbar-thumb:hover {
85 + background: #555;
86 + }
87 +}
88 +</style>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
79 </div> 79 </div>
80 </div> 80 </div>
81 81
82 - <div class="flex justify-end space-x-4"> 82 + <!-- <div class="flex justify-end space-x-4">
83 <div class="text-sm"> 83 <div class="text-sm">
84 <router-link 84 <router-link
85 to="/forgotPwd" 85 to="/forgotPwd"
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
97 {{ isVerifyCodeLogin ? '密码登录' : '验证码登录' }} 97 {{ isVerifyCodeLogin ? '密码登录' : '验证码登录' }}
98 </button> 98 </button>
99 </div> 99 </div>
100 - </div> 100 + </div> -->
101 101
102 <div> 102 <div>
103 <button 103 <button
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
106 class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" 106 class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500"
107 :class="{ 'opacity-70 cursor-not-allowed': loading }" 107 :class="{ 'opacity-70 cursor-not-allowed': loading }"
108 > 108 >
109 - {{ loading ? "登录中..." : "登" }} 109 + {{ loading ? "登录中..." : "登录/注册BEHALO宇宙账号" }}
110 </button> 110 </button>
111 </div> 111 </div>
112 </form> 112 </form>
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
145 </div> 145 </div>
146 </div> --> 146 </div> -->
147 147
148 - <div class="text-center mt-6"> 148 + <!-- <div class="text-center mt-6">
149 <p class="text-sm text-gray-600"> 149 <p class="text-sm text-gray-600">
150 还没有账号? 150 还没有账号?
151 <router-link 151 <router-link
...@@ -155,6 +155,18 @@ ...@@ -155,6 +155,18 @@
155 立即注册 155 立即注册
156 </router-link> 156 </router-link>
157 </p> 157 </p>
158 + </div> -->
159 + <div class="text-center mt-6">
160 + <p class="text-sm text-gray-600">
161 + 登录即表示同意
162 + <span
163 + class="font-medium text-green-600 hover:text-green-500 cursor-pointer"
164 + @click="userAgreementRef.openAgreement()"
165 + >
166 + 《美乐爱觉宇宙用户协议》
167 + </span>
168 + <UserAgreement ref="userAgreementRef" />
169 + </p>
158 </div> 170 </div>
159 </FrostedGlass> 171 </FrostedGlass>
160 </div> 172 </div>
...@@ -170,6 +182,9 @@ import { loginAPI, getUserInfoAPI } from "@/api/users"; ...@@ -170,6 +182,9 @@ import { loginAPI, getUserInfoAPI } from "@/api/users";
170 import { useTitle } from "@vueuse/core"; 182 import { useTitle } from "@vueuse/core";
171 import { smsAPI } from "@/api/common"; 183 import { smsAPI } from "@/api/common";
172 import { showToast } from "vant"; 184 import { showToast } from "vant";
185 +import UserAgreement from "@/components/ui/UserAgreement.vue";
186 +
187 +const userAgreementRef = ref(null);
173 188
174 const handleInputFocus = () => { 189 const handleInputFocus = () => {
175 setTimeout(() => { 190 setTimeout(() => {
...@@ -192,7 +207,7 @@ const password = ref(""); ...@@ -192,7 +207,7 @@ const password = ref("");
192 const verificationCode = ref(""); 207 const verificationCode = ref("");
193 const error = ref(""); 208 const error = ref("");
194 const loading = ref(false); 209 const loading = ref(false);
195 -const isVerifyCodeLogin = ref(false); 210 +const isVerifyCodeLogin = ref(true);
196 const countdown = ref(0); 211 const countdown = ref(0);
197 const isPhoneValid = ref(false); 212 const isPhoneValid = ref(false);
198 213
......