From 940cf8c2e72c1cc4fb4b81a7ea2ceb93ca0b08de Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Sat, 18 Jan 2025 09:51:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ios=E5=AF=A9=E6=A0=B8?= =?UTF-8?q?=E6=99=82=E5=80=99=E7=9A=84=E8=A6=96=E9=A0=BB=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 4 +- api/video/index.js | 90 ++++++++++++---------- components/my-video-list/my-video-list.vue | 68 +++++++++------- manifest.json | 4 +- pages.json | 12 ++- pages/index/index.vue | 12 +-- pages/me/index.vue | 2 +- pages/task/index.vue | 24 +++--- pages/video/detail.nvue | 50 ++++++++++-- store/common.js | 33 +++++--- 10 files changed, 189 insertions(+), 110 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 15f1188..a814c8a 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,11 +2,11 @@ "version" : "1.0", "configurations" : [ { - "playground" : "custom", + "playground" : "standard", "type" : "uni-app:app-android" }, { - "playground" : "standard", + "playground" : "custom", "type" : "uni-app:app-ios" } ] diff --git a/api/video/index.js b/api/video/index.js index 4031e69..01890cf 100644 --- a/api/video/index.js +++ b/api/video/index.js @@ -3,17 +3,24 @@ import http from '@/http/http.js' //获取短剧视频详情 export function getVideoDetail(data) { return http.request({ - url: 'course/courseSets?courseId='+data.courseId, - data + url: 'course/courseSets', + data: data }) } + + + + + + + //追剧 export function zhuiju(data) { return http.request({ url: 'courseCollect/insertCourseCollect', - method:'POST', - data:{ - classify:1, + method: 'POST', + data: { + classify: 1, ...data } }) @@ -23,9 +30,9 @@ export function zhuiju(data) { export function dianzan(data) { return http.request({ url: 'courseCollect/insertCourseCollect', - method:'POST', - data:{ - classify:2, + method: 'POST', + data: { + classify: 2, ...data } }) @@ -33,13 +40,13 @@ export function dianzan(data) { //插入播放历史记录 -export function insertHistory(data){ +export function insertHistory(data) { return http.request({ url: 'courseCollect/insertCourseCollect', - method:'POST', - data:{ - classify:3, - type:1, + method: 'POST', + data: { + classify: 3, + type: 1, ...data } }) @@ -54,12 +61,12 @@ export function getJinbiBili(data) { } //获取推荐视频 -export function tuijianVideo(data){ - const randomNum=10+ Math.ceil(Math.random()*20) +export function tuijianVideo(data) { + const randomNum = 10 + Math.ceil(Math.random() * 20) return http.request({ url: 'course/selectCourseDetailsList', - method:'GET', - data:{ + method: 'GET', + data: { page: 1, limit: 10, randomNum: randomNum @@ -67,64 +74,67 @@ export function tuijianVideo(data){ }) } //解锁10集视频 -export function buyTenVideo(data){ +export function buyTenVideo(data) { return http.request({ url: 'order/insertCourseOrders/limit10', - method:'GET', - data:data + method: 'GET', + data: data }) } //解锁单集或者全部视频 -export function buyVideo(data){ +export function buyVideo(data) { return http.request({ url: 'order/insertCourseOrders', - method:'GET', - data:data + method: 'GET', + data: data }) } //订单支付 -export function payOrder(data){ - let payType='h5' +export function payOrder(data) { + let payType = 'h5' // #ifdef APP - payType='app' + payType = 'app' // #endif return http.request({ - url: 'wuyou/payOrder/'+data.orderId+'?payType='+payType, - method:'GET' + url: 'wuyou/payOrder/' + data.orderId + '?payType=' + payType, + method: 'GET' }) } //获取订单支付状态 -export function getOrderInfo(data){ +export function getOrderInfo(data) { return http.request({ - url: 'wuyou/queryOrder/'+data.orderId, - method:'GET' + url: 'wuyou/queryOrder/' + data.orderId, + method: 'GET' }) } //金币解锁 -export function goldPay(data){ +export function goldPay(data) { return http.request({ url: 'order/payOrders', - method:'POST', - data:{...data,header:{ - 'content-type':'application/x-www-form-urlencoded' - }} + method: 'POST', + data: { + ...data, + header: { + 'content-type': 'application/x-www-form-urlencoded' + } + } }) } //获取转盘抽奖次数 -export function getDrawCount(data){ +export function getDrawCount(data) { return http.request({ url: 'discSpinning/drawCount', - method:'GET', + method: 'GET', data }) } //播放开始或者结束 -export function playStatus(data){ +export function playStatus(data) { return http.request({ url: 'course/viewCourse', - method:'GET', + method: 'GET', data }) } \ No newline at end of file diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index 03d5354..c1a2423 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -5,13 +5,12 @@ @change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1" @transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200"> - + @@ -23,13 +22,12 @@ + @playStatusChange="playStatusChange" :height="wHeight" :isCommand="isCommand" + :showControls="control.showControls" @toDetail="toDetail(item,index)" @itemMounted="itemMounted" + @controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex" + @appear="appear($event,item,index)" :playSpeeds="playSpeeds" @disappear="disappear(item,index)" + @dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)" + @popupShow="popupShow($event,item,index)"> @@ -102,6 +100,8 @@ + + @@ -166,7 +166,6 @@ getElRect } from '@/utils/util.js' const $common = useCommonStore() - // #ifdef APP const domModule = uni.requireNativePlugin('dom') // #endif @@ -190,6 +189,9 @@ onMounted, getCurrentInstance } from 'vue'; + import { + onShow + } from '@dcloudio/uni-app' let initing = true const refPoster = ref(null) @@ -237,7 +239,10 @@ // #ifdef APP control.showControls = false // #endif - + let isExamine = ref() + onShow(() => { + $common.init() + }) const customStyle = computed(() => { // #ifdef H5 return { @@ -543,7 +548,7 @@ } function popupShow(key = 'show', item, index) { - console.log(item); + console.log(key, item, 'debug'); if (key == 'show') { // #ifdef H5 nextTick(() => { @@ -560,6 +565,8 @@ popup.data = item popup.index = index } + + } @@ -707,11 +714,13 @@ const insertHistory = debounce(() => { - const item = videoList.value[current.value] - Api.insertHistory({ - courseId: item.courseId, - courseDetailsId: item.courseDetailsId - }) + if (uni.getStorageSync("token")) { + const item = videoList.value[current.value] + Api.insertHistory({ + courseId: item.courseId, + courseDetailsId: item.courseDetailsId + }) + } }, 1000) function swiperChange(e) { @@ -723,8 +732,10 @@ setVideoList(item) } - + const refPopup=ref(null) function setVideoList(item) { + + const listLen = props.list.length const lastIndex = listLen - 1 const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId) @@ -764,9 +775,10 @@ videoList.value = [props.list[index + 1], props.list[index - 1], item] } } - console.log(videoList.value); + console.log(videoList.value, 'debug'); if (!item.videoUrl) { - popupShow('pay', item, index) + popupShow('pay', item, index) + } } @@ -822,10 +834,10 @@ * @param {type} = [start,end] */ const playStatusChange = debounce((data) => { - Api.playStatus(data) + Api.playStatus(data) }, 2000) - - + + defineExpose({ videoListUpdata diff --git a/manifest.json b/manifest.json index c19901b..f37f9f7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "duanju-app-v3", "appid" : "__UNI__E0B05B1", "description" : "", - "versionName" : "1.0.0", - "versionCode" : 100, + "versionName" : "2.3.4", + "versionCode" : 234, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages.json b/pages.json index f0e3d7f..24fca79 100644 --- a/pages.json +++ b/pages.json @@ -254,5 +254,15 @@ } ] }, - "uniIdRouter": {} + "uniIdRouter": {}, + "condition" : { //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [ + { + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + } + ] + } } \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index a344540..8f62358 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -10,7 +10,7 @@ --> -