diff --git a/src/assets/less/custom.less b/src/assets/less/custom.less
index 2fde2b9..eb054ce 100644
--- a/src/assets/less/custom.less
+++ b/src/assets/less/custom.less
@@ -125,6 +125,8 @@ p {
height: 100%;
width: 100%;
transition: height .3s;
+ position: relative;
+ overflow: hidden;
.slide-list {
height: 100%;
diff --git a/src/components/slide/BVideo.vue b/src/components/slide/BVideo.vue
index 71badd9..6b4699f 100644
--- a/src/components/slide/BVideo.vue
+++ b/src/components/slide/BVideo.vue
@@ -13,7 +13,7 @@
-
+
+ >
-
+
@@ -59,12 +58,15 @@
附近吃喝玩乐
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({
commentVisible: false,
fullScreen: false,
subType: -1,
+ subTypeVisible: false,
+ subTypeHeight: '0',
//用于改变zindex的层级到上层,反正比slide高就行。不然摸不到subType.
subTypeIsTop: false,
totalSize: 0,
@@ -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,68 +405,6 @@ function render(item, itemIndex, play, position) {
\ No newline at end of file