Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e5d01cbf
authored
Mar 09, 2026
by
Lin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 类型优化
1 parent
227ae6e5
Pipeline
#64
for
e5d01cbf
failed
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
51 deletions
apps/web/venus-usedcar/venus-usedcar-h5/src/views/mine/index.vue
apps/web/venus-usedcar/venus-usedcar-h5/src/views/mine/index.vue
View file @
e5d01cb
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
showToast
}
from
"vant"
;
import
{
useUserStore
}
from
"@/stores"
;
import
{
useUserStore
}
from
"@/stores"
;
import
{
showToast
}
from
"vant"
;
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
...
@@ -65,25 +65,35 @@ async function onLogout() {
...
@@ -65,25 +65,35 @@ async function onLogout() {
<div
class=
"mine-header"
>
<div
class=
"mine-header"
>
<div
class=
"header-bg"
/>
<div
class=
"header-bg"
/>
<div
class=
"user-info"
>
<div
class=
"user-info"
>
<van-image
<van-image
class=
"avatar"
:src=
"userStore.userInfo?.avatar || ''"
fit=
"cover"
width=
"64"
height=
"64"
height=
"64"
round
round
fit=
"cover"
:src=
"userStore.userInfo?.avatar || ''"
class=
"avatar"
width=
"64"
>
>
<template
#
error
>
<template
#
error
>
<van-icon
name=
"contact"
size=
"36"
color=
"#fff"
/>
<van-icon
color=
"#fff"
name=
"contact"
size=
"36"
/>
</
template
>
</
template
>
</van-image>
</van-image>
<div
v-if=
"userStore.isLoggedIn"
class=
"user-detail"
>
<div
v-if=
"userStore.isLoggedIn"
class=
"user-detail"
>
<p
class=
"username"
>
{{ userStore.username }}
</p>
<p
class=
"username"
>
<p
class=
"phone"
>
{{ userStore.userInfo?.phone }}
</p>
{{ userStore.username }}
</p>
<p
class=
"phone"
>
{{ userStore.userInfo?.phone }}
</p>
</div>
</div>
<div
v-else
class=
"user-login"
@
click=
"onLogin"
>
<div
v-else
<p
class=
"login-text"
>
点击登录
</p>
class=
"user-login"
<p
class=
"login-tip"
>
登录后享受更多服务
</p>
@
click=
"onLogin"
>
<p
class=
"login-text"
>
点击登录
</p>
<p
class=
"login-tip"
>
登录后享受更多服务
</p>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -91,60 +101,82 @@ async function onLogout() {
...
@@ -91,60 +101,82 @@ async function onLogout() {
<!-- 数据统计 -->
<!-- 数据统计 -->
<div
class=
"mine-stats card"
>
<div
class=
"mine-stats card"
>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-value"
>
0
</div>
<div
class=
"stat-value"
>
<div
class=
"stat-label"
>
收藏
</div>
0
</div>
<div
class=
"stat-label"
>
收藏
</div>
</div>
</div>
<div
class=
"stat-divider"
/>
<div
class=
"stat-divider"
/>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-value"
>
0
</div>
<div
class=
"stat-value"
>
<div
class=
"stat-label"
>
浏览
</div>
0
</div>
<div
class=
"stat-label"
>
浏览
</div>
</div>
</div>
<div
class=
"stat-divider"
/>
<div
class=
"stat-divider"
/>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-item"
@
click=
"showToast('功能开发中')"
>
<div
class=
"stat-value"
>
0
</div>
<div
class=
"stat-value"
>
<div
class=
"stat-label"
>
询价
</div>
0
</div>
<div
class=
"stat-label"
>
询价
</div>
</div>
</div>
</div>
</div>
<!-- 功能菜单 -->
<!-- 功能菜单 -->
<van-cell-group
class=
"mine-menu"
inset
>
<van-cell-group
class=
"mine-menu"
inset
>
<van-cell
<van-cell
v-for=
"item in menuList"
v-for=
"item in menuList"
:key=
"item.title"
:key=
"item.title"
:title=
"item.title"
is-link
center
center
@
click=
"item.action"
is-link
>
:title=
"item.title"
@
click=
"item.action"
>
<
template
#
icon
>
<
template
#
icon
>
<van-icon
:name=
"item.icon"
:color=
"item.iconColor"
size=
"20"
class=
"menu-icon"
/>
<van-icon
class=
"menu-icon"
:color=
"item.iconColor"
:name=
"item.icon"
size=
"20"
/>
</
template
>
</
template
>
</van-cell>
</van-cell>
</van-cell-group>
</van-cell-group>
<!-- 设置项 -->
<!-- 设置项 -->
<van-cell-group
class=
"mine-settings"
inset
>
<van-cell-group
class=
"mine-settings"
inset
>
<van-cell
<van-cell
v-for=
"item in settingList"
v-for=
"item in settingList"
:key=
"item.title"
:key=
"item.title"
:title=
"item.title"
is-link
center
center
@
click=
"item.action"
is-link
>
:title=
"item.title"
@
click=
"item.action"
>
<
template
#
icon
>
<
template
#
icon
>
<van-icon
:name=
"item.icon"
color=
"#969799"
size=
"20"
class=
"menu-icon"
/>
<van-icon
class=
"menu-icon"
color=
"#969799"
:name=
"item.icon"
size=
"20"
/>
</
template
>
</
template
>
</van-cell>
</van-cell>
</van-cell-group>
</van-cell-group>
<!-- 退出登录 -->
<!-- 退出登录 -->
<div
v-if=
"userStore.isLoggedIn"
class=
"logout-btn"
>
<div
v-if=
"userStore.isLoggedIn"
class=
"logout-btn"
>
<van-button
block
round
plain
color=
"#ee0a24"
@
click=
"onLogout"
>
退出登录
</van-button>
<van-button
block
color=
"#ee0a24"
plain
round
@
click=
"onLogout"
>
退出登录
</van-button>
</div>
</div>
<!-- 版本号 -->
<!-- 版本号 -->
<div
class=
"app-version"
>
当前版本 v{{ __APP_VERSION__ ?? '1.0.0' }}
</div>
<div
class=
"app-version"
>
当前版本 v{{ __APP_VERSION__ ?? '1.0.0' }}
</div>
</div>
</div>
</template>
</template>
...
@@ -156,8 +188,8 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -156,8 +188,8 @@ const __APP_VERSION__ = "1.0.0";
@use
"@/assets/styles/variables"
as
*
;
@use
"@/assets/styles/variables"
as
*
;
.mine-page
{
.mine-page
{
background-color
:
var
(
--color-bg-page
);
min-height
:
100vh
;
min-height
:
100vh
;
background-color
:
var
(
--color-bg-page
);
}
}
.mine-header
{
.mine-header
{
...
@@ -167,8 +199,8 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -167,8 +199,8 @@ const __APP_VERSION__ = "1.0.0";
.header-bg
{
.header-bg
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
left
:
0
;
height
:
120px
;
height
:
120px
;
background
:
linear-gradient
(
135deg
,
#ee0a24
0%
,
#ff5a5a
100%
);
background
:
linear-gradient
(
135deg
,
#ee0a24
0%
,
#ff5a5a
100%
);
border-radius
:
0
0
24px
24px
;
border-radius
:
0
0
24px
24px
;
...
@@ -176,34 +208,34 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -176,34 +208,34 @@ const __APP_VERSION__ = "1.0.0";
.user-info
{
.user-info
{
position
:
relative
;
position
:
relative
;
z-index
:
1
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
gap
:
14px
;
gap
:
14px
;
align-items
:
center
;
padding
:
40px
20px
20px
;
padding
:
40px
20px
20px
;
z-index
:
1
;
}
}
.avatar
{
.avatar
{
flex-shrink
:
0
;
border
:
3px
solid
rgba
(
255
,
255
,
255
,
0.6
);
border-radius
:
50%
;
background-color
:
rgba
(
255
,
255
,
255
,
0.2
);
display
:
flex
;
display
:
flex
;
flex-shrink
:
0
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
background-color
:
rgb
(
255
255
255
/
20%
);
border
:
3px
solid
rgb
(
255
255
255
/
60%
);
border-radius
:
50%
;
}
}
.user-detail
{
.user-detail
{
.username
{
.username
{
margin-bottom
:
4px
;
font-size
:
$
font-size-lg
;
font-size
:
$
font-size-lg
;
font-weight
:
700
;
font-weight
:
700
;
color
:
#fff
;
color
:
#fff
;
margin-bottom
:
4px
;
}
}
.phone
{
.phone
{
font-size
:
$
font-size-sm
;
font-size
:
$
font-size-sm
;
color
:
rgba
(
255
,
255
,
255
,
0.8
);
color
:
rgb
(
255
255
255
/
80%
);
}
}
}
}
...
@@ -211,15 +243,15 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -211,15 +243,15 @@ const __APP_VERSION__ = "1.0.0";
cursor
:
pointer
;
cursor
:
pointer
;
.login-text
{
.login-text
{
margin-bottom
:
4px
;
font-size
:
$
font-size-lg
;
font-size
:
$
font-size-lg
;
font-weight
:
700
;
font-weight
:
700
;
color
:
#fff
;
color
:
#fff
;
margin-bottom
:
4px
;
}
}
.login-tip
{
.login-tip
{
font-size
:
$
font-size-sm
;
font-size
:
$
font-size-sm
;
color
:
rgba
(
255
,
255
,
255
,
0.8
);
color
:
rgb
(
255
255
255
/
80%
);
}
}
}
}
}
}
...
@@ -227,8 +259,8 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -227,8 +259,8 @@ const __APP_VERSION__ = "1.0.0";
.mine-stats
{
.mine-stats
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin
:
0
12px
12px
;
padding
:
16px
0
;
padding
:
16px
0
;
margin
:
0
12px
12px
;
border-radius
:
$
radius-base
;
border-radius
:
$
radius-base
;
.stat-item
{
.stat-item
{
...
@@ -237,10 +269,10 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -237,10 +269,10 @@ const __APP_VERSION__ = "1.0.0";
cursor
:
pointer
;
cursor
:
pointer
;
.stat-value
{
.stat-value
{
margin-bottom
:
4px
;
font-size
:
$
font-size-xl
;
font-size
:
$
font-size-xl
;
font-weight
:
700
;
font-weight
:
700
;
color
:
$
color-text-primary
;
color
:
$
color-text-primary
;
margin-bottom
:
4px
;
}
}
.stat-label
{
.stat-label
{
...
@@ -271,9 +303,9 @@ const __APP_VERSION__ = "1.0.0";
...
@@ -271,9 +303,9 @@ const __APP_VERSION__ = "1.0.0";
}
}
.app-version
{
.app-version
{
text-align
:
center
;
padding-bottom
:
8px
;
font-size
:
$
font-size-xs
;
font-size
:
$
font-size-xs
;
color
:
$
color-text-disabled
;
color
:
$
color-text-disabled
;
padding-bottom
:
8px
;
text-align
:
center
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment