增加前端格式检查配置
This commit is contained in:
@@ -35,10 +35,30 @@ const form = reactive({
|
||||
avatar_url: '',
|
||||
})
|
||||
const buyerServices = [
|
||||
{ label: '待支付', icon: Coin, tone: 'warning', to: { path: '/orders', query: { tab: 'pending_payment' } } },
|
||||
{ label: '待交接', icon: Van, tone: 'info', to: { path: '/orders', query: { tab: 'pending_handoff' } } },
|
||||
{ label: '使用中', icon: VideoPlay, tone: 'primary', to: { path: '/orders', query: { tab: 'renting' } } },
|
||||
{ label: '已完成', icon: Finished, tone: 'success', to: { path: '/orders', query: { tab: 'completed' } } },
|
||||
{
|
||||
label: '待支付',
|
||||
icon: Coin,
|
||||
tone: 'warning',
|
||||
to: { path: '/orders', query: { tab: 'pending_payment' } },
|
||||
},
|
||||
{
|
||||
label: '待交接',
|
||||
icon: Van,
|
||||
tone: 'info',
|
||||
to: { path: '/orders', query: { tab: 'pending_handoff' } },
|
||||
},
|
||||
{
|
||||
label: '使用中',
|
||||
icon: VideoPlay,
|
||||
tone: 'primary',
|
||||
to: { path: '/orders', query: { tab: 'renting' } },
|
||||
},
|
||||
{
|
||||
label: '已完成',
|
||||
icon: Finished,
|
||||
tone: 'success',
|
||||
to: { path: '/orders', query: { tab: 'completed' } },
|
||||
},
|
||||
]
|
||||
const sellerServices = [
|
||||
{ label: '发布商品', icon: CirclePlus, tone: 'orange', to: '/seller/listings/create' },
|
||||
@@ -146,8 +166,15 @@ function readError(error: unknown, fallback: string) {
|
||||
<h1>个人资料</h1>
|
||||
<p>{{ displayName }} · {{ maskedPhone }}</p>
|
||||
</div>
|
||||
<button class="hero-realname" :class="`is-${realnameTone}`" type="button" @click="router.push('/realname')">
|
||||
<el-icon><CircleCheckFilled v-if="session.realnameStatus === 'verified'" /><WarningFilled v-else /></el-icon>
|
||||
<button
|
||||
class="hero-realname"
|
||||
:class="`is-${realnameTone}`"
|
||||
type="button"
|
||||
@click="router.push('/realname')"
|
||||
>
|
||||
<el-icon
|
||||
><CircleCheckFilled v-if="session.realnameStatus === 'verified'" /><WarningFilled v-else
|
||||
/></el-icon>
|
||||
<span>{{ realnameStatusLabel(session.realnameStatus) }}</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -168,19 +195,35 @@ function readError(error: unknown, fallback: string) {
|
||||
<button class="avatar-preview" type="button" @click="triggerAvatarUpload">
|
||||
<img v-if="form.avatar_url" :src="resolveAvatarURL(form.avatar_url)" alt="" />
|
||||
<span v-else>{{ avatarText }}</span>
|
||||
<i><el-icon><Camera /></el-icon></i>
|
||||
<i
|
||||
><el-icon><Camera /></el-icon
|
||||
></i>
|
||||
</button>
|
||||
<div class="avatar-actions">
|
||||
<strong>{{ form.nickname || displayName }}</strong>
|
||||
<p>支持上传本地图片,也可以直接填写头像 URL。</p>
|
||||
<el-button :icon="Camera" :loading="uploadingAvatar" @click="triggerAvatarUpload">上传头像</el-button>
|
||||
<input ref="avatarFileInput" type="file" accept="image/*" hidden @change="handleAvatarFileChange" />
|
||||
<el-button :icon="Camera" :loading="uploadingAvatar" @click="triggerAvatarUpload"
|
||||
>上传头像</el-button
|
||||
>
|
||||
<input
|
||||
ref="avatarFileInput"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
hidden
|
||||
@change="handleAvatarFileChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form class="profile-form" label-position="top">
|
||||
<el-form-item label="昵称">
|
||||
<el-input v-model="form.nickname" :prefix-icon="User" maxlength="24" placeholder="请输入昵称" size="large" />
|
||||
<el-input
|
||||
v-model="form.nickname"
|
||||
:prefix-icon="User"
|
||||
maxlength="24"
|
||||
placeholder="请输入昵称"
|
||||
size="large"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="头像地址">
|
||||
<el-input
|
||||
@@ -193,7 +236,14 @@ function readError(error: unknown, fallback: string) {
|
||||
</el-form-item>
|
||||
<div class="form-actions">
|
||||
<el-button size="large" :icon="RefreshRight" @click="resetForm">重置</el-button>
|
||||
<el-button type="primary" size="large" :icon="EditPen" :loading="saving" @click="saveProfile">保存资料</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:icon="EditPen"
|
||||
:loading="saving"
|
||||
@click="saveProfile"
|
||||
>保存资料</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</section>
|
||||
@@ -231,7 +281,12 @@ function readError(error: unknown, fallback: string) {
|
||||
</RouterLink>
|
||||
</div>
|
||||
<div class="service-grid buyer-grid">
|
||||
<RouterLink v-for="item in buyerServices" :key="item.label" class="service-item" :to="item.to">
|
||||
<RouterLink
|
||||
v-for="item in buyerServices"
|
||||
:key="item.label"
|
||||
class="service-item"
|
||||
:to="item.to"
|
||||
>
|
||||
<span class="service-icon" :class="`is-${item.tone}`">
|
||||
<el-icon><component :is="item.icon" /></el-icon>
|
||||
</span>
|
||||
@@ -249,7 +304,12 @@ function readError(error: unknown, fallback: string) {
|
||||
</RouterLink>
|
||||
</div>
|
||||
<div class="service-grid seller-grid">
|
||||
<RouterLink v-for="item in sellerServices" :key="item.label" class="service-item" :to="item.to">
|
||||
<RouterLink
|
||||
v-for="item in sellerServices"
|
||||
:key="item.label"
|
||||
class="service-item"
|
||||
:to="item.to"
|
||||
>
|
||||
<span class="service-icon" :class="`is-${item.tone}`">
|
||||
<el-icon><component :is="item.icon" /></el-icon>
|
||||
</span>
|
||||
@@ -275,9 +335,7 @@ function readError(error: unknown, fallback: string) {
|
||||
padding: 30px 34px;
|
||||
border: 1px solid #eef1f5;
|
||||
border-radius: 18px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(255, 106, 0, 0.12), rgba(37, 99, 235, 0.08)),
|
||||
#ffffff;
|
||||
background: linear-gradient(135deg, rgba(255, 106, 0, 0.12), rgba(37, 99, 235, 0.08)), #ffffff;
|
||||
box-shadow: 0 16px 36px rgba(23, 35, 61, 0.08);
|
||||
}
|
||||
|
||||
@@ -486,7 +544,9 @@ function readError(error: unknown, fallback: string) {
|
||||
}
|
||||
|
||||
.profile-form :deep(.el-input__wrapper.is-focus) {
|
||||
box-shadow: 0 0 0 1px #ff6a00 inset, 0 0 0 4px rgba(255, 106, 0, 0.08);
|
||||
box-shadow:
|
||||
0 0 0 1px #ff6a00 inset,
|
||||
0 0 0 4px rgba(255, 106, 0, 0.08);
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
|
||||
Reference in New Issue
Block a user