Commit b818670b authored by xinzhedeai's avatar xinzhedeai

add:video test

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