feat: 新增用户协议

新增用户协议
This commit is contained in:
Theo
2024-11-29 16:38:07 +08:00
parent 2e224a5093
commit dc856f9aa9
5 changed files with 161 additions and 5 deletions

View File

@@ -32,6 +32,12 @@
"navigationBarTitleText": "关于我们" "navigationBarTitleText": "关于我们"
} }
}, },
{
"path": "pages/mine/user-agreement/index",
"style": {
"navigationBarTitleText": "用户协议"
}
},
{ {
"path": "pages/mine/privacy/index", "path": "pages/mine/privacy/index",
"style": { "style": {

View File

@@ -29,6 +29,12 @@
</view> </view>
</wd-form> </wd-form>
</view> </view>
<view class="agreement-text">
登录即同意
<text class="link" clickable @click="goToUserAgreement">用户协议</text>
<text class="link" clickable @click="goToPrivacy">隐私政策</text>
</view>
</view> </view>
</template> </template>
@@ -72,6 +78,16 @@ const handleLogin = () => {
} }
}); });
}; };
const goToUserAgreement = () => {
uni.navigateTo({
url: "/pages/mine/user-agreement/index",
});
};
const goToPrivacy = () => {
uni.navigateTo({
url: "/pages/mine/privacy/index",
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -82,4 +98,18 @@ const handleLogin = () => {
justify-content: center; justify-content: center;
height: calc(100vh - 50px); height: calc(100vh - 50px);
} }
.agreement-text {
position: fixed;
bottom: 30px;
width: 100%;
margin-top: 20px;
font-size: 12px;
color: #666;
text-align: center;
.link {
color: #2979ff;
cursor: pointer;
}
}
</style> </style>

View File

@@ -42,6 +42,9 @@
<wd-cell title="关于我们" icon="setting" clickable @click="goToAbout"> <wd-cell title="关于我们" icon="setting" clickable @click="goToAbout">
<wd-icon name="arrow-right" /> <wd-icon name="arrow-right" />
</wd-cell> </wd-cell>
<wd-cell title="用户协议" icon="setting" clickable @click="goToUserAgreement">
<wd-icon name="arrow-right" />
</wd-cell>
<wd-cell title="隐私政策" icon="setting" clickable @click="goToPrivacy"> <wd-cell title="隐私政策" icon="setting" clickable @click="goToPrivacy">
<wd-icon name="arrow-right" /> <wd-icon name="arrow-right" />
</wd-cell> </wd-cell>
@@ -78,32 +81,40 @@
import { useUserStore } from "@/store/modules/user"; import { useUserStore } from "@/store/modules/user";
const userStore = useUserStore(); const userStore = useUserStore();
const userInfo = computed(() => userStore.userInfo); const userInfo = computed(() => userStore.userInfo);
const isLogin = computed(() => !!userInfo.value); const isLogin = computed(() => !!userInfo.value);
const defaultAvatar = "/static/images/default-avatar.png"; const defaultAvatar = "/static/images/default-avatar.png";
// 登录
const goToLoginPage = () => { const goToLoginPage = () => {
uni.navigateTo({ url: "/pages/login/index" }); uni.navigateTo({ url: "/pages/login/index" });
}; };
// 个人信息
const goToProfile = () => { const goToProfile = () => {
uni.navigateTo({ url: "/pages/mine/profile/index" }); uni.navigateTo({ url: "/pages/mine/profile/index" });
}; };
// 用户协议
const goToUserAgreement = () => {
uni.navigateTo({ url: "/pages/mine/user-agreement/index" });
};
// 隐私政策
const goToPrivacy = () => { const goToPrivacy = () => {
uni.navigateTo({ url: "/pages/mine/privacy/index" }); uni.navigateTo({ url: "/pages/mine/privacy/index" });
}; };
// 网络测试
const goToNetworkTest = () => { const goToNetworkTest = () => {
uni.navigateTo({ url: "/pages/mine/network-test/index" }); uni.navigateTo({ url: "/pages/mine/network-test/index" });
}; };
// 常见问题
const goToFAQ = () => { const goToFAQ = () => {
uni.navigateTo({ url: "/pages/faq/index" }); uni.navigateTo({ url: "/pages/faq/index" });
}; };
// 关于我们
const goToAbout = () => { const goToAbout = () => {
uni.navigateTo({ url: "/pages/mine/about/index" }); uni.navigateTo({ url: "/pages/mine/about/index" });
}; };
// 应用设置
const goToSettings = () => { const goToSettings = () => {
uni.showToast({ uni.showToast({
title: "建设中...", title: "建设中...",
@@ -111,6 +122,7 @@ const goToSettings = () => {
}); });
//uni.navigateTo({ url: "/pages/settings/index" }); //uni.navigateTo({ url: "/pages/settings/index" });
}; };
// 退出登录
const handleLogout = () => { const handleLogout = () => {
userStore.logout().then(() => { userStore.logout().then(() => {
uni.showToast({ title: "已退出登录", icon: "success" }); uni.showToast({ title: "已退出登录", icon: "success" });

View File

@@ -47,6 +47,8 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import request from "@/utils/request";
interface PingResult { interface PingResult {
delay: string | number; delay: string | number;
status: string; status: string;
@@ -140,10 +142,18 @@ const startTest = async () => {
try { try {
const startTime = Date.now(); const startTime = Date.now();
await uni.request({ // #ifdef H5
const res = await uni.request({
url: "/api/v1/auth/captcha", url: "/api/v1/auth/captcha",
timeout: 5000, timeout: 5000,
}); });
// #endif
// #ifndef H5
const resOther = await request({
url: "/api/v1/auth/captcha",
timeout: 5000,
});
// #endif
const endTime = Date.now(); const endTime = Date.now();
const delay = endTime - startTime; const delay = endTime - startTime;

View File

@@ -0,0 +1,98 @@
<template>
<view class="agreement-container">
<view class="agreement-header">
<text class="header-title">用户协议</text>
<text class="header-date">更新日期2024年3月15日</text>
</view>
<view class="agreement-content">
<view v-for="(section, index) in agreementContent" :key="index" class="section">
<text class="section-title">{{ section.title }}</text>
<text class="section-text">{{ section.content }}</text>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
const agreementContent = [
{
title: "1. 协议的范围",
content:
"本协议是您与我们之间关于使用本应用服务所订立的协议。您在使用本应用服务时,须完全接受本协议所有条款。",
},
{
title: "2. 服务内容",
content:
"本应用向您提供以下服务:网络状态检测、网络性能测试以及其他相关服务。我们将持续优化和更新服务内容,为您提供更好的使用体验。",
},
{
title: "3. 用户隐私",
content:
"我们重视用户的隐私保护,收集信息仅用于提供网络测试服务、改善用户体验和必要的系统维护。我们承诺对您的信息进行严格保密。",
},
{
title: "4. 用户行为规范",
content:
"您在使用本服务时必须遵守中华人民共和国相关法律法规。您不得利用本服务从事违法违规活动。如发现违规行为,我们有权终止服务。",
},
{
title: "5. 免责声明",
content:
"由于网络服务的特殊性,本应用不保证服务一定能满足用户的所有要求。对于因网络状态、通信线路等不可控因素导致的服务中断或其他缺陷,本应用不承担任何责任。",
},
{
title: "6. 协议修改",
content:
"我们保留随时修改本协议的权利。协议修改后,如果您继续使用本应用服务,即视为您已接受修改后的协议。我们建议您定期查看本协议以了解任何变更。",
},
];
</script>
<style lang="scss" scoped>
.agreement-container {
min-height: 100vh;
padding: 20px;
background-color: #fff;
}
.agreement-header {
margin-bottom: 30px;
text-align: center;
.header-title {
display: block;
margin-bottom: 10px;
font-size: 22px;
font-weight: 600;
color: #333;
}
.header-date {
font-size: 14px;
color: #999;
}
}
.agreement-content {
.section {
margin-bottom: 25px;
.section-title {
display: block;
margin-bottom: 12px;
font-size: 17px;
font-weight: 500;
color: #333;
}
.section-text {
display: block;
font-size: 15px;
line-height: 1.6;
color: #666;
text-align: justify;
}
}
}
</style>