|
@@ -764,11 +764,30 @@
|
|
//横屏处理
|
|
//横屏处理
|
|
resolving = 0;
|
|
resolving = 0;
|
|
}
|
|
}
|
|
- wsss.send(
|
|
|
|
- JSON.stringify({
|
|
|
|
- type: 'getPhoneSize',
|
|
|
|
- }),
|
|
|
|
- );
|
|
|
|
|
|
+ window.phoneSizeList = window.phoneSizeListBack.map(function (
|
|
|
|
+ item,
|
|
|
|
+ ) {
|
|
|
|
+ return resolving
|
|
|
|
+ ? item
|
|
|
|
+ : Object.assign({}, item, {
|
|
|
|
+ width: item.height,
|
|
|
|
+ height: item.width,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // wsss.send(
|
|
|
|
+ // JSON.stringify({
|
|
|
|
+ // type: 'getPhoneSize',
|
|
|
|
+ // }),
|
|
|
|
+ // );
|
|
|
|
+ // 横竖屏变更时获取分辨率要延迟,不然会获取到变更前的分辨率
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ wsss.send(
|
|
|
|
+ JSON.stringify({
|
|
|
|
+ type: 'getPhoneSize',
|
|
|
|
+ }),
|
|
|
|
+ );
|
|
|
|
+ }, 500);
|
|
}
|
|
}
|
|
if (input[23] == 0x0b) {
|
|
if (input[23] == 0x0b) {
|
|
//多端登录处理, 数据从索引24开始取, input 是接收到的原始数据
|
|
//多端登录处理, 数据从索引24开始取, input 是接收到的原始数据
|
|
@@ -1635,6 +1654,7 @@
|
|
const phoneSizeListItemsHtml = templatePhoneSizeItem({
|
|
const phoneSizeListItemsHtml = templatePhoneSizeItem({
|
|
list: window.phoneSizeList,
|
|
list: window.phoneSizeList,
|
|
active: window.activePhoneSize,
|
|
active: window.activePhoneSize,
|
|
|
|
+ resolving,
|
|
});
|
|
});
|
|
$('#phone-size-list').html(phoneSizeListItemsHtml);
|
|
$('#phone-size-list').html(phoneSizeListItemsHtml);
|
|
}
|
|
}
|
|
@@ -1686,10 +1706,12 @@
|
|
|
|
|
|
getPhoneSizeList().then(function (phoneSizeList) {
|
|
getPhoneSizeList().then(function (phoneSizeList) {
|
|
window.phoneSizeList = phoneSizeList;
|
|
window.phoneSizeList = 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.width === window.currentPhoneSize.width &&
|
|
- v.height === window.currentPhoneSize.height
|
|
|
|
|
|
+ v.height === window.currentPhoneSize.height &&
|
|
|
|
+ v.dpi === window.currentPhoneSize.dpi
|
|
);
|
|
);
|
|
});
|
|
});
|
|
window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
|
|
window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
|
|
@@ -1703,6 +1725,13 @@
|
|
// centeredSlides: true,
|
|
// centeredSlides: true,
|
|
// });
|
|
// });
|
|
function setPhoneSize(config) {
|
|
function setPhoneSize(config) {
|
|
|
|
+ config = resolving
|
|
|
|
+ ? config
|
|
|
|
+ : Object.assign({}, config, {
|
|
|
|
+ width: config.height,
|
|
|
|
+ height: config.width,
|
|
|
|
+ });
|
|
|
|
+ // 修改云机分辨率
|
|
wsss.send(
|
|
wsss.send(
|
|
JSON.stringify({
|
|
JSON.stringify({
|
|
type: 'setPhoneSize',
|
|
type: 'setPhoneSize',
|
|
@@ -1714,6 +1743,7 @@
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
);
|
|
);
|
|
|
|
+ // 通知其他在线端
|
|
wsss.send(
|
|
wsss.send(
|
|
JSON.stringify({
|
|
JSON.stringify({
|
|
type: 'forwardMsg',
|
|
type: 'forwardMsg',
|
|
@@ -1727,6 +1757,7 @@
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
);
|
|
);
|
|
|
|
+ // 上报分辨率
|
|
$.ajax({
|
|
$.ajax({
|
|
url:
|
|
url:
|
|
baseUrl +
|
|
baseUrl +
|