|
|
@@ -24,12 +24,12 @@
|
|
|
</view>
|
|
|
<view class="check-times">
|
|
|
<view class="time-item"
|
|
|
- ><text class="time">{{ inText }}</text
|
|
|
+ ><text class="time">{{ extractTime(inText) }}</text
|
|
|
><text class="time-label">上班 · {{ inLabel }}</text></view
|
|
|
>
|
|
|
<view class="time-line"></view>
|
|
|
<view class="time-item"
|
|
|
- ><text class="time" :class="{ muted: !daily.actualOut }">{{ outText }}</text
|
|
|
+ ><text class="time" :class="{ muted: !daily.actualOut }">{{ extractTime(outText) }}</text
|
|
|
><text class="time-label">下班 · {{ outLabel }}</text></view
|
|
|
>
|
|
|
</view>
|
|
|
@@ -172,9 +172,17 @@ const shiftText = computed(() => {
|
|
|
const end = daily.scheduledEnd || shiftInfo.endTime;
|
|
|
if (!start || !end) return "休息日";
|
|
|
const name = shiftInfo.ruleName || "今日班次";
|
|
|
- return `${name} · ${start} - ${end}`;
|
|
|
+ return `${name} · ${extractTime(start)} - ${extractTime(end)}`;
|
|
|
});
|
|
|
|
|
|
+// 后端返回的班次时间是 "2026-09-14 09:00:00" / ISO 等带日期的字符串,
|
|
|
+// 这里只展示 HH:MM,避免 2026-09-14 这种信息污染卡片
|
|
|
+function extractTime(value) {
|
|
|
+ if (value == null || value === "") return "";
|
|
|
+ const m = String(value).match(/(\d{1,2}:\d{2})(:\d{2})?/);
|
|
|
+ return m ? m[1] : String(value);
|
|
|
+}
|
|
|
+
|
|
|
const inText = computed(() => daily.actualIn || "--:--");
|
|
|
const outText = computed(() => daily.actualOut || "--:--");
|
|
|
|