hldy_app/pages/login/login.vue

470 lines
10 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="backgroundContainer">
<image class="title-img" src="/static/index/superNu.png" />
<view class="input-father">
<view class="add">+86</view>
<view class="shu"></view>
<input style="font-size: 27rpx;" type="number" v-model="form.phone" maxlength="11" placeholder="请输入手机号" />
</view>
<view class="input-father">
<input class="password" password type="text" v-model="form.password" maxlength="15" placeholder="请输入密码" />
</view>
<view class="input-father">
<input class="password" :password="false" v-model="form.imgcode" maxlength="15" placeholder="请输入验证码" />
<image class="input-code" src="@/static/ceshi.png"></image>
</view>
<view class="input-father-gray" v-show="!fullName">
验证并登录
</view>
<view class="input-father-blue" v-show="fullName" @click="login()">
验证并登录
</view>
<view class="under-container-title">
<view :class="isTarget ? 'radio-circle-target' : 'radio-circle'" @click="isTarget = !isTarget"></view>
<view style="margin-left: 17rpx;" class="radio-circle-font" @click="isTarget = !isTarget">我已阅读并同意</view>
<view class="radio-circle-blue" @click="showPopup=true">
《用户协议》
</view>
<view class="radio-circle-blue" @click="showPopup=true">
《隐私政策》
</view>
</view>
</view>
<!-- 弹出层 -->
<view v-if="showPopup" class="popup-wrapper">
<view class="mask"></view>
<view class="box">
<view class="box-title">
服务条款和隐私保护提示
</view>
<view class="font-father">
<view class="">
欢迎使用护理单元app!
</view>
<view style="text-indent: 2em;">
我们将通过<text class="text-blue">《用户协议》</text>和<text
class="text-blue">《隐私政策》</text>,帮助您了解我们为您提供的服务、我们如何处理个人信息以及您享有的权利。我们会严格按照相关法律法规要求,采取各种安全措施来保护您的个人信息。
</view>
<view style="margin: 30rpx 0;">
点击“同意”按钮,表示您已知情并同意以上协议和以下约定。
</view>
</view>
<view class="gray-box-bgc">
<scroll-view style="width: 100%;height: 100%;" scroll-y :show-scrollbar="true">
<view>
1.为了保障软件的安全运行和账户安全我们会申请收集您的设备信息、IP地址WLANMAC地址。
</view>
<view>
2.上传或拍摄图片、视频,需要使用您的媒体影音、图片、视频、音频、相机、麦克风权限。
</view>
<view>
3.我们可能会申请位置权限,用于为您推荐您可能感兴趣的内容。
</view>
</scroll-view>
</view>
<view class="blue-button" @click="closePopup">同意</view>
<view class="white-button" @click="closeapp">不同意</view>
</view>
</view>
<!-- 弹出层 -->
<view v-if="openbottom" class="popup-wrapper">
<view class="mask" @click="openbottom=false"></view>
<view class="box-small">
<view class="box-title" style="margin-top: 30rpx;">
请阅读并同意以下条款
</view>
<view class="font-father">
<text class="text-blue">《用户协议》</text>
<text class="text-blue">《隐私政策》</text>
</view>
<view class="blue-button" @click="closebottom">同意并继续</view>
</view>
</view>
<!-- 弹出层 -->
<view v-if="openchange" class="popup-wrapper">
<view class="mask"></view>
<view class="box-change">
<view class="box-title">
修改账户登录密码
</view>
<view class="input-father">
<input class="password" :password="false" v-model="changeform.oldpassword" maxlength="15"
placeholder="请输入新密码" />
</view>
<view class="input-father">
<input class="password" :password="false" v-model="changeform.newpassword" maxlength="15"
placeholder="请再次输入新密码" />
</view>
<view class="blue-button" style="margin-top: 80rpx;" @click="openchange=false">确定</view>
</view>
</view>
<!-- 自动更新组件 -->
<zy-update ref="zyupgrade" :noticeflag="true" theme="blue" :h5preview="false" oldversion="1.0.0"
:appstoreflag="true" :autocheckupdate="true"></zy-update>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import ZyUpdate from '@/component/zy-upgrade/zy-upgrade.vue'
const zyupgrade = ref(null);
const isTarget = ref(false);
const form = reactive({
phone: "",
password: "",
imgcode: ""
})
const changeform = reactive({
oldpassword: "",
newpassword: "",
})
// 计算属性
const fullName = computed(() => {
return form.password && isLength11(form.phone) && form.imgcode
})
const showPopup = ref(false)
function closebottom() {
openbottom.value = false;
isTarget.value = true;
}
function closePopup() {
showPopup.value = false;
uni.setStorageSync("appWgtVersion", uni.getSystemInfoSync().appWgtVersion)
}
function closeapp() {
plus.runtime.quit()
}
function isLength11(str) {
return typeof str === 'string' && str.length === 11;
}
const jumpTo = (url : string) => {
uni.navigateTo({
url: url
});
}
const openbottom = ref(false);
const openchange = ref(false);
const login = () => {
if (isTarget.value) {
if (form.password == "123456") {
openchange.value = true;
} else {
jumpTo(`/pages/index/index`)
}
} else {
openbottom.value = true;
}
}
// 生命周期钩子
onLoad(() => {
if (uni.getStorageSync('appWgtVersion') != uni.getSystemInfoSync().appWgtVersion) {
showPopup.value = true;
}
});
// 生命周期钩子
onShow(() => {
zyupgrade.value?.check_update()
});
</script>
<style scoped lang="less">
.backgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
background: url("/static/index/lightbgcnew.png") center/cover, rgba(255, 255, 255, 0.6);
background-blend-mode: screen;
background-size: cover;
background-position: center center;
overflow: hidden;
justify-content: center;
align-items: center;
flex-direction: column;
.title-img {
width: 150rpx;
height: 200rpx;
margin-bottom: 130rpx;
}
.input-father {
height: 90rpx;
width: 550rpx;
background-color: #fff;
border-radius: 30rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
position: relative;
.input-code {
position: absolute;
top: 0;
right: 20rpx;
width: 150rpx;
height: 90rpx;
}
}
.input-father-blue {
margin-top: 100rpx;
height: 90rpx;
width: 550rpx;
background: linear-gradient(to right, #00C9FF, #0076FF);
border-radius: 30rpx;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 32rpx;
}
.input-father-gray {
margin-top: 100rpx;
height: 90rpx;
width: 550rpx;
background: rgb(148, 154, 163);
border-radius: 30rpx;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 32rpx;
}
}
.under-container-title {
display: flex;
margin-top: 80rpx;
align-items: center;
font-size: 25rpx;
font-weight: 500;
.radio-circle-blue {
color: #0083FF;
margin-top: 3rpx;
}
.radio-circle-font {
color: #5A607F;
margin-top: 3rpx;
}
.radio-circle {
position: relative;
margin-top: 2rpx;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 2rpx solid #C0C5D9;
background-color: transparent;
}
.radio-circle-target {
position: relative;
margin-top: 2rpx;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 2rpx solid #C0C5D9;
background-color: transparent;
}
.radio-circle-target::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 30rpx;
height: 30rpx;
background-color: #00C9FF;
border-radius: 50%;
}
}
.add {
margin-left: 50rpx;
font-size: 32rpx;
}
.shu {
background-color: #d2d5d7;
width: 2rpx;
height: 35rpx;
margin: 0 20rpx;
}
.password {
font-size: 27rpx;
margin-left: 30rpx;
width: 100%;
}
.popup-wrapper {
position: fixed;
inset: 0;
z-index: 1000;
/* 初始透明度 */
opacity: 0;
/* 播放动画:名称 fadeIn时长 0.5s,缓动函数 ease保持最后状态 */
animation: fadeIn 0.5s ease forwards;
}
/* 定义关键帧 */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.mask {
position: absolute;
inset: 0;
}
.box-small {
position: absolute;
bottom: 20rpx;
left: 50%;
// transform: translate(0, -50%);
transform: translateX(-50%);
width: 800rpx;
height: 350rpx;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 65rpx;
.box-title {
font-size: 35rpx;
margin: 60rpx 0;
}
.font-father {
line-height: 50rpx;
}
.text-blue {
color: #0083FF;
}
}
.box-change {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -60%);
width: 800rpx;
height: 700rpx;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 65rpx;
.box-title {
font-size: 35rpx;
margin: 60rpx 0;
font-weight: 600;
}
.input-father {
height: 90rpx;
width: 550rpx;
background-color: rgb(247, 247, 251);
border-radius: 30rpx;
margin-bottom: 40rpx;
display: flex;
align-items: center;
}
}
.box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 800rpx;
height: 1100rpx;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 65rpx;
.box-title {
font-size: 35rpx;
margin: 60rpx 0;
}
.font-father {
line-height: 50rpx;
}
.text-blue {
color: #0083FF;
}
.gray-box-bgc {
width: 100%;
height: 250rpx;
border: 2rpx solid #CFD5E4;
background-color: #F2F4F7;
color: #777777;
border-radius: 20rpx;
padding: 20rpx 20rpx;
}
}
.blue-button {
width: 100%;
height: 90rpx;
background: linear-gradient(to right, #00C9FF, #0076FF);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin-top: 50rpx;
border-radius: 25rpx;
font-size: 35rpx;
letter-spacing: 5rpx;
}
.white-button {
width: 100%;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10rpx;
border-radius: 25rpx;
font-size: 35rpx;
}
</style>