diff --git a/src/apiClient/apiClient.ts b/src/apiClient/apiClient.ts index b0cc74e..e044b3e 100644 --- a/src/apiClient/apiClient.ts +++ b/src/apiClient/apiClient.ts @@ -6,7 +6,7 @@ const token = localStorage.getItem('token'); // 创建 Axios 实例 const apiClient = axios.create({ //baseURL: window.location.origin, - baseURL: 'http://localhost:8080/apiForTianze', // 替换为你的后端 API 地址 + baseURL: 'http://192.168.1.35:8080/apiForTianze', // 替换为你的后端 API 地址 /* headers: { 'Content-Type': 'application/json' } */ diff --git a/src/views/adminusers/index.vue b/src/views/adminusers/index.vue index 44ac953..c4f0ab8 100644 --- a/src/views/adminusers/index.vue +++ b/src/views/adminusers/index.vue @@ -15,10 +15,10 @@
-
{{ user.plate.slice(-1) }}
+
{{ user.plateNumber.slice(-1) }}
-

{{ user.plate }}

+

{{ user.plateNumber }}

{{ user.status }} @@ -70,19 +70,19 @@
上次更换日期
-
{{ user.oilChangedAt }}
+
{{ user.oilChangedAt || '未记录' }}
机油类型
-
{{ user.oilType }}
+
{{ user.oilType || '未记录' }}
建议更换周期
-
{{ user.oilCycle }}
+
{{ user.oilCycle || '未记录' }}
下次建议日期
-
{{ user.nextOilDate }}
+
{{ user.nextOilDate || '未记录' }}
@@ -113,7 +115,7 @@
-
+
@@ -122,6 +124,7 @@
{{ record.price }}
+

暂无维修记录

@@ -134,7 +137,7 @@ - + @@ -144,14 +147,16 @@ @@ -733,6 +768,17 @@ h1 { font-weight: 600; } +.repair-list>p { + 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-detail-page { min-height: calc(100vh - 116px); diff --git a/src/views/search/index.vue b/src/views/search/index.vue index caf0c67..c8bb28e 100644 --- a/src/views/search/index.vue +++ b/src/views/search/index.vue @@ -21,12 +21,7 @@ - + @@ -43,7 +38,7 @@
-
+
{{ user.plateNumber.slice(-1) }}
@@ -103,16 +98,16 @@ const mockUsers = Array.from({ length: 24 }, (_, index) => { * 后续接入真实接口时,保持返回 { list, total } 即可替换此方法。 */ function fetchUsers({ page: currentPage, pageSize, keyword: searchKeyword }) { - - /* return response.then(res => { - return { - list: res.data.list, - total: res.data.total, - }; - }).catch(error => { - console.error('获取用户失败', error); - throw error; - }); */ + + /* return response.then(res => { + return { + list: res.data.list, + total: res.data.total, + }; + }).catch(error => { + console.error('获取用户失败', error); + throw error; + }); */ return new Promise((resolve) => { window.setTimeout(() => { const normalizedKeyword = searchKeyword.toUpperCase() @@ -140,9 +135,9 @@ async function loadUsers(reset = false) { loading.value = true try { const result = await apiClient.post('/users', { - page: page.value-1, - pageSize: PAGE_SIZE, - keyword: keyword.value, + page: page.value - 1, + pageSize: PAGE_SIZE, + keyword: keyword.value, }); const list = result.data?.list || [] console.log('获取用户列表', result.data.list); @@ -167,8 +162,11 @@ function clearSearch() { loadUsers(true) } -function toUser() { - router.push('/adminusers') // 点击用户跳转到用户详情页 +function toUser(plateNumber) { + router.push({ + path: '/adminusers', + query: { plateNumber: plateNumber }, + }) // 点击用户跳转到用户详情页 } onMounted(async () => { @@ -250,7 +248,7 @@ h1 { } .header-icon svg, -.search-input > svg { +.search-input>svg { width: 21px; fill: none; stroke: currentColor; @@ -465,7 +463,9 @@ h2 { } @keyframes spin { - to { transform: rotate(360deg); } + to { + transform: rotate(360deg); + } } @media (max-width: 600px) { diff --git a/vite.config.ts b/vite.config.ts index bbcf80c..5d3dedc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,4 +4,8 @@ import vue from '@vitejs/plugin-vue' // https://vite.dev/config/ export default defineConfig({ plugins: [vue()], + server: { + host: '0.0.0.0', + port: 3000 + } })