|
|
|
@ -1,16 +1,22 @@ |
|
|
|
<template> |
|
|
|
<view class="login-prompt" v-if="showPrompt"> |
|
|
|
<view class="mask" :class="{ 'mask-show': showAnimation }" @click="hide"></view> |
|
|
|
<view |
|
|
|
class="mask" |
|
|
|
:class="{ 'mask-show': showAnimation }" |
|
|
|
></view> |
|
|
|
<view class="prompt-content" :class="{ 'slide-up': showAnimation }"> |
|
|
|
<text class="prompt-title">登录以获得更好的体验</text> |
|
|
|
<button class="login-btn" @click="goLogin">登录(推荐)</button> |
|
|
|
<button class="visitor-btn" @click="continueAsVisitor">以访客身份继续</button> |
|
|
|
<button class="login-btn" @click="goLogin">登录</button> |
|
|
|
<button class="visitor-btn" @click="continueAsVisitor"> |
|
|
|
以访客身份继续 |
|
|
|
</button> |
|
|
|
<text class="prompt-title-small">如果您还没有账号,点击注册</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { ref, nextTick } from 'vue'; |
|
|
|
import { ref, nextTick } from "vue"; |
|
|
|
|
|
|
|
// 定义响应式数据 |
|
|
|
const showPrompt = ref(false); |
|
|
|
@ -39,7 +45,7 @@ const hide = () => { |
|
|
|
// 跳转到登录页面 |
|
|
|
const goLogin = () => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/login/login' |
|
|
|
url: "/pages/start/login/login", |
|
|
|
}); |
|
|
|
hide(); |
|
|
|
}; |
|
|
|
@ -47,14 +53,14 @@ const goLogin = () => { |
|
|
|
// 以访客身份继续 |
|
|
|
const continueAsVisitor = () => { |
|
|
|
// 设置访客模式 |
|
|
|
uni.setStorageSync('visitorMode', true); |
|
|
|
uni.setStorageSync("visitorMode", true); |
|
|
|
hide(); |
|
|
|
}; |
|
|
|
|
|
|
|
// 暴露方法给外部使用 |
|
|
|
defineExpose({ |
|
|
|
show, |
|
|
|
hide |
|
|
|
hide, |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -88,10 +94,10 @@ defineExpose({ |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
height: 300rpx; |
|
|
|
height: 400rpx; |
|
|
|
border-radius: 20rpx 20rpx 0 0; |
|
|
|
background-color: white; |
|
|
|
padding: 20rpx 30rpx; |
|
|
|
padding: 20rpx 70rpx; |
|
|
|
transform: translateY(100%); |
|
|
|
transition: transform 0.3s ease; |
|
|
|
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3); |
|
|
|
@ -103,18 +109,18 @@ defineExpose({ |
|
|
|
|
|
|
|
.prompt-title { |
|
|
|
display: block; |
|
|
|
text-align: left; |
|
|
|
font-size: 28rpx; |
|
|
|
text-align: center; |
|
|
|
font-size: 40rpx; |
|
|
|
font-weight: 700; |
|
|
|
color: #333; |
|
|
|
margin-top: 10rpx; |
|
|
|
margin-bottom: 30rpx; |
|
|
|
color: #000000; |
|
|
|
margin-top: 30rpx; |
|
|
|
margin-bottom: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.login-btn { |
|
|
|
width: 100%; |
|
|
|
height: 80rpx; |
|
|
|
background-color:rgb(35, 84, 230); |
|
|
|
background-color: rgb(0, 0, 0); |
|
|
|
color: white; |
|
|
|
font-size: 32rpx; |
|
|
|
line-height: 80rpx; |
|
|
|
@ -131,4 +137,16 @@ defineExpose({ |
|
|
|
line-height: 80rpx; |
|
|
|
border-radius: 40rpx; |
|
|
|
} |
|
|
|
.prompt-title-small { |
|
|
|
display: block; |
|
|
|
text-align: center; |
|
|
|
font-size: 24rpx; |
|
|
|
color: #6a6a6a; |
|
|
|
margin-top: 30rpx; |
|
|
|
margin-bottom: 40rpx; |
|
|
|
line-height: 15.5px; |
|
|
|
letter-spacing: 0.3px; |
|
|
|
font-style: normal; |
|
|
|
font-family: "PingFang SC"; |
|
|
|
} |
|
|
|
</style> |