合并代码

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) { homeVideo(param) {
return util.request({ return util.request({
url: `/video/video/list`, // url: `/video/video/list`,
// url: `/video/api/queryVideoByPage`, url: `/video/api/queryVideoByPage`,
query: param.query, query: param.query,
method: 'GET', method: 'GET',
}) })
@ -22,8 +22,8 @@ const video = {
*/ */
saveVideo(param) { saveVideo(param) {
return util.request({ return util.request({
url: `/video/video/add`, // url: `/video/video/add`,
// url: `/video/api/saveVideo`, url: `/video/api/saveVideo`,
data: param.data, data: param.data,
method: 'POST', 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 * @param {Object} param
@ -253,9 +277,9 @@ const video = {
*/ */
commentList(param) { commentList(param) {
return util.request({ return util.request({
url: `/home/commentList`, url: `/video/api/getCommentsByParams`,
query: param.query, 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 * @param {Object} param

View File

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

View File

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

View File

@ -515,13 +515,15 @@
<view class="item"> <view class="item">
<view class="col"> <view class="col">
<view class="pr"> <view class="pr">
<image class="wh50" src="/static/indexLike.png" mode="aspectFit" v-if="item.isLike == 0" <image class="wh50" src="/static/indexLike.png" mode="aspectFit"
@click="handleLike(index, 0)" @longpress="handlePrivateLike(index)" /> v-if="item.likeStatus == 0" @click="handleLike(index, 0)"
@longpress="handlePrivateLike(index)" />
<!-- 公开赞 -->
<image class="wh50" src="/static/indexLike1.png" mode="aspectFit" <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" <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>
<view class="txt mt10"> <view class="txt mt10">
<text class="text">{{ item.publicLikeCount }}</text> <text class="text">{{ item.publicLikeCount }}</text>

View File

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

View File

@ -53,7 +53,6 @@
// imei // imei
if (!data.userImei) { if (!data.userImei) {
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
//
data.userImei = info.deviceId 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