Commit b818670b authored by xinzhedeai's avatar xinzhedeai

add:video test

parent 0d74eb92
......@@ -12,28 +12,33 @@
<div class="wrapper">
<!-- 视频播放区域 -->
<div class="video-container">
<video controls poster="https://dummyimage.com/750x400">
<source src="https://example.com/video.mp4" type="video/mp4">
您的浏览器不支持视频播放
<!-- <video src="http://192.168.2.37:8080/profile/upload/2025/05/20/test_20250520170318A001.mp4"></video> -->
<video id="myVideo" poster="poster.jpg" controls>
<!-- <source src="video1.mp4" crossorigin type="video/mp4"> -->
<source src="test/testVideo.mp4" type="video/mp4">
您的浏览器不支持HTML5视频播放
</video>
</div>
<!-- 标题与日期 -->
<div class="info-section">
<div class="title-wrapper">
<img class="title-icon" src="https://dummyimage.com/37x32">
<h3 class="video-title">2024年安全生产常识培训视频:危险化学品存储规范</h3>
<h3 class="video-title">{{detailInfo.name}}</h3>
</div>
<p class="video-date">日期:2024-05-20</p>
<p class="video-date">日期:{{ detailInfo.uploadsDate }}</p>
</div>
<!-- 两列图文列表 -->
<div class="grid-list">
<!-- <div class="grid-list">
<div class="grid-item" v-for="item in 11" :key="item.id">
<img class="grid-item-image" src="https://dummyimage.com/340x206" alt="相关内容封面">
<p class="grid-item-text">{{ item }}</p>
</div>
</div>
</div> -->
</div>
</div>
</body>
......
......@@ -9,53 +9,28 @@ window.addEventListener("load", function () {
el: '#app',
data() {
return {
merName:'',
userType: gemhoUtil.getCookie('userType'),
shanghuName: '',
// 新增子Tab数据
hazardList: [
// 更多示例数据...
],
activeTab: '',
status: '',
merId: '',
showSearch: false, // 控制搜索框的显示和隐藏
// 整改状态 0:待整改 1:已整改 2:待审核 3:整改逾期
tabList: [
{ name: '', title: '全部', msgNum: 0, },
{ name: '2', title: '待审核', msgNum: 0, },
{ name: '0', title: '待整改', msgNum: 0, },
{ name: '1', title: '已整改', msgNum: 0, },
{ name: '3', title: '整改逾期', msgNum: 0, },
],
loading: false,
finished: false,
page: 0,
size: 6,
total: 0,
detailInfo:{}
}
},
created() {
let params = gemhoUtil.getUrlParams()
console.log(params);
this.merId = params.merId
},
mounted() {
// this.detail()
},
methods: {
onSearch() {
console.log('xxxx', this.merName)
this.getList()
},
reset() {
this.page = 0
this.size = 6
this.total = 0
this.hazardList = []
handleVideoError(e) {
const error = e.target.error;
console.error("视频播放错误:", {
code: error.code,
message: [
"未知错误",
"网络错误(文件不可达)",
"解码错误(格式/编码不支持)",
"URL无效"
][error.code - 1]
});
},
getList(){
detail(){
// 这里添加获取数据的逻辑
vant.Toast.loading({
message: '正在加载...',
......@@ -65,15 +40,12 @@ window.addEventListener("load", function () {
setTimeout(() => {
http2.post(
{
serviceId: API_KEY_MAP['page']['id'],
interfacePublicKey: API_KEY_MAP['page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['page']['privateKey'],
serviceId: API_KEY_MAP['no-page']['id'],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: {
sign: 3,
// merId: this.merId ? this.merId : '',
merName: this.shanghuName,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sign: 17,
safetyId: gemhoUtil.getParameter('id'),
},
},
(res) => {
......@@ -82,20 +54,16 @@ window.addEventListener("load", function () {
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
this.getList()
this.detail()
}, 0)
return
}
if (res) {
var result = JSON.parse(res)
console.log(result, 'result')
this.loading = false; // 加载状态结束
this.hazardList.push(...result.rows);
this.total = result.total
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
this.detailInfo = result.data
this.detailInfo.videoUrl = './test/testVideo.mp4'
console.log(result, 'detail result')
}
this.loading = false
setTimeout(() => {
......@@ -108,30 +76,7 @@ window.addEventListener("load", function () {
)
}, 0)
},
tabChange(title) {
console.log('tab 切换', title)
this.reset()
this.getList()
},
init() {
this.getList()
},
onSearch() {
this.reset()
this.getList()
},
// 新增选择确认方法
viewDetail(item, type) {
let param = {
id: item.id,
pageName: '_anquan_changshi',
}
let url = gemhoUtil.setParameter('_anquan_changshi-detail.html', param)
console.log(url)
gemhoUtil.navigatePage(url, '跳转中...')
},
}
});
......
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