Skip to content

Commit 6309319

Browse files
author
wangyaqi
committed
update: 增加延迟减少卡顿
1 parent 6a0d041 commit 6309319

3 files changed

Lines changed: 27 additions & 25 deletions

File tree

‎pages/component/cover-view/cover-view.vue‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<view>
33
<page-head title="cover-view用于覆盖map、video等原生组件"></page-head>
4-
<view class="cover-content">
4+
<view class="cover-content" v-if="showMap">
55
<!-- TODO暂时条件编译解决支付宝小程序不能正常显示 cover-x -->
66
<!-- #ifdef APP-PLUS -->
77
<map>
@@ -21,8 +21,15 @@
2121
<script>
2222
export default {
2323
data() {
24-
return {};
25-
}
24+
return {
25+
showMap: false
26+
};
27+
},
28+
onLoad() {
29+
setTimeout(()=>{
30+
this.showMap = true
31+
},350)
32+
}
2633
}
2734
</script>
2835

‎pages/component/video/video.vue‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<view>
33
<page-head :title="title"></page-head>
4-
<view class="uni-padding-wrap uni-common-mt">
4+
<view class="uni-padding-wrap uni-common-mt" v-if="showVideo">
55
<view>
66
<video id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20181126.mp4"
77
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls poster="https://img-cdn-qiniu.dcloud.net.cn/uniapp/doc/poster.png"></video>
@@ -42,13 +42,17 @@
4242
time: 3
4343
}
4444
],
45-
danmuValue: ''
45+
danmuValue: '',
46+
showVideo: false
4647
}
4748
},
4849
onReady: function(res) {
4950
// #ifndef MP-ALIPAY
5051
this.videoContext = uni.createVideoContext('myVideo')
51-
// #endif
52+
// #endif
53+
setTimeout(()=>{
54+
this.showVideo = true
55+
},350)
5256
},
5357
methods: {
5458
sendDanmu: function() {

‎pages/template/tabbar/tabbar.nvue‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,16 @@
147147
},
148148
onLoad() {
149149
setTimeout(()=>{
150-
this.newsList.push({
151-
data: [],
152-
isLoading: false,
153-
refreshText: "",
154-
loadingText: '加载更多...'
155-
});
156-
this.getList(0);
157-
},50)
158-
setTimeout(()=>{
159-
for (var i = 0; i < this.tabBars.length; i++) {
160-
this.newsList.push({
161-
data: [],
162-
isLoading: false,
163-
refreshText: "",
164-
loadingText: '加载更多...'
165-
});
166-
}
167-
this.getList(0);
168-
},300)
150+
this.tabBars.forEach((tabBar) => {
151+
this.newsList.push({
152+
data: [],
153+
isLoading: false,
154+
refreshText: "",
155+
loadingText: '加载更多...'
156+
});
157+
});
158+
this.getList(0);
159+
},350)
169160
},
170161
methods: {
171162
getList(index) {

0 commit comments

Comments
 (0)