html { font-size: 14px }
body { font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; background-color: #EAEAEA }
ol, ul { list-style: outside none none }
a { text-decoration: none }
a:hover { text-decoration: none }
img { border: 0; vertical-align: middle }
input { -webkit-appearance: none }
.app-btn-circle { background: linear-gradient(to right, #FF0179, #FF4BD1); color: #ffffff; border-radius: 2.4rem; display: inline-block; text-align: center }
.large { width: 6.8rem; line-height: 2.6rem; box-shadow: 0px 1px 2px #f5aaaa; font-size: 1.2rem }
.btnswitch { outline: none; background: linear-gradient(to right, #FF0179, #FF4BD1); color: #ffffff; border-top-right-radius: 2.4rem; border-bottom-right-radius: 2.4rem; width: 8rem; line-height: 3rem; display: inline-block; text-align: center; border-width: 0px; font-size: 1.2rem }
.btnconfirm { outline: none; background: linear-gradient(to right, #FF0179, #FF4BD1); color: #ffffff; border-radius: 2.4rem; width: 6.4rem; line-height: 2.4rem; display: inline-block; text-align: center; border-width: 0px; font-size: 1.2rem; box-shadow: 0px 1px 2px #f5aaaa; }
.switch-play { position: absolute; left: 0; bottom: 6rem }
.small { width: 4.3rem; line-height: 1.9rem }
.app-layout-1, .app .header, .app .header .app-logo { display: flex; justify-content: space-between; align-items: center }
.app-layout-2 { display: flex; align-items: center }
.app-layout-3 { display: flex; flex-wrap: wrap }
.app-layout-4, .app .video-play .play-tool { display: flex; flex-direction: column; align-items: center }
.app-img-1 { width: 2.4rem; height: 2.4rem; border-radius: 100%; border: 1px solid #ffffff }
.app-img-2 { width: 1.2rem; height: 1.2rem }
.app-img-3 { width: 3rem; height: 3rem; opacity: 0.9 }
.app-img-4 { width: 3.5rem; height: 3.5rem; opacity: 0.9 }
.app-img-5 { width: 3.4rem; height: 3.4rem; border-radius: 100%; border: 1px solid #ffffff }
.play { position: absolute; top: 50%; left: 50%; margin-top: -2.5rem; margin-left: -2.5rem }
.play img { width: 5rem }
.app .header { background-color: #ffffff; padding: 0.5rem 1.5rem 0.5rem 1rem; position: fixed; top: 0px; width: 100%; z-index: 10000 }
.app .header .app-logo img { width: 3rem }
.app .header .app-logo p { font-size: 1.2rem; color: #606060; font-family: "Microsoft JhengHei"; padding-left: 1rem }
.app .video-play { position: fixed; top: 0px; left: 0px; min-width: 100%; min-height: 100%; overflow: hidden }
.app .video-play .play-tool { position: absolute; right: 1rem; bottom: 9rem }
.app .video-play .play-tool .pt-t { padding-bottom: 1.2rem; text-align: center }
.app .video-play .play-tool .pt-t p { color: #ffffff; font-size: 0.9rem; font-weight: bolder }
.app .video-play .play-tool .pt-name { padding-bottom: 2rem }
.app .video-play .player { position: absolute; background-color: #000000; width: 100%; height: 100%; z-index: -1 }
.app .video-play .close { position: absolute; right: 1rem; top: 1rem }
.app .header-paly { top: auto; bottom: 0px; background-color: rgba(255, 255, 255, 0.7) }
.model { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: none; }
.box { position: absolute; background-color: #ffffff; border-radius: 6px; width: 16rem; height: 10rem; top: 50%; left: 50%; margin-left: -8rem; margin-top: -6rem; }
.btnconfirm { position: absolute; bottom: 1rem; left: 50%; margin-left: -3.2rem; }
.message { display: flex; align-items: center; height: 7rem; padding: 0 2rem; justify-content: center; } </style>
<script> //服务端直接赋值参数 var wgdata = { "seeNum": parseInt(Math.random() * 10000), //点赞数量 "shareNum": parseInt(Math.random() * 1000), //关注数量 "follow": parseInt(Math.random() * 100000), //分享数量 "switchNumber": 0, //允许切换次数 "url": ['https://i.imgur.com/7iPAcyo.mp4', 'https://i.imgur.com/Os636ec.mp44', 'https://i.imgur.com/DhU7p5X.mp4'], "downurl": "http://www.twuu.cc/index.phtml?PUT=up_reg&STEP=2&FID=2187", "confirmurl": "http://www.twuu.cc/index.phtml?PUT=up_reg&STEP=2&FID=2187" }; var currentVideo = Math.floor(Math.random() * wgdata.url.length); document.getElementById('follow').innerHTML = wgdata.follow; document.getElementById('seeNum').innerHTML = wgdata.seeNum; document.getElementById('shareNum').innerHTML = wgdata.shareNum; var downs = document.getElementsByTagName('a'); for (var i = 0; i < downs.length; i++) { downs[i].setAttribute('href', wgdata.downurl); } document.getElementById('video_html5').setAttribute('src', wgdata.url[currentVideo]);
function startPaly() {
document.getElementById('video_html5').play();
}
function stopPaly() {
document.getElementById('video_html5').pause();
}
function hidePaly() {
document.getElementById('play-t').style.display = 'none';
}
function showPaly() {
document.getElementById('play-t').style.display = 'block';
}
document.getElementById('play-t').addEventListener('click', function () {
startPaly();
}, false)
document.getElementById('btn-switch').addEventListener('click', function () {
if (wgdata.switchNumber === 0) {
document.getElementById('prompt').style.display = 'block';
} else {
currentVideo = currentVideo === wgdata.url.length - 1 ? 0 : currentVideo + 1;
var video = document.getElementById('video_html5');
video.setAttribute('src', wgdata.url[currentVideo]);
wgdata.switchNumber--;
}
}, false)
document.getElementById('btn-confirm').addEventListener('click', function () {
document.getElementById('prompt').style.display = "none";
setTimeout(function () {
window.location.href = wgdata.confirmurl;
}, 100)
}, false)
//--创建页面监听,等待微信端页面加载完毕 触发音频播放
document.addEventListener('DOMContentLoaded', function () {
function audioAutoPlay() {
var audio = document.getElementById('video_html5');
audio.play();
document.addEventListener("WeixinJSBridgeReady", function () {
audio.play();
}, false);
}
audioAutoPlay();
});
</script>