update: 获取审核状态判断登录;添加语义化页面标签利于搜索引擎抓取页面信息。

This commit is contained in:
mixtan 2025-06-25 21:02:19 +08:00
parent 9d43997444
commit 7909567dc1
3 changed files with 79 additions and 58 deletions

View File

@ -9,6 +9,10 @@
<title>小发同城官网 - 小发旗下本地sass电商品牌,品类多,价格低。精选好货,省心省钱!</title>
</head>
<body>
<h1 style="display: none">
《小发同城》是小发电商官方商家入驻平台的登录入口,提供了一站式的商家开店服务,在这里,商家可以轻松地注册账号、创建店铺、处理订单等。小发官网致力于为广大商家提供高效便捷的电商运营解决方案,助力商家实现商业成功,和小发合作,一起更好。
<a href="https://www.gpxscs.cn/"><img src="https://www.gpxscs.cn/static/png/logo-CuDMhCuX.png" width="156" height="40" alt="小发同城" /></a>
</h1>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

View File

@ -18,9 +18,11 @@
<div class="header_right">
<div class="start">
<el-button plain type="danger" @click="handleOpenStartPage">
<el-button plain type="danger" @click="handleOpenStartPage">
{{
approval_status == -1 || approval_status == 4 || !isLoggedIn ? "立即入驻" : "查看审核状态"
approval_status == -1 || approval_status == 4 || !isLoggedIn
? "立即入驻"
: "查看审核状态"
}}
</el-button>
</div>
@ -38,7 +40,11 @@
<el-button
link
@click="handleUserInfoClick"
:title="approval_status == -1 || approval_status == 4 ? '点击立即入驻' : '点击查看审核详情'"
:title="
approval_status == -1 || approval_status == 4
? '点击立即入驻'
: '点击查看审核详情'
"
>
{{ mobile }}
</el-button>
@ -73,7 +79,7 @@
import { ref, onMounted, watch, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import { useUserStore } from "@/stores/userStore";
import { Menu,Avatar } from "@element-plus/icons-vue";
import { Menu, Avatar } from "@element-plus/icons-vue";
import { getApproval_status } from "@/api/login";
const emits = defineEmits(["open-login-form", "open-register-form"]);
@ -102,22 +108,28 @@ const userStore = useUserStore();
const isLoggedIn = ref(userStore.isLoggedIn);
const approval_status = ref(-1);
const token = ref(userStore.token);
const mobile = ref(userStore.mobilePhone);
const mobile = ref(userStore.mobilePhone);
watch(userStore, (newVal)=>{
token.value = newVal.token
mobile.value = newVal.mobilePhone.replace(/(^\d{3})(\d+)(\d{4})/g, "$1****$3")
watch(userStore, (newVal) => {
token.value = newVal.token;
mobile.value = newVal.mobilePhone.replace(
/(^\d{3})(\d+)(\d{4})/g,
"$1****$3"
);
isLoggedIn.value = !!token.value;
})
});
// token
onMounted(() => {
getApproval_status().then((res) => {
if (res.code === 0 && res.status === 200) {
approval_status.value = res.data.approval_status;
console.log("res.data.approval_status", res.data.approval_status);
}
});
const mobile = localStorage.getItem("mobilePhone");
if (mobile) {
getApproval_status().then((res) => {
if (res.code === 0 && res.status === 200) {
approval_status.value = res.data.approval_status;
console.log("res.data.approval_status", res.data.approval_status);
}
});
}
});
// userStore.isLoggedIn
@ -257,15 +269,15 @@ onUnmounted(() => {
}
}
.icon_avatar{
width: 32px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
background: #eee;
border-radius: 100%;
}
.icon_avatar {
width: 32px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
background: #eee;
border-radius: 100%;
}
.start {
display: flex;
@ -280,7 +292,6 @@ onUnmounted(() => {
align-items: center;
}
.header_right {
display: flex;
justify-content: flex-end;
@ -305,13 +316,13 @@ onUnmounted(() => {
}
.header_right {
gap: 5px;
}
gap: 5px;
}
.header-menu {
display: none;
}
.avatar {
display: none;
}

View File

@ -1,15 +1,21 @@
<template>
<div class="slider">
<div class="slider-container">
<img class="bg" src="@/assets/image/banner.jpg">
<img class="bg" src="@/assets/image/banner.jpg" />
<div class="box">
<div class="text">
<h2>小发同城</h2>
<h3>店铺商家火热招募中</h3>
<p>开店成本低 0元开店</p>
</div>
<div class="text">
<h2>小发同城</h2>
<h3>店铺商家火热招募中</h3>
<p>开店成本低 0元开店</p>
</div>
<div class="sub">
<el-button :icon="Promotion" color="#ffc114" round size="large" @click="openRegisterForm">
<el-button
:icon="Promotion"
color="#ffc114"
round
size="large"
@click="openRegisterForm"
>
免费开店
</el-button>
<el-button :icon="Download" round size="large" @click="downAndroid">
@ -83,7 +89,7 @@
import { useTransition } from "@vueuse/core";
import { ref, onMounted, defineEmits, watch } from "vue";
import { Promotion, Download } from "@element-plus/icons-vue";
import { ElMessage } from 'element-plus'
import { ElMessage } from "element-plus";
import { getApproval_status } from "@/api/login";
import { useRouter } from "vue-router";
@ -114,9 +120,9 @@ const openRegisterForm = () => {
}
};
const downAndroid = ()=>{
ElMessage.error('敬请期待~')
}
const downAndroid = () => {
ElMessage.error("敬请期待~");
};
const businessmanValue = useTransition(businessman, {
duration: 1500,
@ -143,14 +149,17 @@ const formatter2 = (value: number) => {
return `${Math.round(value)}k+`;
};
onMounted(()=>{
getApproval_status().then((res) => {
if (res.code === 0 && res.status === 200) {
approval_status.value = res.data.approval_status;
console.log("res.data.approval_status", res.data.approval_status);
}
});
})
onMounted(() => {
const mobile = localStorage.getItem("mobilePhone");
if (mobile) {
getApproval_status().then((res) => {
if (res.code === 0 && res.status === 200) {
approval_status.value = res.data.approval_status;
console.log("res.data.approval_status", res.data.approval_status);
}
});
}
});
</script>
<style lang="scss" scoped>
@ -171,7 +180,7 @@ onMounted(()=>{
position: relative;
overflow: hidden;
.bg{
.bg {
left: 50%;
object-fit: contain;
position: absolute;
@ -261,36 +270,33 @@ onMounted(()=>{
width: 100%;
}
.text{
.text {
display: none;
color: #fff;
margin-bottom: 20px;
h2{
h2 {
font-size: 55px;
}
h3{
h3 {
font-size: 32px;
margin-top: 10px;
}
p{
p {
font-size: 32px;
margin-bottom: 10px;
}
}
@media (max-width: 768px) {
.text{
.text {
display: block;
}
.bg{
.bg {
display: none;
}
.slider-container {
height: 360px;
background: linear-gradient(180deg, #f85535, #f76c50);