...
|
...
|
@@ -11,6 +11,8 @@ let $footer = $('#yoho-footer'), |
|
|
$header = $('.yoho-header');
|
|
|
|
|
|
let cleanHtml = require('../../utils/cleanHtml');
|
|
|
const yoho = require('./yoho-app');
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
// 为您优选-40位随机数指纹请求id
|
|
|
let RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) +
|
...
|
...
|
@@ -25,6 +27,44 @@ let _ChannelVary = { |
|
|
|
|
|
require('./common/share');
|
|
|
|
|
|
function iPhoneXHandler(innerHeight) {
|
|
|
if (!yoho.isiPhoneXSeries) {
|
|
|
return false;
|
|
|
}
|
|
|
let currentInnerHeight = window.innerHeight;
|
|
|
let $yohoBody = $('body');
|
|
|
|
|
|
if (yoho.isWechat && window.history.length === 1) {
|
|
|
$yohoBody.addClass('iphonex-series');
|
|
|
} else {
|
|
|
if (innerHeight < currentInnerHeight) {
|
|
|
$yohoBody.addClass('iphonex-series');
|
|
|
} else {
|
|
|
$yohoBody.removeClass('iphonex-series');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 根据机型的全局操作
|
|
|
(function() {
|
|
|
let innerHeight = window.innerHeight;
|
|
|
|
|
|
if (yoho.isWechat) { // 底部tab显示后获取高度
|
|
|
setTimeout(function() {
|
|
|
innerHeight = window.innerHeight;
|
|
|
iPhoneXHandler(innerHeight);
|
|
|
});
|
|
|
} else {
|
|
|
iPhoneXHandler(innerHeight);
|
|
|
}
|
|
|
|
|
|
$(window).scroll(_.throttle(() => {
|
|
|
iPhoneXHandler(innerHeight);
|
|
|
}, 100));
|
|
|
window.onresize = () => {
|
|
|
iPhoneXHandler(innerHeight);
|
|
|
};
|
|
|
}());
|
|
|
function cookie(name) {
|
|
|
|
|
|
// var re = new RegExp(name + '=([^;$]*)', 'i'),
|
...
|
...
|
@@ -570,4 +610,5 @@ window.downLoadApp = downLoadApp; |
|
|
|
|
|
window.mapSort = mapSort;
|
|
|
|
|
|
|
|
|
require('js/common/weixin-report'); |
...
|
...
|
|