50 lines
1.2 KiB
Vue
50 lines
1.2 KiB
Vue
<template>
|
|
<view class="page">
|
|
<u-navbar title="视频教程" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
|
|
title-size='36' height='36' id="navbar">
|
|
</u-navbar>
|
|
<view class="list">
|
|
<view class="list_item">
|
|
<web-view :src="http" @load="onWebViewLoad" @error="onWebViewError"></web-view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
bgc: {
|
|
backgroundColor: "#fff",
|
|
},
|
|
http:''
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.http = 'https://ele.ccttiot.com/ext?url=' + encodeURIComponent('https://player.bilibili.com/player.html?isOutside=true&aid=114369123849636&bvid=BV1CuLczFEe2&cid=29515777844&p=1')
|
|
console.log(this.http);
|
|
},
|
|
methods: {
|
|
onWebViewLoad(e) {
|
|
console.log('网页加载完成', e)
|
|
uni.showToast({ title: '页面加载完成', icon: 'none' })
|
|
},
|
|
|
|
// 网页加载失败时触发
|
|
onWebViewError(e) {
|
|
console.error('加载失败', e)
|
|
uni.showToast({ title: '加载失败', icon: 'none' })
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
background: #fff;
|
|
}
|
|
|
|
</style> |