尝试增加播放页面。如果源不存在会有bug,后面需要修复

This commit is contained in:
晚风拂柳颜 2023-05-11 12:03:16 +08:00
parent 023ba362e6
commit 3279bdff16
4 changed files with 38 additions and 8 deletions

View File

@ -1,3 +1,8 @@
a.links{ a.links{
margin-right: 5px; margin-right: 5px;
} }
.stui-content__thumb .pic iframe{
max-width: 100%;
border-radius: 2px;height:155px;
}

View File

@ -38,13 +38,15 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="stui-pannel clearfix"> <div class="stui-pannel clearfix">
<div class="stui-pannel-box"> <div class="stui-pannel-box">
<div class="stui-pannel__bd"> <div class="stui-pannel__bd">
<div class="stui-content"> <div class="stui-content">
<div class="stui-content__thumb"> <div class="stui-content__thumb">
<a class="pic" href="" title="{{ctx.vod_name}}"> <a class="pic" href="" title="{{ctx.vod_name}}">
<img class="lazyload" :data-original="dinfo.vod_pic" src="/web/cms/mxpro/img/load.gif" /> <img class="lazyload" :data-original="dinfo.vod_pic" src="/web/cms/mxpro/img/load.gif" v-show="!iframeShow"/>
<iframe :src="iframeSrc" v-show="iframeShow" frameborder="0" scrolling="no"></iframe>
</a> </a>
</div> </div>
<div class="stui-content__detail"> <div class="stui-content__detail">
@ -78,7 +80,7 @@
<h3 class="title"><i class="iconfont icon-iconfontplay2"></i> {[vod_tab]}</h3> <h3 class="title"><i class="iconfont icon-iconfontplay2"></i> {[vod_tab]}</h3>
<ul class="stui-content__playlist clearfix"> <ul class="stui-content__playlist clearfix">
<li v-for="vod_url in vod_urls[index]"> <li v-for="vod_url in vod_urls[index]">
<a :href="vod_url.url">{[vod_url.name]}</a> <a :href="vod_url.url" @click.prevent="lazyPlay(vod_url.url)">{[vod_url.name]}</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -228,7 +230,26 @@ const app = createApp({
items.value = JSON.parse(sessionStorage.getItem('items'))||items.value; items.value = JSON.parse(sessionStorage.getItem('items'))||items.value;
hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value; hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value;
}catch (e) {} }catch (e) {}
const iframeSrc = ref('');
const iframeShow = ref(false);
const methods = {
async lazyPlay(url){
iframeShow.value = true;
console.log('准备处理播放地址:'+url);
try {
const res = await axios.get(url,{maxRedirects: 0});
console.log(res.data);
}catch (e) {
console.log('抓到了错误:'+e.message);
console.log('iframeSrc.value:',iframeSrc.value);
iframeSrc.value = url;
}
},
};
return { return {
...methods,
ctx:ctx, ctx:ctx,
items:items, items:items,
is_home:is_home, is_home:is_home,
@ -243,6 +264,8 @@ const app = createApp({
vod_tabs:vod_tabs, vod_tabs:vod_tabs,
vod_urls:vod_urls, vod_urls:vod_urls,
fast_play:fast_play, fast_play:fast_play,
iframeSrc:iframeSrc,
iframeShow:iframeShow,
} }
}, },
}); });

View File

@ -157,7 +157,7 @@ const app = createApp({
const ctx_str = "ctxObj={{ctx|safe}}"; const ctx_str = "ctxObj={{ctx|safe}}";
eval(ctx_str); eval(ctx_str);
// console.log(ctxObj) console.log(ctxObj)
const ctx = ref(ctxObj); const ctx = ref(ctxObj);
const items = ref({ const items = ref({
@ -175,7 +175,9 @@ const app = createApp({
try { try {
items.value = JSON.parse(sessionStorage.getItem('items'))||items.value; items.value = JSON.parse(sessionStorage.getItem('items'))||items.value;
hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value; hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value;
}catch (e) {} }catch (e) {
console.log(e.message)
}
return { return {
ctx:ctx, ctx:ctx,
items:items, items:items,

View File

@ -171,7 +171,7 @@ const stuHeaderComponent = {
const stuCategoryComponent = { const stuCategoryComponent = {
template: ` template: `
<v v-for="item in items.class"> <div v-for="item in items.class">
<div class="stui-vodlist__head"> <div class="stui-vodlist__head">
<a class="pull-right" :href="ctx.path+'?tid='+item.type_id+'&tname='+item.type_name">更多 <i class="iconfont icon-more"></i></a> <a class="pull-right" :href="ctx.path+'?tid='+item.type_id+'&tname='+item.type_name">更多 <i class="iconfont icon-more"></i></a>
<p> <p>
@ -193,7 +193,7 @@ const stuCategoryComponent = {
</div> </div>
</li> </li>
</ul> </ul>
</v> </div>
`, `,
setup(props, context) { setup(props, context) {
console.log('stuCategory组件加载完毕'); console.log('stuCategory组件加载完毕');
@ -317,7 +317,7 @@ const stuLinksComponent = {
// console.log(props); // console.log(props);
}, },
props:{ props:{
links:[], links:Array,
}, //配置需要传入的属性 }, //配置需要传入的属性
delimiters: ['{[', ']}'],//delimiters改变默认的插值符号 delimiters: ['{[', ']}'],//delimiters改变默认的插值符号
}; };