unifiedinteraction
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
<text class="date-text">{{ post.time }}</text>
|
<text class="date-text">{{ post.time }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="spacerview"></view>
|
<view class="spacerview"></view>
|
||||||
<view class="toseeall">
|
<view class="toseeall" @tap="handleInteraction">
|
||||||
<text class="toseealltext">查看全文</text>
|
<text class="toseealltext">查看全文</text>
|
||||||
<image src="@/static/imgs/arrowrightup/arrowrightup@3x.png" class="arrowrightupicon" mode="aspectFit"
|
<image src="@/static/imgs/arrowrightup/arrowrightup@3x.png" class="arrowrightupicon" mode="aspectFit"
|
||||||
alt="查看全文图标" />
|
alt="查看全文图标" />
|
||||||
@@ -172,6 +172,10 @@ const fetchPostData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理点击查看全文
|
||||||
|
const handleInteraction = () => {
|
||||||
|
common.openapp();
|
||||||
|
}
|
||||||
// 组件挂载时获取数据
|
// 组件挂载时获取数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchPostData()
|
fetchPostData()
|
||||||
|
|||||||
@@ -32,25 +32,25 @@
|
|||||||
<!-- 头像+关注 -->
|
<!-- 头像+关注 -->
|
||||||
<view class="user-section">
|
<view class="user-section">
|
||||||
<image :src="videoData.userImg" class="user-avatar" mode="aspectFill"></image>
|
<image :src="videoData.userImg" class="user-avatar" mode="aspectFill"></image>
|
||||||
<view class="follow-btn-container" @tap="toggleFollow">
|
<view class="follow-btn-container" @tap="() => handleInteraction('follow')">
|
||||||
<image src="/static/imgs/followbtn/btn@3x.webp" mode="aspectFit"></image>
|
<image src="/static/imgs/followbtn/btn@3x.webp" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 点赞按钮 -->
|
<!-- 点赞按钮 -->
|
||||||
<view class="action-btn" @tap="toggleLike">
|
<view class="action-btn" @tap="() => handleInteraction('like')">
|
||||||
<image src="/static/imgs/likeicon2/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
<image src="/static/imgs/likeicon2/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
||||||
<text class="action-count">{{ formatCount(videoData.likesum) }}</text>
|
<text class="action-count">{{ formatCount(videoData.likesum) }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评论按钮 -->
|
<!-- 评论按钮 -->
|
||||||
<view class="action-btn" @tap="openComments">
|
<view class="action-btn" @tap="() => handleInteraction('comment')">
|
||||||
<image src="/static/imgs/commenticon/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
<image src="/static/imgs/commenticon/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
||||||
<text class="action-count">{{ formatCount(videoData.commentsum) }}</text>
|
<text class="action-count">{{ formatCount(videoData.commentsum) }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 分享按钮 -->
|
<!-- 分享按钮 -->
|
||||||
<view class="action-btn" @tap="shareVideo">
|
<view class="action-btn" @tap="() => handleInteraction('share')">
|
||||||
<image src="/static/imgs/shareicon/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
<image src="/static/imgs/shareicon/icon-2@3x.webp" class="action-icon" mode="aspectFit"></image>
|
||||||
<text class="action-count">{{ formatCount(videoData.sharesum) }}</text>
|
<text class="action-count">{{ formatCount(videoData.sharesum) }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -81,7 +81,6 @@ const formatDate = common.formatDate
|
|||||||
// 折叠展开状态
|
// 折叠展开状态
|
||||||
const isExpanded = ref(false)
|
const isExpanded = ref(false)
|
||||||
const videoRef = ref(null)
|
const videoRef = ref(null)
|
||||||
const ctx = ref(null)
|
|
||||||
// 静音状态
|
// 静音状态
|
||||||
const isMuted = ref(false)
|
const isMuted = ref(false)
|
||||||
// 播放状态
|
// 播放状态
|
||||||
@@ -209,23 +208,8 @@ const pausevideo = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关注
|
// 统一处理交互操作
|
||||||
const toggleFollow = () => {
|
const handleInteraction = () => {
|
||||||
common.openapp();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点赞
|
|
||||||
const toggleLike = () => {
|
|
||||||
common.openapp();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打开评论
|
|
||||||
const openComments = () => {
|
|
||||||
common.openapp();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分享视频
|
|
||||||
const shareVideo = () => {
|
|
||||||
common.openapp();
|
common.openapp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user