尝试增加播放页面。如果源不存在会有bug,后面需要修复
This commit is contained in:
parent
023ba362e6
commit
3279bdff16
@ -1,3 +1,8 @@
|
||||
a.links{
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.stui-content__thumb .pic iframe{
|
||||
max-width: 100%;
|
||||
border-radius: 2px;height:155px;
|
||||
}
|
||||
@ -37,14 +37,16 @@
|
||||
<stu-header :ctx="ctx" :items="items" :hotsuggs="hotsuggs" :is_home="is_home" :tid="tid"></stu-header>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="stui-pannel clearfix">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel__bd">
|
||||
<div class="stui-content">
|
||||
<div class="stui-content__thumb">
|
||||
<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>
|
||||
</div>
|
||||
<div class="stui-content__detail">
|
||||
@ -78,7 +80,7 @@
|
||||
<h3 class="title"><i class="iconfont icon-iconfontplay2"></i> {[vod_tab]}</h3>
|
||||
<ul class="stui-content__playlist clearfix">
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
@ -228,7 +230,26 @@ const app = createApp({
|
||||
items.value = JSON.parse(sessionStorage.getItem('items'))||items.value;
|
||||
hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value;
|
||||
}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 {
|
||||
...methods,
|
||||
ctx:ctx,
|
||||
items:items,
|
||||
is_home:is_home,
|
||||
@ -243,6 +264,8 @@ const app = createApp({
|
||||
vod_tabs:vod_tabs,
|
||||
vod_urls:vod_urls,
|
||||
fast_play:fast_play,
|
||||
iframeSrc:iframeSrc,
|
||||
iframeShow:iframeShow,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@ -157,7 +157,7 @@ const app = createApp({
|
||||
|
||||
const ctx_str = "ctxObj={{ctx|safe}}";
|
||||
eval(ctx_str);
|
||||
// console.log(ctxObj)
|
||||
console.log(ctxObj)
|
||||
const ctx = ref(ctxObj);
|
||||
|
||||
const items = ref({
|
||||
@ -175,7 +175,9 @@ const app = createApp({
|
||||
try {
|
||||
items.value = JSON.parse(sessionStorage.getItem('items'))||items.value;
|
||||
hotsuggs.value = JSON.parse(sessionStorage.getItem('hotsuggs'))||hotsuggs.value;
|
||||
}catch (e) {}
|
||||
}catch (e) {
|
||||
console.log(e.message)
|
||||
}
|
||||
return {
|
||||
ctx:ctx,
|
||||
items:items,
|
||||
|
||||
@ -171,7 +171,7 @@ const stuHeaderComponent = {
|
||||
|
||||
const stuCategoryComponent = {
|
||||
template: `
|
||||
<v v-for="item in items.class">
|
||||
<div v-for="item in items.class">
|
||||
<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>
|
||||
<p>
|
||||
@ -193,7 +193,7 @@ const stuCategoryComponent = {
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</v>
|
||||
</div>
|
||||
`,
|
||||
setup(props, context) {
|
||||
console.log('stuCategory组件加载完毕');
|
||||
@ -317,7 +317,7 @@ const stuLinksComponent = {
|
||||
// console.log(props);
|
||||
},
|
||||
props:{
|
||||
links:[],
|
||||
links:Array,
|
||||
}, //配置需要传入的属性
|
||||
delimiters: ['{[', ']}'],//delimiters:改变默认的插值符号
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user