From 388599e84088e35ac474edfa415372ef3980f5fb Mon Sep 17 00:00:00 2001 From: ozh Date: Wed, 19 Aug 2026 09:28:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(index):=20=E6=B7=BB=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8C=89=E9=92=AE=E6=94=B9=E4=B8=BA=E5=8F=B3=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E5=9C=86=E5=BD=A2=E5=8A=A0=E5=8F=B7=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/scene.js | 14 ++++++++++++++ pages/index/index.vue | 22 ++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/api/scene.js b/api/scene.js index a7484e9..d0e40aa 100644 --- a/api/scene.js +++ b/api/scene.js @@ -1,9 +1,23 @@ import request from '@/api/http/client' +// 后端就绪后置为 false 即可恢复真实请求。 +const USE_MOCK = true + +// 模拟场景列表数据(后端 /scene/list 就绪后删除)。 +const MOCK_SCENES = [ + { id: 1, name: '家里' }, + { id: 2, name: '养老院' }, + { id: 3, name: '社区中心' } +] + /** * 获取场景列表。 * 约定:data 为数组,每项至少含 { id, name },多余字段不影响前端。 */ export function getSceneList() { + if (USE_MOCK) { + // 模拟网络延迟,让 loading 态可见。 + return new Promise((resolve) => setTimeout(() => resolve(MOCK_SCENES), 500)) + } return request.get('/scene/list') } diff --git a/pages/index/index.vue b/pages/index/index.vue index ff16903..9a45e31 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -33,8 +33,8 @@ - - + + @@ -81,7 +81,6 @@ export default { .page { position: relative; - padding-bottom: 180rpx; } .banner { @@ -153,8 +152,19 @@ export default { .fab-wrap { position: fixed; - right: 32rpx; - bottom: 220rpx; - width: 240rpx; + right: 40rpx; + bottom: 60rpx; + width: 112rpx; + height: 112rpx; + border-radius: 50%; + background: linear-gradient(135deg, #1fca97 0%, #2dbf9c 100%); + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 8rpx 24rpx rgba(31, 202, 151, 0.4); + /* 点击态缩放反馈 */ + &:active { + transform: scale(0.92); + } }