v1.1
This commit is contained in:
1 parent
7328396f0b
commit
1f289a73f9
17 files changed
+1412
-239
No files matched your search
+79
-95
@@ -21,88 +21,64 @@
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M4 16h16M6 16V9l2-3h8l2 3v7M8 16v2m8-2v2M8 11h8" />
|
||||
</svg>
|
||||
<input
|
||||
id="license-plate"
|
||||
v-model.trim="plateNumber"
|
||||
type="text"
|
||||
placeholder="请输入车牌号,如:粤B12345"
|
||||
maxlength="8"
|
||||
autocomplete="off"
|
||||
required
|
||||
/>
|
||||
<input id="license-plate" v-model.trim="plateNumber" type="text" placeholder="请输入车牌号,如:粤B12345"
|
||||
maxlength="8" autocomplete="off" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-item">
|
||||
<label for="status">车辆状态</label>
|
||||
<p class="field-tip">设置车辆当前服务状态</p>
|
||||
<div class="input-wrap">
|
||||
<select id="status" v-model="status">
|
||||
<option value="正常">正常</option>
|
||||
<option value="维修中">维修中</option>
|
||||
<option value="停用">停用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-item">
|
||||
<label for="car-model">车型</label>
|
||||
<p class="field-tip">填写车辆品牌和具体车型</p>
|
||||
<div class="input-wrap">
|
||||
<input
|
||||
id="car-model"
|
||||
v-model.trim="carModel"
|
||||
type="text"
|
||||
placeholder="如:宝马 3系 2022款 325Li"
|
||||
maxlength="50"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label for="car-color">车辆颜色</label>
|
||||
<p class="field-tip">填写车辆外观颜色</p>
|
||||
<div class="input-wrap">
|
||||
<input
|
||||
id="car-color"
|
||||
v-model.trim="carColor"
|
||||
type="text"
|
||||
placeholder="如:星光棕"
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label for="purchase-year">购车年份</label>
|
||||
<p class="field-tip">填写车辆购买年份</p>
|
||||
<div class="input-wrap">
|
||||
<input
|
||||
id="purchase-year"
|
||||
v-model.number="purchaseYear"
|
||||
type="number"
|
||||
min="1900"
|
||||
:max="new Date().getFullYear()"
|
||||
placeholder="如:2022"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label for="role">账号角色</label>
|
||||
<p class="field-tip">设置用户可使用的权限</p>
|
||||
<div class="input-wrap">
|
||||
<select id="role" v-model="role">
|
||||
<option value="user">普通用户</option>
|
||||
<option value="admin">管理员</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<label for="status">车辆状态</label>
|
||||
<p class="field-tip">设置车辆当前服务状态</p>
|
||||
<div class="input-wrap">
|
||||
<select id="status" v-model="status">
|
||||
<option value="正常">正常</option>
|
||||
<option value="维修中">维修中</option>
|
||||
<option value="停用">停用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-item">
|
||||
<label for="car-model">车型</label>
|
||||
<p class="field-tip">填写车辆品牌和具体车型</p>
|
||||
<div class="input-wrap">
|
||||
<input id="car-model" v-model.trim="carModel" type="text" placeholder="如:宝马 3系 2022款 325Li"
|
||||
maxlength="50" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label for="car-color">车辆颜色</label>
|
||||
<p class="field-tip">填写车辆外观颜色</p>
|
||||
<div class="input-wrap">
|
||||
<input id="car-color" v-model.trim="carColor" type="text" placeholder="如:星光棕" maxlength="20" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-item">
|
||||
<label for="purchase-year">购车年份</label>
|
||||
<p class="field-tip">填写车辆购买年份</p>
|
||||
<div class="input-wrap">
|
||||
<input id="purchase-year" v-model.number="purchaseYear" type="number" min="1900"
|
||||
:max="new Date().getFullYear()" placeholder="如:2022" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label for="role">账号角色</label>
|
||||
<p class="field-tip">设置用户可使用的权限</p>
|
||||
<div class="input-wrap">
|
||||
<select id="role" v-model="role">
|
||||
<option value="user">普通用户</option>
|
||||
<option value="admin">管理员</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-item">
|
||||
<label>初始密码</label>
|
||||
<p class="field-tip">系统统一使用默认密码,用户登录后可自行修改</p>
|
||||
@@ -137,16 +113,19 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import apiClient from '../../apiClient/apiClient';
|
||||
import { showPopup } from '../../components/popupService';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const DEFAULT_PASSWORD = '000000'
|
||||
const plateNumber = ref('')
|
||||
const status = ref('正常')
|
||||
const role = ref('')
|
||||
const role = ref('user')
|
||||
const carModel = ref('')
|
||||
const carColor = ref('')
|
||||
const purchaseYear = ref('')
|
||||
const message = ref('')
|
||||
const submitted = ref(false)
|
||||
const router = useRouter()
|
||||
|
||||
async function handleSubmit() {
|
||||
submitted.value = false
|
||||
@@ -170,14 +149,28 @@ async function handleSubmit() {
|
||||
// 后续接入接口时,将 userPayload 作为新增用户请求参数提交。
|
||||
console.log('新增用户参数', userPayload)
|
||||
const response = await apiClient.post('/addUser', userPayload)
|
||||
if (response.status == 201) {
|
||||
if (response.status == 202) {
|
||||
message.value = '添加用户失败,请稍后重试'
|
||||
showPopup('添加用户失败,请稍后重试', 'error')
|
||||
return
|
||||
}else if (response.status == 200) {
|
||||
} else if (response.status == 200) {
|
||||
message.value = `用户 ${plateNumber.value} 添加成功,初始密码为 ${DEFAULT_PASSWORD}`
|
||||
submitted.value = true
|
||||
showPopup(`用户 ${plateNumber.value} 添加成功,初始密码为 ${DEFAULT_PASSWORD}`, 'success')
|
||||
router.push({
|
||||
path: '/adminusers',
|
||||
query: { plateNumber: plateNumber.value },
|
||||
})
|
||||
} else if (response.status == 201) {
|
||||
message.value = '用户已存在,请勿重复添加'
|
||||
showPopup('用户已存在,请勿重复添加', 'warning')
|
||||
router.push({
|
||||
path: '/adminusers',
|
||||
query: { plateNumber: plateNumber.value },
|
||||
})
|
||||
} else {
|
||||
message.value = '添加用户失败,请稍后重试'
|
||||
showPopup('添加用户失败,请稍后重试', 'error')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +204,7 @@ function resetForm() {
|
||||
|
||||
.add-user-card {
|
||||
width: 100%;
|
||||
max-width: 620px;
|
||||
max-width: 860px;
|
||||
padding: 32px 36px 24px;
|
||||
background: #fff;
|
||||
border: 1px solid #e8edf5;
|
||||
@@ -263,12 +256,14 @@ h1 {
|
||||
|
||||
.user-form {
|
||||
padding-top: 27px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.user-form > .form-item + .form-item,
|
||||
.user-form > .form-item + .form-row,
|
||||
.user-form > .form-row + .form-item,
|
||||
.user-form > .form-row + .form-row {
|
||||
.user-form>.form-item+.form-item,
|
||||
.user-form>.form-item+.form-row,
|
||||
.user-form>.form-row+.form-item,
|
||||
.user-form>.form-row+.form-row {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
@@ -277,9 +272,6 @@ h1 {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.form-row .form-item {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-item label {
|
||||
display: block;
|
||||
@@ -439,7 +431,7 @@ h1 {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media (max-width: 760px) {
|
||||
.add-user-page {
|
||||
min-height: calc(100vh - 116px);
|
||||
padding: 24px 14px;
|
||||
@@ -454,14 +446,6 @@ h1 {
|
||||
padding-bottom: 21px;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.form-row .form-item + .form-item {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
gap: 9px;
|
||||
}
|
||||
|
||||
+180
-14
@@ -26,7 +26,7 @@
|
||||
<p>用户账号:{{ user.username }}</p>
|
||||
<p>最近更新:{{ user.updatedAt }}</p>
|
||||
</div>
|
||||
<button class="delete-button" type="button" @click="handleDelete">删除用户</button>
|
||||
<button class="delete-button" type="button" @click="handleDelete(user.plateNumber)">删除用户</button>
|
||||
</section>
|
||||
|
||||
<div class="detail-grid">
|
||||
@@ -84,6 +84,10 @@
|
||||
<dt>下次建议日期</dt>
|
||||
<dd class="highlight">{{ user.nextOilDate || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>下次建议公里数</dt>
|
||||
<dd class="highlight">{{ user.nextOilKilometers || '未记录' }}公里</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<button type="button" class="oil-button" @click="showOilFormFuntion">
|
||||
{{ showOilForm ? '取消更新' : '添加 / 更新机油' }}
|
||||
@@ -92,8 +96,13 @@
|
||||
<label>机油类型<input v-model.trim="oilForm.type" type="text" placeholder="如:全合成 0W-30" /></label>
|
||||
<label>持续时间<input v-model.number="oilForm.duration" type="number" min="1"
|
||||
placeholder="请输入持续月数/月" /></label>
|
||||
|
||||
<label>当前公里数<input v-model="oilForm.nowKilometers" type="number" min="0"
|
||||
placeholder="请输入当前公里数/公里" /></label>
|
||||
<label>建议公里数<input v-model.number="oilForm.kilometers" type="number" min="1"
|
||||
placeholder="请输入公里数/公里" /></label>
|
||||
<label>机油价格<input v-model.number="oilForm.price" type="number" min="0"
|
||||
placeholder="请输入机油价格/元" /></label>
|
||||
<button type="button" class="save-field-button" @click="saveOil">保存机油信息</button>
|
||||
</div>
|
||||
</section>
|
||||
@@ -115,7 +124,8 @@
|
||||
<button type="button" class="add-record-button" @click="showRepairForm = true">添加维修记录</button>
|
||||
</div>
|
||||
<div class="repair-list">
|
||||
<article v-if="repairRecords.length > 0" v-for="record in repairRecords" :key="record.id" class="repair-item">
|
||||
<article v-if="repairRecords.length > 0" v-for="record in repairRecords" :key="record.id"
|
||||
class="repair-item">
|
||||
<time>{{ record.date }}</time>
|
||||
<div class="timeline-dot"></div>
|
||||
<div class="repair-content">
|
||||
@@ -123,6 +133,7 @@
|
||||
<p>{{ record.description }}</p>
|
||||
</div>
|
||||
<span class="repair-price">{{ record.price }}</span>
|
||||
<button type="button" class="view-record-button" @click="openRepairDetail(record)">查看</button>
|
||||
</article>
|
||||
<p v-else>暂无维修记录</p>
|
||||
</div>
|
||||
@@ -141,6 +152,32 @@
|
||||
<button class="submit-record-button" type="submit">保存记录</button>
|
||||
</form>
|
||||
</div>
|
||||
<div v-if="showRepairDetail && selectedRepairRecord" class="modal-mask" @click.self="closeRepairDetail">
|
||||
<section class="repair-form repair-detail-form" aria-labelledby="repair-detail-title">
|
||||
<div class="modal-header">
|
||||
<h2 id="repair-detail-title">维修记录详情</h2>
|
||||
<button type="button" aria-label="关闭详情" @click="closeRepairDetail">×</button>
|
||||
</div>
|
||||
<dl class="repair-detail-list">
|
||||
<div>
|
||||
<dt>维修项目</dt>
|
||||
<dd>{{ selectedRepairRecord.title || '未填写' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>维修日期</dt>
|
||||
<dd>{{ selectedRepairRecord.date || '未填写' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>维修金额</dt>
|
||||
<dd>{{ selectedRepairRecord.price || '未填写' }}</dd>
|
||||
</div>
|
||||
<div class="description-row">
|
||||
<dt>维修描述</dt>
|
||||
<dd>{{ selectedRepairRecord.description || '未填写' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -148,6 +185,7 @@
|
||||
import { onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import apiClient from '../../apiClient/apiClient'
|
||||
import { showPopup } from '../../components/popupService'
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
@@ -158,8 +196,8 @@ const user = reactive({
|
||||
id: 1,
|
||||
plateNumber: String(route.query.plate || '粤B12345'),
|
||||
status: '正常',
|
||||
carModel: '宝马 3系 2022款 325Li',
|
||||
carColor: '星光棕',
|
||||
carModel: '未知车型',
|
||||
carColor: '未知颜色',
|
||||
purchaseYear: '2022',
|
||||
oilChangedAt: '2024-05-18',
|
||||
oilType: '全合成 0W-30',
|
||||
@@ -167,6 +205,7 @@ const user = reactive({
|
||||
oilDuration: 6,
|
||||
nextOilDate: '2024-11-18',
|
||||
updatedAt: '今天 10:28',
|
||||
nextOilKilometers: 0,
|
||||
})
|
||||
|
||||
const vehicleFields = [
|
||||
@@ -178,8 +217,10 @@ const vehicleFields = [
|
||||
const editingField = ref('')
|
||||
const editValue = ref('')
|
||||
const showOilForm = ref(false)
|
||||
const oilForm = reactive({ type: '', duration: null, kilometers: null })
|
||||
const oilForm = reactive({ type: '', duration: null, kilometers: null,nowKilometers: null ,price: null})
|
||||
const showRepairForm = ref(false)
|
||||
const showRepairDetail = ref(false)
|
||||
const selectedRepairRecord = ref(null)
|
||||
const repairForm = reactive({ title: '', date: '', description: '', price: '' })
|
||||
|
||||
const repairRecords = reactive([
|
||||
@@ -191,6 +232,16 @@ function showOilFormFuntion() {
|
||||
showOilForm.value = !showOilForm.value
|
||||
}
|
||||
|
||||
function openRepairDetail(record) {
|
||||
selectedRepairRecord.value = record
|
||||
showRepairDetail.value = true
|
||||
}
|
||||
|
||||
function closeRepairDetail() {
|
||||
showRepairDetail.value = false
|
||||
selectedRepairRecord.value = null
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
if (window.history.length > 1) {
|
||||
router.back()
|
||||
@@ -199,7 +250,22 @@ function goBack() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete() { }
|
||||
function handleDelete(plateNumber) {
|
||||
// 实现删除用户逻辑
|
||||
apiClient.delete(`/deleteUser`, { params: { plateNumber } })
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
showPopup(`用户 ${plateNumber} 删除成功`, 'success')
|
||||
router.push('/search')
|
||||
} else {
|
||||
showPopup(`删除用户 ${plateNumber} 失败,请稍后重试`, 'error')
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('删除用户失败', error)
|
||||
showPopup(`删除用户 ${plateNumber} 失败,请稍后重试`, 'error')
|
||||
})
|
||||
}
|
||||
|
||||
function startEdit(field) {
|
||||
editingField.value = field
|
||||
@@ -219,6 +285,7 @@ async function saveOil() {
|
||||
const response = await apiClient.put(`/updateUserOil`, oilForm, { params: { id: user.id } })
|
||||
if (response.status === 200) {
|
||||
await getUserData(user.plateNumber)
|
||||
showPopup('机油信息已更新', 'success')
|
||||
} else {
|
||||
console.error('保存机油信息失败', response)
|
||||
}
|
||||
@@ -241,6 +308,7 @@ async function saveRepairRecord() {
|
||||
// 所有用户详情修改统一从这里提交给后端。
|
||||
async function updateUserData(user) {
|
||||
await apiClient.put(`/updateUser`, user)
|
||||
showPopup(`用户 ${user.plateNumber} 信息已更新`, 'success')
|
||||
}
|
||||
|
||||
function closeEditing(event) {
|
||||
@@ -269,6 +337,7 @@ async function getUserData(plateNumber) {
|
||||
user.oilCycle = response.data.oilCycle
|
||||
user.updatedAt = response.data.updatedAt
|
||||
user.nextOilDate = response.data.nextOilDate
|
||||
user.nextOilKilometers = response.data.nextOilMileage
|
||||
const secondResponse = await apiClient.get(`/getRepairRecords`, { params: { userId: user.id } })
|
||||
//repairRecords.splice(0, repairRecords.length, ...secondResponse.data)
|
||||
Object.assign(repairRecords, secondResponse.data)
|
||||
@@ -280,7 +349,6 @@ async function getUserData(plateNumber) {
|
||||
onMounted(async () => {
|
||||
document.addEventListener('click', closeEditing)
|
||||
const plateNumber = route.query.plateNumber
|
||||
console.log('route.query.plateNumber:', plateNumber)
|
||||
if (plateNumber) {
|
||||
await getUserData(plateNumber)
|
||||
}
|
||||
@@ -713,6 +781,51 @@ h1 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.repair-detail-form {
|
||||
max-width: 430px;
|
||||
}
|
||||
|
||||
.repair-detail-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.repair-detail-list div {
|
||||
display: flex;
|
||||
padding: 12px 0;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
border-bottom: 1px solid #edf0f5;
|
||||
}
|
||||
|
||||
.repair-detail-list div:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.repair-detail-list dt {
|
||||
color: #8d98aa;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.repair-detail-list dd {
|
||||
margin: 0;
|
||||
color: #354158;
|
||||
font-size: 13px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.repair-detail-list .description-row {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.repair-detail-list .description-row dd {
|
||||
width: 100%;
|
||||
color: #66748a;
|
||||
line-height: 1.7;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.record-count {
|
||||
margin-left: auto;
|
||||
padding: 5px 8px;
|
||||
@@ -724,17 +837,24 @@ h1 {
|
||||
|
||||
.repair-item {
|
||||
display: flex;
|
||||
min-height: 66px;
|
||||
padding: 16px 0 0;
|
||||
align-items: flex-start;
|
||||
min-height: 78px;
|
||||
padding: 16px 0;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
border-bottom: 1px solid #edf0f5;
|
||||
}
|
||||
|
||||
.repair-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.repair-item time {
|
||||
width: 75px;
|
||||
width: 78px;
|
||||
flex: 0 0 78px;
|
||||
padding-top: 2px;
|
||||
color: #8d98aa;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.timeline-dot {
|
||||
@@ -748,24 +868,58 @@ h1 {
|
||||
}
|
||||
|
||||
.repair-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.repair-content strong {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
color: #3c4a62;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.repair-content p {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
margin: 5px 0 0;
|
||||
color: #9aa4b3;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.repair-price {
|
||||
width: 52px;
|
||||
flex: 0 0 52px;
|
||||
color: #354158;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.view-record-button {
|
||||
flex: 0 0 auto;
|
||||
width: 42px;
|
||||
padding: 4px 8px;
|
||||
color: #1769e1;
|
||||
background: #f1f6ff;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: 10px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.view-record-button:hover {
|
||||
background: #dceaff;
|
||||
}
|
||||
|
||||
.repair-list>p {
|
||||
@@ -779,7 +933,7 @@ h1 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media (max-width: 760px) {
|
||||
.user-detail-page {
|
||||
min-height: calc(100vh - 116px);
|
||||
padding: 24px 14px 40px;
|
||||
@@ -825,14 +979,26 @@ h1 {
|
||||
}
|
||||
|
||||
.repair-item time {
|
||||
width: 68px;
|
||||
width: 62px;
|
||||
flex-basis: 62px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.repair-price {
|
||||
width: 42px;
|
||||
flex-basis: 42px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.repair-item {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.view-record-button {
|
||||
width: 38px;
|
||||
padding: 4px 5px;
|
||||
}
|
||||
|
||||
.repair-heading {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
+78
-70
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<!-- <div class="decor decor-one"></div> -->
|
||||
<!-- <div class="decor decor-two"></div> -->
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<section class="form-panel">
|
||||
@@ -45,7 +45,8 @@
|
||||
<rect x="3" y="7" width="18" height="10" rx="2" />
|
||||
<path d="M6 10h12M6 13h2m2 0h2m2 0h2m2 0h2" />
|
||||
</svg>
|
||||
<input v-model="formData.plateNumber" id="phone" type="tel" placeholder="请输入您的车牌号" autocomplete="username" />
|
||||
<input v-model="formData.plateNumber" id="phone" type="tel" placeholder="请输入您的车牌号"
|
||||
autocomplete="username" />
|
||||
</div>
|
||||
<div class="password-label"><label for="password">登录密码</label><a href="#">忘记密码?</a></div>
|
||||
<div class="input-wrap">
|
||||
@@ -53,15 +54,18 @@
|
||||
<rect x="5" y="10" width="14" height="10" rx="2" />
|
||||
<path d="M8 10V7a4 4 0 0 1 8 0v3" />
|
||||
</svg>
|
||||
<input v-model="formData.password" id="password" type="password" placeholder="请输入登录密码" autocomplete="current-password" />
|
||||
<input v-model="formData.password" id="password" type="password" placeholder="请输入登录密码"
|
||||
autocomplete="current-password" />
|
||||
<button type="button" class="password-toggle" aria-label="显示密码"><svg viewBox="0 0 24 24"
|
||||
aria-hidden="true">
|
||||
<path d="M3 12s3.2-5 9-5 9 5 9 5-3.2 5-9 5-9-5-9-5Z" />
|
||||
<circle cx="12" cy="12" r="2" />
|
||||
</svg></button>
|
||||
</div>
|
||||
<label class="remember"><input v-model="formData.remember" type="checkbox" /><span>记住我</span></label>
|
||||
<button :disabled="loading" type="submit" class="login-button">{{ loading ? '登录中...' : '登录' }}</button>
|
||||
<label class="remember"><input v-model="formData.remember"
|
||||
type="checkbox" /><span>记住我</span></label>
|
||||
<button :disabled="loading" type="submit" class="login-button">{{ loading ? '登录中...' : '登录'
|
||||
}}</button>
|
||||
</form>
|
||||
<p class="register-tip">还没有账号?<a href="#">立即注册</a></p>
|
||||
<div class="agreement"><span class="agreement-line"></span><span>登录即表示您同意</span><a
|
||||
@@ -74,75 +78,79 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import apiClient from '../../apiClient/apiClient';
|
||||
import { useUserInfoStore } from '../../stores/UserInfo';
|
||||
import { onMounted } from 'vue';
|
||||
const userStore = useUserInfoStore();
|
||||
const router = useRouter();
|
||||
const formData = ref({
|
||||
plateNumber: '',
|
||||
password: '',
|
||||
remember: false
|
||||
});
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import apiClient from '../../apiClient/apiClient';
|
||||
import { useUserInfoStore } from '../../stores/UserInfo';
|
||||
import { onMounted } from 'vue';
|
||||
import { showPopup } from '../../components/popupService';
|
||||
const userStore = useUserInfoStore();
|
||||
const router = useRouter();
|
||||
const formData = ref({
|
||||
plateNumber: '',
|
||||
password: '',
|
||||
remember: false
|
||||
});
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
async function handleSubmit() {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 模拟登录请求
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
const response =await apiClient.post('/login', formData.value); // 替换为实际的登录请求
|
||||
//await apiClient.post('/login', formData.value); // 替换为实际的登录请求
|
||||
if (response.status == 200) {
|
||||
userStore.setUserInfo({
|
||||
id: response.data.id,
|
||||
plateNumber: response.data.plateNumber,
|
||||
token: response.data.token,
|
||||
role: response.data.role
|
||||
});
|
||||
alert(`登录成功!车牌号:${formData.value.plateNumber}`);
|
||||
if(formData.value.remember){
|
||||
localStorage.setItem('token',response.data.token);
|
||||
}
|
||||
if(userStore.userInfo.role == 'admin'){
|
||||
router.push('/adduser'); // 登录成功后跳转到管理员页面
|
||||
}else{
|
||||
router.push('/main'); // 登录成功后跳转到主页面
|
||||
}
|
||||
} else {
|
||||
alert('登录失败,请检查您的车牌号和密码。');
|
||||
const loading = ref(false);
|
||||
|
||||
async function handleSubmit() {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 模拟登录请求
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
const response = await apiClient.post('/login', formData.value); // 替换为实际的登录请求
|
||||
//await apiClient.post('/login', formData.value); // 替换为实际的登录请求
|
||||
if (response.status == 200) {
|
||||
userStore.setUserInfo({
|
||||
id: response.data.id,
|
||||
plateNumber: response.data.plateNumber,
|
||||
token: response.data.token,
|
||||
role: response.data.role
|
||||
});
|
||||
showPopup(`登录成功!车牌号:${formData.value.plateNumber}`, 'success');
|
||||
if (formData.value.remember) {
|
||||
localStorage.setItem('token', response.data.token);
|
||||
}else {
|
||||
sessionStorage.setItem('token', response.data.token);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('登录失败', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
if (userStore.userInfo.role == 'admin') {
|
||||
router.push('/adduser'); // 登录成功后跳转到管理员页面
|
||||
} else {
|
||||
router.push('/userinfo'); // 登录成功后跳转到主页面
|
||||
}
|
||||
} else {
|
||||
showPopup('登录失败,请检查车牌号和密码是否正确。', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('登录失败', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
onMounted(async () => {
|
||||
const token = localStorage.getItem('token');
|
||||
console.log('token', token);
|
||||
if (token) {
|
||||
const response = await apiClient.post('/loginByToken', null, { params: { token } }); // 替换为实际的验证请求
|
||||
if (response.status == 200) {
|
||||
userStore.setUserInfo({
|
||||
id: response.data.id,
|
||||
plateNumber: response.data.plateNumber,
|
||||
token: response.data.token,
|
||||
role: response.data.role
|
||||
});
|
||||
if (userStore.userInfo.role == 'admin') {
|
||||
router.push('/adduser'); // 登录成功后跳转到管理员页面
|
||||
} else {
|
||||
router.push('/userinfo'); // 登录成功后跳转到主页面
|
||||
}
|
||||
} else {
|
||||
localStorage.removeItem('token');
|
||||
showPopup('自动登录失败,请重新登录。', 'error');
|
||||
}
|
||||
}
|
||||
onMounted(async () => {
|
||||
const token = localStorage.getItem('token');
|
||||
console.log('token', token);
|
||||
if (token) {
|
||||
const response =await apiClient.post('/loginByToken',null, { params: { token } }); // 替换为实际的验证请求
|
||||
if (response.status == 200) {
|
||||
userStore.setUserInfo({
|
||||
id: response.data.id,
|
||||
plateNumber: response.data.plateNumber,
|
||||
token: response.data.token,
|
||||
role: response.data.role
|
||||
});
|
||||
if(userStore.userInfo.role == 'admin'){
|
||||
router.push('/adduser'); // 登录成功后跳转到管理员页面
|
||||
}else{
|
||||
router.push('/main'); // 登录成功后跳转到主页面
|
||||
}
|
||||
} else {
|
||||
alert('登录过期或无效,请重新登录。');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -602,23 +602,9 @@ h1 span {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.topbar {
|
||||
height: auto;
|
||||
min-height: 68px;
|
||||
padding: 14px 18px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.nav-links {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.topbar-actions {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
|
||||
@@ -468,7 +468,7 @@ h2 {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media (max-width: 760px) {
|
||||
.search-page {
|
||||
min-height: calc(100vh - 116px);
|
||||
padding: 22px 14px 40px;
|
||||
|
||||
@@ -0,0 +1,641 @@
|
||||
<template>
|
||||
<main class="user-info-page">
|
||||
<section class="user-info-container">
|
||||
<header class="page-header">
|
||||
<div>
|
||||
<p class="eyebrow">MY VEHICLE SERVICE</p>
|
||||
<h1>我的车辆</h1>
|
||||
<p class="subtitle">查看爱车资料、保养提醒和历史维修记录</p>
|
||||
</div>
|
||||
<span class="service-badge"><i></i>服务中</span>
|
||||
</header>
|
||||
|
||||
<section class="profile-card">
|
||||
<div class="profile-avatar">{{ user.plateNumber.slice(-1) }}</div>
|
||||
<div class="profile-main">
|
||||
<div class="profile-title">
|
||||
<h2>{{ user.plateNumber }}</h2>
|
||||
<span class="status">{{ user.status }}</span>
|
||||
</div>
|
||||
<p>{{ user.carModel }}</p>
|
||||
<p>最后更新:{{ user.updatedAt }}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="info-grid">
|
||||
<section class="info-card">
|
||||
<div class="card-heading">
|
||||
<div class="heading-icon blue">车</div>
|
||||
<div>
|
||||
<h2>车辆资料</h2>
|
||||
<p>爱车的基础信息</p>
|
||||
</div>
|
||||
</div>
|
||||
<dl class="info-list">
|
||||
<div>
|
||||
<dt>车牌号</dt>
|
||||
<dd>{{ user.plateNumber || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>车型</dt>
|
||||
<dd>{{ user.carModel || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>车辆颜色</dt>
|
||||
<dd>{{ user.carColor || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>购车年份</dt>
|
||||
<dd>{{ user.purchaseYear || '未记录' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section class="info-card oil-card">
|
||||
<div class="card-heading">
|
||||
<div class="heading-icon orange">油</div>
|
||||
<div>
|
||||
<h2>机油保养</h2>
|
||||
<p>下一次保养提醒</p>
|
||||
</div>
|
||||
</div>
|
||||
<dl class="info-list">
|
||||
<div>
|
||||
<dt>机油类型</dt>
|
||||
<dd>{{ user.oilType || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>上次更换</dt>
|
||||
<dd>{{ user.oilChangedAt || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>更换周期</dt>
|
||||
<dd>{{ user.oilCycle || '未记录' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>下次建议日期</dt>
|
||||
<dd class="highlight">{{ user.nextOilDate || '未记录' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="info-card repair-card">
|
||||
<div class="card-heading">
|
||||
<div class="heading-icon green">修</div>
|
||||
<div>
|
||||
<h2>维修记录</h2>
|
||||
<p>爱车的历史服务明细</p>
|
||||
</div>
|
||||
<span class="record-count">共 {{ repairRecords.length }} 次</span>
|
||||
</div>
|
||||
<div v-if="repairRecords.length" class="repair-list">
|
||||
<article v-for="record in repairRecords" :key="record.id" class="repair-item">
|
||||
<time>{{ record.date }}</time>
|
||||
<span class="timeline-dot"></span>
|
||||
<div class="repair-content">
|
||||
<strong>{{ record.title }}</strong>
|
||||
<p>{{ record.description }}</p>
|
||||
</div>
|
||||
<span class="repair-price">{{ record.price }}</span>
|
||||
<button type="button" class="view-record-button" @click="openRepairDetail(record)">查看</button>
|
||||
</article>
|
||||
</div>
|
||||
<p v-else class="empty-record">暂无维修记录</p>
|
||||
</section>
|
||||
</section>
|
||||
<div v-if="showRepairDetail && selectedRepairRecord" class="modal-mask" @click.self="closeRepairDetail">
|
||||
<section class="repair-form repair-detail-form" aria-labelledby="repair-detail-title">
|
||||
<div class="modal-header">
|
||||
<h2 id="repair-detail-title">维修记录详情</h2>
|
||||
<button type="button" aria-label="关闭详情" @click="closeRepairDetail">×</button>
|
||||
</div>
|
||||
<dl class="repair-detail-list">
|
||||
<div><dt>维修项目</dt><dd>{{ selectedRepairRecord.title || '未填写' }}</dd></div>
|
||||
<div><dt>维修日期</dt><dd>{{ selectedRepairRecord.date || '未填写' }}</dd></div>
|
||||
<div><dt>维修金额</dt><dd>{{ selectedRepairRecord.price || '未填写' }}</dd></div>
|
||||
<div class="description-row"><dt>维修描述</dt><dd>{{ selectedRepairRecord.description || '未填写' }}</dd></div>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import apiClient from '../../apiClient/apiClient'
|
||||
import { showPopup } from '../../components/popUP.vue'
|
||||
import { useUserInfoStore } from '../../stores/UserInfo'
|
||||
|
||||
const route = useRoute()
|
||||
const useStore = useUserInfoStore()
|
||||
const user = reactive({
|
||||
id: '',
|
||||
plateNumber: String(useStore.userInfo?.plateNumber || route.query.plate || '粤B12345'),
|
||||
status: '正常',
|
||||
carModel: '未知车型',
|
||||
carColor: '未知颜色',
|
||||
purchaseYear: '',
|
||||
oilChangedAt: '',
|
||||
oilType: '',
|
||||
oilCycle: '',
|
||||
nextOilDate: '',
|
||||
updatedAt: '暂无',
|
||||
})
|
||||
const repairRecords = reactive([])
|
||||
const showRepairDetail = ref(false)
|
||||
const selectedRepairRecord = ref(null)
|
||||
|
||||
function openRepairDetail(record) {
|
||||
selectedRepairRecord.value = record
|
||||
showRepairDetail.value = true
|
||||
}
|
||||
|
||||
function closeRepairDetail() {
|
||||
showRepairDetail.value = false
|
||||
selectedRepairRecord.value = null
|
||||
}
|
||||
|
||||
async function loadUserInfo() {
|
||||
try {
|
||||
const response = await apiClient.get('/getUser', { params: { plateNumber: user.plateNumber } })
|
||||
Object.assign(user, {
|
||||
id: response.data.id,
|
||||
plateNumber: response.data.plateNumber,
|
||||
status: response.data.status,
|
||||
carModel: response.data.carModel,
|
||||
carColor: response.data.carColor,
|
||||
purchaseYear: response.data.purchaseYear,
|
||||
oilChangedAt: response.data.lastOilDate,
|
||||
oilType: response.data.oilType,
|
||||
oilCycle: response.data.oilCycle,
|
||||
nextOilDate: response.data.nextOilDate,
|
||||
updatedAt: response.data.updatedAt,
|
||||
})
|
||||
const records = await apiClient.get('/getRepairRecords', { params: { userId: user.id } })
|
||||
repairRecords.splice(0, repairRecords.length, ...(records.data || []))
|
||||
} catch (error) {
|
||||
console.error('获取车辆信息失败', error)
|
||||
showPopup('车辆信息加载失败,请稍后重试', 'error')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(loadUserInfo)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.user-info-page {
|
||||
min-height: calc(100vh - 74px);
|
||||
padding: 38px 24px 60px;
|
||||
color: #1d2b45;
|
||||
background: #f5f7fb;
|
||||
}
|
||||
|
||||
.user-info-container {
|
||||
width: 100%;
|
||||
max-width: 860px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
margin-bottom: 24px;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 7px;
|
||||
color: #1769e1;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1.5px;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 7px;
|
||||
color: #1b2942;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.subtitle,
|
||||
.card-heading p,
|
||||
.profile-main p {
|
||||
margin-bottom: 0;
|
||||
color: #8d98aa;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.service-badge {
|
||||
padding: 7px 10px;
|
||||
color: #239366;
|
||||
background: #eaf8f1;
|
||||
border-radius: 5px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.service-badge i {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
margin-right: 5px;
|
||||
vertical-align: 1px;
|
||||
background: #38b982;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.profile-card,
|
||||
.info-card {
|
||||
background: #fff;
|
||||
border: 1px solid #e8edf5;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 7px 20px #29466b0a;
|
||||
}
|
||||
|
||||
.profile-card {
|
||||
display: flex;
|
||||
min-height: 116px;
|
||||
padding: 24px;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.profile-avatar {
|
||||
display: grid;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
flex: 0 0 60px;
|
||||
place-items: center;
|
||||
color: #1769e1;
|
||||
background: #eaf2ff;
|
||||
border-radius: 14px;
|
||||
font-size: 25px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.profile-main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.profile-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.profile-title h2 {
|
||||
margin: 0 0 7px;
|
||||
color: #1d2b45;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
.profile-main p+p {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 4px 7px;
|
||||
color: #239366;
|
||||
background: #eaf8f1;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
margin-top: 20px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.card-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
padding-bottom: 18px;
|
||||
border-bottom: 1px solid #edf0f5;
|
||||
}
|
||||
|
||||
.heading-icon {
|
||||
display: grid;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
place-items: center;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.heading-icon.blue {
|
||||
color: #1769e1;
|
||||
background: #eaf2ff;
|
||||
}
|
||||
|
||||
.heading-icon.orange {
|
||||
color: #e58b2b;
|
||||
background: #fff2df;
|
||||
}
|
||||
|
||||
.heading-icon.green {
|
||||
color: #24966b;
|
||||
background: #e6f8ef;
|
||||
}
|
||||
|
||||
.card-heading h2 {
|
||||
margin: 0 0 4px;
|
||||
color: #27354d;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.card-heading p {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.info-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.info-list div {
|
||||
display: flex;
|
||||
padding-top: 13px;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.info-list dt {
|
||||
color: #919cac;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.info-list dd {
|
||||
margin: 0;
|
||||
color: #3c4a62;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.info-list dd.highlight {
|
||||
color: #e18427;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.repair-card {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.record-count {
|
||||
margin-left: auto;
|
||||
padding: 5px 8px;
|
||||
color: #1769e1;
|
||||
background: #eaf2ff;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.repair-item {
|
||||
display: flex;
|
||||
min-height: 78px;
|
||||
padding: 16px 0;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
border-bottom: 1px solid #edf0f5;
|
||||
}
|
||||
|
||||
.repair-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.repair-item time {
|
||||
width: 78px;
|
||||
flex: 0 0 78px;
|
||||
padding-top: 2px;
|
||||
color: #8d98aa;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.timeline-dot {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
margin-top: 4px;
|
||||
flex: 0 0 9px;
|
||||
background: #42b883;
|
||||
border: 2px solid #d9f4e7;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.repair-content {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.repair-content strong {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
color: #3c4a62;
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.repair-content p {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
margin: 5px 0 0;
|
||||
color: #9aa4b3;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.repair-price {
|
||||
width: 52px;
|
||||
flex: 0 0 52px;
|
||||
color: #354158;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.view-record-button {
|
||||
width: 42px;
|
||||
flex: 0 0 42px;
|
||||
padding: 4px 8px;
|
||||
color: #1769e1;
|
||||
background: #f1f6ff;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.view-record-button:hover {
|
||||
background: #dceaff;
|
||||
}
|
||||
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
padding: 20px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #17233c66;
|
||||
}
|
||||
|
||||
.repair-form {
|
||||
width: 100%;
|
||||
max-width: 430px;
|
||||
padding: 24px;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 14px 40px #17233c33;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
margin-bottom: 18px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.modal-header h2 {
|
||||
margin: 0;
|
||||
color: #1b2942;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.modal-header button {
|
||||
padding: 0;
|
||||
color: #8d98aa;
|
||||
background: none;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.repair-detail-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.repair-detail-list div {
|
||||
display: flex;
|
||||
padding: 12px 0;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
border-bottom: 1px solid #edf0f5;
|
||||
}
|
||||
|
||||
.repair-detail-list div:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.repair-detail-list dt {
|
||||
color: #8d98aa;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.repair-detail-list dd {
|
||||
margin: 0;
|
||||
color: #354158;
|
||||
font-size: 13px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.repair-detail-list .description-row {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.repair-detail-list .description-row dd {
|
||||
width: 100%;
|
||||
color: #66748a;
|
||||
line-height: 1.7;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.empty-record {
|
||||
margin: 16px 0 0;
|
||||
padding: 22px 12px;
|
||||
color: #9aa4b3;
|
||||
background: #f7faff;
|
||||
border: 1px dashed #dfe6ef;
|
||||
border-radius: 7px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.user-info-page {
|
||||
min-height: calc(100vh - 116px);
|
||||
padding: 24px 14px 40px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.profile-card {
|
||||
padding: 18px 15px;
|
||||
}
|
||||
|
||||
.profile-avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
flex-basis: 48px;
|
||||
border-radius: 11px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.profile-title h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
padding: 18px 15px;
|
||||
}
|
||||
|
||||
.repair-item {
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.repair-item time {
|
||||
width: 62px;
|
||||
flex-basis: 62px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.repair-price {
|
||||
width: 42px;
|
||||
flex-basis: 42px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.view-record-button {
|
||||
width: 38px;
|
||||
flex-basis: 38px;
|
||||
padding: 4px 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<div class="wait-page">
|
||||
<div class="wait-bg-circle circle-1"></div>
|
||||
<div class="wait-bg-circle circle-2"></div>
|
||||
|
||||
<div class="wait-content">
|
||||
<div class="wait-icon">
|
||||
<svg viewBox="0 0 120 120" class="icon-svg">
|
||||
<circle cx="60" cy="60" r="46" class="icon-ring" />
|
||||
<path d="M60 32v30l20 12" class="icon-hand" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h1 class="wait-title">暂未上线</h1>
|
||||
<p class="wait-subtitle">敬请期待,我们正在努力打磨中…</p>
|
||||
|
||||
<div class="wait-tips">
|
||||
<span class="dot"></span>
|
||||
<span>新功能即将与您见面</span>
|
||||
</div>
|
||||
|
||||
<button class="wait-btn" type="button" @click="goBack">返回上一页</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const goBack = () => {
|
||||
if (window.history.length > 1) {
|
||||
window.history.back();
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wait-page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
padding: 40px 16px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(160deg, #f5f8ff 0%, #eef3ff 45%, #f7f9ff 100%);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wait-bg-circle {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
filter: blur(6px);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.circle-1 {
|
||||
top: -120px;
|
||||
right: -80px;
|
||||
width: 320px;
|
||||
height: 320px;
|
||||
background: radial-gradient(circle, rgba(64, 128, 255, 0.18), transparent 70%);
|
||||
}
|
||||
|
||||
.circle-2 {
|
||||
bottom: -140px;
|
||||
left: -100px;
|
||||
width: 380px;
|
||||
height: 380px;
|
||||
background: radial-gradient(circle, rgba(120, 90, 255, 0.14), transparent 70%);
|
||||
}
|
||||
|
||||
.wait-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
max-width: 520px;
|
||||
padding: 48px 36px;
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
box-shadow: 0 12px 40px rgba(64, 96, 180, 0.12);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.wait-icon {
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
margin-bottom: 24px;
|
||||
animation: float 3.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.icon-svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.icon-ring {
|
||||
fill: none;
|
||||
stroke: #4b7bff;
|
||||
stroke-width: 6;
|
||||
stroke-linecap: round;
|
||||
stroke-dasharray: 240 290;
|
||||
transform-origin: 60px 60px;
|
||||
animation: spin 6s linear infinite;
|
||||
}
|
||||
|
||||
.icon-hand {
|
||||
fill: none;
|
||||
stroke: #4b7bff;
|
||||
stroke-width: 6;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.wait-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 2px;
|
||||
color: #24304a;
|
||||
}
|
||||
|
||||
.wait-subtitle {
|
||||
margin: 0 0 20px;
|
||||
font-size: 15px;
|
||||
line-height: 1.7;
|
||||
color: #6b7891;
|
||||
}
|
||||
|
||||
.wait-tips {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 28px;
|
||||
padding: 8px 18px;
|
||||
font-size: 13px;
|
||||
color: #4b7bff;
|
||||
background: rgba(75, 123, 255, 0.08);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4b7bff;
|
||||
animation: blink 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.wait-btn {
|
||||
min-width: 148px;
|
||||
height: 42px;
|
||||
padding: 0 28px;
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(135deg, #5b8bff, #3f6cff);
|
||||
box-shadow: 0 8px 18px rgba(63, 108, 255, 0.32);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.wait-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 12px 24px rgba(63, 108, 255, 0.4);
|
||||
}
|
||||
|
||||
.wait-btn:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 6px 14px rgba(63, 108, 255, 0.3);
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.25;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.wait-content {
|
||||
padding: 36px 22px;
|
||||
}
|
||||
|
||||
.wait-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.wait-icon {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user