From e7b27888e3c0c306c27c85e954a2d24f02155950 Mon Sep 17 00:00:00 2001 From: lik Date: Thu, 3 Sep 2026 13:29:39 +0800 Subject: [PATCH] tmp --- app.json | 8 +- components/order-stats/index.wxss | 29 +++- images/chat-green.png | Bin 0 -> 1837 bytes images/home-green.png | Bin 0 -> 2047 bytes images/set-green.png | Bin 0 -> 3604 bytes pages/healthprofile/profileInfo.js | 53 +++++++ pages/healthprofile/profileInfo.less | 130 +++++++++++++++- pages/healthprofile/profileInfo.wxml | 21 +++ pages/home/index.js | 56 ++++--- pages/home/index.wxml | 23 ++- pages/home/index.wxss | 95 ++++++------ pages/order/orderDetail.js | 15 +- pages/order/orderDetail.wxml | 18 +-- pages/order/orderDetail.wxss | 45 ++++-- pages/set/index.js | 67 ++++----- pages/set/index.wxml | 53 ++++--- pages/set/index.wxss | 217 +++++++++++++++------------ 17 files changed, 565 insertions(+), 265 deletions(-) create mode 100644 images/chat-green.png create mode 100644 images/home-green.png create mode 100644 images/set-green.png diff --git a/app.json b/app.json index 0bf51e3..c5484a0 100644 --- a/app.json +++ b/app.json @@ -25,7 +25,7 @@ }, "tabBar": { "color": "#8a8a8a", - "selectedColor": "#1296db", + "selectedColor": "#1a8a63", "backgroundColor": "#ffffff", "borderStyle": "black", "list": [ @@ -33,19 +33,19 @@ "pagePath": "pages/home/index", "text": "首页", "iconPath": "images/home.png", - "selectedIconPath": "images/home-blue.png" + "selectedIconPath": "images/home-green.png" }, { "pagePath": "pages/ai/index", "text": "AI", "iconPath": "images/chat.png", - "selectedIconPath": "images/chat-blue.png" + "selectedIconPath": "images/chat-green.png" }, { "pagePath": "pages/set/index", "text": "设置", "iconPath": "images/set.png", - "selectedIconPath": "images/set-blue.png" + "selectedIconPath": "images/set-green.png" } ] }, diff --git a/components/order-stats/index.wxss b/components/order-stats/index.wxss index 56fefdd..ffb6c84 100644 --- a/components/order-stats/index.wxss +++ b/components/order-stats/index.wxss @@ -12,13 +12,26 @@ } .os-title { + position: relative; font-size: 30rpx; - font-weight: 500; + font-weight: 600; color: #1a1a1a; - margin-left: 8rpx; + margin-left: 20rpx; letter-spacing: 1rpx; } +.os-title::before { + content: ''; + position: absolute; + left: -20rpx; + top: 50%; + transform: translateY(-50%); + width: 8rpx; + height: 28rpx; + border-radius: 4rpx; + background: linear-gradient(180deg, #2dd36f, #17c3a5); +} + .os-card { background: linear-gradient(135deg, #ffffff 0%, #f3fbf8 100%); border-radius: 24rpx; @@ -63,11 +76,11 @@ } .os-num.blue { - color: #409eff; + color: #17c3a5; } .os-num.orange { - color: #ff9f43; + color: #f5a623; } .os-label { @@ -92,13 +105,13 @@ } .os-item:nth-child(3) .os-fee { - color: #3d8fe0; - background: rgba(64, 158, 255, 0.12); + color: #14a08a; + background: rgba(23, 195, 165, 0.12); } .os-item:nth-child(5) .os-fee { - color: #e08a1e; - background: rgba(255, 159, 67, 0.14); + color: #d99a2b; + background: rgba(245, 166, 35, 0.14); } .os-divider { diff --git a/images/chat-green.png b/images/chat-green.png new file mode 100644 index 0000000000000000000000000000000000000000..a21a4f4d7cb8170ea78bc2b34482206a7eaa2876 GIT binary patch literal 1837 zcmZ{lc~sJg7RP@uxBz8|OK6Uo;(~}vsi~EkJ1(SXJ#|tkqjJ}5GADCTabIyaF=e!@ z8ESB;d}>0LN#JOjJ{vW|kX%NLur$nN?7cbjM`zw2_ug~Q=bwA-_kPdK@xi<8gsH;- z0N9ChcP4CC@|Td8-Oi8gPVoRh_5;rOsQ+b}s5UZN^*EBO<+MmhTJ})8CTUQ7&5%I8K_s8CX#slX28T52+Sa>>K|k z_*1}SZQ|L18t zlT7YNS3`)FViWP{>JBoFeT99M?UEvf3k-=?VlY$fJSH7jCXWdji3@$!#OCa{5M7A8 zRSaZ_>zk?MM)?@1$N6DboDmZ%=*B0@a-Jb$?z4XFQz1G%-JqTR9o(jjWnbXW?f7id zn_w-zNDXG+D;bu+#on14i~|90{f6T*@)atcsA|(bt~PR5{+XF|98_j$a2m9v$LzcG zAhJcUgY_p}73n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?otEJA9*X^tVCT>E!%GSNn3^Er!>~(>6oXwNiOI%a!2G-nJ3QX zg+nZ~|6F0{l;B{L2x-p48(?<6G-tRB%v=H(Zzz$Yk zfG{Wq(h4~91#6|b>~|Vbv4cl`e7VS6GGBRlEb+yoz))7=CIe3KTIO=eMfDGr0i|<; zcOy768XKpEt%HRAOiOTzi(f2H+%)#BNvZqmlRXZ9osnG%GJc5~&HAb4fEPY0&-pfG zXRT8!^9LA|M!02LHfgvTok4CKPd>e|rAFF%?R_;`|D1QlzP<>n*B5~1{K>!Ug#I@9 zk(9E0j)EEmcPQH|HLk5}+2s*&T!HkZzw}m1*)tlAwJ?4^>Be4?tGmz%!bKSDq|gV7 zu+|VI6>C WNN%sQqujqAI{>-)kZ-%v&ix0~#+RP} literal 0 HcmV?d00001 diff --git a/images/set-green.png b/images/set-green.png new file mode 100644 index 0000000000000000000000000000000000000000..d078745c4c761fad462bc4748fdc5a100c47a056 GIT binary patch literal 3604 zcmV+v4(suWP) z3$Pbe9ml`iEE*IMga`yn@BxHSiSn2-$#|K8@~~!5kwFPd$_WrtP+pUPklIKFX5a%G zlV@ZgX`-Qsk|tdVG^ONmB}ELnSSCYrX1@QKojdpc-{1M|IlKGc-OtRffo@>KRYydDK`88Skaz5y=q*!e+5v93%|ld&~Fi*dDFski>}Wjtr0$0XSQ5&k6wj0Q3NG8WllJd9~*M_24}#9Mze6vZ4o& zjK-Y+HkbL`0bap-UDTO+YH}t3Qg%A3GxcOa0Hhyet_9$%m_IzdkOcvdjKuu_YAwpF z3l;s{xN$2Ji$M@v34w>kVNTxC`Z4GXG`1w;JGq7gG&Ic0&tL{zOl{+ z-{q}799~=tz$pM`TikykfTaMAa#k2fef%zth^Xv~*om(SW+@4M0qh2FWnhXw$j&!H zAZ0e+acY-|U0LB6~RCw=1{`@I`GZ=?wG<@$1p8Yr1SsVRA(#+<&d0TL=(Sghd&>6sI zs3QozvoMB6u|`G_0I33DE;W8Z_E59c5U%5Ik^eSo+IKwGHIhap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zr5o0bds@zx=bG8Tapv3q!hnVpm16``vAL>pnXO%;2X z5whk4txEJ@PC=7qHBF?kV)nusjvB zpN1}RrC`Qp1goUz>b!_~$jMnu0z`-#*SqPc~U z$yy5-MF6%jCtVn43lc_rjmM`PqYk{3_^~&=Yongtog}9)>sQGn-HS#vqvZJ=50a?F zT%jp?iB=^Y#T+a(17F*S`nVG_S{~vH`c?%$xn~tQ3DdwJZpn;*H^va!Mm}P0Wpk=} zkf9dF9gRsovH(0SJjw(C+y7)LliuJTCs`hhx%aV{lTSxwI&%ng5@uE(!`ZGba2TZ2 zUt%@;B9YU>&!=r&d-f0%hNW9le0E@OuGw(~seD8q1}o){OOGH^@ifFoDeth0Y@@E3 z#J0s5p)@T@=ezO=oJ${pxM;>~qibFG#5v$nwq?G;lP3ymEY215?iD=E^Ra8?LbO(L z35t@URm*7By)vedv>@-ent5v+I!MI16a+EOCJ!<5=rz=Z`{G2_v6*$6x|3j{}y=BP^ma(2?MoH3igeu*VdHL^(GIqM2X*02~S*uf^ z2WZuZg2jezjxuvCrhQ{2^D5uOQ$hOCfFlk1obK8c%|~?bqZK;uC{Mv0#xLfv6_PH_ zpm%JP*#Hg%AnIX{BY56GV~1dG<~aeaxy)2LRC=ZdujOE zvn~B&K20>Y0#ITdzoMrkC;(H~hB!_T^+GiZK#5vmXWHoLn+XLV&Tup@1)nZ@Pz5EY#_otO!8dA7p!!X7ALI6#+m3DPl4~ zApklG0Z1XsGg_BdvNQv1VO9^{EK6} item.label), bloodTypes: BLOOD_TYPES }, @@ -44,6 +53,50 @@ Page({ } }, + onShow() { + // 从订单页返回后刷新关联订单列表 + if (this.data.isEdit && this.data.profileId) { + this.loadProfileOrders(this.data.profileId) + } + }, + + /** + * 加载与本档案关联的预约订单 + */ + loadProfileOrders(profileId) { + API.escort.getAllRecords({ page: 1, pageSize: 50, healthProfileId: profileId }) + .then(res => { + if (res.code !== 0) return + const pad = (n) => String(n).padStart(2, '0') + const orderList = (res.data.records || []).map(item => { + const d = item.schedule && item.schedule.date ? new Date(item.schedule.date) : null + return { + ...item, + statusText: STATUS_TEXT_MAP[item.status] || item.status, + hospitalText: [item.hospital && item.hospital.name, item.hospital && item.hospital.department] + .filter(Boolean).join('·'), + schedule: { + ...item.schedule, + dateText: d && !isNaN(d.getTime()) + ? `${d.getMonth() + 1}月${d.getDate()}日 ${pad(d.getHours())}:${pad(d.getMinutes())}` + : '' + } + } + }) + this.setData({ orderList }) + }) + .catch(() => {}) + }, + + /** + * 点击关联订单,进入订单详情 + */ + onOrderTap(e) { + const id = e.currentTarget.dataset.id + if (!id) return + wx.navigateTo({ url: `/pages/order/orderDetail?id=${id}` }) + }, + /** * 加载档案详情 */ diff --git a/pages/healthprofile/profileInfo.less b/pages/healthprofile/profileInfo.less index 4b1c076..ef80177 100644 --- a/pages/healthprofile/profileInfo.less +++ b/pages/healthprofile/profileInfo.less @@ -21,11 +21,25 @@ page { } .section-title { + position: relative; display: block; - font-size: 32rpx; - font-weight: 700; + font-size: 30rpx; + font-weight: 600; color: #1a1a1a; - margin-left: 8rpx; + margin-left: 28rpx; + letter-spacing: 1rpx; + + &::before { + content: ''; + position: absolute; + left: -20rpx; + top: 50%; + transform: translateY(-50%); + width: 8rpx; + height: 28rpx; + border-radius: 4rpx; + background: linear-gradient(180deg, #2dd36f, #17c3a5); + } } .form-card { @@ -68,6 +82,116 @@ page { background-color: #f0f0f0; } +/* 关联预约订单 */ +.order-list { + margin-top: 16rpx; + display: flex; + flex-direction: column; + gap: 20rpx; +} + +.order-card { + background-color: #ffffff; + border-radius: 24rpx; + padding: 28rpx 32rpx; + box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); + + &:active { + opacity: 0.85; + } +} + +.order-line1 { + display: flex; + align-items: center; +} + +.order-patient { + font-size: 30rpx; + font-weight: 600; + color: #1a1a1a; + margin-right: 16rpx; +} + +.order-service { + font-size: 26rpx; + font-weight: 500; + color: #1abc9c; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.status-tag { + font-size: 22rpx; + padding: 6rpx 20rpx; + border-radius: 30rpx; + font-weight: 500; + flex-shrink: 0; +} + +.status-pending { + background: #fdf3e0; + color: #d99a2b; +} + +.status-confirmed { + background: #e6f4ee; + color: #43a08a; +} + +.status-in_progress { + background: #e6f4ee; + color: #43a08a; +} + +.status-completed { + background: #efedf6; + color: #8a7bb5; +} + +.status-cancelled { + background: #f5f5f5; + color: #b0b0b0; +} + +.order-line2 { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 12rpx; +} + +.order-hospital { + font-size: 26rpx; + color: #888888; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-right: 16rpx; +} + +.order-time { + font-size: 26rpx; + color: #a0a3bd; + flex-shrink: 0; +} + +.empty-order { + margin-top: 16rpx; + background-color: #ffffff; + border-radius: 24rpx; + padding: 48rpx 0; + text-align: center; + + text { + font-size: 26rpx; + color: #b8b8c4; + } +} + /* 操作按钮 */ .btn-group { display: flex; diff --git a/pages/healthprofile/profileInfo.wxml b/pages/healthprofile/profileInfo.wxml index 2c0a2be..eab66e1 100644 --- a/pages/healthprofile/profileInfo.wxml +++ b/pages/healthprofile/profileInfo.wxml @@ -81,6 +81,27 @@ + + + 预约订单 + + + + {{item.patient.name}} + {{item.escort.serviceName}} + {{item.statusText}} + + + {{item.hospitalText}} + {{item.schedule.dateText}} + + + + + 暂无关联的预约订单 + + + 陪诊预约 diff --git a/pages/home/index.js b/pages/home/index.js index b53c180..5cdbad4 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -4,18 +4,20 @@ const API = require('../../utils/api.js') Page({ data: { today: '', + greeting: '', + todayText: '', pendingCount: 0, completedCount: 0, recentOrders: [], - // 快捷入口:前3个为快捷操作(橙色系),后4个为功能入口(绿色系) + // 快捷入口:type=quick 为快捷操作(橙色系),type=function 为功能入口(绿色系),分行显示 quickEntries: [ - { icon: 'add-circle', name: '增加预约', url: '/pages/order/orderEdit', color: '#ff8f4d' }, - { icon: 'file-add', name: '增加档案', url: '/pages/healthprofile/profileInfo', color: '#ff8f4d' }, - { icon: 'lightbulb-circle-filled', name: 'AI办公', url: '/pages/ai/index', isTab: true, color: '#ff8f4d' }, - { icon: 'bill', name: '预约订单', url: '/pages/order/index', color: '#1abc9c' }, - { icon: 'heart', name: '健康档案', url: '/pages/healthprofile/index', color: '#1abc9c' }, - { icon: 'user', name: '注册用户', url: '/pages/customer/index', color: '#1abc9c' }, - { icon: 'user-circle', name: '个人信息', url: '/pages/me/index', color: '#1abc9c' } + { type: 'quick', icon: 'add-circle', name: '增加预约', url: '/pages/order/orderEdit', color: '#ff8f4d' }, + { type: 'quick', icon: 'file-add', name: '增加档案', url: '/pages/healthprofile/profileInfo', color: '#ff8f4d' }, + { type: 'quick', icon: 'lightbulb-circle-filled', name: 'AI办公', url: '/pages/ai/index', isTab: true, color: '#ff8f4d' }, + { type: 'function', icon: 'bill', name: '预约订单', url: '/pages/order/index', color: '#1abc9c' }, + { type: 'function', icon: 'heart', name: '健康档案', url: '/pages/healthprofile/index', color: '#1abc9c' }, + { type: 'function', icon: 'user', name: '注册用户', url: '/pages/customer/index', color: '#1abc9c' }, + { type: 'function', icon: 'user-circle', name: '个人信息', url: '/pages/me/index', color: '#1abc9c' } ], online: true, profile: { @@ -23,7 +25,7 @@ Page({ level: '初级陪诊师', avatar: '' }, - todayIncome: 168, + todayIncome: 0, todayOrderCount: 0, pendingOrder: { count: 1, @@ -63,7 +65,10 @@ Page({ this.loadUser() const now = new Date(); const today = now.toISOString().substring(0, 10); - this.setData({ today }); + const hour = now.getHours(); + const greeting = hour < 6 ? '夜深了' : hour < 9 ? '早上好' : hour < 12 ? '上午好' : hour < 14 ? '中午好' : hour < 18 ? '下午好' : '晚上好'; + const week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][now.getDay()]; + this.setData({ today, greeting, todayText: `${now.getMonth() + 1}月${now.getDate()}日 ${week}` }); this.getRecentOrders(); this.getStats(); }, @@ -104,16 +109,33 @@ Page({ }, async getStats() { - const today = new Date().toISOString().substring(0, 10); - const [todayRes, pendingRes, completedRes] = await Promise.all([ - API.escort.getAllRecords({ appointmentDate: today }), - API.escort.getAllRecords({ status: 'pending,confirmed' }), + const now = new Date(); + const pad = (n) => String(n).padStart(2, '0'); + // 本地日期(toISOString 是 UTC,早晨会差一天) + const todayStr = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`; + const isSameDay = (d, ref) => + d.getFullYear() === ref.getFullYear() && d.getMonth() === ref.getMonth() && d.getDate() === ref.getDate(); + const feeOf = (item) => Number(item.payment && item.payment.totalFee) || 0; + + const [todayRes, completedRes] = await Promise.all([ + API.escort.getAllRecords({ appointmentDate: todayStr }), API.escort.getAllRecords({ status: 'completed' }) ]); + + // 今日收益:当日已完成订单的费用合计 + let todayIncome = 0; + if (completedRes.code === 0) { + (completedRes.data.records || []).forEach(item => { + const d = item.schedule && item.schedule.date ? new Date(item.schedule.date) : null; + if (d && !isNaN(d.getTime()) && isSameDay(d, now)) { + todayIncome += feeOf(item); + } + }); + } + this.setData({ - todayOrderCount: todayRes.code === 0 ? (todayRes.data.records || []).length : 0, - pendingCount: pendingRes.code === 0 ? (pendingRes.data.records || []).length : 0, - completedCount: completedRes.code === 0 ? (completedRes.data.records || []).length : 0, + todayIncome, + todayOrderCount: todayRes.code === 0 ? (todayRes.data.records || []).length : 0 }); }, diff --git a/pages/home/index.wxml b/pages/home/index.wxml index 388e89b..6fc272f 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -15,6 +15,7 @@ {{profile.level}} + {{greeting}},{{todayText}} @@ -33,6 +34,7 @@ {{todayIncome}} + 今日接单 @@ -47,11 +49,21 @@ 快捷入口 - - - + + + + + + {{item.name}} + + + + + + + + {{item.name}} - {{item.name}} @@ -65,7 +77,7 @@ 近7日订单 全部 - + @@ -86,6 +98,7 @@ + 暂无近7日订单 diff --git a/pages/home/index.wxss b/pages/home/index.wxss index 2a4a1d8..9991adc 100644 --- a/pages/home/index.wxss +++ b/pages/home/index.wxss @@ -1,7 +1,7 @@ /* pages/home/index.wxss */ page { - background: linear-gradient(180deg, #ffb97a 0%, #f5f6fa 420rpx); + background: #f5f6fa; color: #1a1a2e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; } @@ -12,16 +12,15 @@ page { padding: 24rpx 24rpx 64rpx; } -/* === 头部信息卡(浅色玻璃) === */ +/* === 头部信息卡(翡翠绿实底) === */ .header-card { position: relative; overflow: hidden; - background: rgba(255, 255, 255, 0.62); - border: 1rpx solid rgba(255, 255, 255, 0.85); + background: linear-gradient(135deg, #29b785 0%, #1a8a63 100%); border-radius: 28rpx; padding: 36rpx 32rpx; - color: #3d2f25; - box-shadow: 0 12rpx 32rpx rgba(242, 100, 80, 0.16); + color: #ffffff; + box-shadow: 0 12rpx 32rpx rgba(26, 138, 99, 0.25); } /* 装饰光斑,增加层次 */ @@ -30,7 +29,7 @@ page { content: ''; position: absolute; border-radius: 50%; - background: rgba(255, 138, 61, 0.1); + background: rgba(255, 255, 255, 0.07); pointer-events: none; } @@ -46,7 +45,7 @@ page { height: 160rpx; bottom: -80rpx; left: -40rpx; - background: rgba(242, 100, 80, 0.08); + background: rgba(255, 255, 255, 0.05); } .profile-row { @@ -65,8 +64,8 @@ page { width: 96rpx; height: 96rpx; border-radius: 50%; - background-color: rgba(255, 138, 61, 0.15); - border: 2rpx solid rgba(255, 255, 255, 0.9); + background-color: rgba(255, 255, 255, 0.2); + border: 2rpx solid rgba(255, 255, 255, 0.45); display: flex; align-items: center; justify-content: center; @@ -82,7 +81,7 @@ page { .avatar-text { font-size: 40rpx; font-weight: 600; - color: #f2633f; + color: #ffffff; } .profile-info { @@ -101,21 +100,28 @@ page { .level-tag { margin-left: 12rpx; - background-color: rgba(242, 100, 80, 0.12); + background-color: rgba(255, 255, 255, 0.2); border-radius: 16rpx; padding: 4rpx 14rpx; } .level-text { font-size: 20rpx; - color: #e05a3a; + color: #ffffff; +} + +.greeting { + display: block; + margin-top: 8rpx; + font-size: 22rpx; + color: rgba(255, 255, 255, 0.65); } .online-switch { display: flex; align-items: center; - background-color: rgba(255, 255, 255, 0.75); - border: 1rpx solid rgba(255, 255, 255, 0.9); + background-color: rgba(255, 255, 255, 0.16); + border: 1rpx solid rgba(255, 255, 255, 0.28); border-radius: 28rpx; padding: 6rpx 6rpx 6rpx 18rpx; } @@ -123,14 +129,14 @@ page { .switch-text { font-size: 24rpx; margin-right: 10rpx; - color: #3d2f25; + color: #ffffff; } .switch-track { width: 56rpx; height: 32rpx; border-radius: 16rpx; - background-color: rgba(61, 47, 37, 0.15); + background-color: rgba(255, 255, 255, 0.35); position: relative; transition: background-color 0.2s ease; } @@ -152,7 +158,7 @@ page { .switch-track.on .switch-thumb { left: 26rpx; - background-color: #ff8f4d; + background-color: #1a8a63; } .stats-row { @@ -170,9 +176,14 @@ page { align-items: flex-end; } +.stat-divider { + width: 2rpx; + background: rgba(255, 255, 255, 0.25); +} + .stat-label { font-size: 24rpx; - color: rgba(61, 47, 37, 0.65); + color: rgba(255, 255, 255, 0.75); } .stat-value { @@ -191,7 +202,7 @@ page { font-size: 44rpx; font-weight: 700; line-height: 1; - color: #f2633f; + color: #ffffff; } /* === 通用 Section === */ @@ -230,16 +241,10 @@ page { .view-all { display: flex; align-items: center; - gap: 6rpx; font-size: 24rpx; color: #a0a3bd; } -.view-all .arrow { - font-size: 28rpx; - color: #a0a3bd; -} - /* === 快捷功能入口 === */ .card { background-color: #ffffff; @@ -255,6 +260,11 @@ page { flex-wrap: wrap; } +.quick-row { + display: flex; + width: 100%; +} + .quick-item { width: 25%; display: flex; @@ -272,7 +282,6 @@ page { .quick-icon { width: 88rpx; height: 88rpx; - background-color: #e6f9f3; border-radius: 26rpx; display: flex; align-items: center; @@ -282,7 +291,7 @@ page { } .quick-label { - font-size: 24rpx; + font-size: 26rpx; color: #3a3f4d; } @@ -338,23 +347,23 @@ page { } .status-pending { - background: #fff8e6; - color: #e6a23c; + background: #fdf3e0; + color: #d99a2b; } .status-confirmed { - background: #ecf5ff; - color: #409eff; + background: #e9f1f8; + color: #5c88a8; } .status-in_progress { - background: #f0f9eb; - color: #67c23a; + background: #e6f4ee; + color: #43a08a; } .status-completed { - background: #f4f0ff; - color: #7c5cfc; + background: #efedf6; + color: #8a7bb5; } .status-cancelled { @@ -370,7 +379,7 @@ page { } .order-hospital { - font-size: 24rpx; + font-size: 26rpx; color: #888888; flex: 1; overflow: hidden; @@ -380,7 +389,7 @@ page { } .order-time { - font-size: 24rpx; + font-size: 26rpx; color: #a0a3bd; flex-shrink: 0; } @@ -390,13 +399,15 @@ page { background: #ffffff; border-radius: 24rpx; border: 1rpx solid rgba(31, 61, 56, 0.06); - padding: 80rpx 0; - text-align: center; + padding: 64rpx 0; + display: flex; + flex-direction: column; + align-items: center; box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07); } .empty-text { - font-size: 28rpx; + margin-top: 16rpx; + font-size: 26rpx; color: #c0c3d4; - font-weight: 400; } diff --git a/pages/order/orderDetail.js b/pages/order/orderDetail.js index 412cb6c..c685e9b 100644 --- a/pages/order/orderDetail.js +++ b/pages/order/orderDetail.js @@ -133,8 +133,8 @@ Page({ paymentStatusText: PAYMENT_STATUS_MAP[payment.status] || payment.status || '未支付', attendantSexText: attendant.sex === 'male' ? '男' : attendant.sex === 'female' ? '女' : '', sexRequirementText: escort.sexRequirement === 'male' ? '要求男陪诊' : escort.sexRequirement === 'female' ? '要求女陪诊' : '不限', - // 操作按钮(待确认/已确认状态下可编辑订单信息) - showEditBtn: status === 'pending' || status === 'confirmed', + // 操作按钮(任何状态下均可编辑订单信息) + showEditBtn: true, showConfirmBtn: status === 'pending', showCancelBtn: status === 'pending', showStartBtn: status === 'confirmed', @@ -153,6 +153,17 @@ Page({ wx.makePhoneCall({ phoneNumber: phone }) }, + // 点击患者信息,进入健康档案详情 + onProfileTap() { + if (!this.data.healthProfileId) { + wx.showToast({ title: '该订单未关联健康档案', icon: 'none' }) + return + } + wx.navigateTo({ + url: `/pages/healthprofile/profileInfo?id=${this.data.healthProfileId}` + }) + }, + // 编辑订单 onEdit() { wx.navigateTo({ diff --git a/pages/order/orderDetail.wxml b/pages/order/orderDetail.wxml index c56e91a..113235b 100644 --- a/pages/order/orderDetail.wxml +++ b/pages/order/orderDetail.wxml @@ -24,20 +24,8 @@ use-cache="{{false}}" dial="{{true}}" bind:call="callPhone" + bindtap="onProfileTap" /> - - - 体重 - {{order.patient.weight}}kg - - - 身高 - {{order.patient.height}}cm - - - 身份证号 - {{order.patient.idnumber}} - @@ -133,10 +121,6 @@ 服务费用 ¥{{order.payment.totalFee || 0}} - - 已支付 - ¥{{order.payment.paidFee}} - 支付状态 {{paymentStatusText}} diff --git a/pages/order/orderDetail.wxss b/pages/order/orderDetail.wxss index 039c1e0..db593d5 100644 --- a/pages/order/orderDetail.wxss +++ b/pages/order/orderDetail.wxss @@ -89,17 +89,30 @@ page { } .section-title { - font-size: 32rpx; - font-weight: 700; + position: relative; + font-size: 30rpx; + font-weight: 600; color: #1a1a1a; - margin-bottom: 16rpx; - margin-left: 8rpx; + margin-bottom: 24rpx; + margin-left: 20rpx; letter-spacing: 1rpx; } +.section-title::before { + content: ''; + position: absolute; + left: -20rpx; + top: 50%; + transform: translateY(-50%); + width: 8rpx; + height: 28rpx; + border-radius: 4rpx; + background: linear-gradient(180deg, #2dd36f, #17c3a5); +} + .info-card { background: #ffffff; - border-radius: 24rpx; + border-radius: 8rpx; padding: 28rpx; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); } @@ -115,14 +128,14 @@ page { } .info-label { - font-size: 24rpx; + font-size: 28rpx; color: #a0a3bd; width: 140rpx; flex-shrink: 0; } .info-value { - font-size: 26rpx; + font-size: 28rpx; color: #3a3d5c; flex: 1; } @@ -150,12 +163,12 @@ page { } .patient-age { - font-size: 24rpx; + font-size: 26rpx; color: #a0a3bd; } .patient-phone { - font-size: 24rpx; + font-size: 26rpx; color: #a0a3bd; } @@ -208,7 +221,7 @@ page { } .attendant-phone { - font-size: 24rpx; + font-size: 26rpx; color: #a0a3bd; } @@ -222,7 +235,9 @@ page { /* === 备注信息 === */ .note-block { - margin-bottom: 20rpx; + display: flex; + align-items: baseline; + margin-bottom: 16rpx; } .note-block:last-child { @@ -230,18 +245,18 @@ page { } .note-label { - display: block; - font-size: 24rpx; + font-size: 26rpx; color: #a0a3bd; - margin-bottom: 8rpx; + width: 140rpx; + flex-shrink: 0; font-weight: 500; } .note-content { - display: block; font-size: 26rpx; color: #3a3d5c; line-height: 1.6; + flex: 1; } /* === 底部操作 === */ diff --git a/pages/set/index.js b/pages/set/index.js index 08987c6..fcb4d63 100644 --- a/pages/set/index.js +++ b/pages/set/index.js @@ -3,8 +3,9 @@ const API = require('../../utils/api.js') Page({ data: { isLoggedIn: false, - userInfo: null, - phoneNumber: '', + displayName: '', + avatar: '', + levelText: '初级陪诊员', version: '1.0.0', showLoginPopup: false, loginForm: { @@ -12,7 +13,7 @@ Page({ mobile: '' }, menuList: [ - { icon: 'user', title: '个人资料', url: '' }, + { icon: 'user', title: '个人资料', url: '/pages/me/index' }, { icon: 'notification', title: '消息通知', url: '' }, { icon: 'lock-on', title: '账号安全', url: '' }, { icon: 'help-circle', title: '帮助中心', url: '' }, @@ -38,28 +39,34 @@ Page({ }, onUserLogin(user) { - this.setData({ - isLoggedIn: true, - userInfo: user, - phoneNumber: this.maskPhoneNumber(user.mobile || '') - }) + this.applyUser(user) }, checkLoginStatus() { const app = getApp() - const user = app.globalData.user - if (user && user.security && user.security.token) { - this.setData({ - isLoggedIn: true, - userInfo: user, - phoneNumber: this.maskPhoneNumber(user.mobile || '') - }) - } + this.applyUser(app.globalData.user) }, - maskPhoneNumber(phone) { - if (!phone || phone.length < 7) return phone - return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') + /** + * 将用户对象映射为页面展示字段(真实信息) + */ + applyUser(user) { + if (!user || !user.security || !user.security.token) { + this.setData({ + isLoggedIn: false, + displayName: '', + avatar: '', + levelText: '初级陪诊员' + }) + return + } + const p = user.profile || {} + this.setData({ + isLoggedIn: true, + displayName: p.name || '管理员', + avatar: p.avatar || '', + levelText: user.level || p.level || '初级陪诊员' + }) }, getAppVersion() { @@ -112,14 +119,12 @@ Page({ if (data.code == 0) { const app = getApp() app.globalData.user = data.data.user + this.applyUser(app.globalData.user) this.setData({ - isLoggedIn: true, - userInfo: app.globalData.user, - phoneNumber: this.maskPhoneNumber(app.globalData.user.profile.mobile || ''), showLoginPopup: false, loginForm: { name: '', mobile: '' } }) - + wx.showToast({ title: '登录成功', icon: 'success' }) } else { wx.showToast({ title: '登录失败', icon: 'none' }) @@ -159,7 +164,7 @@ Page({ wx.showModal({ title: '退出登录', content: '确定要退出登录吗?', - confirmColor: '#4c6ef5', + confirmColor: '#1a8a63', success: (res) => { if (res.confirm) { wx.showLoading({ title: '退出中...' }) @@ -183,11 +188,7 @@ Page({ wx.removeStorageSync('admin_ai_session_id') wx.removeStorageSync('admin_ai_chat_history') - this.setData({ - isLoggedIn: false, - userInfo: null, - phoneNumber: '' - }) + this.applyUser(null) wx.showToast({ title: '已退出登录', icon: 'success' }) }, @@ -200,18 +201,14 @@ Page({ wx.showModal({ title: '清除缓存', content: '确定要清除所有缓存数据吗?', - confirmColor: '#4c6ef5', + confirmColor: '#1a8a63', success: (res) => { if (res.confirm) { wx.clearStorage({ success: () => { const app = getApp() app.globalData.user = null - this.setData({ - isLoggedIn: false, - userInfo: null, - phoneNumber: '' - }) + this.applyUser(null) wx.showToast({ title: '缓存已清除', icon: 'success' }) } }) diff --git a/pages/set/index.wxml b/pages/set/index.wxml index 0fcf01c..e675445 100644 --- a/pages/set/index.wxml +++ b/pages/set/index.wxml @@ -1,21 +1,23 @@ - +