解決衝突
This commit is contained in:
@@ -1,46 +1,109 @@
|
||||
<template>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class=" w-full box" style="width: 100vw;">
|
||||
<list v-if="showAndriod" :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox"
|
||||
:pagingEnabled="true" @loadmore="loadmore" :scrollable="true">
|
||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||
:isAndriod="isAndriod" :isTabbar="isTabbar" @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($event, item,index)" @dianzanClick="dianzanClick(item,index)"
|
||||
@share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||
</view>
|
||||
</cell>
|
||||
</list>
|
||||
<view v-if="isH5||isIos" class=" w-full box" style="width: 100vw;">
|
||||
<swiper @longpress="popupShow('speed')" :style="{height:wHeight+'px'}" v-if="videoList.length"
|
||||
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
||||
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
||||
<swiper-item v-for="(item,index) in videoList" :key="index">
|
||||
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :height="wHeight"
|
||||
@playStatusChange="playStatusChange" :showControls="control.showControls" :current="current"
|
||||
:isCollect="isCollect" @toDetail="toDetail(item,index)" @controlstoggles="controlstoggles"
|
||||
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
|
||||
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||
:isAndriod="isAndriod" :isTabbar="isTabbar" @playStatusChange="playStatusChange"
|
||||
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
||||
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
||||
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP -->
|
||||
<list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true"
|
||||
@loadmore="loadmore" :scrollable="true">
|
||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||
@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)"></list-item-vue>
|
||||
</view>
|
||||
</cell>
|
||||
</list>
|
||||
|
||||
<!-- #endif -->
|
||||
|
||||
|
||||
<!-- 返回按钮 -->
|
||||
<view class="back-icon" v-if="!isTabbar&&control.showBack">
|
||||
<u-icon name="arrow-left" color="#fff" :size="28" @click="back"></u-icon>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 选集 -->
|
||||
<up-popup :show="popup.show" :round="10" @close="popupClose('show')" :customStyle="customStyle">
|
||||
<up-overlay :show="popup.show" @click="popupClose('show')">
|
||||
<view class="u-p-30 bg-fff xuanji-box">
|
||||
<view class="u-flex u-flex-row u-row-between">
|
||||
<view class="u-flex u-flex-row" style="align-items: baseline;">
|
||||
<text class="color-333 u-font-32 ">{{info.title}}</text>
|
||||
<text class="u-font-28 color-666 u-m-l-20">共{{list.length}}集</text>
|
||||
</view>
|
||||
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('show')"></up-icon>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" :style="{height:xuanjiData.height+'px'}"
|
||||
:scroll-top="xuanjiData.scrollTop" :show-scrollbar="false">
|
||||
<view class="ji-list u-flex u-flex-row u-flex-wrap">
|
||||
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item,index)"
|
||||
:class="[nowIndex==index?'active':'',(index+1)%3==0?'mr-0':'','ji-item'+index]"
|
||||
v-for="(item,index) in list" :key="index">
|
||||
<text class="u-font-28" :class="{'color-fff':nowIndex==index}">第{{index+1}}集</text>
|
||||
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
|
||||
<up-icon name="lock" :size="14" color="#fff"></up-icon>
|
||||
<!-- <image class="lock-icon" src="@/static/images/lock.png" mode=""></image> -->
|
||||
</view>
|
||||
<image v-if="nowIndex==index" class="playing" src="@/static/images/playIng.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</up-overlay>
|
||||
|
||||
|
||||
|
||||
<!-- 暂时舍弃,因为在ios上会有奇怪问题导致经常不出现 -->
|
||||
<!-- 选集-->
|
||||
<!-- <view class="mask" :class="{'mask-show':popup.show}">
|
||||
<view class="u-p-30 bg-fff box">
|
||||
<view class="u-flex u-flex-row u-row-between">
|
||||
<view class="u-flex u-flex-row" style="align-items: baseline;">
|
||||
<text class="color-333 u-font-32 ">{{info.title}}</text>
|
||||
<text class="u-font-28 color-666 u-m-l-20">共{{list.length}}集</text>
|
||||
</view>
|
||||
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('show')"></up-icon>
|
||||
</view>
|
||||
<view :style="{height:xuanjiData.height+'px',overflow:'hidden'}">
|
||||
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" :style="{height:xuanjiData.height+'px'}"
|
||||
:scroll-top="xuanjiData.scrollTop" :show-scrollbar="false">
|
||||
<view class="ji-list u-flex u-flex-row u-flex-wrap">
|
||||
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item,index)"
|
||||
:class="[nowIndex==index?'active':'',(index+1)%3==0?'mr-0':'','ji-item'+index]"
|
||||
v-for="(item,index) in list" :key="index">
|
||||
<text class="u-font-28" :class="{'color-fff':nowIndex==index}">第{{index+1}}集</text>
|
||||
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
|
||||
<up-icon name="lock" :size="14" color="#fff"></up-icon>
|
||||
</view>
|
||||
<image v-if="nowIndex==index" class="playing" src="@/static/images/playIng.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view> -->
|
||||
<up-popup :show="popup.show1" :round="10" @close="popupClose('show')" :customStyle="customStyle">
|
||||
<view class="u-p-30">
|
||||
<view class="u-flex u-flex-row u-row-between">
|
||||
<view class="u-flex u-flex-row" style="align-items: baseline;">
|
||||
@@ -49,25 +112,30 @@
|
||||
</view>
|
||||
<up-icon name="close" :size="16" color="#333" bold @click="popupClose('show')"></up-icon>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" ref="refXuanjiList"
|
||||
:style="{height:xuanjiData.height+'px'}" @scroll="xuanjiScroll" :scroll-top="xuanjiData.scrollTop"
|
||||
scroll-with-animation :show-scrollbar="false">
|
||||
<view class="ji-list u-flex u-flex-row u-flex-wrap">
|
||||
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item,index)"
|
||||
:class="[nowIndex==index?'active':'',(index+1)%3==0?'mr-0':'','ji-item'+index]"
|
||||
v-for="(item,index) in list" :key="index">
|
||||
<text class="u-font-28" :class="{'color-fff':nowIndex==index}">第{{index+1}}集</text>
|
||||
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
|
||||
<up-icon name="lock" :size="14" color="#fff"></up-icon>
|
||||
<view :style="{height:xuanjiData.height+'px',overflow:'hidden'}">
|
||||
<scroll-view scroll-y="true" class="u-m-t-30 xuanji-scroll" :style="{height:xuanjiData.height+'px'}"
|
||||
:scroll-top="xuanjiData.scrollTop" :show-scrollbar="false">
|
||||
<view class="ji-list u-flex u-flex-row u-flex-wrap">
|
||||
<view class="ji-item u-flex-xy-center u-text-center" @click="jiClick(item,index)"
|
||||
:class="[nowIndex==index?'active':'',(index+1)%3==0?'mr-0':'','ji-item'+index]"
|
||||
v-for="(item,index) in list" :key="index">
|
||||
<text class="u-font-28" :class="{'color-fff':nowIndex==index}">第{{index+1}}集</text>
|
||||
<view class="lock u-flex-xy-center" v-if="!item.videoUrl">
|
||||
<up-icon name="lock" :size="14" color="#fff"></up-icon>
|
||||
<!-- <image class="lock-icon" src="@/static/images/lock.png" mode=""></image> -->
|
||||
</view>
|
||||
<image v-if="nowIndex==index" class="playing" src="@/static/images/playIng.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<image v-if="nowIndex==index" class="playing" src="@/static/images/playIng.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
|
||||
<!-- 支付 -->
|
||||
<up-popup :show="popup.pay" :round="10" @close="popupClose('pay')" :customStyle="customStyle">
|
||||
<view class="u-p-30">
|
||||
@@ -155,7 +223,9 @@
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<my-poster ref="refPoster"></my-poster>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -187,11 +257,18 @@
|
||||
watch,
|
||||
nextTick,
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
getCurrentInstance,
|
||||
onUnmounted
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
|
||||
let isH5 = false
|
||||
// #ifdef H5
|
||||
isH5 = true
|
||||
// #endif
|
||||
const sysinfo = uni.getSystemInfoSync()
|
||||
const isIos = sysinfo.platform == 'ios' ? true : false
|
||||
const isAndriod = sysinfo.platform == 'android' ? true : false
|
||||
const showAndriod = !isH5 && isAndriod ? true : false
|
||||
let initing = true
|
||||
const refPoster = ref(null)
|
||||
|
||||
@@ -239,10 +316,6 @@
|
||||
// #ifdef APP
|
||||
control.showControls = false
|
||||
// #endif
|
||||
let isExamine = ref()
|
||||
onShow(() => {
|
||||
$common.init()
|
||||
})
|
||||
const customStyle = computed(() => {
|
||||
// #ifdef H5
|
||||
return {
|
||||
@@ -327,7 +400,7 @@
|
||||
scrollTop: 0,
|
||||
items: [],
|
||||
scrollHeight: 0,
|
||||
height: 400
|
||||
height: 300
|
||||
})
|
||||
const refXuanjiList = ref(null)
|
||||
|
||||
@@ -335,15 +408,19 @@
|
||||
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 +
|
||||
const scrollTop = Math.ceil((nowIndex.value + 1) / 3) * oneItemHeight - (xuanjiData.height) / 2 +
|
||||
oneItemHeight / 2
|
||||
return
|
||||
// #endif
|
||||
if (props.list.length <= 15) {
|
||||
xuanjiData.scrollTop = 0
|
||||
return
|
||||
}
|
||||
xuanjiData.scrollTop = scrollTop * 1 < 0 ? 0 : scrollTop
|
||||
|
||||
// #ifdef H5
|
||||
if (!xuanjiData.items[props.list.length - 1]) {
|
||||
const res = await getElRect('ji-list', instance, {
|
||||
rect: true
|
||||
@@ -366,6 +443,9 @@
|
||||
xuanjiData.scrollTop = xuanjiData.items[nowIndex.value].top - (xuanjiData.height) / 2 + (xuanjiData.items[
|
||||
nowIndex.value].height) / 2
|
||||
console.log(xuanjiData);
|
||||
// #endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -379,14 +459,15 @@
|
||||
if (isFirst) {
|
||||
$mountedComponents[index] = true
|
||||
}
|
||||
console.log('appear:' + index);
|
||||
if (!initing) {
|
||||
cacheIndex = index
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function disappear(item, index) {
|
||||
|
||||
if (index == nowIndex.value && cacheIndex != null && !initing) {
|
||||
function disappear(e, item, index) {
|
||||
if (index == nowIndex.value && cacheIndex !== null && !initing) {
|
||||
console.log('disappear' + index);
|
||||
console.log('disappear nowIndex' + nowIndex.value);
|
||||
console.log('cacheIndex' + cacheIndex);
|
||||
@@ -493,9 +574,9 @@
|
||||
videoList.value[newCurrent] = item;
|
||||
current.value = newCurrent;
|
||||
popupClose('show')
|
||||
// #ifdef APP
|
||||
goListPosition(index)
|
||||
// #endif
|
||||
if (showAndriod) {
|
||||
goListPosition(index)
|
||||
}
|
||||
}
|
||||
|
||||
let refList = ref([])
|
||||
@@ -538,17 +619,25 @@
|
||||
|
||||
|
||||
function popupClose(key) {
|
||||
console.log('popupClose:' + key);
|
||||
if (key == 'show') {
|
||||
// xuanjiData.scrollTop = 0
|
||||
}
|
||||
if (key) {
|
||||
popup[key] = false
|
||||
return
|
||||
}
|
||||
for (let i in popup) {
|
||||
popup[i] = false
|
||||
if (!i.includes(['data', 'payType'])) {
|
||||
popup[i] = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function popupShow(key = 'show', item, index) {
|
||||
console.log(key, item, 'debug');
|
||||
console.log('key' + popup[key]);
|
||||
console.log('popupShow');
|
||||
if (key == 'show') {
|
||||
// #ifdef H5
|
||||
nextTick(() => {
|
||||
@@ -558,7 +647,6 @@
|
||||
// #ifdef APP
|
||||
xuanjiInit()
|
||||
// #endif
|
||||
|
||||
}
|
||||
popup[key] = true
|
||||
if (item) {
|
||||
@@ -609,15 +697,14 @@
|
||||
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)
|
||||
goListPosition(index)
|
||||
})
|
||||
// #endif
|
||||
if (showAndriod) {
|
||||
nextTick(() => {
|
||||
const index = props.list.findIndex(v => v.courseDetailsId == item.courseDetailsId)
|
||||
goListPosition(index)
|
||||
})
|
||||
} else {
|
||||
setVideoList(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -777,8 +864,11 @@
|
||||
}
|
||||
console.log(videoList.value, 'debug');
|
||||
if (!item.videoUrl) {
|
||||
popupShow('pay', item, index)
|
||||
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
popupShow('pay', item, index)
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,9 +891,9 @@
|
||||
})
|
||||
watch(() => props.list.length, (newval) => {
|
||||
console.log('props.list.length change' + newval);
|
||||
// #ifdef H5
|
||||
init()
|
||||
// #endif
|
||||
if (!showAndriod) {
|
||||
init()
|
||||
}
|
||||
})
|
||||
watch(() => nowIndex.value, (newval) => {})
|
||||
const nowDanjiPrice = computed(() => {
|
||||
@@ -953,7 +1043,7 @@
|
||||
|
||||
.ji-list {
|
||||
.ji-item {
|
||||
width: 210rpx;
|
||||
width: 208rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-right: 30rpx;
|
||||
height: 88rpx;
|
||||
@@ -979,6 +1069,11 @@
|
||||
padding: 2rpx 4rpx;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
.lock-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.playing {
|
||||
@@ -990,7 +1085,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.ji-item:nth-of-type(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
@@ -1053,9 +1149,48 @@
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
|
||||
.playing {}
|
||||
|
||||
&.active {
|
||||
background-color: #ffffff;
|
||||
|
||||
.playing {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
z-index: 2000;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
justify-content: end;
|
||||
transition: transform .3s ease-in-out;
|
||||
transform: translateY(100vh);
|
||||
|
||||
&.mask-show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 10px 10px 0 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.xuanji-box {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 10px 10px 0 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user