jsy-app/pages/agreement.vue

275 lines
6.2 KiB
Vue
Raw Permalink Normal View History

2025-02-07 16:16:29 +08:00
<template>
2025-02-11 16:12:04 +08:00
<view class="login-container" v-if="showPop">
2025-02-07 16:16:29 +08:00
<view class="title">
<image :src="appInfo.logo"></image>
<text>{{appInfo.name}}</text>
</view>
2025-02-11 16:12:04 +08:00
<view class="bottom_text">
<view>浙ICP备2023018079号-2A</view>
<view>浙江及时雨智能灌溉设备有限责任公司</view>
</view>
</view>
<view class="login-container" v-else style="background-image: url(../static/images/login/login_bg1.png);">
<view class="title">
<image :src="appInfo.logo"></image>
<text>{{appInfo.name}}</text>
</view>
<view class="login-form-content" >
<image src="/static/images/login/jz.gif" style="width: 120px; height: 120px;margin-top: 50%;" :vertical="true"></image>
<!-- <u-loading-icon size="50" mode="circle" :vertical="true" text="数据恢复中" /> -->
2025-02-07 18:52:47 +08:00
<u-button size="large" text="重新登录" @click="reLoginFun" v-if="reLogin" />
2025-02-07 16:16:29 +08:00
</view>
<view class="bottom_text">
<view>浙ICP备2023018079号-2A</view>
<view>浙江及时雨智能灌溉设备有限责任公司</view>
</view>
</view>
<!-- 协议弹窗 -->
2025-02-11 16:18:09 +08:00
<u-popup mode="center" :show="showPop" :is-mask-click="false">
2025-02-11 10:38:37 +08:00
<view style="background: #f3f3f3;max-width: 70vw;padding: 10px; border-radius: 5px;">
2025-02-11 09:54:57 +08:00
<view style="text-align: center;font-weight: bold;margin-bottom: 10px;">
2025-02-07 16:16:29 +08:00
<text>用户协议和隐私协议</text>
</view>
2025-02-11 10:38:37 +08:00
<view style="line-height: 24px; font-size: 14px; color: #555;">
2025-02-07 16:16:29 +08:00
我们依据相关法律制定了
<text class="text-blue" @click="handleUserAgrement">用户协议</text>
<text class="text-blue" @click="handlePrivacy">隐私协议</text>
,请您在点击同意之前仔细阅读并充分理解相关条款为了便于您理解隐私政策,特向您说明如下:
<br>
1为了向您提供服务,我们需要收集您的设备信息和操作日志;
<br>
2我们会采取业界先进的安全措施保护您的信息安全,未经您同意,我们不会向第三方共享您的信息;
<br>
3您可以对上述信息进行查询更正删除我们也在政策中提供专门的个人信息保护联系方式
<br>
如您同意以上协议内容,请点击"同意"接受并开始使用我们的服务
</view>
2025-02-11 10:38:37 +08:00
<view style=" display: flex;margin-top: 10px;grid-gap: 10px;">
<u-button size="large" text="暂不使用" @click="closeApp" />
<u-button type="success" size="large" text="同意" @click="toLoginFun" />
2025-02-07 16:16:29 +08:00
</view>
</view>
</u-popup>
</template>
<script setup>
import {
ref,
watch,
computed
} from "vue";
import {
onLoad,
onShow,
} from "@dcloudio/uni-app"
import {
getToken
} from '@/utils/auth'
2025-02-07 18:52:47 +08:00
import * as loginJS from '@/utils/login.js'
2025-02-19 18:28:55 +08:00
import plugins from "@/plugins";
2025-02-07 16:16:29 +08:00
import config from '@/config.js'
const appInfo = config.appInfo;
const showPop = ref(false);
2025-02-07 18:52:47 +08:00
const reLogin = ref(false);
2025-02-07 16:16:29 +08:00
onLoad(() => {
2025-02-07 18:52:47 +08:00
loginJS.hasToken().then(res => {
2025-02-11 16:12:04 +08:00
showPop.value = false;
2025-02-07 16:16:29 +08:00
// 登录
2025-02-11 16:18:09 +08:00
loginJS.getInfo().then(() => {
uni.switchTab({
url: '/pages/index',
});
}).catch(error => {
reLogin.value = true;
2025-02-19 18:28:55 +08:00
plugins.modal.msg(error)
2025-02-11 16:18:09 +08:00
})
2025-02-07 16:16:29 +08:00
}).catch(error => {
showPop.value = true;
// #ifdef H5
2025-02-07 18:52:47 +08:00
toLoginFun()
2025-02-07 16:16:29 +08:00
// #endif
})
})
// 暂不使用
function closeApp() {
// #ifdef APP-PLUS
plus.runtime.quit();
// #endif
}
// 同意
2025-02-07 18:52:47 +08:00
function toLoginFun() {
uni.reLaunch({
2025-02-07 16:16:29 +08:00
url: `/pages/login`
});
}
2025-02-07 18:52:47 +08:00
// 重新登录
function reLoginFun() {
loginJS.reLoginHandle();
}
2025-02-07 16:16:29 +08:00
const globalConfig = ref(config);
// 隐私协议
function handlePrivacy() {
let site = globalConfig.value.appInfo.agreements[0];
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
// 用户协议
function handleUserAgrement() {
let site = globalConfig.value.appInfo.agreements[1]
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
</script>
<style lang="scss" scoped>
uni-page-wrapper {
max-height: 100%;
overflow: hidden;
}
page {
background-color: #ffffff;
}
2025-02-11 16:18:09 +08:00
::v-deep .u-popup__content {
background-color: transparent !important;
}
2025-02-07 16:16:29 +08:00
.u-checkbox {
margin: 0;
}
::v-deep .u-checkbox__icon-wrap.u-checkbox__icon-wrap--square {
width: 15px !important;
height: 15px !important;
}
.login-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
background-image: url(../static/images/login/login_bg.png);
background-size: 100% 100%;
background-position: 30% 30%;
background-repeat: no-repeat;
::v-deep .u-tabs__wrapper__nav__item__text {
font-size: 32rpx;
}
.title {
margin: 80px 0 30px;
font-size: 44rpx;
color: #39ac4f;
text-align: center;
image {
width: 120rpx;
height: 120rpx;
margin-bottom: 20px;
}
text {
display: block;
}
}
.login-form-content {
text-align: center;
margin: 10px auto 20px;
width: 80%;
.input-item {
background-color: transparent !important;
border-bottom: 1px solid #39ac4f;
border-image: linear-gradient(to left, transparent, #39ac4f, transparent)1;
margin: 0px auto;
height: 45px;
border-radius: 20px;
.icon {
color: #39ac4f;
font-size: 48rpx;
}
.input {
width: 100%;
font-size: 30rpx;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.login-code {
margin-top: 10px;
display: flex;
justify-content: space-around;
.login-code-button {
width: 96px;
height: 38px;
white-space: nowrap
}
}
.tip-text {
font-size: 28rpx;
color: #c0c4cc;
margin: 10px 0;
width: 100%;
overflow: hidden;
}
.red-tip {
font-size: 28rpx;
color: #ff1e35;
}
.remember-password {
margin-top: 20px;
display: flex;
justify-content: space-between;
.forget-password {
color: #39ac4f;
font-size: 28rpx;
}
}
.login-btn {
margin-top: 40px;
height: 45px;
}
}
.account_agreement {
text-align: left;
margin: 20px 15px;
font-size: 20rpx;
font-weight: bold;
color: red;
}
.bottom_text {
text-align: center;
margin: auto auto 10px auto;
font-size: 20rpx;
color: #000;
}
}
</style>