|
@@ -59,6 +59,34 @@
|
|
|
</div>
|
|
|
{{~}}
|
|
|
</template>
|
|
|
+ <template id="template-shear">
|
|
|
+ {{? it.length}}
|
|
|
+ <div class="title">
|
|
|
+ 剪贴板
|
|
|
+ <div class="btn-clear">清空</div>
|
|
|
+ </div>
|
|
|
+ <div class="slide-wrapper-content">
|
|
|
+ {{~ it :item:index }}
|
|
|
+ <div class="slide-wrapper">
|
|
|
+ <div class="slide-scroll animate-slide-start">
|
|
|
+ <div
|
|
|
+ class="slide-content"
|
|
|
+ data-content="{{= encodeHtml(item.content)}}"
|
|
|
+ >
|
|
|
+ <div>{{= encodeHtml(item.content)}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="slide-content-button" data-id="{{= item.id}}">
|
|
|
+ <button>删除</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {{~}}
|
|
|
+ </div>
|
|
|
+ {{??}}
|
|
|
+ <img class="empty" src="img/jianqieban_pic@2x.png" alt="" />
|
|
|
+ <div class="empty-txt">剪贴板为空</div>
|
|
|
+ {{?}}
|
|
|
+ </template>
|
|
|
<div class="container" id="player">
|
|
|
<div class="muted" id="btnMuted">
|
|
|
<div class="control-right-img" data-id="1">
|
|
@@ -764,16 +792,16 @@
|
|
|
//横屏处理
|
|
|
resolving = 0;
|
|
|
}
|
|
|
- window.phoneSizeList = window.phoneSizeListBack.map(function (
|
|
|
- item,
|
|
|
- ) {
|
|
|
- return resolving
|
|
|
- ? item
|
|
|
- : Object.assign({}, item, {
|
|
|
- width: item.height,
|
|
|
- height: item.width,
|
|
|
- });
|
|
|
- });
|
|
|
+ // window.phoneSizeList = window.phoneSizeListBack.map(function (
|
|
|
+ // item,
|
|
|
+ // ) {
|
|
|
+ // return resolving
|
|
|
+ // ? item
|
|
|
+ // : Object.assign({}, item, {
|
|
|
+ // width: item.height,
|
|
|
+ // height: item.width,
|
|
|
+ // });
|
|
|
+ // });
|
|
|
|
|
|
// wsss.send(
|
|
|
// JSON.stringify({
|
|
@@ -781,13 +809,13 @@
|
|
|
// }),
|
|
|
// );
|
|
|
// 横竖屏变更时获取分辨率要延迟,不然会获取到变更前的分辨率
|
|
|
- setTimeout(function () {
|
|
|
- wsss.send(
|
|
|
- JSON.stringify({
|
|
|
- type: 'getPhoneSize',
|
|
|
- }),
|
|
|
- );
|
|
|
- }, 500);
|
|
|
+ // setTimeout(function () {
|
|
|
+ // wsss.send(
|
|
|
+ // JSON.stringify({
|
|
|
+ // type: 'getPhoneSize',
|
|
|
+ // }),
|
|
|
+ // );
|
|
|
+ // }, 500);
|
|
|
}
|
|
|
if (input[23] == 0x0b) {
|
|
|
//多端登录处理, 数据从索引24开始取, input 是接收到的原始数据
|
|
@@ -830,6 +858,38 @@
|
|
|
var cutList = [];
|
|
|
let timer,
|
|
|
isFlag = true;
|
|
|
+ const shearTemplate = doT.template(
|
|
|
+ $('#template-shear').html().replace(/&/g, '&'),
|
|
|
+ );
|
|
|
+
|
|
|
+ function updateShearHtml(list) {
|
|
|
+ $('.box-shear-plate').html(shearTemplate(list));
|
|
|
+ }
|
|
|
+ // 对字符串进行html转义
|
|
|
+ function encodeHtml(content) {
|
|
|
+ return [
|
|
|
+ ['<', '<'],
|
|
|
+ ['>', '>'],
|
|
|
+ ['&', '&'],
|
|
|
+ ['"', '"'],
|
|
|
+ ].reduce(function (previousValue, currentValue) {
|
|
|
+ return previousValue.replace(
|
|
|
+ new RegExp(currentValue[0], 'g'),
|
|
|
+ currentValue[1],
|
|
|
+ );
|
|
|
+ }, content);
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.box-shear-plate').on('click', '.slide-content', function (e) {
|
|
|
+ handleCopy(e.currentTarget.dataset.content);
|
|
|
+ });
|
|
|
+ $('.box-shear-plate').on('click', '.btn-clear', function (e) {
|
|
|
+ handleClear();
|
|
|
+ });
|
|
|
+ $('.box-shear-plate').on('click', '.slide-content-button', function (e) {
|
|
|
+ handleDelete(e.currentTarget.dataset.id);
|
|
|
+ });
|
|
|
+
|
|
|
function showShearPlate() {
|
|
|
if (!isControl) {
|
|
|
return;
|
|
@@ -872,36 +932,9 @@
|
|
|
type: 'get',
|
|
|
dataType: 'json',
|
|
|
success: function (res) {
|
|
|
- if (res.status === 0) {
|
|
|
- if (res.data.length) {
|
|
|
- cutList = array_unique(res.data);
|
|
|
- var str =
|
|
|
- '<div class="title">剪贴板<div onclick="handleClear()" class="btn-clear">清空</div></div><div class="slide-wrapper-content">';
|
|
|
- cutList.forEach(function (item) {
|
|
|
- str +=
|
|
|
- "<div class='slide-wrapper'><div class='slide-scroll animate-slide-start'><div class='slide-content'><div onclick='handleCopy(\"" +
|
|
|
- item.content +
|
|
|
- '")\'>' +
|
|
|
- item.content +
|
|
|
- "</div></div><div class='slide-content-button'><button onclick='handleDelete(" +
|
|
|
- item.id +
|
|
|
- ")'>删除</button></div></div></div>";
|
|
|
- });
|
|
|
- str += '</div>';
|
|
|
- $('.box-shear-plate').append(str);
|
|
|
- } else {
|
|
|
- $('.box-shear-plate').append(
|
|
|
- '<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
|
- );
|
|
|
- }
|
|
|
- $('.mask').show();
|
|
|
- initSlider();
|
|
|
- } else {
|
|
|
- $('.box-shear-plate').append(
|
|
|
- '<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
|
- );
|
|
|
- $('.mask').show();
|
|
|
- }
|
|
|
+ updateShearHtml(res.status === 0 ? res.data : []);
|
|
|
+ $('.mask').show();
|
|
|
+ initSlider();
|
|
|
},
|
|
|
});
|
|
|
});
|
|
@@ -1422,6 +1455,19 @@
|
|
|
getAD();
|
|
|
});
|
|
|
}
|
|
|
+ // 观看广告次数上报
|
|
|
+ function reportFrequency() {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/resoures/v1/trial/reportFrequency/' + userCardId,
|
|
|
+ headers: {
|
|
|
+ Authorization: token,
|
|
|
+ },
|
|
|
+ type: 'post',
|
|
|
+ contentType: 'application/json',
|
|
|
+ dataType: 'json',
|
|
|
+ success: function (res) {},
|
|
|
+ });
|
|
|
+ }
|
|
|
//广告信息
|
|
|
// function adInit() {
|
|
|
// sourceType = parameters['sourceType'];
|
|
@@ -1522,19 +1568,6 @@
|
|
|
success: function (res) {},
|
|
|
});
|
|
|
}
|
|
|
- // 观看广告次数上报
|
|
|
- function reportFrequency() {
|
|
|
- $.ajax({
|
|
|
- url: baseUrl + '/api/resoures/v1/trial/reportFrequency/' + userCardId,
|
|
|
- headers: {
|
|
|
- Authorization: token,
|
|
|
- },
|
|
|
- type: 'post',
|
|
|
- contentType: 'application/json',
|
|
|
- dataType: 'json',
|
|
|
- success: function (res) {},
|
|
|
- });
|
|
|
- }
|
|
|
//关闭广告
|
|
|
$('.time-close-wrap')[0].addEventListener('click', () => {
|
|
|
if (videoTime == 0) {
|
|
@@ -1658,6 +1691,11 @@
|
|
|
const templatePhoneSizeItem = doT.template(
|
|
|
$('#template-phone-size-item').html().replace(/&/g, '&'),
|
|
|
);
|
|
|
+ // console.log({
|
|
|
+ // list: window.phoneSizeList,
|
|
|
+ // active: window.activePhoneSize,
|
|
|
+ // resolving,
|
|
|
+ // });
|
|
|
const phoneSizeListItemsHtml = templatePhoneSizeItem({
|
|
|
list: window.phoneSizeList,
|
|
|
active: window.activePhoneSize,
|
|
@@ -1681,11 +1719,12 @@
|
|
|
window.phoneSizeList = [];
|
|
|
// 当前生效的分辨率
|
|
|
window.currentPhoneSize = {
|
|
|
+ // id: 1,
|
|
|
width: 720,
|
|
|
height: 1280,
|
|
|
};
|
|
|
// 选中的分辨率
|
|
|
- window.activePhoneSize = window.currentPhoneSize;
|
|
|
+ // window.activePhoneSize = window.currentPhoneSize;
|
|
|
|
|
|
function getPhoneSizeList() {
|
|
|
return $.ajax({
|
|
@@ -1704,8 +1743,8 @@
|
|
|
return {
|
|
|
id: v.id,
|
|
|
dpi: v.dpi,
|
|
|
- width: v.width || v.abscissa,
|
|
|
- height: v.height || v.ordinate || v.high,
|
|
|
+ width: v.width,
|
|
|
+ height: v.high,
|
|
|
};
|
|
|
});
|
|
|
});
|
|
@@ -1713,16 +1752,18 @@
|
|
|
|
|
|
getPhoneSizeList().then(function (phoneSizeList) {
|
|
|
window.phoneSizeList = phoneSizeList;
|
|
|
- window.phoneSizeListBack = phoneSizeList; // 备份下数据,用户横竖切换时。
|
|
|
+ // window.phoneSizeListBack = phoneSizeList; // 备份下数据,用户横竖切换时。
|
|
|
const currentPhoneSize = window.phoneSizeList.find(function (v) {
|
|
|
return (
|
|
|
- v.width === window.currentPhoneSize.width &&
|
|
|
- v.height === window.currentPhoneSize.height &&
|
|
|
+ v.width ===
|
|
|
+ window.currentPhoneSize[resolving ? 'width' : 'height'] &&
|
|
|
+ v.height ===
|
|
|
+ window.currentPhoneSize[resolving ? 'height' : 'width'] &&
|
|
|
v.dpi === window.currentPhoneSize.dpi
|
|
|
);
|
|
|
});
|
|
|
window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
|
|
|
- return updatePhoneSizeListHtml();
|
|
|
+ // return updatePhoneSizeListHtml();
|
|
|
});
|
|
|
|
|
|
// const phoneSizeListSwiper = new Swiper('#phone-size-list-swiper', {
|
|
@@ -1732,12 +1773,10 @@
|
|
|
// centeredSlides: true,
|
|
|
// });
|
|
|
function setPhoneSize(config) {
|
|
|
- config = resolving
|
|
|
- ? config
|
|
|
- : Object.assign({}, config, {
|
|
|
- width: config.height,
|
|
|
- height: config.width,
|
|
|
- });
|
|
|
+ // config = Object.assign({}, config, {
|
|
|
+ // width: config.width,
|
|
|
+ // height: config.height,
|
|
|
+ // });
|
|
|
// 修改云机分辨率
|
|
|
wsss.send(
|
|
|
JSON.stringify({
|