Pārlūkot izejas kodu

feat(user): add user service agreement and privacy policy pages

1. 新增用户服务协议和隐私政策页面
2. 在登录页添加协议勾选框与跳转入口
3. 完成两个新页面的路由配置
408249787@qq.com 10 stundas atpakaļ
vecāks
revīzija
4c97744546
4 mainītis faili ar 308 papildinājumiem un 14 dzēšanām
  1. 16 0
      pages.json
  2. 122 0
      pages/user/agreement.uvue
  3. 36 14
      pages/user/login.uvue
  4. 134 0
      pages/user/privacy.uvue

+ 16 - 0
pages.json

@@ -97,6 +97,22 @@
 				"navigationStyle": "custom",
 				"disableScroll": true
 			}
+		},
+		{
+			"path": "pages/user/agreement",
+			"style": {
+				"pageOrientation": "portrait",
+				"navigationStyle": "custom",
+				"disableScroll": true
+			}
+		},
+		{
+			"path": "pages/user/privacy",
+			"style": {
+				"pageOrientation": "portrait",
+				"navigationStyle": "custom",
+				"disableScroll": true
+			}
 		}
 	],
 	"globalStyle": {

+ 122 - 0
pages/user/agreement.uvue

@@ -0,0 +1,122 @@
+<template>
+	<cl-page>
+	<cl-topbar title="用户服务协议" fixed safeAreaTop></cl-topbar>
+		<view class="container">
+			<scroll-view class="content" scroll-y>
+				<view class="article">
+					<view class="section">
+						<view class="section-title">一、协议说明</view>
+						<view class="section-content">
+							<p>欢迎您使用乐学小盘熊小程序(以下简称“本小程序”)。您在使用本小程序服务前,请认真阅读本《用户服务协议》。您的注册、登录、浏览、使用等行为,即代表您已阅读、理解并同意接受本协议全部条款,自愿遵守本协议约束。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">二、服务说明</view>
+						<view class="section-content">
+							<p>本小程序为用户提供在线功能服务,用户可通过手机号完成账号登录、使用小程序对应功能。本小程序仅提供合法合规的日常服务,不提供违法、违规、侵权、色情、暴力、赌博等内容与服务。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">三、用户账号与使用规范</view>
+						<view class="section-content">
+							<p>3.1 用户可通过手机号完成账号注册与登录,保证所提交信息真实、有效、合法。</p>
+							<p>3.2 用户不得利用本小程序从事任何违反国家法律法规、侵害他人合法权益、扰乱公共秩序的行为。</p>
+							<p>3.3 用户账号仅限本人使用,不得转借、出租、出售、共享给他人。因用户自身保管不当产生的一切后果,由用户自行承担。</p>
+							<p>3.4 如用户存在违规使用行为,我方有权采取包括但不限于警告、限制功能、封禁账号等处理措施。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">四、用户权利与义务</view>
+						<view class="section-content">
+							<p>4.1 用户有权在遵守本协议前提下正常使用小程序全部公开服务。</p>
+							<p>4.2 用户有义务保证自身操作合法合规,不得恶意攻击、骚扰、刷量、破坏小程序正常运行。</p>
+							<p>4.2 用户不得在小程序内发布、传播违法、侵权、低俗、虚假等违规信息。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">五、知识产权</view>
+						<view class="section-content">
+							<p>本小程序所有文字、界面、功能、代码、标识等知识产权均归我方所有。未经我方书面许可,任何单位及个人不得复制、转载、篡改、商用、二次分发。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">六、免责声明</view>
+						<view class="section-content">
+							<p>6.1 我方将尽力保障小程序稳定运行,但不对因网络故障、系统维护、第三方原因、不可抗力导致的临时无法使用、数据延迟等问题承担责任。</p>
+							<p>6.2 用户使用本小程序产生的自主决策、自主操作行为,后果由用户自行承担。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">七、协议更新</view>
+						<view class="section-content">
+							<p>我方有权根据业务及法规需要,适时更新本服务协议,更新后将在小程序内公示,公示后即生效,继续使用即视为接受更新后协议。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">八、其他</view>
+						<view class="section-content">
+							<p>本协议适用中华人民共和国法律,如发生争议,双方优先协商解决,协商不成可向我方所在地人民法院提起诉讼。</p>
+						</view>
+					</view>
+
+					<view class="footer">
+						<p>本协议最终解释权归本平台所有。</p>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+	</cl-page>
+</template>
+
+<script lang="ts" setup>
+</script>
+
+<style lang="scss" scoped>
+.container {
+	@apply w-full h-full bg-white  pb-8 px-4;
+}
+
+.title {
+	@apply text-xl font-bold text-center mb-6 text-gray-800;
+}
+
+.content {
+	@apply h-[calc(100vh-100px)];
+}
+
+.article {
+	@apply text-gray-600 text-sm leading-relaxed;
+}
+
+.section {
+	@apply mb-6;
+}
+
+.section-title {
+	@apply font-bold text-gray-800 mb-2 text-base;
+}
+
+.section-content {
+	@apply pl-4;
+}
+
+.section-content p {
+	@apply mb-2;
+	text-indent: 2em;
+}
+
+.footer {
+	@apply mt-8 pt-4 border-t border-gray-100 text-center text-gray-400;
+}
+
+.footer p {
+	@apply mb-1;
+}
+</style>

+ 36 - 14
pages/user/login.uvue

@@ -24,12 +24,23 @@
 							<password :form="formData" />
 						</view>
 						<view class="flex flex-row items-center justify-center mb-5">
-							<cl-button :pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading"
+							<cl-button :disabled="!agree"
+								:pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading"
 								@tap="toLogin">
 								登录
 							</cl-button>
 						</view>
-
+						<cl-checkbox v-model="agree">
+							<view class="flex flex-row items-center w-full text-[12px]">
+								同意并阅读
+								<cl-text :size="12" color="primary" @tap.stop="toAgreement">
+									《用户服务协议》
+								</cl-text>和
+								<cl-text :size="12" color="primary" @tap.stop="toPrivacy">
+									《隐私政策》
+								</cl-text>
+							</view>
+						</cl-checkbox>
 					</cl-form>
 				</view>
 			</view>
@@ -47,10 +58,10 @@
 					</view>
 				</view>
 				<view v-if="val === 'password'">
-					<cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }" :loading="loading"
-						@tap="tabsChange('quickly_login')">
-						<cl-image src="https://oss.xiaoxiongcode.com/static/home/phone.svg" mode="heightFix" height="20px"
-							width="auto"></cl-image>
+					<cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }"
+						:loading="loading" @tap="tabsChange('quickly_login')">
+						<cl-image src="https://oss.xiaoxiongcode.com/static/home/phone.svg" mode="heightFix"
+							height="20px" width="auto"></cl-image>
 					</cl-button>
 					<view class="mt-1">
 						<cl-text :size="14" color="#666">
@@ -59,10 +70,10 @@
 					</view>
 				</view>
 				<view v-else>
-					<cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }" :loading="loading"
-						@tap="tabsChange('password')">
-						<cl-image src="https://oss.xiaoxiongcode.com/static/home/password.svg" mode="heightFix" height="20px"
-							width="auto"></cl-image>
+					<cl-button type="info" :pt="{ className: '!h-[40px] !rounded-full w-[40px] mx-auto !p-1' }"
+						:loading="loading" @tap="tabsChange('password')">
+						<cl-image src="https://oss.xiaoxiongcode.com/static/home/password.svg" mode="heightFix"
+							height="20px" width="auto"></cl-image>
 					</cl-button>
 					<view class="mt-1">
 						<cl-text :size="14" color="#666">
@@ -92,12 +103,13 @@ import password from './components/password.uvue';
 import { ref } from 'vue'
 import type { ClTabsItem } from "@/uni_modules/cool-ui";
 import { encryptPassword, user, router } from '@/.cool';
-import { loginApi, wechatLogin,quicklyRegister } from "@/services/user";
+import { loginApi, wechatLogin, quicklyRegister } from "@/services/user";
 import type { ClActionSheetOptions } from "@/uni_modules/cool-ui";
 
 const actionSheetRef = ref<ClActionSheetComponentPublicInstance | null>(null);
 
 const val = ref('quickly_login')
+const agree = ref(false)
 const list: ClTabsItem[] = [
 	{
 		label: '验证码登录',
@@ -146,14 +158,14 @@ function toLogin() {
 		})
 		router.home();
 	}).catch(err => {
-		if(err.message=='手机号不存在'&&val.value==='quickly_login'){
+		if (err.message == '手机号不存在' && val.value === 'quickly_login') {
 			quicklyRegister({
 				username: formData.value.username,
 				password: 'ba3253876aed6bc22d4a6ff53d8406c6ad864195ed144ab5c87621b6c233b548baeae6956df346ec8c17f5ea10f35ee3cbc514797ed7ddd3145464e2a0bab413',
 			}).then(res => {
-			  handleSelect(formData.value.username)
+				handleSelect(formData.value.username)
 			})
-		}else{
+		} else {
 			uni.showToast({
 				title: err.message,
 				icon: 'none'
@@ -210,6 +222,16 @@ function handleSelect(item: string) {
 	})
 
 }
+function toAgreement() {
+	router.push({
+		path: '/pages/user/agreement'
+	})
+}
+function toPrivacy() {
+	router.push({
+		path: '/pages/user/privacy'
+	})
+}
 </script>
 
 <style lang="scss" scoped>

+ 134 - 0
pages/user/privacy.uvue

@@ -0,0 +1,134 @@
+<template>
+	<cl-page>
+		<cl-topbar title="隐私政策" fixed safeAreaTop></cl-topbar>
+		<view class="container">
+			<scroll-view class="content" scroll-y>
+				<view class="article">
+					<view class="section">
+						<view class="section-title">一、前言</view>
+						<view class="section-content">
+							<p>本隐私政策旨在向用户清晰说明:本小程序如何收集、使用、存储、保护您的个人信息,严格遵守《个人信息保护法》《网络安全法》及微信小程序平台相关规范。本政策仅适用于本小程序服务。
+							</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">二、我们收集的信息(仅必要信息)</view>
+						<view class="section-content">
+							<p>为实现账号注册、手机号登录、身份核验核心功能,在获得您明示同意后,我们仅收集以下必要信息:</p>
+							<p>2.1 手机号码:用于用户注册、登录、验证身份、保障账号安全,为小程序核心功能必需信息。</p>
+							<p>2.2 系统基础日志信息:仅用于排查故障、保障服务稳定,不会用于其他用途。</p>
+							<p>本小程序不会主动收集通讯录、位置、相册、麦克风、摄像头等非必要隐私信息。</p>
+
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">三、信息使用目的</view>
+						<view class="section-content">
+							<p>3.1 完成用户身份识别、账号登录、账号管理。</p>
+							<p>3.2 保障账号安全,防止恶意注册、恶意登录。</p>
+							<p>3.3 维护小程序正常、稳定、安全运行。</p>
+							<p>3.4 提供您所需要的小程序服务功能。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">四、信息的存储与保护</view>
+						<view class="section-content">
+							<p>4.1 您的个人信息仅用于本小程序服务范围,不会对外出售、出租、非法共享。</p>
+							<p>4.2 我方采用安全技术及管理制度保护用户个人信息,防止信息泄露、篡改、丢失。</p>
+							<p>4.3 用户数据仅在国内存储,不向境外传输。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">五、信息的共享与披露</view>
+						<view class="section-content">
+							<p>未经用户本人同意,我方不会向任何第三方共享、披露、转让用户个人信息。法律法规、司法机关、监管部门依法要求提供的除外。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">六、用户权利</view>
+						<view class="section-content">
+							<p>您有权随时查看、更正、申请删除您的个人信息、撤回授权、注销账号。如有相关需求,可通过小程序内反馈渠道联系我们。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">七、未成年人保护</view>
+						<view class="section-content">
+							<p>我们高度重视未成年人隐私保护,若您为未成年人,请在监护人陪同与同意下使用本小程序。我们不会主动收集未成年人敏感信息。</p>
+						</view>
+					</view>
+
+					<view class="section">
+						<view class="section-title">八、政策更新</view>
+						<view class="section-content">
+							<p>我方可根据法律法规及业务需要更新本隐私政策,更新后将在小程序公示,公示后生效,继续使用服务视为接受更新后政策。</p>
+						</view>
+					</view>
+					<view class="section">
+						<view class="section-title">九、联系与投诉渠道</view>
+						<view class="section-content">
+							<p>如您对本隐私政策或个人信息保护有疑问、建议、投诉,可通过小程序内客服渠道联系我们。</p>
+							<p>生效日期:2026年05月26日</p>
+						</view>
+					</view>
+					<view class="footer">
+						<p>本隐私政策最终解释权归本平台所有。</p>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+	</cl-page>
+</template>
+
+<script lang="ts" setup>
+import Back from '@/components/back.uvue'
+</script>
+
+<style lang="scss" scoped>
+.container {
+	@apply w-full h-full bg-white  pb-8 px-4;
+}
+
+.title {
+	@apply text-xl font-bold text-center mb-6 text-gray-800;
+}
+
+.content {
+	@apply h-[calc(100vh-100px)];
+}
+
+
+.article {
+	@apply text-gray-600 text-sm leading-relaxed;
+}
+
+.section {
+	@apply mb-6;
+}
+
+.section-title {
+	@apply font-bold text-gray-800 mb-2 text-base;
+}
+
+.section-content {
+	@apply pl-4;
+}
+
+.section-content p {
+	@apply mb-2;
+	text-indent: 2em;
+}
+
+.footer {
+	@apply mt-8 pt-4 border-t border-gray-100 text-center text-gray-400;
+}
+
+.footer p {
+	@apply mb-1;
+}
+</style>