-
+
-
-
活动地址
-
- {{ tempActivity.address }}
+
+
{{ $t('page.activityDetail.activityDate') }}
+
+ {{ tempActivity.startTime }}
+
+
+
{{ $t('page.activityDetail.activityAddress') }}
+
+
{{ tempActivity.address }}
+
+ {{ $t('page.activityDetail.copyAddress') }}
+
+
+
+
+ {{ showMap ? $t('page.activityDetail.hideMap') : $t('page.activityDetail.showMap') }}
+
+
+
+
+
+
+
+
+
{{ $t('page.activityDetail.mapUnavailable') }}
+
+
+
+
+
-
主办方信息
+
{{ $t('page.activityDetail.organizerInfo') }}
-
-
-
举办者:
-
{{ tempActivity?.dept?.leader }}
+
+
+
+ {{ $t('page.activityDetail.organizer') }}:
+ {{ tempActivity?.dept?.leader }}
+
-
-
-
邮箱:
-
- {{ tempActivity?.dept?.email }}
-
+
+
+
+ {{ $t('page.activityDetail.email') }}:
+ {{ tempActivity?.dept?.email }}
+
+
+ {{ $t('page.activityDetail.copyEmail') }}
+
-
活动详情
+
{{ $t('page.activityDetail.activityDetails') }}
{{ tempActivity.details }}
-
+
- {{ loading ? '报名中...' : '立即报名' }}
+ {{ loading ? $t('page.activityDetail.signingUp') : $t('page.activityDetail.signUpNow') }}
@@ -126,7 +163,7 @@
\ No newline at end of file
diff --git a/src/i18n/locales/en_US.json b/src/i18n/locales/en_US.json
index cc7fcda..6cb36fa 100644
--- a/src/i18n/locales/en_US.json
+++ b/src/i18n/locales/en_US.json
@@ -180,6 +180,29 @@
"duration": "Duration"
}
},
+ "activityDetail": {
+ "recruitmentStatus": "Recruitment Status",
+ "activityDuration": "Activity Duration",
+ "hours": "hours",
+ "activityDate": "Activity Date",
+ "activityAddress": "Activity Address",
+ "copyAddress": "Copy Address",
+ "showMap": "Show Map",
+ "hideMap": "Hide Map",
+ "mapUnavailable": "Map service is currently unavailable",
+ "organizerInfo": "Organizer Information",
+ "organizer": "Organizer",
+ "email": "Email",
+ "copyEmail": "Copy Email",
+ "activityDetails": "Activity Details",
+ "signingUp": "Signing Up...",
+ "signUpNow": "Sign Up Now",
+ "signUpSuccess": "Sign up successful",
+ "signUpFailed": "Sign up failed",
+ "copySuccess": "Copy successful",
+ "copyFailed": "Copy failed",
+ "fetchFailed": "Failed to fetch activity details"
+ },
"userRecordInquiry": {
"stats": {
"totalHours": "Total Hours",
diff --git a/src/i18n/locales/zh_CN.json b/src/i18n/locales/zh_CN.json
index e665cb0..94e244f 100644
--- a/src/i18n/locales/zh_CN.json
+++ b/src/i18n/locales/zh_CN.json
@@ -179,6 +179,29 @@
"duration": "活动时长"
}
},
+ "activityDetail": {
+ "recruitmentStatus": "招募人数",
+ "activityDuration": "活动时间",
+ "hours": "小时",
+ "activityDate": "活动日期",
+ "activityAddress": "活动地址",
+ "copyAddress": "复制地址",
+ "showMap": "显示地图",
+ "hideMap": "隐藏地图",
+ "mapUnavailable": "地图服务暂不可用",
+ "organizerInfo": "主办方信息",
+ "organizer": "举办者",
+ "email": "邮箱",
+ "copyEmail": "复制邮箱",
+ "activityDetails": "活动详情",
+ "signingUp": "报名中...",
+ "signUpNow": "立即报名",
+ "signUpSuccess": "报名成功",
+ "signUpFailed": "报名失败",
+ "copySuccess": "复制成功",
+ "copyFailed": "复制失败",
+ "fetchFailed": "获取活动详情失败"
+ },
"userRecordInquiry": {
"stats": {
"totalHours": "累计时长",
diff --git a/src/utils/gradientColors.js b/src/utils/gradientColors.js
new file mode 100644
index 0000000..74bafc2
--- /dev/null
+++ b/src/utils/gradientColors.js
@@ -0,0 +1,38 @@
+// 定义渐变色配置
+export const gradients = {
+ blue: 'bg-gradient-to-br from-blue-400 to-indigo-600',
+ green: 'bg-gradient-to-br from-green-400 to-emerald-600',
+ purple: 'bg-gradient-to-br from-purple-400 to-fuchsia-600',
+ orange: 'bg-gradient-to-br from-orange-400 to-red-600',
+ teal: 'bg-gradient-to-br from-teal-400 to-cyan-600',
+ pink: 'bg-gradient-to-br from-pink-400 to-rose-600',
+ amber: 'bg-gradient-to-br from-amber-400 to-orange-600',
+ indigo: 'bg-gradient-to-br from-indigo-400 to-purple-600',
+ red: 'bg-gradient-to-br from-red-400 to-pink-600',
+ yellow: 'bg-gradient-to-br from-yellow-400 to-amber-600',
+};
+
+// 根据字符串生成确定的数字
+export function getHashCode(str) {
+ let hash = 0;
+ for (let i = 0; i < str.length; i++) {
+ const char = str.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return Math.abs(hash);
+}
+
+// 根据活动信息获取渐变色
+export function getGradientColor(activity) {
+ if (!activity) {
+ return gradients.blue;
+ }
+
+ const identifier = activity.activityId || activity.activityName || '';
+ const hashCode = getHashCode(identifier);
+ const gradientKeys = Object.keys(gradients);
+ const index = hashCode % gradientKeys.length;
+
+ return gradients[gradientKeys[index]];
+}
\ No newline at end of file