fei.wang
6 天以前 e15f561a1f9eddfde503d59baf45a860b131928e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/3/19
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
    <!-- 添加视口元标签 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <style>
        /* 定义通用按钮样式 */
        .el-button {
            display: inline-block;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            background: #fff;
            border: 1px solid #dcdfe6;
            color: #606266;
            -webkit-appearance: none;
            text-align: center;
            box-sizing: border-box;
            outline: none;
            margin: 0;
            transition: .1s;
            font-weight: 500;
            -moz-user-select: none;
            -webkit-user-select: none;
            -ms-user-select: none;
            /* 调整按钮内边距以适应手机端 */
            padding: 10px 16px;
            font-size: 14px;
            border-radius: 4px;
        }
 
        /* 定义主要按钮样式 */
        .el-button--primary {
            color: #fff;
            background-color: #409eff;
            border-color: #409eff;
        }
 
        /* 鼠标悬停效果 */
        .el-button--primary:hover {
            background: #66b1ff;
            border-color: #66b1ff;
        }
 
        /* 去除 a 标签默认下划线 */
        a.el-button {
            text-decoration: none;
        }
 
        /* 视频样式,设置宽度为 100% 以自适应屏幕 */
        video {
            width: 100%;
            height: auto;
        }
    </style>
</head>
<body>
<video id="myVideo" controls>
    <source src="view/Home/Safer.mp4" type="video/mp4">
    <source src="35.%20Inherently_Safer.mov" type="video/quicktime">
    你的浏览器不支持播放此视频。
</video>
<p><a  href="https://forms.office.com/Pages/ResponsePage.aspx?id=cA1LiPuZFUqgcaPAeoRMSjg6rEwGTKNAnzDiWqMXzSpUNzc1QUM0NFBWTlBKVjhMV1QzS0Y3UzFZSC4u&origin=QRCode" id="backButton" class="el-button el-button--primary">
    完成视频观看
</a></p>
<script>
    var lock = false
    const video = document.getElementById('myVideo');
    video.addEventListener('error', function() {
        console.log('视频加载出错');
        alert('视频加载出错,请检查网络或视频文件。');
    });
    setTimeout(function () {
        // const backButton = document.getElementById('backButton');
        // document.getElementById('backButton').style.display = '';
        lock=true
    },6000)
    const backButton = document.getElementById('backButton');
    backButton.addEventListener('click', function(event) {
        console.log(lock)
 
        if (lock ==false){
            alert('未完成视频观看。');
            event.preventDefault(); // 阻止默认的链接跳转行为
            window.history.back(); // 返回上一级页面
            return false
        }else{
            return true
        }
 
 
        //
    });
</script>
</body>
</html>