初始化提交
This commit is contained in:
117
js/ainong/app.js
Normal file
117
js/ainong/app.js
Normal file
@@ -0,0 +1,117 @@
|
||||
/* Template Name: Crezo - Multipurpose Template
|
||||
Author: Themesdesign
|
||||
Version: 1.0.0
|
||||
Updated: April 2021
|
||||
File Description:Main JS file of the template
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
'use strict';
|
||||
// Navbat Toggle
|
||||
var scroll = $(window).scrollTop();
|
||||
|
||||
$('.navbar-toggle').on('click', function (event) {
|
||||
$(this).toggleClass('open');
|
||||
$('#navigation').slideToggle(400);
|
||||
});
|
||||
|
||||
$('.navigation-menu>li').slice(-2).addClass('last-elements');
|
||||
|
||||
$('.menu-arrow,.submenu-arrow').on('click', function (e) {
|
||||
if ($(window).width() < 992) {
|
||||
e.preventDefault();
|
||||
$(this).parent('li').toggleClass('open').find('.submenu:first').toggleClass('open');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".navigation-menu a").each(function () {
|
||||
if (this.href == window.location.href) {
|
||||
$(this).parent().addClass("active"); // add active to li of the current link
|
||||
$(this).parent().parent().parent().addClass("active"); // add active class to an anchor
|
||||
$(this).parent().parent().parent().parent().parent().addClass("active"); // add active class to an anchor
|
||||
}
|
||||
});
|
||||
// Smooth scroll
|
||||
$('.navbar-nav a, .mouse-down a').on('click', function(event) {
|
||||
var $anchor = $(this);
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: $($anchor.attr('href')).offset().top - 0
|
||||
}, 1500, 'easeInOutExpo');
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Clickable Menu
|
||||
$(".has-submenu a").click(function() {
|
||||
if(window.innerWidth < 992){
|
||||
if($(this).parent().hasClass('open')){
|
||||
$(this).siblings('.submenu').removeClass('open');
|
||||
$(this).parent().removeClass('open');
|
||||
} else {
|
||||
$(this).siblings('.submenu').addClass('open');
|
||||
$(this).parent().addClass('open');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//SCROLLSPY
|
||||
$(".navbar-nav").scrollspy({
|
||||
offset: 20
|
||||
});
|
||||
|
||||
//sticky header on scroll
|
||||
$(window).scroll(function() {
|
||||
var scroll = $(window).scrollTop();
|
||||
|
||||
if (scroll >= 50) {
|
||||
$(".navbar-sticky").addClass("small");
|
||||
} else {
|
||||
$(".navbar-sticky").removeClass("small");
|
||||
}
|
||||
});
|
||||
|
||||
$(window).scroll(function() {
|
||||
var scroll = $(window).scrollTop();
|
||||
|
||||
if (scroll >= 50) {
|
||||
$(".sticky").addClass("nav-sticky");
|
||||
} else {
|
||||
$(".sticky").removeClass("nav-sticky");
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
|
||||
// Loader
|
||||
$(window).on('load', function() {
|
||||
$('#status').fadeOut();
|
||||
$('#preloader').delay(350).fadeOut('slow');
|
||||
$('body').delay(350).css({
|
||||
'overflow': 'visible'
|
||||
});
|
||||
});
|
||||
|
||||
// BACK TO TOP
|
||||
$(window).scroll(function(){
|
||||
if ($(this).scrollTop() > 100) {
|
||||
$('.back-to-top').fadeIn();
|
||||
} else {
|
||||
$('.back-to-top').fadeOut();
|
||||
}
|
||||
});
|
||||
$('.back-to-top').click(function(){
|
||||
$("html, body").animate({ scrollTop: 0 }, 1000);
|
||||
return false;
|
||||
});
|
||||
|
||||
//Tooltip
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
});
|
||||
//Popover
|
||||
$(function () {
|
||||
$('[data-toggle="popover"]').popover()
|
||||
});
|
||||
})(jQuery)
|
||||
7
js/ainong/bootstrap.bundle.min.js
vendored
Normal file
7
js/ainong/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/ainong/jquery-3.5.1.min.js
vendored
Normal file
2
js/ainong/jquery-3.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
51
js/ajax-mail.js
Normal file
51
js/ajax-mail.js
Normal file
@@ -0,0 +1,51 @@
|
||||
$(function() {
|
||||
|
||||
// Get the form.
|
||||
var form = $('#contact-form');
|
||||
|
||||
// Get the messages div.
|
||||
var formMessages = $('.ajax-response');
|
||||
|
||||
// Set up an event listener for the contact form.
|
||||
$(form).submit(function(e) {
|
||||
// Stop the browser from submitting the form.
|
||||
e.preventDefault();
|
||||
|
||||
// Serialize the form data.
|
||||
var formData = $(form).serialize();
|
||||
|
||||
// Submit the form using AJAX.
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: $(form).attr('action'),
|
||||
data: formData
|
||||
})
|
||||
.done(function(response) {
|
||||
// Make sure that the formMessages div has the 'success' class.
|
||||
$(formMessages).removeClass('error');
|
||||
$(formMessages).addClass('success');
|
||||
|
||||
// Set the message text.
|
||||
$(formMessages).text(response);
|
||||
|
||||
// Clear the form.
|
||||
$('#contact-form input,#contact-form textarea').val('');
|
||||
})
|
||||
.fail(function(data) {
|
||||
// Make sure that the formMessages div has the 'error' class.
|
||||
$(formMessages).removeClass('success');
|
||||
$(formMessages).addClass('error');
|
||||
|
||||
// Set the message text.
|
||||
if (data.responseText !== '') {
|
||||
$(formMessages).text(data.responseText);
|
||||
} else {
|
||||
$(formMessages).text('Oops! An error occured and your message could not be sent.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
7
js/bootstrap.min.js
vendored
Normal file
7
js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
50
js/case-details.js
Normal file
50
js/case-details.js
Normal file
@@ -0,0 +1,50 @@
|
||||
function GetRequest(id) {
|
||||
var url = decodeURI(location.search);
|
||||
var object = {};
|
||||
if (url.indexOf("?") != -1)
|
||||
{
|
||||
var str = url.substr(1);
|
||||
var strs = str.split("&");
|
||||
for (var i = 0; i < strs.length; i++) {
|
||||
object[strs[i].split("=")[0]] = strs[i].split("=")[1]
|
||||
}
|
||||
}
|
||||
return object[id];
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: serveUrl + '?c=index&a=case_list',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'id': GetRequest("id")
|
||||
},
|
||||
success: function (res) {
|
||||
var caseTetails = ''
|
||||
caseContent = res.data.list
|
||||
caseTetails += `
|
||||
|
||||
<div class="blog-wrapper mb-40" >
|
||||
<div class="blog-content">
|
||||
<h2 class="blog-title">
|
||||
${caseContent[0].title}
|
||||
</h2>
|
||||
<div class="meta-info">
|
||||
<ul>
|
||||
<li class="posts-time">${timestampToTime(Number(caseContent[0].create_time))}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>${caseContent[0].title}</p>
|
||||
<div class="blog-thumb">
|
||||
<img class="case" src="${caseContent[0].img}" alt="" />
|
||||
<img class="case" src="${caseContent[0].img}" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
`
|
||||
$('#caseBox').append(caseTetails)
|
||||
},
|
||||
error: function (err) {
|
||||
}
|
||||
})
|
||||
107
js/case.js
Normal file
107
js/case.js
Normal file
@@ -0,0 +1,107 @@
|
||||
// Avoid `console` errors in browsers that lack a console.
|
||||
// 记录高亮 成功案例
|
||||
let index = 1
|
||||
function changePage(i) {
|
||||
// 移除兄弟元素样式
|
||||
$(`#role${i}`).siblings().removeClass("active")
|
||||
// 设置选中 数字选中
|
||||
if (typeof i === "number") {
|
||||
$(`#role${i}`).addClass("active")
|
||||
index = i
|
||||
} else {//上下分页 判断最长和最短
|
||||
if (index <= 0 && index > 3) return
|
||||
i ? changePage(--index) : changePage(++index)
|
||||
}
|
||||
}
|
||||
function changeclick() {
|
||||
console.log(123);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: serveUrl + '?c=index&a=case_list',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
www: 5,
|
||||
page: 1,
|
||||
pagesize: 10,
|
||||
},
|
||||
success: function (res) {
|
||||
//getting data
|
||||
var caseTada = res.data.list
|
||||
var cont = res.data.count
|
||||
console.log(cont);
|
||||
//right case
|
||||
var caseRight = ''
|
||||
for (var i = 0; i <= 2; i++) {
|
||||
caseRight += `
|
||||
<div class="sidebar-rc-post">
|
||||
<ul>
|
||||
<li style="border-bottom:1px solid #c0c0c0;margin-bottom:15px;padding-bottom:15px">
|
||||
<div class="rc-post-thumb">
|
||||
<a href="case-details.html?id=${caseTada[i].id}">
|
||||
<img id="modal" style=" display:block;width:85px;height:65px;" src="${caseTada[i].img}" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="rc-post-content">
|
||||
<h4 style="width:320px !important">
|
||||
<a href="case-details.html?id=${caseTada[i].id}">${caseTada[i].title}</a>
|
||||
</h4>
|
||||
<div class="widget-date">${timestampToTime(Number(caseTada[i].create_time))}</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
$('#caseTree').append(caseRight)
|
||||
// left case
|
||||
var caseDetails = ''
|
||||
for (var i = 0; i < caseTada.length; i++) {
|
||||
caseDetails += `
|
||||
<div class="blog-wrapper mb-40">
|
||||
<div class="blog-thumb">
|
||||
<img class="bottom-case" src="${caseTada[i].img}" alt="" />
|
||||
</div>
|
||||
<div class="meta-info">
|
||||
<ul>
|
||||
<li class="posts-time">${timestampToTime(Number(caseTada[i].create_time))}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blog-content">
|
||||
|
||||
<h class="title1">${caseTada[i].title} </h>
|
||||
<p class="title2">${caseTada[i].title} </p>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="link-box">
|
||||
<a href="case-details.html?id=${caseTada[i].id}">查看详情</a>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
$('#fatherel').append(caseDetails)
|
||||
//paging device
|
||||
pageHtml = `<li id="upPage" onclick="changePage(true)">
|
||||
<a href="#">上一页</a>
|
||||
</li>`
|
||||
|
||||
for (let i = 1; i <= Math.ceil(res.data.count / 10); i++) {
|
||||
pageHtml += `<li class="${i ? '' : 'active'}" id="role${i}" onclick="changeclick">
|
||||
<a href="case.html">
|
||||
<span>${i}</span>
|
||||
</a>
|
||||
</li>
|
||||
`
|
||||
}
|
||||
pageHtml += `<li onclick="changePage(false)">
|
||||
<a href="#" id="nextPage">下一页</a>
|
||||
</li>`
|
||||
$('#pageUl').append(pageHtml)
|
||||
},
|
||||
error: function (err) {
|
||||
}
|
||||
})
|
||||
|
||||
8
js/common.js
Normal file
8
js/common.js
Normal file
@@ -0,0 +1,8 @@
|
||||
var urls = {
|
||||
"dev": 'http://192.168.0.160:80',
|
||||
"test": 'http://192.168.0.160:7100',
|
||||
"prod": 'https://www.aiotagro.com',
|
||||
|
||||
}
|
||||
var env = 'prod'
|
||||
var serveUrl = urls[env]
|
||||
21
js/contact.js
Normal file
21
js/contact.js
Normal file
@@ -0,0 +1,21 @@
|
||||
//send message
|
||||
$('#sendMsg').on('click',function() {
|
||||
$.ajax({
|
||||
url: serveUrl + '?c=index&a=contact',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data:$('#contact-form').serialize(),
|
||||
success: function(res) {
|
||||
if(document.getElementById("tel").value !== "" && document.getElementById('call').value !=="" ) {
|
||||
$('#call').val('')
|
||||
$('#emails').val('')
|
||||
$('#tel').val('')
|
||||
$('#messages').val('')
|
||||
alert(res.message)
|
||||
} else{
|
||||
alert('请您输入正确手机号')
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
12
js/isotope.pkgd.min.js
vendored
Normal file
12
js/isotope.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/jquery-3.5.1.min.js
vendored
Normal file
2
js/jquery-3.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
js/jquery.counterup.min.js
vendored
Normal file
8
js/jquery.counterup.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jquery.counterup.js 1.0
|
||||
*
|
||||
* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
|
||||
* Released under the GPL v2 License
|
||||
*
|
||||
* Date: Nov 26, 2013
|
||||
*/(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(jQuery);
|
||||
4
js/jquery.magnific-popup.min.js
vendored
Normal file
4
js/jquery.magnific-popup.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
js/jquery.meanmenu.min.js
vendored
Normal file
1
js/jquery.meanmenu.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function($){"use strict";$.fn.meanmenu=function(e){var n={meanMenuTarget:jQuery(this),meanMenuContainer:"body",meanMenuClose:"X",meanMenuCloseSize:"18px",meanMenuOpen:"<span /><span /><span />",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"",meanScreenWidth:"480",meanNavPush:"",meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,meanDisplay:"block",removeElements:""};e=$.extend(n,e);var a=window.innerWidth||document.documentElement.clientWidth;return this.each(function(){var n=e.meanMenuTarget,t=e.meanMenuContainer,r=e.meanMenuClose,i=e.meanMenuCloseSize,s=e.meanMenuOpen,u=e.meanRevealPosition,m=e.meanRevealPositionDistance,l=e.meanRevealColour,o=e.meanScreenWidth,c=e.meanNavPush,v=".meanmenu-reveal",h=e.meanShowChildren,d=e.meanExpandableChildren,y=e.meanExpand,j=e.meanContract,Q=e.meanRemoveAttrs,f=e.onePage,g=e.meanDisplay,p=e.removeElements,C=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/Blackberry/i)||navigator.userAgent.match(/Windows Phone/i))&&(C=!0),(navigator.userAgent.match(/MSIE 8/i)||navigator.userAgent.match(/MSIE 7/i))&&jQuery("html").css("overflow-y","scroll");var w="",x=function(){if("center"===u){var e=window.innerWidth||document.documentElement.clientWidth,n=e/2-22+"px";w="left:"+n+";right:auto;",C?jQuery(".meanmenu-reveal").animate({left:n}):jQuery(".meanmenu-reveal").css("left",n)}},A=!1,E=!1;"right"===u&&(w="right:"+m+";left:auto;"),"left"===u&&(w="left:"+m+";right:auto;"),x();var M="",P=function(){M.html(jQuery(M).is(".meanmenu-reveal.meanclose")?r:s)},W=function(){jQuery(".mean-bar,.mean-push").remove(),jQuery(t).removeClass("mean-container"),jQuery(n).css("display",g),A=!1,E=!1,jQuery(p).removeClass("mean-remove")},b=function(){var e="background:"+l+";color:"+l+";"+w;if(o>=a){jQuery(p).addClass("mean-remove"),E=!0,jQuery(t).addClass("mean-container"),jQuery(".mean-container").prepend('<div class="mean-bar"><a href="#nav" class="meanmenu-reveal" style="'+e+'">Show Navigation</a><nav class="mean-nav"></nav></div>');var r=jQuery(n).html();jQuery(".mean-nav").html(r),Q&&jQuery("nav.mean-nav ul, nav.mean-nav ul *").each(function(){jQuery(this).is(".mean-remove")?jQuery(this).attr("class","mean-remove"):jQuery(this).removeAttr("class"),jQuery(this).removeAttr("id")}),jQuery(n).before('<div class="mean-push" />'),jQuery(".mean-push").css("margin-top",c),jQuery(n).hide(),jQuery(".meanmenu-reveal").show(),jQuery(v).html(s),M=jQuery(v),jQuery(".mean-nav ul").hide(),h?d?(jQuery(".mean-nav ul ul").each(function(){jQuery(this).children().length&&jQuery(this,"li:first").parent().append('<a class="mean-expand" href="#" style="font-size: '+i+'">'+y+"</a>")}),jQuery(".mean-expand").on("click",function(e){e.preventDefault(),jQuery(this).hasClass("mean-clicked")?(jQuery(this).text(y),jQuery(this).prev("ul").slideUp(300,function(){})):(jQuery(this).text(j),jQuery(this).prev("ul").slideDown(300,function(){})),jQuery(this).toggleClass("mean-clicked")})):jQuery(".mean-nav ul ul").show():jQuery(".mean-nav ul ul").hide(),jQuery(".mean-nav ul li").last().addClass("mean-last"),M.removeClass("meanclose"),jQuery(M).click(function(e){e.preventDefault(),A===!1?(M.css("text-align","center"),M.css("text-indent","0"),M.css("font-size",i),jQuery(".mean-nav ul:first").slideDown(),A=!0):(jQuery(".mean-nav ul:first").slideUp(),A=!1),M.toggleClass("meanclose"),P(),jQuery(p).addClass("mean-remove")}),f&&jQuery(".mean-nav ul > li > a:first-child").on("click",function(){jQuery(".mean-nav ul:first").slideUp(),A=!1,jQuery(M).toggleClass("meanclose").html(s)})}else W()};C||jQuery(window).resize(function(){a=window.innerWidth||document.documentElement.clientWidth,a>o,W(),o>=a?(b(),x()):W()}),jQuery(window).resize(function(){a=window.innerWidth||document.documentElement.clientWidth,C?(x(),o>=a?E===!1&&b():W()):(W(),o>=a&&(b(),x()))}),b()})}}(jQuery);
|
||||
4
js/jquery.nice-select.min.js
vendored
Normal file
4
js/jquery.nice-select.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/* jQuery Nice Select - v1.0
|
||||
https://github.com/hernansartorio/jquery-nice-select
|
||||
Made by Hernán Sartorio */
|
||||
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
|
||||
445
js/main.js
Normal file
445
js/main.js
Normal file
@@ -0,0 +1,445 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
// meanmenu
|
||||
jQuery("#mobile-menu").meanmenu({
|
||||
meanMenuContainer: ".mobile-menu",
|
||||
meanScreenWidth: "992"
|
||||
});
|
||||
|
||||
$(".info-bar").on("click", function() {
|
||||
$(".extra-info").addClass("info-open");
|
||||
});
|
||||
|
||||
$(".close-icon").on("click", function() {
|
||||
$(".extra-info").removeClass("info-open");
|
||||
});
|
||||
|
||||
|
||||
$("[data-background]").each(function () {
|
||||
$(this).css("background-image", "url(" + $(this).attr("data-background") + ")")
|
||||
})
|
||||
|
||||
// slider - active
|
||||
function mainSlider() {
|
||||
var BasicSlider = $(".slider-active");
|
||||
|
||||
BasicSlider.on("init", function(e, slick) {
|
||||
var $firstAnimatingElements = $(".single-slider:first-child").find(
|
||||
"[data-animation]"
|
||||
);
|
||||
doAnimations($firstAnimatingElements);
|
||||
});
|
||||
|
||||
BasicSlider.on("beforeChange", function(e, slick, currentSlide, nextSlide) {
|
||||
var $animatingElements = $(
|
||||
'.single-slider[data-slick-index="' + nextSlide + '"]'
|
||||
).find("[data-animation]");
|
||||
doAnimations($animatingElements);
|
||||
});
|
||||
|
||||
BasicSlider.slick({
|
||||
autoplay: false,
|
||||
autoplaySpeed: 10000,
|
||||
dots: true,
|
||||
fade: true,
|
||||
arrows: false,
|
||||
responsive: [
|
||||
{ breakpoint: 767, settings: { dots: false, arrows: false } }
|
||||
]
|
||||
});
|
||||
|
||||
function doAnimations(elements) {
|
||||
var animationEndEvents =
|
||||
"webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
|
||||
elements.each(function() {
|
||||
var $this = $(this);
|
||||
var $animationDelay = $this.data("delay");
|
||||
var $animationType = "animated " + $this.data("animation");
|
||||
$this.css({
|
||||
"animation-delay": $animationDelay,
|
||||
"-webkit-animation-delay": $animationDelay
|
||||
});
|
||||
$this.addClass($animationType).one(animationEndEvents, function() {
|
||||
$this.removeClass($animationType);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
mainSlider();
|
||||
|
||||
// blog - active
|
||||
$(".blog-active").slick({
|
||||
dots: true,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 3,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 991,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 480,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// testimonial-active
|
||||
$(".testimonial-active").slick({
|
||||
dots: true,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 600,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 480,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// testimonial-active
|
||||
$(".testimonial-bg").slick({
|
||||
dots: false,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 600,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 480,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// testimonial-active
|
||||
$(".testimonial-box-active").slick({
|
||||
dots: true,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 3,
|
||||
centerMode: true,
|
||||
slidesToScroll: 1,
|
||||
centerPadding: 0,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 992,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 767,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 520,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
dots: false
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// testimonial-active
|
||||
$(".brand-active").slick({
|
||||
dots: false,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 5,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 991,
|
||||
settings: {
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 768,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 520,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// testimonial-active
|
||||
$(".related-project-active").slick({
|
||||
dots: false,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 991,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 767,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 520,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// related-product-active
|
||||
$(".related-product-active").slick({
|
||||
dots: false,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 991,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 767,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 520,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// related-product-active
|
||||
$(".service-active").slick({
|
||||
dots: true,
|
||||
arrows: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: false
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 991,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 767,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 520,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
// portfolio active
|
||||
$(".portfolio-area").imagesLoaded(function() {
|
||||
var grid = $(".grid").isotope({
|
||||
itemSelector: ".grid-item",
|
||||
percentPosition: true,
|
||||
masonry: {
|
||||
// use outer width of grid-sizer for columnWidth
|
||||
columnWidth: ".grid-item"
|
||||
}
|
||||
});
|
||||
|
||||
$(".portfolio-menu").on("click", "button", function() {
|
||||
var filterValue = $(this).attr("data-filter");
|
||||
grid.isotope({ filter: filterValue });
|
||||
});
|
||||
|
||||
//for portfolio menu active class
|
||||
$(".portfolio-menu button").on("click", function(event) {
|
||||
$(this)
|
||||
.siblings(".active")
|
||||
.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
// magnificPopup
|
||||
$(".popup-img").magnificPopup({
|
||||
type: "image",
|
||||
gallery: {
|
||||
enabled: true
|
||||
}
|
||||
});
|
||||
|
||||
/* magnificPopup video view */
|
||||
$('.popup-video').magnificPopup({
|
||||
type: 'iframe'
|
||||
});
|
||||
|
||||
// counterUp
|
||||
$(".counter").counterUp({
|
||||
delay: 10,
|
||||
time: 1000
|
||||
});
|
||||
|
||||
// niceSelect
|
||||
$("select").niceSelect();
|
||||
|
||||
// scrollUp
|
||||
$.scrollUp({
|
||||
scrollText: '<i class="fas fa-chevron-up"></i>',
|
||||
scrollSpeed: 900,
|
||||
animation: "fade"
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
54
js/news-details.js
Normal file
54
js/news-details.js
Normal file
@@ -0,0 +1,54 @@
|
||||
// 获取地址栏中的id参数
|
||||
function GetRequest(id) {
|
||||
var url = decodeURI(location.search);
|
||||
var object = {};
|
||||
if (url.indexOf("?") != -1)
|
||||
{
|
||||
var str = url.substr(1);
|
||||
var strs = str.split("&");
|
||||
for (var i = 0; i < strs.length; i++) {
|
||||
object[strs[i].split("=")[0]] = strs[i].split("=")[1]
|
||||
}
|
||||
}
|
||||
return object[id];
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: serveUrl + '?c=index&a=news_list',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'id': GetRequest("id")
|
||||
},
|
||||
success: function (res) {
|
||||
//需要获取的数据
|
||||
var detailsContent = ''
|
||||
newsDatails = res.data.list
|
||||
detailsContent += `
|
||||
|
||||
<div class="blog-wrapper mb-40">
|
||||
<div class="blog-content">
|
||||
<h2 class="blog-title">
|
||||
${newsDatails[0].title}
|
||||
</h2>
|
||||
<div class="meta-info">
|
||||
<ul>
|
||||
<li class="posts-time">${timestampToTime(Number(newsDatails[0].create_time))}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>${newsDatails[0].content_html}</p>
|
||||
<p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
`
|
||||
$('#new-details-tree').append(detailsContent)
|
||||
},
|
||||
error: function (err) {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
89
js/news.js
Normal file
89
js/news.js
Normal file
@@ -0,0 +1,89 @@
|
||||
// Avoid `console` errors in browsers that lack a console.
|
||||
// 记录高亮
|
||||
var index = 1
|
||||
let length = 5
|
||||
|
||||
getlist(1)
|
||||
|
||||
function getlist(page) {
|
||||
// 记录页数
|
||||
index = page
|
||||
// 是不是最大页 默认最大页为5 后面会重置
|
||||
if (index > length) {
|
||||
return index--
|
||||
}
|
||||
// 是不是最小页
|
||||
if (index < 1) {
|
||||
return index++
|
||||
}
|
||||
$.ajax({
|
||||
url: serveUrl + '?c=index&a=news_list',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
www: 5,
|
||||
page: index + '',
|
||||
pagesize: 9,
|
||||
},
|
||||
success: function (res) {
|
||||
//获取需要的数据
|
||||
var group = res.data.list
|
||||
// 记录页码长度
|
||||
length = Math.ceil(res.data.count / 9)
|
||||
// 详情
|
||||
var str = ''
|
||||
for (var i = 0; i < group.length; i++) {
|
||||
str += `
|
||||
<div class="col-lg-4 col-md-6 blog-item mb-40">
|
||||
<div class="blog-wrapper blog-column">
|
||||
<div class="blog-thumb">
|
||||
<img class="news" style="height:189px" src="${group[i].img}" alt="" />
|
||||
</div>
|
||||
<div class="meta-info">
|
||||
<ul>
|
||||
<li class="posts-time">${group[i].create_time == '0' ? '' : timestampToTime(Number(group[i].create_time))}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blog-content" >
|
||||
<p style="font-size:18px;font-weight:bold;margin:10px 0px 15px;color:#333333"> ${group[i].title} </p>
|
||||
<p style="display:-webkit-box:-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;"> ${(group[i].content_htmls)}</p>
|
||||
</div>
|
||||
<div class="link-box">
|
||||
<a class="detailsId" href="news-details.html?id=${group[i].id}">查看详情</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
document.querySelector('#box').innerHTML = str
|
||||
var back = `<li id="upPage" onclick="getlist(--index)">
|
||||
<a href="#">上一页</a>
|
||||
</li>`
|
||||
var strs = ''
|
||||
for (let i = 1; i <= Math.ceil(res.data.count / 9); i++) {
|
||||
strs += `<li class="${i === index ? 'active' : ''}" onclick="getlist(${i})">
|
||||
<a href="#">
|
||||
<span >${i}</span>
|
||||
</a>
|
||||
</li>`
|
||||
}
|
||||
var next = `<li id="nextPage" onclick="getlist(++index)">
|
||||
<a href="#">下一页</a>
|
||||
</li>`
|
||||
var mm = back + strs + next
|
||||
document.querySelector('#pageUl').innerHTML = mm
|
||||
|
||||
},
|
||||
error: function (err) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
43
js/plugins.js
Normal file
43
js/plugins.js
Normal file
File diff suppressed because one or more lines are too long
5
js/popper.min.js
vendored
Normal file
5
js/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
js/slick.min.js
vendored
Normal file
1
js/slick.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
17
js/timers.js
Normal file
17
js/timers.js
Normal file
@@ -0,0 +1,17 @@
|
||||
//将秒转化为时间戳
|
||||
function timestampToTime(seconds){
|
||||
var date = new Date(seconds*1000)
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var day = date.getDate();
|
||||
var currentTime = year + "-" + month + "-" + day ;
|
||||
return currentTime
|
||||
}
|
||||
|
||||
//过滤字符串中所有html标签
|
||||
function filterHTMLTag(str) {
|
||||
str = str.replace(/<\/?[^>]*>/g, ''); //去除HTML tag
|
||||
str = str.replace(/[ | ]*\n/g, '\n'); //去除行尾空白
|
||||
str = str.replace(/ /ig, ''); //去掉
|
||||
return str;
|
||||
}
|
||||
5
js/vendor/jquery-1.12.4.min.js
vendored
Normal file
5
js/vendor/jquery-1.12.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
js/vendor/modernizr-3.5.0.min.js
vendored
Normal file
3
js/vendor/modernizr-3.5.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
js/waypoints.min.js
vendored
Normal file
8
js/waypoints.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user