|
@@ -764,16 +764,16 @@
|
|
//横屏处理
|
|
//横屏处理
|
|
resolving = 0;
|
|
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(
|
|
// wsss.send(
|
|
// JSON.stringify({
|
|
// JSON.stringify({
|
|
@@ -781,13 +781,13 @@
|
|
// }),
|
|
// }),
|
|
// );
|
|
// );
|
|
// 横竖屏变更时获取分辨率要延迟,不然会获取到变更前的分辨率
|
|
// 横竖屏变更时获取分辨率要延迟,不然会获取到变更前的分辨率
|
|
- setTimeout(function () {
|
|
|
|
- wsss.send(
|
|
|
|
- JSON.stringify({
|
|
|
|
- type: 'getPhoneSize',
|
|
|
|
- }),
|
|
|
|
- );
|
|
|
|
- }, 500);
|
|
|
|
|
|
+ // setTimeout(function () {
|
|
|
|
+ // wsss.send(
|
|
|
|
+ // JSON.stringify({
|
|
|
|
+ // type: 'getPhoneSize',
|
|
|
|
+ // }),
|
|
|
|
+ // );
|
|
|
|
+ // }, 500);
|
|
}
|
|
}
|
|
if (input[23] == 0x0b) {
|
|
if (input[23] == 0x0b) {
|
|
//多端登录处理, 数据从索引24开始取, input 是接收到的原始数据
|
|
//多端登录处理, 数据从索引24开始取, input 是接收到的原始数据
|
|
@@ -1422,6 +1422,19 @@
|
|
getAD();
|
|
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() {
|
|
// function adInit() {
|
|
// sourceType = parameters['sourceType'];
|
|
// sourceType = parameters['sourceType'];
|
|
@@ -1522,19 +1535,6 @@
|
|
success: function (res) {},
|
|
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', () => {
|
|
$('.time-close-wrap')[0].addEventListener('click', () => {
|
|
if (videoTime == 0) {
|
|
if (videoTime == 0) {
|
|
@@ -1658,6 +1658,11 @@
|
|
const templatePhoneSizeItem = doT.template(
|
|
const templatePhoneSizeItem = doT.template(
|
|
$('#template-phone-size-item').html().replace(/&/g, '&'),
|
|
$('#template-phone-size-item').html().replace(/&/g, '&'),
|
|
);
|
|
);
|
|
|
|
+ // console.log({
|
|
|
|
+ // list: window.phoneSizeList,
|
|
|
|
+ // active: window.activePhoneSize,
|
|
|
|
+ // resolving,
|
|
|
|
+ // });
|
|
const phoneSizeListItemsHtml = templatePhoneSizeItem({
|
|
const phoneSizeListItemsHtml = templatePhoneSizeItem({
|
|
list: window.phoneSizeList,
|
|
list: window.phoneSizeList,
|
|
active: window.activePhoneSize,
|
|
active: window.activePhoneSize,
|
|
@@ -1681,11 +1686,12 @@
|
|
window.phoneSizeList = [];
|
|
window.phoneSizeList = [];
|
|
// 当前生效的分辨率
|
|
// 当前生效的分辨率
|
|
window.currentPhoneSize = {
|
|
window.currentPhoneSize = {
|
|
|
|
+ // id: 1,
|
|
width: 720,
|
|
width: 720,
|
|
height: 1280,
|
|
height: 1280,
|
|
};
|
|
};
|
|
// 选中的分辨率
|
|
// 选中的分辨率
|
|
- window.activePhoneSize = window.currentPhoneSize;
|
|
|
|
|
|
+ // window.activePhoneSize = window.currentPhoneSize;
|
|
|
|
|
|
function getPhoneSizeList() {
|
|
function getPhoneSizeList() {
|
|
return $.ajax({
|
|
return $.ajax({
|
|
@@ -1704,8 +1710,8 @@
|
|
return {
|
|
return {
|
|
id: v.id,
|
|
id: v.id,
|
|
dpi: v.dpi,
|
|
dpi: v.dpi,
|
|
- width: v.width || v.abscissa,
|
|
|
|
- height: v.height || v.ordinate || v.high,
|
|
|
|
|
|
+ width: v.width,
|
|
|
|
+ height: v.high,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -1713,16 +1719,18 @@
|
|
|
|
|
|
getPhoneSizeList().then(function (phoneSizeList) {
|
|
getPhoneSizeList().then(function (phoneSizeList) {
|
|
window.phoneSizeList = phoneSizeList;
|
|
window.phoneSizeList = phoneSizeList;
|
|
- window.phoneSizeListBack = phoneSizeList; // 备份下数据,用户横竖切换时。
|
|
|
|
|
|
+ // window.phoneSizeListBack = phoneSizeList; // 备份下数据,用户横竖切换时。
|
|
const currentPhoneSize = window.phoneSizeList.find(function (v) {
|
|
const currentPhoneSize = window.phoneSizeList.find(function (v) {
|
|
return (
|
|
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
|
|
v.dpi === window.currentPhoneSize.dpi
|
|
);
|
|
);
|
|
});
|
|
});
|
|
window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
|
|
window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
|
|
- return updatePhoneSizeListHtml();
|
|
|
|
|
|
+ // return updatePhoneSizeListHtml();
|
|
});
|
|
});
|
|
|
|
|
|
// const phoneSizeListSwiper = new Swiper('#phone-size-list-swiper', {
|
|
// const phoneSizeListSwiper = new Swiper('#phone-size-list-swiper', {
|
|
@@ -1732,12 +1740,10 @@
|
|
// centeredSlides: true,
|
|
// centeredSlides: true,
|
|
// });
|
|
// });
|
|
function setPhoneSize(config) {
|
|
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(
|
|
wsss.send(
|
|
JSON.stringify({
|
|
JSON.stringify({
|