feat(admin): 司機評價欄與訂單評分呈現(B5 下游) - #22
Merged
Merged
Conversation
評分上線後只有司機自己看得到;營運方要能一眼找出評價低的司機,客服要能回答 「這位乘客給了幾分、寫了什麼」。 - Driver 型別加 RatingAvg/RatingCount;normalizeDriver 走 num(),舊後端不帶 rating_* 時自然歸零,等同「尚無評分」,不需另做缺鍵判斷。 - 司機管理頁「評價」欄:有評分顯示星+平均+則數(tooltip 說明幾位乘客評的), 沒評分顯示「尚無評分」而非 0.0——0 則不代表差,渲染成 0.0 顆星會看起來像 被評成 0 分。可排序,且沒評分的一律排最後(不該混進低分名單)。 - RATING_COLOR:< 3.5 紅、< 4.5 黃、其餘金。低分要一眼看得出來,那是營運會 採取行動的訊號;門檻純呈現用,不參與任何計算或派單邏輯。 - 訂單詳情加「乘客評分」卡:唯讀 Rate + 分數 + 時間 + 評論;只給星等沒留言 時明說,未評分整塊不顯示(沒評不是缺資料,空卡片只會讓人以為壞了)。 - RideDetail.rating 為 null 表示未評分(後端不帶該鍵)。 驗收:tsc 無誤、oxlint 乾淨、vitest 123 passed(原 118+新 5)。 反向確認拿掉排序的「沒評分排最後」特例,該案會 FAIL。 瀏覽器實跑(dev server + dispatch docker):司機列表顯示 4.5 (2) 與「尚無評分」, 與 API 一致;訂單詳情顯示 5/5+評論、Rate 為 disabled;未評分的訂單無該卡片。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
評分(B5)上線後只有司機自己看得到。營運方要能一眼找出評價低的司機,
客服要能回答**「這位乘客給了幾分、寫了什麼」**。
改了什麼
Driver型別加RatingAvg/RatingCount;normalizeDriver走既有的num(),舊後端不帶
rating_*時自然歸零=「尚無評分」,不需另做缺鍵判斷。沒評分顯示「尚無評分」而非 0.0——0 則不代表差,渲染成 0.0 顆星會看起來像被評成 0 分。
可排序,且沒評分的一律排最後(不該混進低分名單)。
RATING_COLOR:< 3.5 紅、< 4.5 黃、其餘金。低分要一眼看得出來,那是營運會採取行動的訊號;門檻純呈現用,不參與任何計算或派單邏輯。
Rate+ 分數 + 時間 + 評論;只給星等沒留言時明說,未評分整塊不顯示(沒評不是缺資料,空卡片只會讓人以為壞了)。
驗收
tsc --noEmit無誤、oxlint乾淨、vitest123 passed(原 118+新 5)。4.5 (2)與「尚無評分」,與 API 回的rating_avg=4.5 rating_count=2一致。Rate為 disabled(admin 不能改乘客的評分)。hasRatingCard: false)。🤖 Generated with Claude Code