From ae1ced2a0c36184f6220c6b1a5433506f3de6518 Mon Sep 17 00:00:00 2001 From: hebo Date: Sat, 10 Jan 2026 10:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/base/jc/bm.vue | 71 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/src/pages/base/jc/bm.vue b/src/pages/base/jc/bm.vue index 135fdfe..4558210 100644 --- a/src/pages/base/jc/bm.vue +++ b/src/pages/base/jc/bm.vue @@ -11,6 +11,14 @@ + + + + + 加载中... + + + - 返回首页 + 返回 @@ -79,8 +87,12 @@ const curXs = computed(() => getCurXs); // 就餐标准列表 const jcBzList = ref([]); +// 加载状态 +const loading = ref(false); + // 获取就餐标准列表 const getJcBzList = async () => { + loading.value = true; try { const res = await checkXsJcBmApi({ xsId: getCurXs.id @@ -130,6 +142,12 @@ const getJcBzList = async () => { }); } catch (error) { console.error('获取就餐标准列表失败:', error); + uni.showToast({ + title: '获取数据失败,请重试', + icon: 'none' + }); + } finally { + loading.value = false; } }; @@ -401,10 +419,55 @@ onMounted(() => { text-align: center; border-radius: 22px; font-size: 16px; - background-color: #fff; - color: #333; - border: 1px solid #ddd; + background-color: #2879ff; + color: #fff; + border: none; } } +// 加载遮罩层样式 +.loading-mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + + .loading-content { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #fff; + border-radius: 8px; + padding: 30px 40px; + min-width: 120px; + + .loading-spinner { + width: 40px; + height: 40px; + border: 3px solid #f3f3f3; + border-top: 3px solid #2879ff; + border-radius: 50%; + animation: spin 1s linear infinite; + margin-bottom: 15px; + } + + .loading-text { + font-size: 14px; + color: #666; + } + } +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + \ No newline at end of file