|
|
@@ -187,10 +187,21 @@ onUnmounted(() => {
|
|
|
cleanupTimers();
|
|
|
});
|
|
|
|
|
|
-// 页面显示时重新激活轮询
|
|
|
+// 页面显示时重新激活轮询和倒计时
|
|
|
onShow(() => {
|
|
|
- if (doorStatus.value === 'opened' || doorStatus.value === 'closing') {
|
|
|
+ if (doorStatus.value === 'opened') {
|
|
|
isComponentActive = true;
|
|
|
+ // 重启选购倒计时(从当前剩余秒数继续)
|
|
|
+ if (!countdownTimer) {
|
|
|
+ startCountdown();
|
|
|
+ }
|
|
|
+ startStatusPolling();
|
|
|
+ } else if (doorStatus.value === 'closing') {
|
|
|
+ isComponentActive = true;
|
|
|
+ // 重启返回首页倒计时(从当前剩余秒数继续)
|
|
|
+ if (!returnCountdownTimer) {
|
|
|
+ startReturnCountdown();
|
|
|
+ }
|
|
|
startStatusPolling();
|
|
|
}
|
|
|
});
|