Initial commit of akmon project
This commit is contained in:
51
pages/mt/video.uvue
Normal file
51
pages/mt/video.uvue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<view :class="['mt-video', isLargeScreen ? 'large' : 'small']">
|
||||
<video :src="videoUrl" controls class="mt-video-player" />
|
||||
<text class="mt-video-title">{{ videoTitle }}</text>
|
||||
<view class="mt-video-actions">
|
||||
<button @tap="onFavorite">{{ $t('mt.video.favorite') }}</button>
|
||||
<button @tap="onShare">{{ $t('mt.video.share') }}</button>
|
||||
<button @tap="onLike">{{ $t('mt.video.like') }}</button>
|
||||
</view>
|
||||
<view class="mt-video-desc">{{ videoDesc }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="uts">
|
||||
import { responsiveState } from '@/utils/utils'
|
||||
import { ChatDataService } from '@/utils/chatDataService.uts'
|
||||
|
||||
const videoUrl = ref('')
|
||||
const videoTitle = ref('')
|
||||
const videoDesc = ref('')
|
||||
|
||||
|
||||
|
||||
function onFavorite() {
|
||||
// 收藏逻辑
|
||||
}
|
||||
function onShare() {
|
||||
// 分享逻辑
|
||||
}
|
||||
function onLike() {
|
||||
// 点赞逻辑
|
||||
}
|
||||
onLoad((params) => {
|
||||
if (params.url) {
|
||||
const u = params.url as string
|
||||
// resolve to cached local path; fallback to url if fails
|
||||
;(async () => { videoUrl.value = await ChatDataService.resolveVideoSource(u) })()
|
||||
}
|
||||
if (params.title) videoTitle.value = params.title
|
||||
if (params.desc) videoDesc.value = params.desc
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.mt-video {
|
||||
padding: 24rpx;
|
||||
&.large { max-width: 900rpx; margin: 0 auto; }
|
||||
.mt-video-player { width: 100%; height: 400rpx; border-radius: 12rpx; margin-bottom: 24rpx; }
|
||||
.mt-video-title { font-size: 36rpx; font-weight: bold; margin-bottom: 12rpx; }
|
||||
.mt-video-actions { display: flex; gap: 16rpx; margin-bottom: 16rpx; }
|
||||
.mt-video-desc { color: #888; font-size: 26rpx; }
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user