// var globalData = {}; function Page(window, $) { var _this = this; _this.data = {}; //涓荤粨鏋勶細鍏辩敤鏂规硶 _this.commonMethods = { // 璋冪敤swiper newSwiper: function (option) { var mySwiper = new Swiper('[swipertype="banner"]', { pagination: { el: '[swiperpagination="banner"]', }, slidesPerView: 'auto', spaceBetween: 0, freeMode: false, autoplay: { disableOnInteraction: false, } }); if (option && option.autoplayStart === true) { mySwiper.autoplay.start(); } }, // 椤堕儴瀵艰埅 headerNav: function () { // $('#headerNavListDom').on('click', 'li', function () { // $(this).addClass('active').siblings().removeClass('active'); // }); // 鏍规嵁url鍔犺浇褰撳墠鐨刟ctive (function urlActive(dom) { var $nav = $(dom).children(); // 鎶婅矾鐢辩粰鏁寸悊鍑烘潵, 鐢ㄦ潵缁欏綋鍓峱ageLink鍔犱笂active function getUrlList() { var urlList = []; if (!_this.data.urlList) { var leftMenuNavListLen = $nav.length; console.log($nav); for (var i = 0; i < leftMenuNavListLen; i++) { var item = $nav.eq(i).children(); var itemLen = item.length; switch (itemLen) { //1锛氬彧鏈変竴绾у鑸 2锛氬甫浜岀骇瀵艰埅 case 1: var itemHref = item.eq(0).attr('href'); urlList.push(itemHref && /html?/.test(itemHref) ? itemHref.match(/\/[\s\S]*.html?$/)[0] : ''); break; case 2: var item_secondNavList = item.eq(1).children(); var item_secondNavListLen = item_secondNavList.length; urlList.push([]); for (var u = 0; u < item_secondNavListLen; u++) { var item_sec_href = item_secondNavList.eq(u).children().eq(0).attr('href'); urlList[i][u] = item_sec_href ? item_sec_href.match(/\/[\s\S]*.html?$/)[0] : ''; } break; } } _this.data.urlList = urlList; } else { urlList = _this.data.urlList; } return urlList; }; var urlList = getUrlList(); var urlListLen = urlList.length; var location_href = location.href; console.log(urlList); console.log(location_href); console.log(urlListLen); //鏍规嵁绛涢€夊嚭鏉ョ殑url杩涜鍖归厤addClass('active'); for (var i = 0; i < urlListLen; i++) { var item = urlList[i]; switch (typeof item) { case 'string': if (new RegExp(item).test(location_href) && item !== '') { $nav.eq(i).children().eq(0).addClass('active'); break; } break; case 'object': //甯?绾у鑸 var itemLen = item.length; for (var t = 0; t < itemLen; t++) { var item_secondHref = item[t]; if (new RegExp(item_secondHref).test(location_href)) { var $nav_secondList = $nav.eq(i).children(); $nav_secondList.eq(1).children().eq(t).addClass('active'); $nav_secondList.eq(0).addClass('active'); break; } } break; } } })('#headerNavListDom'); //瀵艰埅鑳屾櫙娓愬彉 // var $headerNavDom = $('#headerNavDom'); // // $(document).on('scroll', function (e) { // var scrollTop = $(this).scrollTop(); // var opacityVal = scrollTop / 200; // // if (opacityVal < 1.5) { // $headerNavDom.css('background-color', 'rgba(255, 255, 255, ' + (opacityVal < 0.5 ? 0.5 : opacityVal) + ')') // } // }); }, // components_renderCenterVideo: function (videoSrc) { var html = '
\
\ \
\
'; xx.mask({ switch: 'open', duration: 600, bgColor: 'rgba(0, 0, 0, 0.5)', zIndex: 500, onFn: function () { $('body').append(html); var vdieoConstructor = videojs("videoDom", { muted: false, autoplay: true, isFullscreen: true, }, function onVideoReady() { this.play(); }); //鍏抽棴閬僵鏃剁敤鍒扮殑鍑芥暟 globalData.closeMaskFn = function () { $('#centerVideoDom').remove(); vdieoConstructor.dispose(); } }, }); } }; //涓荤粨鏋勶細椤甸潰璺敱 var pageFnRoutes = { //璺敱锛氶椤 index: function () { // 璋冪敤swiper var mySwiper = new Swiper('[swipertype="banner"]', { pagination: { el: '[swiperpagination="banner"]', clickable: true, }, loop: true, slidesPerView: 'auto', spaceBetween: 0, freeMode: false, autoplay: { disableOnInteraction: false, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); //鎻掑叆棣栭〉鐨勮棰 xx.$ajax({ urlKey: 'getVideoList', post: { paginate: 3 }, success: function (ret) { var videoList = ret.res.data; var videoListLen = videoList.length; if (videoListLen > 0) { var html = ''; videoList.forEach(function (item) { html += '
  • \
    \ \ \
    \

    ' + item.title + '

    \
  • '; }); $('#videoListModules').removeClass('d-none'); $('#videoListDom').append(html); } }, }) }, //璺敱锛氬叧浜庢垜浠 aboutUs: function () { // 宸濈敯鐨勪粙缁岤 杞挱---------------------------------寮€濮 var mySwiper = new Swiper('[swipertype="banner"]', { pagination: { el: '[swiperpagination="banner"]', clickable: true, }, autoplay: { disableOnInteraction: false, }, on: { slideChangeTransitionStart: function () { var activeIndex = this.activeIndex; var lastIntroduceActIndex = _this.data.lastIntroduceActIndex || 0; $('#introduceTxtListDom').children().eq(activeIndex).removeClass('d-none'); lastIntroduceActIndex !== undefined ? $('#introduceTxtListDom').children().eq(lastIntroduceActIndex).addClass('d-none') : ''; _this.data.lastIntroduceActIndex = activeIndex }, }, }); $('#introduceTxtListDom').children().eq(0).addClass('d-none'); //澶勭悊浠嬬粛宸濈敯鐨勮疆鎾?寮€濮 var $paginationList = $('[swiperpagination="banner"]').children(); var $paginationListLen = $paginationList.length; for (var i = 0; i < $paginationListLen; i++) { var item = $paginationList.eq(i); item.html(i + 1); } // 宸濈敯鐨勪粙缁岤 杞挱---------------------------------缁撴潫 //璇佷功杞挱寮€濮 --------------------------------------寮€濮 new Swiper('[swipertype="multiple"]', { slidesPerView: 'auto', spaceBetween: 10, freeMode: true, disableOnInteraction: false, slidesPerView: 4, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); //璇佷功杞挱寮€濮 --------------------------------------寮€濮 // 鏌ョ湅鏇村---------------------------------------------寮€濮 function hideMore() { var devlopList_child = $('#devlopListDom').children(); var devlopList_childLen = devlopList_child.length; for (var i = 0; i < devlopList_childLen; i++) { var item = devlopList_child.eq(i); if (i > 2) { item.addClass('d-none'); } } _this.data.isHideMoreDevelopList = true; } hideMore(); //鍙樉绀哄墠5涓彂灞曞巻绋 //鍒囨崲鏌ョ湅鏇村 $('#lookMoreDom').on('click', function () { var $this = $(this); var isEnglish = $this.attr('data-english'); if (_this.data.isHideMoreDevelopList === true) { $('#devlopListDom').children().removeClass('d-none'); $this.html(!isEnglish ? '鏀惰捣鏇村' : 'HIDE').addClass('active'); _this.data.isHideMoreDevelopList = false; } else { hideMore(); $this.html(!isEnglish ? '鐐瑰嚮鏌ョ湅鏇村' : 'READ MORE').removeClass('active'); } }); // 鏌ョ湅鏇村---------------------------------------------缁撴潫 }, //璺敱锛氫骇鍝佽鎯 productDetails: function () { //榧犳爣缁忚繃灏忓浘寮€濮?---------------------------------------------------寮€濮 var smallImgList = []; var $smallProductList = $('#smallProductListDom'); var $smallProductList_child = $smallProductList.children(); var $smallProductList_childLen = $smallProductList_child.length; for (var i = 0; i < $smallProductList_childLen; i++) { var item = $smallProductList_child.eq(i); smallImgList.push(item.find('img').attr('src')); } var $bigProductImgDom = $('#bigProductImgDom'); $smallProductList.on('mouseenter', 'li', function () { var $this = $(this); var swtichImgTimer = _this.data.swtichImgTimer; swtichImgTimer && clearTimeout(swtichImgTimer); _this.data.swtichImgTimer = setTimeout(function () { switchImg($this); }, 50); $('#myvideo').hide(); $('#myvideo').parent('div').addClass('pb-100'); $('#bigProductImgDom').show(); !!document.getElementById('myvideo') ? document.getElementById('myvideo').pause() :false; $('.icon-play').css('z-index',100); }); function switchImg($this) { var index = $this.index(); $bigProductImgDom.attr('src', smallImgList[index]); //鍒囨崲鍥剧墖 $this.addClass('active'); //灏忓浘鍔燼ctive var lastActIdx_smallImg = _this.data.lastActIdx_smallImg; lastActIdx_smallImg !== undefined && $smallProductList.children().eq(lastActIdx_smallImg).removeClass('active'); //绉婚櫎涓婁竴涓皬鍥剧殑active _this.data.lastActIdx_smallImg = index; } //榧犳爣缁忚繃灏忓浘寮€濮?---------------------------------------------------缁撴潫 }, //璺敱锛氱粡鍏稿鎴 userCase: function () { // var html2 = ''; // for (var t = 0; t < 11; t++) { // html2 += // '
  • \ //
    \ //
    \ // \ //
    \ //

    瑙︽懜寮忔敹娆炬満

    \ //
    \ //
  • '; // } // $('#userCaseListDom').html(html2); var _userCaseList = userCaseList; //鍒濆鍖栧崰浣嶆搷浣滐紝姣?涓渚嬩负涓€缁勶紝鎻掑叆鐩稿簲鐨勫崰浣嶇锛岀敤浜庡睍绀烘渚嬭鎯?----------寮€濮 var $userCaseList_child = $('#userCaseListDom').children(); var $userCaseList_childLen = $userCaseList_child.length; var html = '
  • '; _userCaseList.push('鍗犱綅鍏冪礌'); nextSpliceIndex += 1; } $userCaseList_child.eq($userCaseList_childLen - 1).after(html); } console.log(remainder); console.log(_userCaseList); //鍒濆鍖栧崰浣嶆搷浣滐紝姣?涓渚嬩负涓€缁勶紝鎻掑叆鐩稿簲鐨勫崰浣嶇锛岀敤浜庡睍绀烘渚嬭鎯?----------缁撴潫 //鏌ョ湅妗堜緥璇︽儏------------------------------------------------------------寮€濮 $('#userCaseListDom').on('click', '[CASE]', function () { var $this = $(this); var index = $this.index(); if (_this.data.lastActIdx_case === index) { return false; } var rowIndex = Math.ceil((index + 1) / 5); //褰撳墠鐐瑰嚮鐨勮繖涓紝灞炰簬'绗嚑琛?, 鐢ㄤ簬鎻掑叆妗堜緥璇︽儏 var insertIndex = 4 * rowIndex + rowIndex - 1; console.log('index: ' + index); console.log('rowIndex: ' + rowIndex); console.log('insertIndex: ' + (insertIndex)); var caseDetailObj = _userCaseList[index]; //妗堜緥璇︽儏 //鎻掑叆妗堜緥灏忓浘-----寮€濮 var smallImgList = caseDetailObj.imagesGroup || []; var smallImgListLen = smallImgList.length; var html = ''; html += '
  • \
    \
    \
    '; html += '
    '; if (smallImgListLen > 0 && smallImgList[0]) { html += '
    '; for (var i = 0; i < smallImgListLen; i++) { var item = smallImgList[i]; if (item) { html += '
    '; } } } ; html += '
    '; // html += // '
  • \ //
    '; // if (smallImgListLen > 0 && smallImgList[0]) { // html += // ''; // }; //鎻掑叆妗堜緥灏忓浘-----缁撴潫 html += '
    \
    \

    '+ caseDetailObj.txt + '

    \

    '+ caseDetailObj.info + '

    \
    \
    \ \
  • '; var lastActIdx_caseDetails = _this.data.lastActIdx_caseDetails; //涓婃琚睍寮€鐨勬渚嬭鎯呯殑绱㈠紩锛堝湪绗嚑琛岋級 var lastActIdx_case = _this.data.lastActIdx_case; //涓婃琚睍寮€鐨勬渚嬭鎯 //涓嶆槸鍦ㄥ悓涓€琛岋紝闅愯棌caseDetails lastActIdx_caseDetails !== undefined && lastActIdx_caseDetails !== insertIndex && $('#userCaseListDom').children().eq(lastActIdx_caseDetails).replaceWith('
  • ' + (!isEnglish ? item.name : item.name_en) + '
  • ' } $('#categoryNavListDom').html(html); _this.data.categoryNavList = oData; getDriverObj.categoryNavID = oData[lastActiveIndex_categoryNav].id; }, }); }; //鑾峰彇璧勬簮鍒嗙被璇︽儏 var getCategoryDetailsListByEquType = function (equipmentType) { xx.$ajax({ urlKey: 'getCategory', post: { type: equipmentType, // 澶х被 1锛歐indows 2锛氬畨鍗 }, success: function (ret) { var oData = ret.res; var oDataLen = oData.length; var html = ''; for (var i = 0; i < oDataLen; i++) { var item = oData[i]; html += '
  • ' + (!isEnglish ? item.name : item.name_en) + '
  • ' } $('#categoryDetailsListDom').html(html); }, }); } //鑾峰彇鍨嬪彿鍒楄〃 var getModelList = function (options) { xx.$ajax({ urlKey: 'getModelList', post: { type: options.equipmentType, // 澶х被 1锛歐indows 2锛氬畨鍗 category_id: options.categoryDetailsID//category_id 鍒嗙被ID }, success: function (ret) { var oData = ret.res; var oDataLen = oData.length; var html = ''; if (oDataLen > 0) { for (var i = 0; i < oDataLen; i++) { var item = oData[i]; html += '
  • ' + item.name + '
  • ' } } else { html = '
  • ' + (!isEnglish ? '鏆傛棤鍨嬪彿' : 'No Data') + '

  • '; } $('#modeListDom').html(html); }, }); } //鑾峰彇椹卞姩鍒楄〃 var getDriverList = function (getWayType, option) { try { var post; switch (getWayType) { //0锛氱偣鍑诲瀷鍙疯幏鍙 1锛氱偣鍑绘妧鏈垎绫伙紙妯潃鐨勫垎绫伙級鑾峰彇 2锛氭悳绱㈡爮鑾峰彇 case 2: post = { type: option.equipmentType, //澶х被 1锛歐indows 2锛氬畨鍗 keyword: option.keyword, //鎼滅储鏍忓叧閿瘝 } break; default: post = { type: option.equipmentType, //澶х被 1锛歐indows 2锛氬畨鍗 resources_category_id: option.categoryNavID, //鎶€鏈敮鎸佸垎绫籌D category_id: option.categoryDetailsID, //鍒嗙被ID type_id: option.modeID, //鍨嬪彿ID } console.info('post', post); for (var key in post) { var item = post[key]; if (item === undefined) { switch (key) { case 'category_id': throw '涓诲姩缁堟锛氬垎绫绘湁璇?; default: throw '涓诲姩缁堟锛氬弬鏁颁笉榻愬叏'; } } } break; } // keyword: '', //鎼滅储鏍忓叧閿瘝 console.log(post); // for (var key in post) { // var item = post[key]; // if (item === undefined) { // switch (key) { // case 'category_id': // alert('璇烽€夋嫨鍒嗙被'); // break; // default: // alert('鍙傛暟鏈夎'); // break; // } // return false; // } // } xx.$ajax({ urlKey: 'getDriverList', post: post, success: function (ret) { var oData = ret.res; var oDataLen = oData.length; var html = ''; if (oDataLen > 0) { for (var i = 0; i < oDataLen; i++) { var item = oData[i]; html += '
  • \ '+ (!isEnglish ? item.resources_name : item.resources_name_en) + '\ \ '+ item.filesize + '\
    \ \
    \ '+ (!isEnglish ? '涓嬭浇' : 'download') + '\
    \
  • '; } $('#driverListDom').html(html); } else { $('#driverListDom').html('
  • ' + (!isEnglish ? '鏆傛棤鏁版嵁' : 'No Data') + '

  • '); } }, }); } catch (error) { console.warn('error', error); } }; //鑾峰彇甯歌闂 var getCommonProblem = function (getDriverObj) { xx.$ajax({ urlKey: 'getCommonProblem', post: { type: getDriverObj.equipmentType, // 澶х被 1锛歐indows 2锛氬畨鍗 }, success: function (ret) { var oData = ret.res; var oDataLen = oData.length; var html = ''; if (oDataLen > 0) { for (var i = 0; i < oDataLen; i++) { var item = oData[i]; html += '
  • \

    '+ (!isEnglish ? item.resources_name : item.resources_name_en) + '

    \ \
  • '; } } else { html = !isEnglish ? '鏆傛棤鏁版嵁~' : 'No Data'; } $('#commonProblemListDom').html(html).removeClass('d-none'); }, }); } }, //璺敱锛氫骇鍝佸垎绫 productList: function () { //鏍规嵁鍒嗙被id娓叉煋浜у搧鍒楄〃 var renderProductListByCategoryID = function (options) { var _isEnglish = data.isEnglish; var submitOptions = { page: options.page || 1,// page 1 椤电爜 category_id: options.id, //鍒嗙被 涓嶄紶鏌ュ叏閮 浼犲垯杩斿洖鎸囧畾鍒嗙被涓嬬殑浜у搧鍒楄〃 type: options.type, // 澶х被 1锛歐indows 2锛氬畨鍗 status: _isEnglish ? 2 : 1, //1:涓枃 2锛氳嫳鏂 }; for(var key in submitOptions){ if(!submitOptions[key]){ delete submitOptions[key]; } } xx.$ajax({ urlKey: 'getProductList', post: submitOptions, success: function (ret) { var _data = data; _data.lastGetProductListID = options.id; _data.lastGetProductListType = options.type; try { if (ret.code !== 1) throw ret.msg; var oData = ret.res.data; var html = ''; var _isEnglish = data.isEnglish; if (oData.length > 0) { oData.forEach(function (item) { html += '
  • \ \
    \ \
    \

    '+ (_isEnglish === true ? item.goods_name_en : item.goods_name) + '

    \

    '+ (_isEnglish === true ? item.specification_en : item.specification) + '

    \
    \
  • '; }); } else { html = '
  • ' + (_isEnglish === true ? 'No product' : '鏆傛棤浜у搧') + '
  • '; } $('#productListDom').html(html); options.success && options.success(ret.res); } catch (error) { alert(error); } }, }); }; var data = { isEnglish: !!$('body').attr('data-isEnlish'), }; //鑾峰彇浜у搧鍒嗙被 var getAndRenderProductCategoryList = function (options) { // $('#productCategoryListDom li').eq(options.type-1 ).addClass('active').siblings().removeClass('active'); xx.$ajax({ urlKey: 'getProductCategoryListByType', post: { type: options.type, // 澶х被 1锛歐indows 2锛氬畨鍗 }, success: function (ret) { try { if (ret.code !== 1) throw ret.msg; var oData = ret.res; var html = ''; var _isEnglish = data.isEnglish; oData.unshift({ big_id: oData[0].big_id, id: null, name: "鍏ㄩ儴", name_en: 'All' }); if (oData.length > 0) { oData.forEach(function (item, index) { html += '
  • \ \ '+ (_isEnglish === true ? item.name_en : item.name) + '\ \
  • '; }); } else { html = '
  • \ '+ (_isEnglish === true ? 'No product classification' : '鏆傛棤浜у搧鍒嗙被') + '\
  • '; } $('#navCategoryListDom').html(html); //榛樿鑾峰彇绗竴涓垎绫昏鎯 renderProductListByCategoryID({ id: oData[0].id, type: oData[0].big_id, success: function (ret) { //鐢熸垚鍒嗛〉鍣 console.info('ret', ret); renderPageSizeModules({ startPage: ret.current_page, endPage: ret.last_page || 1, }); } }); options.success && options.success(ret); } catch (error) { alert(error); } }, }); } //鍒囨崲澶у垎绫 $('#productCategoryListDom').on('click', 'li', function () { var $this = $(this); var $index = $this.index(); $this.addClass('active').siblings().removeClass('active'); if ($index <= 1) { //0: windows 2:android 3:閰嶄欢 getAndRenderProductCategoryList({ type: $index + 1, }); } else { renderProductListByCategoryID({ id: '', type: 3, }); $('#navCategoryListDom').html(''); } }); //鍒囨崲浜у搧鍒嗙被瀵艰埅 $('#navCategoryListDom').on('click', 'li', function () { var $this = $(this); var categoryID = $this.attr('data-id'); var bigType = $this.attr('data-bigType'); $this.addClass('active').siblings().removeClass('active'); //鑾峰彇鍒嗙被璇︽儏 renderProductListByCategoryID({ id: categoryID, type: bigType }); }); //big_id浠庨〉闈紶杩囨潵銆傛牴鎹〉闈㈠弬鏁拌幏鍙栨寚瀹氬垎绫绘暟鎹 if( big_id == '0' ){ $('#productCategoryListDom li').eq(2 ).addClass('active').siblings().removeClass('active'); renderProductListByCategoryID({ id: '', type: 3, }); $('#navCategoryListDom').html(''); }else{ getAndRenderProductCategoryList({ type: big_id }); } //鐢熸垚鍒嗛〉鍣 var currentPage; var totallPage; var renderPageSizeModules = function (options) { var startPage = currentPage = options.startPage; var endPage = totallPage = options.endPage; var html_paginate = ''; for (var i = startPage; i <= endPage; i++) { html_paginate += '
  • ' + i + '
  • ' } var html_all = '
  • \ '+ html_paginate + '\
  • '; $('#pageSizeModulesDom').html(html_all); }; //鐐瑰嚮鍒嗛〉鍣 $('#pageSizeModulesDom').on('click', 'li', function () { try { var $this = $(this); var page = $this.attr('data-page'); var toGetPage; var _currentPage = currentPage; var _totallPage = totallPage; switch (page) { //last:涓婁竴椤 next:涓嬩竴椤 default: 鐩存帴鍒囨崲鍒扮洰鏍囬〉闈 case 'last': if (_currentPage !== undefined && _currentPage > 1) { toGetPage = _currentPage - 1; } else { throw '褰撳墠宸叉槸绗竴椤?; } break; case 'next': if (_currentPage !== undefined && _currentPage < _totallPage) { toGetPage = _currentPage + 1; } else { throw '褰撳墠宸叉槸鏈€鍚庝竴椤?; } break; default: toGetPage = Number(page); break; } if (toGetPage === undefined) { console.info('娌℃湁椤电爜'); return false; } var _data = data; renderProductListByCategoryID({ page: toGetPage, id: _data.lastGetProductListID, type: _data.lastGetProductListType, success: function () { if (page === 'next' || page === 'last') { var pageSizeList = $('#pageSizeModulesDom').children(); pageSizeList.eq(toGetPage).addClass('active'); pageSizeList.eq(_currentPage).removeClass('active'); } else { $this.addClass('active').siblings().removeClass('active'); } currentPage = toGetPage; //淇濈暀褰撳墠鐨勯〉鏁 console.info('currentPage', currentPage); } }); } catch (error) { console.info('errr', error); } console.info('page', page); }); }, //璺敱锛氳棰戝垪琛 videoList: function () { var currentPage = 1; var lastPage = null; var isPosting = null; var getAnSetVideoList = function (options) { // 鑾峰彇骞惰缃棰戝垪琛 xx.$ajax({ urlKey: 'getVideoList', data: { page: options.currentPage, }, success: function (ret) { var result = ret.res; var videoList = result.data; var videoListLen = videoList.length; if (videoListLen > 0) { var html = ''; videoList.forEach(function (item) { html += '
  • \
    \ \ \
    \
    \
    ' + item.title + '
    \

    '+ item.add_time + '

    \
    \
  • '; }); $('#videoListModules').removeClass('d-none'); $('#videoListDom').append(html); } currentPage = result.current_page; lastPage = result.last_page; options.complete && options.complete(); }, fail: function () { options.complete && options.complete(); } }); } // 鑾峰彇绗竴椤垫暟鎹 getAnSetVideoList({ currentPage: 1, }); //鐩戝惉椤甸潰婊氬姩鍒板簳閮 window.addEventListener("scroll", function () { const _doc = document; const _docEle = _doc.documentElement; const _docBody = _doc.body; const windowHeight = _docEle.clientHeight || _docBody.clientHeight; let scrollTop = _docEle.scrollTop || _docBody.scrollTop; let scrollHeight = _docEle.scrollHeight || _docBody.scrollHeight; console.info("scrollTop", scrollTop); console.info("windowHeight", windowHeight); console.info("scrollHeight", scrollHeight); //婊氬姩鏉″埌搴曢儴鐨勬潯浠 if (scrollTop + windowHeight >= scrollHeight - 10) { //鍐欏悗鍙板姞杞芥暟鎹殑鍑芥暟 console.log( "璺濋《閮? + scrollTop + "鍙鍖洪珮搴? + windowHeight + "婊氬姩鏉℃€婚珮搴? + scrollHeight ); if (lastPage && lastPage > currentPage) { if (isPosting === true) { console.info('璇锋眰涓?, '') return false; }; isPosting = true; getAnSetVideoList({ currentPage: currentPage + 1, complete: function () { isPosting = false; } }); } } }, true); }, } _this.commonMethods.headerNav(); $(function () { //涓荤粨鏋勶細鍒濆鍖栨搷浣?鎵ц椤甸潰鏂规硶 if (document.querySelector('[pageFn]') !== null) { var pageFn = $('body').attr('pageFn') + '.page'; // 鏍规嵁url鍔犺浇鐩稿簲鐨刾ageFn for (var item in pageFnRoutes) { if (new RegExp(item + '.page').test(pageFn)) { !(pageFnRoutes[item])(); return false; } } } }); }; (function (window, $) { //閬僵--娣″叆娣″嚭 var $mask; var lastNewMask; var isFirMaskIn = true; window.xx = { // 閬僵 mask: function (objMask) { if ((new Date().getTime() - lastNewMask) < (objMask.duration || 500) && !isFirMaskIn) { console.log('棰戠箒鐐瑰嚮'); return false; } lastNewMask = new Date().getTime(); isFirMaskIn = false; if (objMask.switch == 'open') { var html = ''; $('body').append(html); $mask = $('#maskBox'); $mask.css('display', 'block'); timer = setTimeout(function () { $('body').css({ 'overflow': 'hidden', }); $mask.css('opacity', '1'); if (objMask.onFn) { (objMask.onFn)(objMask.onFnSwitch); }; }, 100); } else { $('body').css({ 'overflow': 'auto', }); $mask.css('opacity', '0'); if (objMask.offFn) { (objMask.offFn)(objMask.offFnSwitch); }; timer = setTimeout(function () { $mask.remove(); }, (objMask.duration || 500)); } }, // 涓棿鎻愮ず妗 showTips: function (objTips) { var html = '
    \
    '+ objTips.title + '
    \
    '; var domBody = document.querySelector('body'); $(domBody).append(html); var domTipsText = document.querySelector('#tipsText'); var domTips = document.querySelector('#tips'); showTips = function (objTips) { domTipsText.innerHTML = objTips.title; if (domTips.style.display == 'block') { //鍔ㄧ敾杩樺湪鎵ц涓 return; } else { domTips.style.display = 'block'; setTimeout(function () { domTipsText.classList.add('tips-tips-active'); //鍔犺浇杩涙潵鐨勫姩鐢 }, 100); setTimeout(function () { domTipsText.classList.remove('tips-tips-active'); //閫€鍑哄姩鐢 }, objTips.duration); setTimeout(function () { domTips.style.display = 'none'; //闅愯棌妯″潡 }, Number(objTips.duration) + 0.6 * 1000); } } showTips(objTips); window.xx.showTips = showTips; }, $ajax: function (option) { var _this = this; console.info('璇锋眰鐨刾ost', option.post); $.ajax({ // url: 'http://citaq.com/index.php' + _this.urlObj[option.urlKey], url: '/index.php' + _this.urlObj[option.urlKey], data: option.post || '', type: "post", dataType: "json", success: function (ret) { var code = ret && ret.code; if (code === 1) { option.success && option.success(ret); } else { option.fail && option.fail(); } console.log('--------------------------璇锋眰缁撴灉-----寮€濮?-----------------'); console.log(ret); console.log('--------------------------璇锋眰缁撴灉-----缁撴潫------------------'); }, fail: function (err) { option.fail && option.fail(); console.log(err); } }); }, urlObj: { getResourcesCategory: '/technical_support/getResourcesCategory', //鑾峰彇鎶€鏈敮鎸佸垎绫 getCategory: '/technical_support/getCategory', //鑾峰彇鍒嗙被 getModelList: '/technical_support/getModel', //鑾峰彇鍨嬪彿鍒楄〃 getDriverList: '/technical_support/getDriver', //鑾峰彇椹卞姩鍒楄〃 getCommonProblem: '/technical_support/getQuestion', //鑾峰彇甯歌闂 getProductCategoryListByType: '/product/getCategory', //鑾峰彇浜у搧鍒嗙被 getProductList: '/product/getProductList', //鑾峰彇浜у搧鍒楄〃 downloadFileByID: '/technical_support/download', //涓嬭浇鏂囦欢 getVideoList: '/about/product_video', //鑾峰彇瑙嗛鍒楄〃 } } })(window, $); //鍏抽棴閬僵 var closedMask = function () { xx.mask({ switch: 'closed', duration: 600, offFn: globalData.closeMaskFn, bgColor: 'rgba(0, 0, 0, 0.3)', zIndex: 500, }); } // Page.apply(Page, [window, $]);