Commit 29a1056d authored by jyx's avatar jyx

代码优化

parent fb0b06a1
......@@ -95,7 +95,7 @@
this.$emit("goRecommend")
},
click(detail) {
navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)))
navigateTo(`/pagesC/video/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)))
},
longClick(key) {
this.isEditStyle = true
......
......@@ -311,19 +311,15 @@
});
},
handleBanner(item) {
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleInfo(item) {
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleTop(item) {
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleBottomPlay(item) {
// navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleBottomClose() {
......
......@@ -236,7 +236,7 @@
this.isqp = e.detail.show
},
detail(detail) {
navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) +
navigateTo(`/pagesC/video/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) +
`&playNext=1`)
},
collect(vedioId, index) {
......
......@@ -84,25 +84,16 @@
}, {
"root": "pagesC",
"pages": [{
"path": "ttvideo/ttVideoDetail",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "#ffffff",
"usingComponents ": {
"video-player": "ext://industry/video-player"
}
}
},
{
"path": "video/newVideoDetail",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "#ffffff"
"path": "ttvideo/ttVideoDetail",
"style": {
"navigationStyle": "default",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "#ffffff",
"usingComponents ": {
"video-player": "ext://industry/video-player"
}
}
]
}]
},
{
"root": "pagesD",
......@@ -147,19 +138,18 @@
"pages/home": {
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages": ["pagesA", "pagesC", "pagesD"] //进入页面后预下载分包
},
"pages/recommend/recommend": {
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages": ["pagesC"] //进入页面后预下载分包
},
"pages/my/my": {
"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
"packages": ["pagesD"] //进入页面后预下载分包
}
// ,
// "pages/recommend/recommend": {
// "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
// "packages": ["pagesC"] //进入页面后预下载分包
// },
// "pages/my/my": {
// "network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)
// "packages": ["pagesD"] //进入页面后预下载分包
// }
},
"globalStyle": {
"backgroundColor": "#232325",
"backgroundColor": "#f5f5f5",
"navigationStyle": "default",
"app-plus": {
"bounce": "none",
......
......@@ -95,7 +95,7 @@
this.$emit("goRecommend")
},
click(detail) {
navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)))
navigateTo(`/pagesC/video/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)))
},
longClick(key) {
this.isEditStyle = true
......
......@@ -236,7 +236,7 @@
this.isqp = e.detail.show
},
detail(detail) {
navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) +
navigateTo(`/pagesC/video/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(detail)) +
`&playNext=1`)
},
collect(vedioId, index) {
......
......@@ -2,23 +2,20 @@
<view style="width: 100%;height: 100%;">
<!-- <status-title style="position: absolute;" iconColor="white" :showBack="true" /> -->
<swiper class="swiper" circular @change="swiperChange" :current="current" :vertical="true" :duration="duration">
<swiper-item v-for="(list, index) in displaySwiperList" :key="index">
<swiper-item v-for="(list, index) in displaySwiperList" :key="index" @click="tapVides()">
<block>
<tt-video-player v-if="canUseTTPlayer && Math.abs(displayIndex-index)==0" :id="list.vedioIndex"
:album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1"
object-fit="contain" :controls="controls" :poster="data.coverImage" :loop="!isplay"
@getsource="getsource" :enable-progress-gesture="false" :show-loading="true"
:autoplay="!list.lock" :enable-progress-gesture="false" :show-loading="true" @play="startPlay"
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" @timeupdate="timeUpdate"
@ended="ended" @click="tapVides()" @error="error">
<cover-view>{{list.douyinAlbumId}}</cover-view>
<cover-view>{{list.douyinEpisodeId}}</cover-view>
</tt-video-player>
@ended="ended" />
<video v-if="!canUseTTPlayer && Math.abs(displayIndex-index)==0" :id="list.vedioIndex"
@ended="ended" :controls="controls" :loop="!isplay" :enable-progress-gesture="false"
:show-loading="true" :show-fullscreen-btn="false" @controlstoggle="controlstoggle"
:poster="data.coverImage" @click="tapVides()" @timeupdate="timeupdate" :autoplay="!list.lock"
:src="list.vedioUrl" class="tsvideo" play-btn-position="center" object-fit="contain" />
:poster="data.coverImage" @timeupdate="timeupdate" :autoplay="!list.lock" :src="list.vedioUrl"
class="tsvideo" play-btn-position="center" object-fit="contain" />
<view v-if="originList[originIndex].lock || !list.vedioUrl" class="videoHover tsimg"
@click.stop="tapVideoHover(index,list.pays)"
......@@ -125,8 +122,6 @@
showCoinPop: false,
vipBackPage: '',
canUseTTPlayer: true,
ttPreloadAlbumId: '',
ttPreloadEpisodeId: '',
};
},
onLoad(options) {
......@@ -142,9 +137,6 @@
// #ifdef MP-TOUTIAO
this.canUseTTPlayer = tt.canIUse('video-player')
if (this.canUseTTPlayer && tt.canIUse('preloadResourceVideo')) {
this.preloadplaylet()
}
this.ttuop = 64
// #endif
......@@ -167,27 +159,32 @@
return result;
},
methods: {
startPlay() {
if (tt.canIUse('preloadResourceVideo')) {
this.preloadplaylet()
}
},
preloadplaylet() {
var preIndex = 0
if (this.displayIndex < 2) {
preIndex = this.displayIndex + 1
} else {
preIndex = 0
}
// 抖音预加载
tt.preloadResourceVideo({
albumId: '7312714531850388019',
episodeId: '7312719321847529984',
albumId: this.displaySwiperList[preIndex].douyinAlbumId,
episodeId: this.displaySwiperList[preIndex].douyinEpisodeId,
cloudType: 1,
version: 1,
success: () => {
console.log("短剧预加载成功", );
console.log("短剧预加载成功" + this.displaySwiperList[preIndex].douyinEpisodeId);
},
fail: (error) => {
console.log("短剧预加载失败", error);
},
});
},
getsource(e) {
console.log('AAAAAAA ' + e)
},
error(e) {
console.log('BBBBBBB ' + e)
},
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买看点
......@@ -213,8 +210,6 @@
// return
// }
console.log('AAAAAAA')
this.$nextTick(() => {
// 延迟渲染,否则位置错乱
this.showCoinPop = true
......
This diff is collapsed.
......@@ -83,7 +83,7 @@
});
},
handleInfo(item) {
navigateTo(`/pagesC/video/newVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
navigateTo(`/pagesC/video/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleXing(item) {
var that = this;
......
......@@ -4,7 +4,7 @@
$main-color: #03E7C9;
$second-color: #413F48;
/* 背景颜色 */
$bg-color: #232325;
$bg-color: #f5f5f5;
$bg-color-gray: #f8f8f8;
$bg-color-hover: #f1f1f1; //点击状态颜色
$bg-color-mask: rgba(0, 0, 0, 0.5); //遮罩颜色
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment