Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
broadcast_cloud
/
web-live
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
2
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1cc4c277
authored
Mar 08, 2021
by
MichaelJier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature
1. 组件延迟任务优化 2. 优化直播介绍富文本样式
parent
6a0e7c4c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
18 deletions
+61
-18
components/modules/menuBox/list.vue
+15
-10
components/modules/menuBox/menuClass/imageText.vue
+6
-0
components/modules/menuBox/menuClass/invite/index.vue
+1
-1
components/view/mobile.vue
+10
-7
plugins/Mixin/defer.js
+29
-0
No files found.
components/modules/menuBox/list.vue
View file @
1cc4c277
...
@@ -6,33 +6,35 @@
...
@@ -6,33 +6,35 @@
<div
class=
"swiper-container"
ref=
"swiper"
>
<div
class=
"swiper-container"
ref=
"swiper"
>
<div
class=
"swiper-wrapper"
>
<div
class=
"swiper-wrapper"
>
<div
class=
"swiper-slide"
v-for=
"(item, index) in menuList"
:key=
"index"
>
<div
class=
"swiper-slide"
v-for=
"(item, index) in menuList"
:key=
"index"
>
<!--
<div
v-if=
"defer(index)"
>
-->
<template
v-if=
"item.menuType == 'imagetext'"
>
<template
v-if=
"item.menuType == 'imagetext'"
>
<image-text
:menuInfo=
"item.menuInfo"
:menuId=
"item.id"
></image-text>
<image-text
:menuInfo=
"item.menuInfo"
:menuId=
"item.id"
v-if=
"defer(index)"
></image-text>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'playlists'"
>
<
template
v-else-if=
"item.menuType == 'playlists'"
>
<play-lists
:listId=
"item.menuInfo
"
></play-lists>
<play-lists
:listId=
"item.menuInfo"
v-if=
"defer(index)
"
></play-lists>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'share'"
>
<
template
v-else-if=
"item.menuType == 'share'"
>
<invite-box
></invite-box>
<invite-box
v-if=
"defer(index)"
></invite-box>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'shop'"
>
<
template
v-else-if=
"item.menuType == 'shop'"
>
<shop-box
:menuId=
"item.id"
:showHot=
"!caseInfo.status"
:showList=
"true
"
></shop-box>
<shop-box
:menuId=
"item.id"
:showHot=
"!caseInfo.status"
:showList=
"true"
v-if=
"defer(index)
"
></shop-box>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'coupon'"
>
<
template
v-else-if=
"item.menuType == 'coupon'"
>
<coupon-box
></coupon-box>
<coupon-box
v-if=
"defer(index)"
></coupon-box>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'report'"
>
<
template
v-else-if=
"item.menuType == 'report'"
>
<report-box
:id=
"item.menuInfo
"
></report-box>
<report-box
:id=
"item.menuInfo"
v-if=
"defer(index)
"
></report-box>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'chat'"
>
<
template
v-else-if=
"item.menuType == 'chat'"
>
<chat-box
:isShowChat=
"isShowChat
"
></chat-box>
<chat-box
:isShowChat=
"isShowChat"
v-if=
"defer(index)
"
></chat-box>
</
template
>
</
template
>
<
template
v-else-if=
"item.menuType == 'iframeLine'"
>
<
template
v-else-if=
"item.menuType == 'iframeLine'"
>
<iframe-line
:menuInfo=
"item.menuInfo
"
></iframe-line>
<iframe-line
:menuInfo=
"item.menuInfo"
v-if=
"defer(index)
"
></iframe-line>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<empty404
></empty404>
<empty404
v-if=
"defer(index)"
></empty404>
</
template
>
</
template
>
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -41,6 +43,7 @@
...
@@ -41,6 +43,7 @@
<
script
>
<
script
>
import
{
mapGetters
}
from
'vuex'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
traffic
}
from
'@/plugins/openTraffic'
;
import
{
traffic
}
from
'@/plugins/openTraffic'
;
import
Defer
from
'@/plugins/Mixin/defer.js'
;
const
imageText
=
resolve
=>
require
([
'./menuClass/imageText'
],
resolve
);
const
imageText
=
resolve
=>
require
([
'./menuClass/imageText'
],
resolve
);
const
playLists
=
resolve
=>
require
([
'./menuClass/playLists/index'
],
resolve
);
const
playLists
=
resolve
=>
require
([
'./menuClass/playLists/index'
],
resolve
);
const
inviteBox
=
resolve
=>
require
([
'./menuClass/invite'
],
resolve
);
const
inviteBox
=
resolve
=>
require
([
'./menuClass/invite'
],
resolve
);
...
@@ -68,10 +71,12 @@ export default {
...
@@ -68,10 +71,12 @@ export default {
props
:
{
props
:
{
value
:
{}
value
:
{}
},
},
mixins
:
[
Defer
()],
data
()
{
data
()
{
return
{
return
{
swiper
:
null
,
swiper
:
null
,
active
:
this
.
value
active
:
this
.
value
,
deferMenuList
:
[]
};
};
},
},
computed
:
{
computed
:
{
...
...
components/modules/menuBox/menuClass/imageText.vue
View file @
1cc4c277
...
@@ -66,9 +66,15 @@ export default {
...
@@ -66,9 +66,15 @@ export default {
.imageText
{
.imageText
{
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
padding
:
0.1rem
;
::v-deep
img
{
::v-deep
img
{
max-width
:
100%
;
max-width
:
100%
;
}
}
.ql-editor
{
background
:
rgba
(
255
,
255
,
255
,
0.1
);
border-radius
:
.1rem
;
//
color
:
var
(
--chatBox-text-color
);
}
}
}
.ql-container.ql-snow
{
.ql-container.ql-snow
{
border
:
0
;
border
:
0
;
...
...
components/modules/menuBox/menuClass/invite/index.vue
View file @
1cc4c277
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</div>
</div>
<div
class=
"invite__list-box"
>
<div
class=
"invite__list-box"
>
<div
class=
"invite__list-box__list"
>
<div
class=
"invite__list-box__list"
>
<div
class=
"invite__list-box__list--topthree"
>
<div
class=
"invite__list-box__list--topthree"
v-if=
"threeList.length > 0"
>
<div
v-for=
"(item, index) in threeList"
:key=
"index"
style=
"display: inline-block;"
:class=
"index === 0 ? 'first-box' : index === 1 ? 'second-box': 'third-box'"
>
<div
v-for=
"(item, index) in threeList"
:key=
"index"
style=
"display: inline-block;"
:class=
"index === 0 ? 'first-box' : index === 1 ? 'second-box': 'third-box'"
>
<div
class=
"invite__list-box__list--topthree__item"
>
<div
class=
"invite__list-box__list--topthree__item"
>
<div
class=
"invite__list-box__list--topthree__item--head second"
v-if=
"index === 0"
>
<div
class=
"invite__list-box__list--topthree__item--head second"
v-if=
"index === 0"
>
...
...
components/view/mobile.vue
View file @
1cc4c277
<
template
>
<
template
>
<div
class=
"page-box view-mobile"
@
touchmove
.
stop
.
prevent
@
click=
"_closeAll"
>
<div
class=
"page-box view-mobile"
@
touchmove
.
stop
.
prevent
@
click=
"_closeAll"
>
<div
class=
"live"
>
<div
class=
"live"
>
<div
class=
"top-list-box m-carousel-dvertising"
>
<div
class=
"top-list-box m-carousel-dvertising"
v-if=
"defer(1)"
>
<advert-top
v-if=
"isAdTop"
></advert-top>
<advert-top
v-if=
"isAdTop"
></advert-top>
</div>
</div>
<div
class=
"player-box"
>
<div
class=
"player-box"
v-if=
"defer(2)"
>
<player-box></player-box>
<player-box></player-box>
</div>
</div>
<div
class=
"camera-box"
@
touchmove
.
stop
>
<div
class=
"camera-box"
@
touchmove
.
stop
v-if=
"defer(3)"
>
<camera-box
v-if=
"isCamera"
></camera-box>
<camera-box
v-if=
"isCamera"
></camera-box>
</div>
</div>
<div
class=
"tab-list-box"
@
touchmove
.
stop
>
<div
class=
"tab-list-box"
@
touchmove
.
stop
v-if=
"defer(4)"
>
<menu-tab
v-model=
"menuActive"
></menu-tab>
<menu-tab
v-model=
"menuActive"
></menu-tab>
</div>
</div>
<div
class=
"middle-list-box"
>
<div
class=
"middle-list-box"
v-if=
"defer(5)"
>
<extend-commodity
v-if=
"spread"
></extend-commodity>
<extend-commodity
v-if=
"spread"
></extend-commodity>
<advert-middle
v-else-if=
"isAdMiddle"
></advert-middle>
<advert-middle
v-else-if=
"isAdMiddle"
></advert-middle>
</div>
</div>
<div
class=
"text-box"
>
<div
class=
"text-box"
v-if=
"defer(6)"
>
<advert-text
v-if=
"isAdText"
></advert-text>
<advert-text
v-if=
"isAdText"
></advert-text>
</div>
</div>
<div
class=
"content-box"
@
touchmove
.
stop
>
<div
class=
"content-box"
@
touchmove
.
stop
v-if=
"defer(7)"
>
<div
class=
"menu-list-box"
id=
"menu-list-box"
>
<div
class=
"menu-list-box"
id=
"menu-list-box"
>
<menu-list
v-model=
"menuActive"
></menu-list>
<menu-list
v-model=
"menuActive"
></menu-list>
</div>
</div>
...
@@ -51,6 +51,8 @@ import playerBox from '@/components/modules/playerBox';
...
@@ -51,6 +51,8 @@ import playerBox from '@/components/modules/playerBox';
import
menuTab
from
'@/components/modules/menuBox/tab'
;
import
menuTab
from
'@/components/modules/menuBox/tab'
;
import
menuList
from
'@/components/modules/menuBox/list'
;
import
menuList
from
'@/components/modules/menuBox/list'
;
import
Defer
from
'@/plugins/Mixin/defer.js'
;
export
default
{
export
default
{
name
:
'mobile'
,
name
:
'mobile'
,
head
()
{
head
()
{
...
@@ -72,6 +74,7 @@ export default {
...
@@ -72,6 +74,7 @@ export default {
extendAd
,
extendAd
,
extendCommodity
extendCommodity
},
},
mixins
:
[
Defer
()],
data
()
{
data
()
{
return
{
return
{
menuActive
:
0
,
menuActive
:
0
,
...
...
plugins/Mixin/defer.js
0 → 100644
View file @
1cc4c277
// 渐进式渲染
export
default
function
(
count
=
10
)
{
return
{
data
()
{
return
{
displayPriority
:
0
}
},
mounted
()
{
this
.
runDisplayPriority
()
},
methods
:
{
runDisplayPriority
()
{
const
step
=
()
=>
{
requestAnimationFrame
(()
=>
{
this
.
displayPriority
++
if
(
this
.
displayPriority
<
count
)
{
step
()
}
})
}
step
()
},
defer
(
priority
)
{
return
this
.
displayPriority
>=
priority
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment