|
@@ -34,13 +34,13 @@
|
|
|
<view class="d-timedown-card">
|
|
|
<view class="d-title">距离报名结束</view>
|
|
|
<view class="timedown">
|
|
|
- <view class="time">{{ days? days: '--' }}</view>
|
|
|
+ <view class="time">{{ days ? days : '--' }}</view>
|
|
|
<view class="unit">天</view>
|
|
|
- <view class="time">{{ hours? hours:'--' }}</view>
|
|
|
+ <view class="time">{{ hours ? hours : '--' }}</view>
|
|
|
<view class="unit">:</view>
|
|
|
- <view class="time">{{ minutes ? minutes: '--' }}</view>
|
|
|
+ <view class="time">{{ minutes ? minutes : '--' }}</view>
|
|
|
<view class="unit">:</view>
|
|
|
- <view class="time">{{ seconds ? seconds: '--' }}</view>
|
|
|
+ <view class="time">{{ seconds ? seconds : '--' }}</view>
|
|
|
</view>
|
|
|
<view class="timedown-tips">
|
|
|
<view class="tips-icon">!</view>
|
|
@@ -90,7 +90,7 @@
|
|
|
<view class="">已报名人数:{{ eventsInfoObj.orderNum }}</view>
|
|
|
</view>
|
|
|
<view class="cell-num-header">
|
|
|
- <view class="img" v-for="(item,index) in groupedMessages" :key="index">
|
|
|
+ <view class="img" v-for="(item, index) in groupedMessages" :key="index">
|
|
|
<image :src="item.avatar" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -156,7 +156,7 @@ import { ref, onMounted, computed, onUnmounted, getCurrentInstance, nextTick } f
|
|
|
import { http } from '@/utils/http';
|
|
|
import { useCacheStore } from '@/stores/cache';
|
|
|
import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
|
|
|
-import { RouterUtils, TipsUtils,fixImgStyle } from '@/utils/util';
|
|
|
+import { RouterUtils, TipsUtils, fixImgStyle } from '@/utils/util';
|
|
|
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
|
|
|
const statusBarHeight = ref(0);
|
|
|
const cache = useCacheStore()
|
|
@@ -278,36 +278,36 @@ const seconds = ref<string>('00');
|
|
|
let timer: number | null = null;
|
|
|
// 将日期字符串转换为 iOS 支持的格式
|
|
|
const formatDateForIOS = (dateStr: string): string => {
|
|
|
- // 将 "yyyy-MM-dd HH:mm:ss" 转换为 "yyyy/MM/dd HH:mm:ss"
|
|
|
- return dateStr.replace(/-/g, '/');
|
|
|
+ // 将 "yyyy-MM-dd HH:mm:ss" 转换为 "yyyy/MM/dd HH:mm:ss"
|
|
|
+ return dateStr.replace(/-/g, '/');
|
|
|
};
|
|
|
const updateCountdown = () => {
|
|
|
- const now = new Date().getTime();
|
|
|
- // 使用格式化后的日期字符串
|
|
|
- const formattedEndTime = formatDateForIOS(endTime.value);
|
|
|
- const endDate = new Date(formattedEndTime).getTime();
|
|
|
- const timeLeft = endDate - now;
|
|
|
- if (timeLeft <= 0) {
|
|
|
- days.value = '00';
|
|
|
- hours.value = '00';
|
|
|
- minutes.value = '00';
|
|
|
- seconds.value = '00';
|
|
|
- if (timer) {
|
|
|
- clearInterval(timer);
|
|
|
- timer = null;
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- // 计算剩余时间并更新显示
|
|
|
- const calcDays = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
|
|
|
- const calcHours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
|
|
- const calcMinutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
|
|
|
- const calcSeconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
|
|
|
-
|
|
|
- days.value = String(calcDays).padStart(2, '0');
|
|
|
- hours.value = String(calcHours).padStart(2, '0');
|
|
|
- minutes.value = String(calcMinutes).padStart(2, '0');
|
|
|
- seconds.value = String(calcSeconds).padStart(2, '0');
|
|
|
+ const now = new Date().getTime();
|
|
|
+ // 使用格式化后的日期字符串
|
|
|
+ const formattedEndTime = formatDateForIOS(endTime.value);
|
|
|
+ const endDate = new Date(formattedEndTime).getTime();
|
|
|
+ const timeLeft = endDate - now;
|
|
|
+ if (timeLeft <= 0) {
|
|
|
+ days.value = '00';
|
|
|
+ hours.value = '00';
|
|
|
+ minutes.value = '00';
|
|
|
+ seconds.value = '00';
|
|
|
+ if (timer) {
|
|
|
+ clearInterval(timer);
|
|
|
+ timer = null;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 计算剩余时间并更新显示
|
|
|
+ const calcDays = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
|
|
|
+ const calcHours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
|
|
+ const calcMinutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
|
|
|
+ const calcSeconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
|
|
|
+
|
|
|
+ days.value = String(calcDays).padStart(2, '0');
|
|
|
+ hours.value = String(calcHours).padStart(2, '0');
|
|
|
+ minutes.value = String(calcMinutes).padStart(2, '0');
|
|
|
+ seconds.value = String(calcSeconds).padStart(2, '0');
|
|
|
};
|
|
|
// 获取详情数据
|
|
|
const eventsInfoObj = ref({})
|
|
@@ -329,6 +329,8 @@ const open_map = () => {
|
|
|
uni.openLocation({
|
|
|
latitude: eventsInfoObj.value.latitude,
|
|
|
longitude: eventsInfoObj.value.longitude,
|
|
|
+ name: eventsInfoObj.value.name,
|
|
|
+ address: eventsInfoObj.value.address,
|
|
|
success: function () {
|
|
|
console.log('success');
|
|
|
}
|