From 77ceacf2a51de006e0b7c2ce4b76111410931da2 Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Sun, 5 Jan 2025 19:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jiuyi2/api/durian.js | 11 -- jiuyi2/api/video.js | 136 +++++++++++--------- jiuyi2/common/js/config.js | 2 +- jiuyi2/common/js/util.js | 5 + jiuyi2/components/footerMenu/footerMenu.vue | 102 ++------------- jiuyi2/components/mine/codeInput.vue | 44 +++++++ jiuyi2/pages/index/index.nvue | 10 +- jiuyi2/pages/mine/setting/secondPwd.vue | 4 +- jiuyi2/pages/release/video.vue | 38 +++--- jiuyi2/readme.md | 1 - jiuyi2/vite.config.js | 8 +- 11 files changed, 163 insertions(+), 198 deletions(-) create mode 100644 jiuyi2/components/mine/codeInput.vue diff --git a/jiuyi2/api/durian.js b/jiuyi2/api/durian.js index 03011083..7b6cc3ea 100644 --- a/jiuyi2/api/durian.js +++ b/jiuyi2/api/durian.js @@ -25,17 +25,6 @@ export const durian = { query: param.query, }) }, - /** - * 果树列表 - * @param {Object} param - */ - durianList(param) { - return util.request({ - url: `/coreplay/duriantreeinfo/tree-list`, - method: 'GET', - query: param.query, - }) - }, /** * 我的榴莲果树 * @param {Object} param diff --git a/jiuyi2/api/video.js b/jiuyi2/api/video.js index e1b9637b..65726982 100644 --- a/jiuyi2/api/video.js +++ b/jiuyi2/api/video.js @@ -3,6 +3,80 @@ import util from '@/common/js/util.js' // 视频模块 const video = { + /** + * 首页视频分页接口 + * @param {Object} param + */ + homeVideo(param) { + return util.request({ + url: `/video/api/queryVideoByPage`, + query: param.query, + method: 'GET', + }) + }, + + /** + * 发布作品 + * @param {Object} param + */ + saveVideo(param) { + return util.request({ + url: `/video/api/saveVideo`, + data: param.data, + method: 'POST', + }) + }, + + /** + * 保存点赞 + * @param {Object} param + */ + saveLikes(param) { + return util.request({ + url: `/video/api/saveLikes`, + data: param.data, + method: 'POST', + }) + }, + + /** + * 取消点赞 + * @param {Object} param + */ + cancelLikes(param) { + return util.request({ + url: `/video/api/cancelLikes`, + data: param.data, + method: 'POST', + }) + }, + + /** + * 查看标签分类 + * @param {Object} param + */ + getLabel(param) { + return util.request({ + url: `/video/api/getTagsByPage`, + data: param.data, + method: 'GET', + load: true, + }) + }, + + /** + * 新增或编辑标签 + * @param {Object} param + */ + setLabel(param) { + return util.request({ + url: `/video/api/saveTags`, + data: param.data, + method: 'POST', + load: true, + }) + }, + /** * 申请完播量 * @param {Object} param @@ -144,18 +218,6 @@ const video = { }) }, - /** - * 首页视频分页接口 - * @param {Object} param - */ - homeVideo(param) { - return util.request({ - url: `/video/video/list`, - query: param.query, - method: 'GET', - }) - }, - /** * 我的关注视频列表 * @param {Object} param @@ -168,44 +230,6 @@ const video = { }) }, - /** - * 查看标签分类 - * @param {Object} param - */ - getLabel(param) { - return util.request({ - url: `/video/tag/list`, - query: param.query, - method: 'GET', - load: true, - }) - }, - - /** - * 新增或编辑标签 - * @param {Object} param - */ - setLabel(param) { - return util.request({ - url: `/video/tag/add`, - query: param.query, - method: 'POST', - load: true, - }) - }, - - /** - * 发布作品 - * @param {Object} param - */ - publishVideo(param) { - return util.request({ - url: `/video/video/add`, - data: param.data, - method: 'POST', - }) - }, - /** * 修改视频信息接口 * @param {Object} param @@ -242,18 +266,6 @@ const video = { }) }, - /** - * 点赞/取消点赞接口 0取消 1点赞 - * @param {Object} param - */ - thumbsUp(param) { - return util.request({ - url: `/home/thumbsUp`, - query: param.query, - method: 'POST', - }) - }, - /** * 发表评论 * @param {Object} param diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index 0296c9f9..5ddf125c 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://5310d716.r22.cpolar.top', + host: 'http://7fee92ac.r22.cpolar.top', // host: 'http://192.168.1.236:8080', // #endif // 上传文件二级路径 diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index bacce249..78bae56e 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1830,6 +1830,11 @@ const util = { }) }) }, + + // 分页 + paging: { + // + }, } export default util \ No newline at end of file diff --git a/jiuyi2/components/footerMenu/footerMenu.vue b/jiuyi2/components/footerMenu/footerMenu.vue index 3a9e2c2a..7db30c1f 100644 --- a/jiuyi2/components/footerMenu/footerMenu.vue +++ b/jiuyi2/components/footerMenu/footerMenu.vue @@ -201,18 +201,12 @@ - + - + - - - - - - - {{item.name}} + + {{item.name}} @@ -220,11 +214,6 @@ - - - - - @@ -237,6 +226,7 @@ + {{item.name}} @@ -273,84 +263,22 @@ .menu { justify-content: space-between; + padding: 20rpx 0; /* #ifndef APP-NVUE */ display: flex; /* #endif */ /* #ifdef APP-NVUE */ flex-direction: row; /* #endif */ - padding: 20rpx 0; } .item { /* #ifndef APP-NVUE */ display: flex; /* #endif */ - /* #ifdef APP-NVUE */ - flex-direction: row; - /* #endif */ - // align-items: center; - justify-content: space-between; + align-items: center; + justify-content: center; flex: 1; - // border-bottom: $boderSize solid; - - .text { - font-size: 30rpx; - } - - // - .option { - flex: 1; - margin: 0 10rpx; - } - - // - .side { - /* #ifndef APP-NVUE */ - position: relative; - /* #endif */ - width: 10rpx; - background-color: #fff; - opacity: 0; - - // - .top { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 20rpx; - width: 10rpx; - border-top: $boderSize solid; - border-left: $boderSize solid; - border-radius: 20rpx 0 0 0; - transform: translate(10rpx, 1rpx); - } - - // - .bottom { - position: absolute; - top: 20rpx; - bottom: 0; - width: 10rpx; - border-right: $boderSize solid; - border-bottom: $boderSize solid; - border-radius: 0 0 20rpx 0; - // transform: translateY(4rpx); - } - - &.right { - transform: scaleX(-1); - } - } - - .option { - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - align-items: center; - justify-content: center; - } } // 黑色的 @@ -358,13 +286,6 @@ border-top: 1rpx solid #999; background-color: #161616; - .item, - .side .top, - .side .bottom, - .item .option { - border-color: #fff; - } - .active { .text { color: #fff; @@ -381,13 +302,6 @@ box-shadow: 0px 8px 20px rgba(0, 0, 0, .3); background-color: #fff; - .item, - .side .top, - .side .bottom, - .item .option { - border-color: #999; - } - .active { .text { color: #333; diff --git a/jiuyi2/components/mine/codeInput.vue b/jiuyi2/components/mine/codeInput.vue new file mode 100644 index 00000000..93006fc1 --- /dev/null +++ b/jiuyi2/components/mine/codeInput.vue @@ -0,0 +1,44 @@ + + + + + \ No newline at end of file diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue index 3e829907..131c7844 100644 --- a/jiuyi2/pages/index/index.nvue +++ b/jiuyi2/pages/index/index.nvue @@ -209,7 +209,6 @@ setTimeout(() => { // 获取视频容器节点信息 dom.getComponentRect(proxy.$refs.containerRef[0], (option) => { - console.log('option', option) viewSize.height = option.size.height viewSize.width = option.size.width }) @@ -223,7 +222,9 @@ onHide(() => { // 暂停视频 - proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause() + if (proxy.$refs[`videoRef${tabIndex.value}`]) { + proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause() + } }) onUnload(() => { @@ -390,7 +391,7 @@ /** * 触发完成特效 - * @param {Object} mode ['complete1'|'complete2'] 需要出发的动画键 + * @param {Object} mode ['complete1'|'complete2'] 需要触发的动画键 */ function handleCompleteMode(mode) { // 开启对应的特效 @@ -411,7 +412,8 @@ // 开启计时器 readSecond.timer = setInterval(() => { // 当前视频有效读秒 小于等于 最大有效读秒限制(视频最大时长-2s,设置的有效读秒上限) - if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, config.value.EFFECTIVE_VIDEO_TIME)) { + if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, config.value + .EFFECTIVE_VIDEO_TIME)) { // 增加这条视频的有效读秒 item.readSecond++ } else { diff --git a/jiuyi2/pages/mine/setting/secondPwd.vue b/jiuyi2/pages/mine/setting/secondPwd.vue index a7af100b..3c03542e 100644 --- a/jiuyi2/pages/mine/setting/secondPwd.vue +++ b/jiuyi2/pages/mine/setting/secondPwd.vue @@ -42,6 +42,7 @@ }) onReady(() => { + // 弹出安全键盘 proxy.$refs.CodeKeyboard.show(); }) @@ -63,7 +64,7 @@ ...form } console.log('data', data) - return + // return // 验证必填项 if (!data.pwd) { @@ -138,6 +139,7 @@ * @param {Object} val */ function KeyInfo(val) { + // 如果大于六位 if (form[formKey.value].length >= 6) return // 判断是否输入的是删除键 if (val.keyCode === 8) { diff --git a/jiuyi2/pages/release/video.vue b/jiuyi2/pages/release/video.vue index c10a1d68..cd3a550e 100644 --- a/jiuyi2/pages/release/video.vue +++ b/jiuyi2/pages/release/video.vue @@ -32,8 +32,6 @@ description = '' // 话题 tags = '' - // at用户 - subscriber = '' // 视频大小 videoSize = '' // 视频时长 @@ -175,10 +173,10 @@ function getLabel() { return new Promise((resolve, reject) => { api.video.getLabel({ - query: { + data: { pageNum: label.pageNum, pageSize: label.pageSize, - tagName: labelKeyword.value, + name: labelKeyword.value, } }).then(rs => { if (rs.code == 200) { @@ -214,8 +212,8 @@ // 添加标签 function addLabel() { api.video.setLabel({ - query: { - tagName: labelKeyword.value, + data: { + name: labelKeyword.value, } }).then(rs => { if (rs.code == 200) { @@ -240,8 +238,12 @@ */ function handleSelectLabel(ev, index) { // 是否包含 - const findIndex = labelSelect.findIndex(item => item.tagId == ev.tagId) - if (findIndex < 0) labelSelect.push(ev) + const findIndex = labelSelect.findIndex(item => item.id == ev.id) + // + if (findIndex < 0) { + if (labelSelect.length >= 5) util.alert('最多上传5个') + else labelSelect.push(ev) + } } /** @@ -311,7 +313,7 @@ const data = { ...form } - // let fnName = 'publishVideo' + // let fnName = 'saveVideo' // // 如果是编辑 // if (form.videoId) { @@ -344,7 +346,7 @@ } // 如果有选择的标签 if (labelSelect[0]) { - data.tags = labelSelect.map(item => item.tagId).join(',') + data.tags = labelSelect.map(item => item.id).join(',') } // if (userSelect[0]) { // data.subscriberId = userSelect.map(item => item.userId).join(',') @@ -352,7 +354,7 @@ // } // 发布 - api.video.publishVideo({ + api.video.saveVideo({ data, }).then(rs => { if (rs.code == 200) { @@ -373,12 +375,6 @@ } - -