From aeb81fd2e5177b5301d9152c95c771f8ceb4ddde Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 14 Jan 2025 10:27:35 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=E6=8E=A5=E4=BC=A0=E5=8F=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/video/index.js | 2 +- components/my-video-list/list-item.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/video/index.js b/api/video/index.js index 4bc7fd2..79a0dcc 100644 --- a/api/video/index.js +++ b/api/video/index.js @@ -25,7 +25,7 @@ export function dianzan(data) { url: 'courseCollect/insertCourseCollect', method:'POST', data:{ - classify:3, + classify:2, ...data } }) diff --git a/components/my-video-list/list-item.vue b/components/my-video-list/list-item.vue index 8d7abd4..8096ade 100644 --- a/components/my-video-list/list-item.vue +++ b/components/my-video-list/list-item.vue @@ -36,7 +36,7 @@ - {{item.goodNum}} + {{item.goodNum<0?0:item.goodNum}} From acf20d8f71206dcc93923655808964511ae80827 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 14 Jan 2025 10:50:13 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=BC=80=E5=A7=8B=E5=92=8C=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/video/index.js | 9 ++++++ components/my-video-list/list-item.vue | 41 +++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/api/video/index.js b/api/video/index.js index 79a0dcc..51d4b66 100644 --- a/api/video/index.js +++ b/api/video/index.js @@ -118,4 +118,13 @@ export function getDrawCount(data){ method:'GET', data }) +} + +//播放开始或者结束 +export function playStatus(data){ + return http.request({ + url: 'course/viewCourse', + method:'GET', + data + }) } \ No newline at end of file diff --git a/components/my-video-list/list-item.vue b/components/my-video-list/list-item.vue index 8096ade..af1112f 100644 --- a/components/my-video-list/list-item.vue +++ b/components/my-video-list/list-item.vue @@ -2,6 +2,7 @@ - + + + :class="[nowIndex==index?'active':'',(index+1)%3==0?'mr-0':'','ji-item'+index]" + v-for="(item,index) in list" :key="index"> 第{{index+1}}集 @@ -157,8 +161,11 @@ import { useCommonStore } from '@/store/common.js' + import { + getElRect + } from '@/utils/util.js' const $common = useCommonStore() - + // #ifdef APP const domModule = uni.requireNativePlugin('dom') // #endif @@ -185,6 +192,7 @@ let initing = true const refPoster = ref(null) + const props = defineProps({ list: { type: Array, @@ -192,11 +200,11 @@ [] } }, - options:{ + options: { tpye: Object, default: () => { return { - courseDetailsId:'' + courseDetailsId: '' } } }, @@ -228,7 +236,7 @@ // #ifdef APP control.showControls = false // #endif - + const customStyle = computed(() => { // #ifdef H5 return { @@ -266,7 +274,7 @@ const $mountedComponents = {} function itemMounted(index) { - $mountedComponents[index]=true + $mountedComponents[index] = true } function back() { @@ -308,6 +316,49 @@ payType: null }) + //选集数据 + const xuanjiData = reactive({ + scrollTop: 0, + items: [], + scrollHeight: 0, + height:400 + }) + const refXuanjiList=ref(null) + function xuanjiScroll(e){ + console.log(e); + } + async function xuanjiInit() { + // #ifdef APP + const height=44 + const marginBottom=10 + const oneItemHeight=height+marginBottom + xuanjiData.scrollTop=Math.ceil((nowIndex.value+1)/3) * oneItemHeight - (xuanjiData.height)/2+oneItemHeight/2 + return + // #endif + + if (!xuanjiData.items[props.list.length - 1]) { + const res = await getElRect('ji-list', instance, { + rect: true + }) + xuanjiData.scrollHeight = res.height + let firstItemTop=0 + for (let i in props.list) { + const res1 = await getElRect('ji-item' + i, instance, { + rect: true + }) + if(i==0){ + firstItemTop=res1.top + } + xuanjiData.items[i] = { + height: res1.height, + top: i==0?0: res1.top-firstItemTop + } + } + } + xuanjiData.scrollTop =xuanjiData.items[nowIndex.value].top-(xuanjiData.height)/2+(xuanjiData.items[nowIndex.value].height)/2 + console.log(xuanjiData); + } + function openBs() { @@ -316,7 +367,7 @@ let cacheIndex = null function appear(isFirst, item, index) { - if(isFirst){ + if (isFirst) { $mountedComponents[index] = true } if (!initing) { @@ -340,7 +391,6 @@ } - //非金币支付 async function payOrder(data) { const res = await Api.payOrder(data) @@ -376,12 +426,12 @@ //确认支付 async function payConfirm() { const [type, num] = popup.payType.split('-'); - if(type!='gold'){ + if (type != 'gold') { if (!isAgree.value) { return infoBox.showToast('请阅读并同意 《付费须知说明》') } } - + console.log(type, num); let data = { courseId: popup.data.courseId @@ -392,10 +442,10 @@ const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data) console.log(res); - if(!res.orders){ + if (!res.orders) { return uni.showToast({ - title:'创建订单失败', - icon:'none' + title: '创建订单失败', + icon: 'none' }) } if (res) { @@ -419,7 +469,7 @@ function payBtnClick(type, num) { console.log(type, num); popup.payType = `${type}-${num}` - if(type=='gold'){ + if (type == 'gold') { return payConfirm() } popupClose('show') @@ -490,6 +540,17 @@ function popupShow(key = 'show', item, index) { console.log(item); + if (key == 'show') { + // #ifdef H5 + nextTick(() => { + xuanjiInit() + }) + // #endif + // #ifdef APP + xuanjiInit() + // #endif + + } popup[key] = true if (item) { popup.data = item @@ -513,6 +574,7 @@ isCollect.value = newval }) + function toDetail(item, index) { uni.navigateTo({ url: '/pages/video/detail?courseId=' + item.courseId @@ -533,15 +595,15 @@ function init() { - let item=props.list.find(v=>props.options.courseDetailsId==v.courseDetailsId) - item=item?item:props.info.current; + let item = props.list.find(v => props.options.courseDetailsId == v.courseDetailsId) + item = item ? item : props.info.current; if (JSON.stringify(item) !== '{}') { // #ifdef H5 setVideoList(item) // #endif // #ifdef APP nextTick(() => { - const index = props.list.findIndex(v => v.courseDetailsId ==item.courseDetailsId) + const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId) goListPosition(index) }) // #endif @@ -583,11 +645,11 @@ courseId: item.courseId, courseDetailsId: item.courseDetailsId, type: item.isGood ? 1 : 0 - }).then(res=>{ - if(res){ + }).then(res => { + if (res) { uni.showToast({ - title:'操作成功!', - icon:'none' + title: '操作成功!', + icon: 'none' }) } }) @@ -718,14 +780,17 @@ configInit() onMounted(() => { init() + // setTimeout(()=>{ // },500) }) watch(() => props.list.length, (newval) => { + console.log('props.list.length change' + newval); // #ifdef H5 init() // #endif }) + watch(() => nowIndex.value, (newval) => {}) const nowDanjiPrice = computed(() => { return videoList.value[current.value].price }) From b674358871958a26761b8bb9706f22c7ca70af37 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Tue, 14 Jan 2025 17:35:34 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 2 +- pages/me/withdraw/index.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 15f1188..e466870 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,7 +2,7 @@ "version" : "1.0", "configurations" : [ { - "playground" : "custom", + "playground" : "standard", "type" : "uni-app:app-android" }, { diff --git a/pages/me/withdraw/index.vue b/pages/me/withdraw/index.vue index 918a012..9255de9 100644 --- a/pages/me/withdraw/index.vue +++ b/pages/me/withdraw/index.vue @@ -1,6 +1,7 @@ - + 可提现总额 ¥ {{ data.mayMoney }}