diff --git a/components/Aplayer.vue b/components/Aplayer.vue index 480e75f..b857d6f 100644 --- a/components/Aplayer.vue +++ b/components/Aplayer.vue @@ -33,7 +33,6 @@ const props = defineProps<{ }>() const emit = defineEmits(['onPlay', 'onAbort', 'onPause']) const { locale } = useCurrentLocale() -const { t } = useI18n() const player = ref() const coverzip = computed(() => { @@ -43,21 +42,21 @@ const coverzip = computed(() => { }) const sources = computed(() => { - if (_.isObject(props.videoUrl)) { - const keys = _.keys(props.videoUrl) - return keys.map(key => { + if (_.isArray(props.videoUrl)) { + return props.videoUrl.map((item: any) => { return { - src: props.videoUrl[key], + src: item.url, type: 'video/mp4', - label: key + label: item.label } }) - } else if (_.isArray(props.videoUrl)) { - return props.videoUrl.map((item: any) => { + } else if (_.isObject(props.videoUrl)) { + const keys = _.keys(props.videoUrl) + return keys.map(key => { return { - src: item.url, + src: props.videoUrl[key], type: 'video/mp4', - label: item.label + label: key } }) } else { diff --git a/composables/useMovieOper.ts b/composables/useMovieOper.ts index 55d880c..a4ef391 100644 --- a/composables/useMovieOper.ts +++ b/composables/useMovieOper.ts @@ -23,6 +23,7 @@ export const useMovieOperate = () => { isLoading.value = false } movieItem.loginVo.isLike = !movieItem.loginVo.isLike + if (movieItem.likeNums) movieItem.likeNums += movieItem.loginVo.isLike ? 1 : -1 } const pollMovie = (movieItem: MovieVo) => { @@ -32,11 +33,12 @@ export const useMovieOperate = () => { if (movieItem && movieItem.loginVo.isPoll) { ElMessage.warning(t('pollLimit')) } else { - ElMessageBox.confirm(t('pollTip'), '提示').then(async () => { + ElMessageBox.confirm(t('pollTip'), t('tip')).then(async () => { const { data } = await pollVideo(movieItem.movieId) - movieItem.loginVo && (movieItem.loginVo.isPoll = true) - if (data?.code === 200) { + if (data?.code === 200 && movieItem.loginVo) { + movieItem.loginVo && (movieItem.loginVo.isPoll = true) ElMessage.success(t('pollSuccess')) + if (movieItem.pollNums) movieItem.pollNums += movieItem.loginVo.isPoll ? 1 : -1 } }) } diff --git a/i18n/locales/cn.json b/i18n/locales/cn.json index 2c6beec..dc1c6b9 100644 --- a/i18n/locales/cn.json +++ b/i18n/locales/cn.json @@ -114,5 +114,8 @@ "tip": "提示", "more": "更多", "delete": "删除", - "gotoView": "前往查看" + "gotoView": "前往查看", + "enterreview": "请输入评论吧~", + "ping": "评", + "comment-area": "评论区" } diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 95636a8..d40d339 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -113,5 +113,8 @@ "tip": "Tip", "more": "See More", "delete": "Delete", - "gotoView": "Go to View" + "gotoView": "Go to View", + "enterreview": "Please send a review for this video~", + "ping": "Send", + "comment-area": "Comment Area" } diff --git a/i18n/locales/jp.json b/i18n/locales/jp.json index 626e7a9..65c289c 100644 --- a/i18n/locales/jp.json +++ b/i18n/locales/jp.json @@ -111,5 +111,8 @@ "pollTip": "この作品に票を入れますか? (1ユーザーが1日に入れる作品は2作品までです)", "tip": "注意", "delete": "削除", - "gotoView": "見に行く" + "gotoView": "見に行く", + "enterreview": "レビューを送ってくださいね~", + "ping": "送信", + "comment-area": "评论区" } diff --git a/pages/activity/[activityId]/history.vue b/pages/activity/[activityId]/history.vue index 4ade2b8..6476d79 100644 --- a/pages/activity/[activityId]/history.vue +++ b/pages/activity/[activityId]/history.vue @@ -38,35 +38,11 @@ type="primary" class="mt-2" @click="gotoActivity(`/activity/${activity.activityId}`)" - >前往查看{{ $t('gotoView') }} - @@ -75,7 +51,7 @@ import { useGlobalStore } from '~~/stores/global' import { useDayjs } from '#dayjs' import loading from '@/assets/img/1_1.gif' const { activityList, isLoading } = useActivityList() -const { config, unloading } = useGlobalStore() +const { unloading } = useGlobalStore() const { locale } = useCurrentLocale() const gotoActivity = useLocaleNavigate() const dayjs = useDayjs() @@ -85,6 +61,7 @@ const isOngoing = (dateStr1: any, dateStr2: any) => { const dateRange1 = dayjs(dateStr1).toDate().getTime() const dateRange2 = dayjs(dateStr2).toDate().getTime() const date = new Date().getTime() + if (date < dateRange1) return true return date < dateRange2 && date > dateRange1 } @@ -150,6 +127,7 @@ watchEffect(() => { } .img { width: 150px; + min-width: 150px; margin-right: 2rem; } } diff --git a/pages/activity/[activityId]/main.vue b/pages/activity/[activityId]/main.vue index 3dcca54..9eaeccb 100644 --- a/pages/activity/[activityId]/main.vue +++ b/pages/activity/[activityId]/main.vue @@ -182,7 +182,7 @@ const getDays = async () => { try { const { data } = await getActivityDays(props.activityId) if (data && data.length > 0) { - days.value = data + days.value = data.sort((a: any, b: any) => a.sortIndex - b.sortIndex) if (day.value && day.value !== -1) { currentDay.value = day.value return diff --git a/pages/activity/[activityId]/support.vue b/pages/activity/[activityId]/support.vue index 601d07a..40febb6 100644 --- a/pages/activity/[activityId]/support.vue +++ b/pages/activity/[activityId]/support.vue @@ -56,8 +56,8 @@
-
-
+
+
diff --git a/pages/movie/[movieId].vue b/pages/movie/[movieId].vue index 7ab13ca..688297a 100644 --- a/pages/movie/[movieId].vue +++ b/pages/movie/[movieId].vue @@ -170,7 +170,7 @@

- Comment Area ({{ total }}) + {{ $t('comment-area') }} ({{ total }})

@@ -195,7 +195,7 @@ />
- 评! + {{ + $t('ping') + }}