From 582092f467907fcaabf1684b26735ddadb1816b9 Mon Sep 17 00:00:00 2001 From: MaDaLei Date: Sat, 18 Apr 2026 17:34:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20H5=E6=B5=B7=E6=8A=A5Canvas=E6=8C=89devic?= =?UTF-8?q?ePixelRatio=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- report.html | 3 + src/api/index.js | 23 +- src/components/AppPageState.vue | 146 +++++ src/components/report/BeforeAfterSlider.vue | 243 ++++++++ src/components/report/DuringMediaGrid.vue | 194 ++++++ src/components/report/ReminderCard.vue | 16 +- src/pages.json | 1 + src/pages/appointment/AppointmentDetail.vue | 53 +- src/pages/home/Home.vue | 406 +++++++++++-- src/pages/login/Login.vue | 23 +- src/pages/mine/Leads.vue | 61 +- src/pages/mine/MyOrders.vue | 113 ++-- src/pages/mine/MyPets.vue | 69 ++- src/pages/mine/MyReports.vue | 93 +-- src/pages/mine/PetHistory.vue | 272 +++++++++ src/pages/report-view/reportView.vue | 624 ++++++++------------ src/utils/apiResult.js | 11 + src/utils/appointment.js | 2 +- src/views/ReportView.vue | 290 ++++++--- 20 files changed, 1969 insertions(+), 676 deletions(-) create mode 100644 src/components/AppPageState.vue create mode 100644 src/components/report/BeforeAfterSlider.vue create mode 100644 src/components/report/DuringMediaGrid.vue create mode 100644 src/pages/mine/PetHistory.vue create mode 100644 src/utils/apiResult.js diff --git a/README.md b/README.md index fe8c94e..82648d8 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ npm run dev:h5 | 页面 | 路径 | 说明 | |------|------|------| | 登录 | /pages/login/login | Tab切换:员工登录/老板登录/注册老板/注册员工 | -| 首页 | /pages/home/home | 预约列表 Tab(待确认/进行中/已完成)+ 新建预约 | +| 首页 | /pages/home/home | 预约列表 Tab(待开始/进行中/已完成)+ 新建预约 | | 洗美报告 | /pages/report/report | 填写报告 + 提交后显示链接+二维码 | | 报告页 | /pages/report-view/reportView | 独立访问的报告页(token=xxx) | | 我的 | /pages/mine/mine | 个人中心,老板有额外菜单 | diff --git a/report.html b/report.html index 3f848f6..2931763 100644 --- a/report.html +++ b/report.html @@ -4,6 +4,9 @@ 服务报告 - 宠伴生活馆 + + +
diff --git a/src/api/index.js b/src/api/index.js index a2bbcab..b6d9833 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -43,8 +43,13 @@ export const sendSms = (phone) => post('/sms/send', { phone }) // 登录 export const login = (phone, code) => post('/user/login', { phone, code }) -/** 微信小程序:getPhoneNumber 返回的 detail.code */ -export const wxPhoneLogin = (phoneCode) => post('/user/wx-phone-login', { phoneCode }) +/** + * 微信小程序:getPhoneNumber 的 phoneCode + uni.login 的 code(loginCode)一并提交,服务端换手机号并沉淀 openid。 + * @param {string} phoneCode getPhoneNumber 回调 detail.code + * @param {string} [loginCode] uni.login 返回的 code(与 phoneCode 不同) + */ +export const wxPhoneLogin = (phoneCode, loginCode) => + post('/user/wx-phone-login', { phoneCode, loginCode: loginCode || '' }) // 注册老板 export const registerBoss = (data) => post('/user/register-boss', data) @@ -59,6 +64,10 @@ export const updatePet = (data) => put('/pet/update', data) export const deletePet = (id, operatorUserId, role) => del(`/pet/delete?id=${id}&operatorUserId=${operatorUserId}&role=${encodeURIComponent(role)}`) +/** 按宠物:预约 + 报告时间线(需 operatorUserId + role 鉴权) */ +export const getPetHistory = (petId, operatorUserId, role) => + get('/pet/history', { petId, operatorUserId, role }) + // 预约列表 export const getAppointmentList = (userId, storeId, options = {}) => get('/appointment/list', { userId, storeId, ...options }) @@ -95,9 +104,13 @@ export const getReportList = (params) => get('/report/list', params) // 报告页:下次服务建议日期 export const getReportSuggestion = (token) => get(`/report/${encodeURIComponent(token)}/suggestion`) -// 报告页:宠主留资(下次提醒) -export const submitReportReminder = (token, phone) => - post(`/report/${encodeURIComponent(token)}/reminder`, { phone, consent: true }) +// 报告页:宠主留资(下次提醒);小程序可传 loginCode(uni.login)沉淀 openid/unionid +export const submitReportReminder = (token, phone, loginCode) => + post(`/report/${encodeURIComponent(token)}/reminder`, { + phone, + consent: true, + loginCode: loginCode || '' + }) // 报告页:一键退订 export const unsubscribeReportReminder = (unsubscribeToken) => diff --git a/src/components/AppPageState.vue b/src/components/AppPageState.vue new file mode 100644 index 0000000..d186976 --- /dev/null +++ b/src/components/AppPageState.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/components/report/BeforeAfterSlider.vue b/src/components/report/BeforeAfterSlider.vue new file mode 100644 index 0000000..f3e6782 --- /dev/null +++ b/src/components/report/BeforeAfterSlider.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/src/components/report/DuringMediaGrid.vue b/src/components/report/DuringMediaGrid.vue new file mode 100644 index 0000000..7bc9809 --- /dev/null +++ b/src/components/report/DuringMediaGrid.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/components/report/ReminderCard.vue b/src/components/report/ReminderCard.vue index a0d60d0..4c9f8e0 100644 --- a/src/components/report/ReminderCard.vue +++ b/src/components/report/ReminderCard.vue @@ -126,12 +126,26 @@ async function loadSuggestion() { } } +const fetchMiniLoginCode = () => + new Promise((resolve) => { + // #ifdef MP-WEIXIN + uni.login({ + success: (res) => resolve((res && res.code) || ''), + fail: () => resolve('') + }) + // #endif + // #ifndef MP-WEIXIN + resolve('') + // #endif + }) + async function onSubmit() { if (!canSubmit.value) return errorMsg.value = '' submitting.value = true try { - const res = await submitReportReminder(props.token, phone.value) + const loginCode = await fetchMiniLoginCode() + const res = await submitReportReminder(props.token, phone.value, loginCode) if (res && res.code === 200 && res.data && res.data.ok) { savedDate.value = res.data.remindDate || suggestion.value.remindDate submitted.value = true diff --git a/src/pages.json b/src/pages.json index b462684..d3f12f2 100644 --- a/src/pages.json +++ b/src/pages.json @@ -13,6 +13,7 @@ {"path": "pages/mine/MyReports"}, {"path": "pages/mine/MyOrders"}, {"path": "pages/mine/MyPets"}, + {"path": "pages/mine/PetHistory"}, {"path": "pages/mine/Profile"}, {"path": "pages/video-player/videoPlayer"}, {"path": "pages/report-view/reportView"}, diff --git a/src/pages/appointment/AppointmentDetail.vue b/src/pages/appointment/AppointmentDetail.vue index b9b4aaf..a82be28 100644 --- a/src/pages/appointment/AppointmentDetail.vue +++ b/src/pages/appointment/AppointmentDetail.vue @@ -6,9 +6,18 @@ - 加载中… - - + + @@ -41,9 +50,8 @@ 预约编号 {{ detail.id }} - - - 未找到该预约 + + @@ -51,12 +59,16 @@ import { ref, computed } from 'vue' import { onLoad } from '@dcloudio/uni-app' import AppIcon from '../../components/AppIcon.vue' +import AppPageState from '../../components/AppPageState.vue' +import { messageFromApi, NETWORK_ERROR_MSG } from '../../utils/apiResult.js' import { getAppointmentDetail } from '../../api/index.js' import { formatDateTimeCN } from '../../utils/datetime.js' import { getAppointmentStatusText, getAppointmentTagClass } from '../../utils/appointment.js' const loading = ref(true) +const loadError = ref(null) const detail = ref(null) +const routeId = ref('') const navSafeStyle = (() => { const statusBarHeight = uni.getSystemInfoSync?.().statusBarHeight || 20 @@ -78,23 +90,38 @@ const tagClass = (status) => getAppointmentTagClass(status) const goBack = () => uni.navigateBack() const load = async (id) => { + loadError.value = null if (!id) { + detail.value = null loading.value = false return } loading.value = true - const res = await getAppointmentDetail(Number(id)) - loading.value = false - if (res.code === 200 && res.data) { - detail.value = res.data - } else { + try { + const res = await getAppointmentDetail(Number(id)) + if (res && res.code === 200 && res.data) { + detail.value = res.data + } else { + detail.value = null + if (res && res.code === 404) { + loadError.value = null + } else { + loadError.value = messageFromApi(res, '加载失败') + } + } + } catch (e) { detail.value = null - uni.showToast({ title: res.message || '加载失败', icon: 'none' }) + loadError.value = NETWORK_ERROR_MSG + } finally { + loading.value = false } } +const retryLoad = () => load(routeId.value) + onLoad((options) => { - load(options.id) + routeId.value = options.id || '' + load(routeId.value) }) diff --git a/src/pages/home/Home.vue b/src/pages/home/Home.vue index b9c124b..86c9402 100644 --- a/src/pages/home/Home.vue +++ b/src/pages/home/Home.vue @@ -11,12 +11,37 @@ 查看预约进度,点击右下角加号新建预约 - + + + {{ card.value }} + {{ card.label }} + {{ card.hint }} + + + + + ‹ 返回 + 今日日程 + + + + ‹ 返回 + 本周已完成 + + + + {{ tab.title }} - - - - - {{ item.petName }} - {{ item.serviceType }} + + + + + + {{ item.petName }} + {{ item.serviceType }} + + {{ item.statusText }} + + {{ item.time }} + + - {{ item.statusText }} - - {{ item.time }} - - - 暂无预约 - + + @@ -63,13 +97,38 @@ {{ storeInfo.name || '宠伴生活馆' }} + + + {{ card.value }} + {{ card.label }} + {{ card.hint }} + + + + + ‹ 返回 + 今日日程 + + + + ‹ 返回 + 本周已完成 + + + - + {{ tab.title }} - - - - - {{ item.petName }} - {{ item.serviceType }} + + + + + + {{ item.petName }} + {{ item.serviceType }} + + {{ item.statusText }} - {{ item.statusText }} - - {{ item.time }} - - - - - - - + {{ item.time }} + + + + + + + + - 暂无数据 - + + @@ -195,12 +263,36 @@ import { getAppointmentAvailableSlots } from '../../api/index.js' import TabBar from '../../components/TabBar.vue' +import AppPageState from '../../components/AppPageState.vue' +import { messageFromApi, NETWORK_ERROR_MSG } from '../../utils/apiResult.js' import { getUserSession, getStoreSession } from '../../utils/session.js' import { useNavigator } from '../../composables/useNavigator.js' import { formatDateTimeCN } from '../../utils/datetime.js' import { getAppointmentStatusText } from '../../utils/appointment.js' import { normalizeToHalfHour, ymdLocal, formatHalfHourSlotRange } from '../../utils/halfHourTime.js' +/** 预约时间转本地日历 YYYY-MM-DD */ +function apptYmd(iso) { + if (!iso) return '' + const d = new Date(iso) + if (Number.isNaN(d.getTime())) return '' + return ymdLocal(d) +} + +/** 预约是否落在本周(周一至周日,本地时区) */ +function isApptInThisWeek(iso) { + if (!iso) return false + const t = new Date(iso).getTime() + if (Number.isNaN(t)) return false + const now = new Date() + const day = now.getDay() + const monOff = day === 0 ? -6 : 1 - day + const mon = new Date(now.getFullYear(), now.getMonth(), now.getDate() + monOff) + mon.setHours(0, 0, 0, 0) + const nextMon = new Date(mon.getTime() + 7 * 24 * 60 * 60 * 1000) + return t >= mon.getTime() && t < nextMon.getTime() +} + const userInfo = getUserSession() const storeInfo = getStoreSession() const { goPage } = useNavigator() @@ -217,12 +309,41 @@ const navSafeStyle = (() => { const currentStatus = ref(userInfo.role === 'customer' ? 'new' : 'doing') const statusTabs = [ - { title: '待确认', name: 'new' }, + { title: '待开始', name: 'new' }, { title: '进行中', name: 'doing' }, { title: '已完成', name: 'done' } ] const orders = ref([]) +const appointmentsLoading = ref(false) +const appointmentsError = ref(null) +/** tab | today | week:聚合视图;week 仅本周已完成 */ +const listMode = ref('tab') +const activeDashKey = ref(null) + +const todayYmd = computed(() => ymdLocal()) + +const homeStats = computed(() => { + const list = orders.value + const today = todayYmd.value + return { + todayCount: list.filter((o) => apptYmd(o.appointmentTime) === today && o.status !== 'cancel').length, + doingCount: list.filter((o) => o.status === 'doing').length, + newCount: list.filter((o) => o.status === 'new').length, + weekDoneCount: list.filter((o) => o.status === 'done' && isApptInThisWeek(o.appointmentTime)).length + } +}) + +const dashCards = computed(() => { + const s = homeStats.value + return [ + { key: 'today', value: s.todayCount, label: '今日到店', hint: '已排期' }, + { key: 'doing', value: s.doingCount, label: '进行中', hint: '服务中' }, + { key: 'new', value: s.newCount, label: '待开始', hint: '开剪前' }, + { key: 'weekDone', value: s.weekDoneCount, label: '本周完成', hint: '已完成单' } + ] +}) + const newApptCount = computed(() => orders.value.filter(o => o.status === 'new').length) const doingApptCount = computed(() => orders.value.filter(o => o.status === 'doing').length) const serviceTypes = ref([]) @@ -269,6 +390,65 @@ const filteredOrders = computed(() => orders.value.filter(o => { return true })) +const ordersForList = computed(() => { + if (listMode.value === 'today') { + const t = todayYmd.value + return orders.value + .filter((o) => apptYmd(o.appointmentTime) === t && o.status !== 'cancel') + .slice() + .sort((a, b) => new Date(a.appointmentTime) - new Date(b.appointmentTime)) + } + if (listMode.value === 'week') { + return orders.value + .filter((o) => o.status === 'done' && isApptInThisWeek(o.appointmentTime)) + .slice() + .sort((a, b) => new Date(b.appointmentTime) - new Date(a.appointmentTime)) + } + return filteredOrders.value +}) + +const selectTab = (name) => { + currentStatus.value = name + listMode.value = 'tab' + activeDashKey.value = null +} + +const onDashCardClick = (key) => { + activeDashKey.value = key + if (key === 'today') { + listMode.value = 'today' + return + } + if (key === 'weekDone') { + listMode.value = 'week' + return + } + listMode.value = 'tab' + if (key === 'doing') currentStatus.value = 'doing' + else if (key === 'new') currentStatus.value = 'new' +} + +const exitListMode = () => { + listMode.value = 'tab' + activeDashKey.value = null +} + +const showListPlaceholder = computed( + () => !appointmentsLoading.value && !appointmentsError.value && ordersForList.value.length === 0 +) + +const listEmptyTitle = computed(() => { + if (listMode.value === 'today') return '今日暂无预约' + if (listMode.value === 'week') return '本周暂无已完成' + return userInfo.role === 'customer' ? '暂无预约' : '暂无数据' +}) + +const listEmptyHint = computed(() => + listMode.value === 'today' || listMode.value === 'week' + ? '可返回列表切换日期或 Tab' + : '切换上方状态或新建预约' +) + const loadStaffAvailableSlots = async () => { if (!storeInfo?.id) { staffAvailableTimes.value = [] @@ -337,11 +517,47 @@ const onStaffApptTimeChange = (e) => { } const fetchAppointments = async () => { + appointmentsError.value = null if (userInfo.role === 'customer') { - if (!userInfo.id) return - const res = await getAppointmentList(userInfo.id) - if (res.code === 200) { - orders.value = res.data.map(appt => ({ + if (!userInfo.id) { + appointmentsLoading.value = false + return + } + appointmentsLoading.value = true + try { + const res = await getAppointmentList(userInfo.id) + if (res && res.code === 200) { + orders.value = res.data.map((appt) => ({ + id: appt.id, + title: appt.serviceType || '洗澡美容预约', + desc: `${appt.petType || ''} - ${appt.petName || ''}`, + time: formatDateTimeCN(appt.appointmentTime), + status: appt.status || 'new', + statusText: getAppointmentStatusText(appt.status), + petName: appt.petName, + petType: appt.petType, + serviceType: appt.serviceType, + appointmentTime: appt.appointmentTime + })) + } else { + appointmentsError.value = messageFromApi(res, '加载失败') + } + } catch (e) { + appointmentsError.value = NETWORK_ERROR_MSG + } finally { + appointmentsLoading.value = false + } + return + } + if (!storeInfo.id) { + appointmentsLoading.value = false + return + } + appointmentsLoading.value = true + try { + const res = await getAppointmentList(null, storeInfo.id, { page: 1, pageSize: 50 }) + if (res && res.code === 200) { + orders.value = res.data.map((appt) => ({ id: appt.id, title: appt.serviceType || '洗澡美容预约', desc: `${appt.petType || ''} - ${appt.petName || ''}`, @@ -353,26 +569,13 @@ const fetchAppointments = async () => { serviceType: appt.serviceType, appointmentTime: appt.appointmentTime })) + } else { + appointmentsError.value = messageFromApi(res, '加载失败') } - return - } - if (!storeInfo.id) return - const res = await getAppointmentList(null, storeInfo.id, { page: 1, pageSize: 50 }) - if (res.code === 200) { - orders.value = res.data.map(appt => ({ - id: appt.id, - title: appt.serviceType || '洗澡美容预约', - desc: `${appt.petType || ''} - ${appt.petName || ''}`, - time: formatDateTimeCN(appt.appointmentTime), - status: appt.status || 'new', - statusText: getAppointmentStatusText(appt.status), - petName: appt.petName, - petType: appt.petType, - serviceType: appt.serviceType, - appointmentTime: appt.appointmentTime - })) - const newCount = orders.value.filter(o => o.status === 'new').length - if (newCount > 0) uni.showToast({ title: `${newCount} 个待确认`, icon: 'none' }) + } catch (e) { + appointmentsError.value = NETWORK_ERROR_MSG + } finally { + appointmentsLoading.value = false } } @@ -555,6 +758,81 @@ onShow(() => { } .home-remark-textarea { min-height: 80px; line-height: 1.5; } +/* 首页数据看板 */ +.home-dash { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + margin: 0 16px 12px; +} +.dash-card { + background: #fff; + border-radius: 14px; + padding: 12px 10px 10px; + box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06); + border: 1.5px solid transparent; +} +.dash-card--active { + border-color: #2db96d; + background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 55%); +} +.dash-card-value { + display: block; + font-size: 26px; + font-weight: 800; + color: #1a1a1a; + letter-spacing: -0.5px; + line-height: 1.1; +} +.dash-card-label { + display: block; + margin-top: 4px; + font-size: 13px; + font-weight: 700; + color: #3f3f3a; +} +.dash-card-hint { + display: block; + margin-top: 2px; + font-size: 11px; + color: #a8a89f; +} + +.list-mode-bar { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 16px 8px; + padding: 10px 12px; + background: #ecfdf5; + border-radius: 12px; + border: 1px solid #bbf7d0; +} +.list-mode-back { + font-size: 15px; + font-weight: 600; + color: #15803d; + padding: 4px 0; +} +.list-mode-title { + font-size: 15px; + font-weight: 700; + color: #166534; +} +.list-mode-placeholder { + width: 56px; +} +.list-mode-bar--muted { + background: #f8fafc; + border-color: #e2e8f0; +} +.list-mode-bar--muted .list-mode-title { + color: #334155; +} +.list-mode-bar--muted .list-mode-back { + color: #64748b; +} + /* B端 Tab */ .tabs-wrap { display: flex; diff --git a/src/pages/login/Login.vue b/src/pages/login/Login.vue index f2927fe..6b17e3d 100644 --- a/src/pages/login/Login.vue +++ b/src/pages/login/Login.vue @@ -160,6 +160,20 @@ const backToLoginForm = () => { view.value = 'login' } const showToast = (msg) => uni.showToast({ title: msg, icon: 'none' }) +/** 微信小程序 wx.login,用于服务端 jscode2session 换 openid(与手机号授权 code 无关) */ +const fetchWxLoginCode = () => + new Promise((resolve) => { + // #ifdef MP-WEIXIN + uni.login({ + success: (res) => resolve((res && res.code) || ''), + fail: () => resolve('') + }) + // #endif + // #ifndef MP-WEIXIN + resolve('') + // #endif + }) + const handleSendSms = async () => { if (!loginForm.phone || loginForm.phone.length !== 11) return showToast('请输入正确的手机号') const res = await sendSms(loginForm.phone) @@ -253,7 +267,8 @@ const onWxGetPhoneNumber = async (e) => { } loginLoading.value = true try { - const res = await wxPhoneLogin(code) + const loginCode = await fetchWxLoginCode() + const res = await wxPhoneLogin(code, loginCode) if (res.code === 200) { setUserSession(res.data.user) setStoreSession(res.data.store) @@ -277,7 +292,8 @@ const onWxGetPhoneNumberBoss = async (e) => { if (!code) { showToast('未获取到授权,请手动输入'); return } loginLoading.value = true try { - const res = await wxPhoneLogin(code) + const loginCode = await fetchWxLoginCode() + const res = await wxPhoneLogin(code, loginCode) const phone = getWxLoginPhone(res) if (phone) { bossForm.phone = phone @@ -302,7 +318,8 @@ const onWxGetPhoneNumberStaff = async (e) => { if (!code) { showToast('未获取到授权,请手动输入'); return } loginLoading.value = true try { - const res = await wxPhoneLogin(code) + const loginCode = await fetchWxLoginCode() + const res = await wxPhoneLogin(code, loginCode) const phone = getWxLoginPhone(res) if (phone) { staffForm.phone = phone diff --git a/src/pages/mine/Leads.vue b/src/pages/mine/Leads.vue index 1347fd4..12577a4 100644 --- a/src/pages/mine/Leads.vue +++ b/src/pages/mine/Leads.vue @@ -37,16 +37,17 @@ - - - 加载中… - - - - {{ tab === 'pending' ? '暂无待回访,今天可以喘口气' : '还没有宠主留资' }} - - - + + 手机号 {{ item.phone }} + + openid + {{ item.wechatOpenid }} + + + unionid + {{ item.wechatUnionid }} + 留资时间 {{ formatDateTime(item.createTime) }} @@ -90,7 +99,8 @@ - + + @@ -98,6 +108,8 @@ import { ref, computed, onMounted } from 'vue' import { onShow } from '@dcloudio/uni-app' import AppIcon from '../../components/AppIcon.vue' +import AppPageState from '../../components/AppPageState.vue' +import { messageFromApi, NETWORK_ERROR_MSG } from '../../utils/apiResult.js' import { getReportLeads } from '../../api/index.js' import { getStoreSession, getUserSession } from '../../utils/session.js' import { formatDateTimeYMDHM } from '../../utils/datetime.js' @@ -107,7 +119,15 @@ const storeInfo = getStoreSession() const tab = ref('pending') const loading = ref(false) +const loadError = ref(null) const list = ref([]) + +const emptyTitle = computed(() => + tab.value === 'pending' ? '暂无待回访' : '还没有宠主留资' +) +const emptyHint = computed(() => + tab.value === 'pending' ? '今天可以喘口气,或切换「全部留资」' : '宠主在报告页留资后将出现在这里' +) const pendingCount = ref(0) const navSafeStyle = (() => { @@ -129,6 +149,7 @@ const switchTab = (t) => { const loadList = async () => { if (!storeInfo.id) return + loadError.value = null loading.value = true try { const res = await getReportLeads(storeInfo.id, tab.value) @@ -137,7 +158,11 @@ const loadList = async () => { if (tab.value === 'pending') { pendingCount.value = list.value.length } + } else { + loadError.value = messageFromApi(res, '加载失败') } + } catch (e) { + loadError.value = NETWORK_ERROR_MSG } finally { loading.value = false } @@ -306,20 +331,6 @@ onShow(() => { color: #16a34a; } -.state-wrap { padding: 40px 16px; text-align: center; color: #94a3b8; font-size: 13px; } -.spinner { - width: 26px; height: 26px; - margin: 0 auto 8px; - border: 3px solid #e2e8f0; - border-top-color: #16a34a; - border-radius: 50%; - animation: spin 0.8s linear infinite; -} -@keyframes spin { to { transform: rotate(360deg); } } -.state-text { font-size: 13px; color: #94a3b8; } - -.empty { padding: 40px 16px; text-align: center; color: #94a3b8; font-size: 13px; } - .list { padding: 0 16px; } .lead-card { diff --git a/src/pages/mine/MyOrders.vue b/src/pages/mine/MyOrders.vue index 3107ae8..71e3d3f 100644 --- a/src/pages/mine/MyOrders.vue +++ b/src/pages/mine/MyOrders.vue @@ -10,7 +10,7 @@ 服务进度一目了然 查看您的预约状态,随时掌握服务进度。 - 按状态查看订单,待确认可快速开始服务,进行中可直接填写报告。 + 按状态查看订单,待开始可点「开始服务」,进行中可填写报告。 @@ -25,43 +25,53 @@ -
-
-
{{ item.title }}
- {{ item.statusText }} -
-
- - {{ item.desc }} -
- -
-
- - + +
+
+
{{ item.title }}
+ {{ item.statusText }}
- -
-
-
- +
+ + {{ item.desc }} +
+ +
+
+ + +
+ +
+
+
+ +
-
+
- - 暂无数据
+ + diff --git a/src/pages/report-view/reportView.vue b/src/pages/report-view/reportView.vue index 90112e0..c3fd881 100644 --- a/src/pages/report-view/reportView.vue +++ b/src/pages/report-view/reportView.vue @@ -1,94 +1,88 @@