Files
SEONexus/code/public/template/shikong/huiyuan/js/public/common.js
2025-04-21 17:49:17 +08:00

53 lines
1.4 KiB
JavaScript

import {
checkIsLoginFn,
hideCctvDomByEquipmentClass,
intiHistoryHref,
init,
isSearchValid,
pageJumpFn
} from './commonFun.js';
import CommonCctv from '../cctv/common.js';
/**
* 所有页面调用的js
*/
const commonJs = function(){
document.addEventListener('DOMContentLoaded', function () {
hideCctvDomByEquipmentClass()
intiHistoryHref()
init()
CommonCctv.init()
// 格式化轮播广告和 顶部导航的间隙
function getHeaderHeight() {
if(document.getElementById('header') && document.querySelector('.j-booth-elements-header')){
var intHeaderHeight = document.getElementById('header').offsetHeight;
document.querySelector('.j-booth-elements-header').style.height = intHeaderHeight + 'px';
}
}
// 当窗口大小改变时调整高度
window.onresize = getHeaderHeight();
// 页面加载时调整高度
window.onload = getHeaderHeight();
})
}()
/**
* 会员 板块初始化
*/
const MenBerPublicJs = function () {
const selectors = [
".bill-web",".bind-web", ".buy-web", ".capital-flow-web", ".charge-web",".member-info-web",
".recfeedback-web", ".setting-web",
".withdrawal-funds-web", ".my-promotion-web",
".withdrawal-records-web"
];
if (selectors.some(selector => document.querySelector(selector))) {
window.addEventListener('load', checkIsLoginFn);
}
}()