diff --git a/jiuyi2/api/video.js b/jiuyi2/api/video.js index 32164d12..e81ab24c 100644 --- a/jiuyi2/api/video.js +++ b/jiuyi2/api/video.js @@ -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 diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index 13ccb64a..a27ced0a 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -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 // 上传文件二级路径 diff --git a/jiuyi2/components/index/commentArea.vue b/jiuyi2/components/index/commentArea.vue index 7365da77..25ebc542 100644 --- a/jiuyi2/components/index/commentArea.vue +++ b/jiuyi2/components/index/commentArea.vue @@ -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() diff --git a/jiuyi2/components/index/indexVideo.vue b/jiuyi2/components/index/indexVideo.vue index bbce3eef..7445f47d 100644 --- a/jiuyi2/components/index/indexVideo.vue +++ b/jiuyi2/components/index/indexVideo.vue @@ -515,13 +515,15 @@ - + + + v-else-if="item.likeStatus == 1" @click="handleLike(index, 1)" /> + v-else-if="item.likeStatus == 2" @click="handleLike(index, 1)" /> {{ item.publicLikeCount }} diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue index 93d549de..b0b185a3 100644 --- a/jiuyi2/pages/index/index.nvue +++ b/jiuyi2/pages/index/index.nvue @@ -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"> - - - - + + + + diff --git a/jiuyi2/pages/login/loginPhone.vue b/jiuyi2/pages/login/loginPhone.vue index f53dc4f8..e7c8f660 100644 --- a/jiuyi2/pages/login/loginPhone.vue +++ b/jiuyi2/pages/login/loginPhone.vue @@ -53,7 +53,6 @@ // 如果imei为空 if (!data.userImei) { const info = uni.getSystemInfoSync() - // data.userImei = info.deviceId } diff --git a/jiuyi2/readme.md b/jiuyi2/readme.md index 079e449d..ac831bbb 100644 --- a/jiuyi2/readme.md +++ b/jiuyi2/readme.md @@ -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 没有赞 + + diff --git a/jiuyi2/readme_files/1.jpg b/jiuyi2/readme_files/1.jpg deleted file mode 100644 index 59dea168..00000000 Binary files a/jiuyi2/readme_files/1.jpg and /dev/null differ diff --git a/jiuyi2/readme_files/2.jpg b/jiuyi2/readme_files/2.jpg deleted file mode 100644 index 59dea168..00000000 Binary files a/jiuyi2/readme_files/2.jpg and /dev/null differ diff --git a/jiuyi2/readme_files/3.jpg b/jiuyi2/readme_files/3.jpg deleted file mode 100644 index b93bfeee..00000000 Binary files a/jiuyi2/readme_files/3.jpg and /dev/null differ