合并代码

This commit is contained in:
sx 2025-01-07 23:13:56 +08:00
parent b07032764e
commit 5c80ff7a73
10 changed files with 90 additions and 70 deletions

View File

@ -9,8 +9,8 @@ const video = {
*/
homeVideo(param) {
return util.request({
url: `/video/video/list`,
// url: `/video/api/queryVideoByPage`,
// url: `/video/video/list`,
url: `/video/api/queryVideoByPage`,
query: param.query,
method: 'GET',
})
@ -22,8 +22,8 @@ const video = {
*/
saveVideo(param) {
return util.request({
url: `/video/video/add`,
// url: `/video/api/saveVideo`,
// url: `/video/video/add`,
url: `/video/api/saveVideo`,
data: param.data,
method: 'POST',
})
@ -53,6 +53,30 @@ const video = {
})
},
/**
* 视频 点赞取消赞
* @param {Object} param
*/
videoLike(param) {
return util.request({
url: `/home/videoLike`,
query: param.query,
method: 'POST',
})
},
/**
* 观看视频记录接口
* @param {Object} param
*/
browseLog(param) {
return util.request({
url: `/video/Effective/second`,
data: param.data,
method: 'POST',
})
},
/**
* 查看标签分类
* @param {Object} param
@ -253,9 +277,9 @@ const video = {
*/
commentList(param) {
return util.request({
url: `/home/commentList`,
url: `/video/api/getCommentsByParams`,
query: param.query,
method: 'POST',
method: 'GET',
})
},
@ -283,30 +307,6 @@ const video = {
})
},
/**
* 视频 点赞取消赞
* @param {Object} param
*/
videoLike(param) {
return util.request({
url: `/home/videoLike`,
query: param.query,
method: 'POST',
})
},
/**
* 观看视频记录接口
* @param {Object} param
*/
browseLog(param) {
return util.request({
url: `/video/Effective/second`,
data: param.data,
method: 'POST',
})
},
/**
* 热点视频
* @param {Object} param

View File

@ -5,7 +5,7 @@ const config = {
host: 'http://localhost:5173',
// #endif
// #ifndef H5
host: 'http://7fee92ac.r22.cpolar.top',
host: 'http://13859d41.r22.cpolar.top',
// host: 'http://192.168.1.236:8080',
// #endif
// 上传文件二级路径

View File

@ -52,13 +52,12 @@
})
onBeforeUnmount(() => {
uni.offKeyboardHeightChange(rs => {
console.log('rs', rs)
})
uni.offKeyboardHeightChange()
})
//
function refreshList() {
console.log('refreshList')
listProperty.total = 0
listProperty.pageNum = 1
getList()
@ -69,7 +68,7 @@
//
api.video.commentList({
query: {
videoId: detail.videoId,
videoId: detail.id,
pageSize: listProperty.pageSize,
pageNume: listProperty.pageNum,
}
@ -111,6 +110,7 @@
return
}
//
api.video.comment({
query: {
partentId: reply.id ? reply.id : 0,
@ -143,7 +143,7 @@
* @param {Object} item 当前视频对象
*/
function open(item) {
if (detail.videoId != item.videoId) {
if (detail.id != item.id) {
Object.assign(detail, {}, item)
//
refreshList()

View File

@ -515,13 +515,15 @@
<view class="item">
<view class="col">
<view class="pr">
<image class="wh50" src="/static/indexLike.png" mode="aspectFit" v-if="item.isLike == 0"
@click="handleLike(index, 0)" @longpress="handlePrivateLike(index)" />
<image class="wh50" src="/static/indexLike.png" mode="aspectFit"
v-if="item.likeStatus == 0" @click="handleLike(index, 0)"
@longpress="handlePrivateLike(index)" />
<!-- 公开赞 -->
<image class="wh50" src="/static/indexLike1.png" mode="aspectFit"
v-else-if="item.isLike == 1" @click="handleLike(index, 1)" />
v-else-if="item.likeStatus == 1" @click="handleLike(index, 1)" />
<!-- 私密赞的图标 -->
<image class="wh50" src="/static/privateLike.png" mode="aspectFit"
v-else-if="item.isLike == 3" @click="handleLike(index, 1)" />
v-else-if="item.likeStatus == 2" @click="handleLike(index, 1)" />
</view>
<view class="txt mt10">
<text class="text">{{ item.publicLikeCount }}</text>

View File

@ -286,7 +286,7 @@
pageSize: recList.pageSize,
}
}).then(rs => {
console.log('getRecList then rs', recList, rs)
console.log('getRecList then rs', rs)
// 设置列表
setList(rs, recList)
})
@ -588,31 +588,25 @@
index,
isLike
} = param
// 当前项
const item = tabCurrent.value.listData()[index]
// 操作状态
let type = 1
// 0未点赞 1已点赞 3私密赞
if (item.isLike == 0) type = isLike
// 请求
let request = api.video.cancelLikes
// 如果不是取消点赞
if (isLike !== 0) request = api.video.saveLikes
//
api.video.videoLike({
query: {
// 0赞1取消赞 3私密赞
type,
request({
data: {
// 0未点赞 1公开赞 2私密赞
type: isLike,
// 视频id
videoId: item.videoId,
videoId: item.id,
}
}).then(rs => {
if (rs.code == 200) {
// 同步点赞状态
item.isLike = {
0: 1,
1: 0,
3: 3,
} [type]
// 取消减数量 否则增加
type == 1 ? item.likes-- : item.likes++
uni.$emit('updateVideo', item)
uni.$emit('updateVideo', rs.data)
return
}
util.alert({
@ -713,19 +707,19 @@
@touchend="onTouchend($event,index)" @loadmore="item.getMoreList">
<cell class="cell" :style="[{height: viewSize.height + 'px'}]" :ref="`cellRef` + index"
v-for="(secItem,secIndex) in item.listData()" :key="secItem.id" @click.stop>
<!-- <template v-if="index >= current[tabIndex] - 1 && index <= current[tabIndex] + 1">
<template v-if="current[tabIndex] < secIndex + 2 && current[tabIndex] > secIndex - 2">
<view class="pa t0 l0 r0 b0 fmid" :style="{zIndex: 99,}">
<text class="f32 cfff">{{current[tabIndex]}}</text>
<text class="f32 cfff">{{index}}</text>
</view> -->
<!-- 视频 -->
<indexVideo :ref="'videoRef' + index" :tabIndex="index" :current="current[tabIndex]"
:width="viewSize.width" :height="viewSize.height" :item="secItem" :index="secIndex"
@showTime="handleShowTime" @showComment="handleShowCommentAlt"
@showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend"
@onPlay="handleVideoOnPlay" @onPause="handleVideoOnPause" @like="videoLike"
@longtap="$refs.moreMenuRef.open(secItem)" />
<!-- </template> -->
</view>
<!-- 视频 -->
<indexVideo :ref="'videoRef' + index" :tabIndex="index" :current="current[tabIndex]"
:width="viewSize.width" :height="viewSize.height" :item="secItem" :index="secIndex"
@showTime="handleShowTime" @showComment="handleShowCommentAlt"
@showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend"
@onPlay="handleVideoOnPlay" @onPause="handleVideoOnPause" @like="videoLike"
@longtap="$refs.moreMenuRef.open(secItem)" />
</template>
</cell>
</list>
</view>

View File

@ -53,7 +53,6 @@
// imei
if (!data.userImei) {
const info = uni.getSystemInfoSync()
//
data.userImei = info.deviceId
}

View File

@ -363,3 +363,28 @@ call_type 通话类型 2为视频1是音频
释放
选择视频截帧
"publicLikes": [], // 公开赞列表
"privateLikes": [], // 隐私赞列表
"favorites": [], //收藏列表
"comments": [], // 评论列表
"forwords": null,
"publicLikeCount": 0, // 公开赞数量
"privateLikeCount": 0, // 隐私赞数量
"favoriteCount": 0, // 收藏数量
"commentCount": 0, // 评论数量
"auditUserId": null // 审核人
"title": "Java牛逼", //视频标题
"description": "Java确实牛逼", //视频描述
"tags": "1,2,3", //视频标签传视频标签id 多个用英文逗号隔开)
"coverUrl": "123.jpg", //封面图 URL
"videoUrl": "456.mp4", //视频文件 URL
"videoSize": 1231, //视频文件大小(b)
"videoDuration": 1123, //视频时长(秒)
"status": 1, //视频状态 0草稿 1待审核 2审核失败 3已发布 4已下架
"breadth": 3.1, //视频宽度
"height": 2.1 //视频高度
"likeStatus": "1" // 1 公开赞 2私有赞 0 没有赞

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB