|
|
|
@ -11,13 +11,12 @@
@@ -11,13 +11,12 @@
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<div class="slide-content" |
|
|
|
|
@touchstart="pageClick"> |
|
|
|
|
> |
|
|
|
|
<H class="first-horizontal-item" |
|
|
|
|
name="main" |
|
|
|
|
id="slideHook" |
|
|
|
|
v-love="'slideHook'" |
|
|
|
|
v-model:index="state.navIndex"> |
|
|
|
|
<SlideItem> |
|
|
|
|
<SlideItem id="slide1"> |
|
|
|
|
<div class="sub-type" |
|
|
|
|
:class="state.subTypeIsTop?'top':''" |
|
|
|
|
ref="subTypeRef"> |
|
|
|
@ -59,12 +58,15 @@
@@ -59,12 +58,15 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="sub-type-notice" |
|
|
|
|
v-if="state.subType===-1 && state.navIndex === 0" |
|
|
|
|
v-if="state.subType===-1 && !state.subTypeVisible" |
|
|
|
|
@click="showSubType">附近吃喝玩乐 |
|
|
|
|
</div> |
|
|
|
|
<VInfinite |
|
|
|
|
:style="{background: 'black'}" |
|
|
|
|
@touchstart="pageClick" |
|
|
|
|
v-love="'slideHook'" |
|
|
|
|
:style="{background: 'black',marginTop:state.subTypeVisible?state.subTypeHeight:0}" |
|
|
|
|
name="main" |
|
|
|
|
id="slide1-infinite" |
|
|
|
|
v-model:index="state.itemIndex" |
|
|
|
|
:render="render" |
|
|
|
|
:list="state.recommendVideos" |
|
|
|
@ -224,7 +226,7 @@ const bodyWidth = computed(() => store.state.bodyWidth)
@@ -224,7 +226,7 @@ const bodyWidth = computed(() => store.state.bodyWidth)
|
|
|
|
|
const subTypeRef = ref(null) |
|
|
|
|
const state = reactive({ |
|
|
|
|
baseIndex: 0, |
|
|
|
|
navIndex: 4, |
|
|
|
|
navIndex: 0, |
|
|
|
|
itemIndex: 0, |
|
|
|
|
test: '', |
|
|
|
|
recommendVideos: [ |
|
|
|
@ -263,6 +265,8 @@ const state = reactive({
@@ -263,6 +265,8 @@ const state = reactive({
|
|
|
|
|
commentVisible: false, |
|
|
|
|
fullScreen: false, |
|
|
|
|
subType: -1, |
|
|
|
|
subTypeVisible: false, |
|
|
|
|
subTypeHeight: '0', |
|
|
|
|
//用于改变zindex的层级到上层,反正比slide高就行。不然摸不到subType. |
|
|
|
|
subTypeIsTop: false, |
|
|
|
|
totalSize: 0, |
|
|
|
@ -301,24 +305,17 @@ function loadMore() {
@@ -301,24 +305,17 @@ function loadMore() {
|
|
|
|
|
function showSubType(e) { |
|
|
|
|
Utils.$stopPropagation(e) |
|
|
|
|
console.log('subTypeRef',) |
|
|
|
|
state.subType = 0 |
|
|
|
|
setTimeout(() => { |
|
|
|
|
state.subTypeIsTop = true |
|
|
|
|
}, 300) |
|
|
|
|
let id = state.recommendVideos[state.itemIndex].id |
|
|
|
|
bus.emit(EVENT_KEY.OPEN_SUB_TYPE, { |
|
|
|
|
id, |
|
|
|
|
height: subTypeRef.value.getBoundingClientRect().height |
|
|
|
|
}) |
|
|
|
|
state.subTypeHeight = subTypeRef.value.getBoundingClientRect().height + 'px' |
|
|
|
|
state.subTypeVisible = true |
|
|
|
|
setTimeout(() => state.subTypeIsTop = true, 300) |
|
|
|
|
bus.emit(EVENT_KEY.OPEN_SUB_TYPE,) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function pageClick(e) { |
|
|
|
|
// console.log('pageClick') |
|
|
|
|
if (state.subType !== -1) { |
|
|
|
|
state.subType = -1 |
|
|
|
|
state.subTypeIsTop = false |
|
|
|
|
let id = state.recommendVideos[state.itemIndex].id |
|
|
|
|
bus.emit(EVENT_KEY.CLOSE_SUB_TYPE, {id}) |
|
|
|
|
if (state.subTypeVisible) { |
|
|
|
|
state.subTypeIsTop = state.subTypeVisible = false |
|
|
|
|
bus.emit(EVENT_KEY.CLOSE_SUB_TYPE,) |
|
|
|
|
Utils.$stopPropagation(e) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -408,13 +405,41 @@ function render(item, itemIndex, play, position) {
@@ -408,13 +405,41 @@ function render(item, itemIndex, play, position) {
|
|
|
|
|
<style scoped lang="less"> |
|
|
|
|
@import "@/assets/less/index"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.test-slide-wrapper { |
|
|
|
|
font-size: 14rem; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
.big { |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 100rem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.slide-content { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.first-horizontal-item { |
|
|
|
|
//width: 90vw; |
|
|
|
|
//height: 80vh; |
|
|
|
|
width: 100vw; |
|
|
|
|
height: calc(100vh - @footer-height); |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
#slide1 { |
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
|
|
.sub-type { |
|
|
|
|
width: 100%; |
|
|
|
|
position: fixed; |
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
|
|
&.top { |
|
|
|
|
z-index: 1; |
|
|
|
|
z-index: 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.local { |
|
|
|
@ -471,45 +496,13 @@ function render(item, itemIndex, play, position) {
@@ -471,45 +496,13 @@ function render(item, itemIndex, play, position) {
|
|
|
|
|
color: white; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.test-slide-wrapper { |
|
|
|
|
font-size: 14rem; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
.big { |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 100rem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.slide-content { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.first-horizontal-item { |
|
|
|
|
//width: 90vw; |
|
|
|
|
//height: 80vh; |
|
|
|
|
width: 100vw; |
|
|
|
|
height: calc(100vh - @footer-height); |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
.red { |
|
|
|
|
background-color: red; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.yellow { |
|
|
|
|
background-color: yellow; |
|
|
|
|
#slide1-infinite { |
|
|
|
|
z-index: 1; |
|
|
|
|
margin-top: 0; |
|
|
|
|
transition: height, margin-top .3s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.blue { |
|
|
|
|
background-color: blue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.gray { |
|
|
|
|
background-color: gray; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</style> |