Skip to content

Commit

Permalink
fix: some display bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ADKcodeXD committed Mar 11, 2024
1 parent 0384714 commit a8969c3
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 50 deletions.
19 changes: 9 additions & 10 deletions components/Aplayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions composables/useMovieOper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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
}
})
}
Expand Down
5 changes: 4 additions & 1 deletion i18n/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,8 @@
"tip": "提示",
"more": "更多",
"delete": "删除",
"gotoView": "前往查看"
"gotoView": "前往查看",
"enterreview": "请输入评论吧~",
"ping": "",
"comment-area": "评论区"
}
5 changes: 4 additions & 1 deletion i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
5 changes: 4 additions & 1 deletion i18n/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,8 @@
"pollTip": "この作品に票を入れますか? (1ユーザーが1日に入れる作品は2作品までです)",
"tip": "注意",
"delete": "削除",
"gotoView": "見に行く"
"gotoView": "見に行く",
"enterreview": "レビューを送ってくださいね~",
"ping": "送信",
"comment-area": "评论区"
}
30 changes: 4 additions & 26 deletions pages/activity/[activityId]/history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,11 @@
type="primary"
class="mt-2"
@click="gotoActivity(`/activity/${activity.activityId}`)"
>前往查看</ElButton
>{{ $t('gotoView') }}</ElButton
>
</div>
</div>
</div>
<!-- <div
class="activity-content"
v-for="activity in activityList?.result"
:key="activity.activityId"
@click="gotoActivity(`/activity/${activity.activityId}`)"
>
<div class="img">
<MyCustomImage :img="activity.activityLogo" />
</div>
<div class="info px-2">
<div class="info-header">
<p class="title">
{{ activity.activityName[locale] || activity.activityName['cn'] }}
</p>
<span class="tag-primary ml-2"> {{ $t('xxActivity', [activity.activityId]) }}</span>
<span class="tag-day ml-2" v-if="config?.currentActivityId === activity.activityId">
{{ $t('currentactivity') }}</span
>
</div>
<p v-if="activity.startTime && activity.endTime">
{{ $t('startAndEndTime') }}:{{ activity.startTime }} - {{ activity.endTime }}
</p>
</div>
</div> -->
</div>
</template>
Expand All @@ -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()
Expand All @@ -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
}
Expand Down Expand Up @@ -150,6 +127,7 @@ watchEffect(() => {
}
.img {
width: 150px;
min-width: 150px;
margin-right: 2rem;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pages/activity/[activityId]/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pages/activity/[activityId]/support.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
</div>
</template>
<div v-else-if="currentActiveSponsor" class="w-full h-full flex items-center justify-center">
<div class="w-3/5 text-center">
<div :style="{ maxHeight: currentActiveSponsor.sponsorName.cn ? '400px' : '500px' }">
<div class="w-4/5 flex flex-col items-center justify-center text-center">
<div style="max-height: 400px">
<MyCustomImage :img="currentActiveSponsor.sponsorLogo" />
</div>
<div class="title">
Expand Down
10 changes: 5 additions & 5 deletions pages/movie/[movieId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<div class="underright">
<div class="movie-comment-area ml-4">
<p class="comment-area-title text-light-50 flex items-center mb-2">
<span class="mark block"></span>Comment Area ({{ total }})
<span class="mark block"></span>{{ $t('comment-area') }} ({{ total }})
</p>
<div class="flex-1 overflow-auto review-area">
<ElEmpty :description="$t('noComment')" v-if="comments.length === 0" />
Expand All @@ -195,17 +195,17 @@
/>
<div class="relative">
<ElInput
placeholder="请输入评论吧~"
:placeholder="$t('enterreview')"
:rows="2"
v-model="content"
type="textarea"
resize="none"
@focus="isFocus = true"
@blur="isFocus = false"
></ElInput>
<ElButton type="danger" @click="sentComment" size="small" class="button"
>!</ElButton
>
<ElButton type="danger" @click="sentComment" size="small" class="button">{{
$t('ping')
}}</ElButton>
</div>
</div>
</div>
Expand Down

0 comments on commit a8969c3

Please sign in to comment.