From 408a975acfe2cb399ab05f8a5ed3b0c7e5a298b8 Mon Sep 17 00:00:00 2001 From: xcw <727612669@qq.com> Date: Wed, 20 Nov 2024 14:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=8B=B1=E6=96=87=E7=AB=99?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F=E4=B8=8D=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/css/styleEn.css | 64 +++++++++ public/static/js/scriptEn.js | 241 ++++++++++++++++++++++++++++++++++ view/en/layout.html | 3 +- 3 files changed, 307 insertions(+), 1 deletion(-) create mode 100644 public/static/css/styleEn.css create mode 100644 public/static/js/scriptEn.js diff --git a/public/static/css/styleEn.css b/public/static/css/styleEn.css new file mode 100644 index 0000000..18efedb --- /dev/null +++ b/public/static/css/styleEn.css @@ -0,0 +1,64 @@ +.nav ul li .nav-second { + width: 200px; +} +.nav ul li:nth-child(3) .nav-second { + width: 280px; +} +.all-title-box2 span { + text-transform: uppercase; +} +.about-box3 .box-info { + margin-top: 0; +} +.product-title-box .product-item { + font-size: 1rem; +} +.service-box3 .box-info .pull-right { + margin-top: 0; +} + +.marketing-box1 .box-info .pull-left p { + white-space: initial; +} +@media screen and (max-width: 1024px) { + .nav ul li .nav-second { + width: 100%; + } + .nav ul li:nth-child(3) .nav-second { + width: 100%; + } + .product-title-box { + flex-wrap: wrap; + } + .product-title-box .product-item { + width: 50%; + border-bottom: 1px solid rgba(255,255,255,0.5); + } + + .marketing-box1 .box-info .pull-left p { + white-space: normal; + } +} + +@media screen and (max-width: 768px) { + .product-title-box .product-item { + width: 100%; + } + .about-box1 .disFlex { + display: block; + } + .about-box2 .top-box { + display: block; + } + .about-box2 .top-box .fr { + text-align: center; + margin-top: 20px; + } + .about-box2 .top-box .fr span { + margin-left: 0; + width: 49%; + } + .about-box4 .swiper-btn span { + display: none; + } +} \ No newline at end of file diff --git a/public/static/js/scriptEn.js b/public/static/js/scriptEn.js new file mode 100644 index 0000000..598941e --- /dev/null +++ b/public/static/js/scriptEn.js @@ -0,0 +1,241 @@ +window.onload; +$(window).resize(wah); + +function wah() { + +} + +layui.use(['layer', 'form', 'element'], function(){ + var layer = layui.layer,form = layui.form,element = layui.element; +}); + +$(window).scroll(function(event) { + if ($(window).scrollTop() > 0) { + $('.head-box').addClass('active'); + } else { + $('.head-box').removeClass('active'); + } + if ($(window).scrollTop() > 400) { + $('.gotop').fadeIn(); + } else { + $('.gotop').fadeOut(); + } +}) + +$(window).on("load", function() { + setTimeout(function() { + $('.loading').fadeOut(); + }, 4000) +}) + +$(function() { + + $('.nav_btn').click(function() { + if ($('.nav_btn').attr('class') == 'nav_btn cur') { + $('.nav_btn').removeClass('cur'); + $('.nav').removeClass('active'); + $('body').css('overflow', 'inherit'); + } else { + $('.nav_btn').addClass('cur'); + $('.nav').addClass('active'); + $('body').css('overflow', 'hidden'); + } + }); + + + $('.home-box1 .center-block li').hover(function(){ + if($(this).attr('class') != 'active'){ + $('.home-box1 .center-block li').removeClass('active').eq($(this).index()).addClass('active') + } + }) + + $('.about-box2 .top-box .fr span').removeClass('active').eq(0).addClass('active') + $('.about-box2 .lower-box').hide().eq(0).show(); + $('.about-box2 .top-box .fr span').click(function(){ + if($(this).attr('class') != 'active'){ + $('.about-box2 .top-box .fr span').removeClass('active').eq($(this).index()).addClass('active') + $('.about-box2 .lower-box').hide().eq($(this).index()).show(); + } + }) + $('.about-box2 .lower-box').each(function(){ + var that = $(this) + that.find('.pull-right ul li').removeClass('active').eq(0).addClass('active') + that.find('.pull-left ul li').hide().eq(0).show(); + that.find('.pull-right ul li').click(function(){ + if($(this).attr('class') != 'active'){ + that.find('.pull-right ul li').removeClass('active').eq($(this).index()).addClass('active') + that.find('.pull-left ul li').hide().eq($(this).index()).show(); + } + }) + }) + + $('.marketing-box2 .center-block ul li').each(function(){ + var that = $(this) + that.find('.top-box').click(function(){ + if(that.attr('class') != 'active'){ + that.addClass('active') + that.find('.top-box .pull-right').text('Up') + that.find('.lower-box').stop(true,false).slideDown() + }else{ + that.removeClass('active') + that.find('.top-box .pull-right').text('Open') + that.find('.lower-box').stop(true,false).slideUp() + } + }) + }) + + $('.about-box5 .video-box i').click(function(){ + $(this).fadeOut() + $('.about-box5 .video-box').find('video').get(0).play() + }) + + + $('.ewm_tc').click(function() { + $(this).fadeOut(); + }) + + if ($(window).width() <= 768) { + $('.home-box1 .center-block li').addClass('active') + + $('.nav ul li .nav-second a').click(function(){ + $('.nav_btn').removeClass('cur'); + $('.nav').removeClass('active'); + $('body').css('overflow', 'inherit'); + }) + $('.nav ul li span.cur').each(function(){ + $(this).find('a').append('') + }) + $('.nav ul li span.cur a i').click(function(){ + return false + }) + } else { + + } + + + $(".gotop").click(function() { + var anh = $("body").offset().top; + $("html,body").stop().animate({ + scrollTop: anh + }, 1000); + scrollAnh = 0; + scrollNum = 0; + }); + + // 留言提交 中文 + $('#message-submit').click(function () { + var companyName = $("#message-form input[name='company_name']").val(); + var name = $("#message-form input[name='name']").val(); + var phone = $("#message-form input[name='phone']").val(); + var email = $("#message-form input[name='email']").val(); + var content = $("#message-form textarea[name='content']").val(); + var url = $("#message-form").data('action'); + var token = $('#token').attr('content'); + if(companyName.length == 0 && name.length == 0) { + layer.msg('公司名称和联系人署名至少需要填写一个'); + return; + } + if(companyName.length > 0 && (companyName.length < 2 || companyName.length > 100)) { + layer.msg('司名称长度限制为2~100个字符'); + return; + } + if(name.length > 0 && (name.length < 2 || name.length > 100)) { + layer.msg('联系人署名长度限制为2~100个字符'); + return; + } + if(phone.length == 0 && email.length == 0) { + layer.msg('联系电话和邮箱至少需要填写一个'); + return; + } + if(content.length == 0 || (content.length < 6 || content.length > 500)) { + layer.msg('请输入4 ~ 500字符的咨询事项内容'); + return; + } + + $.ajax({ + dataType: "json", + type: "post", + async:true, + url: url, + data: { + 'company_name':companyName, + 'name':name, + 'phone':phone, + 'email':email, + 'content':content, + '_token':token, + }, + success: function(data) { + if(data.code == 0) { + layer.msg('提交成功, 感谢您的反馈!'); + $("#message-form input").val(''); + $("#message-form textarea").val(''); + } else { + layer.msg(data.msg); + } + }, + error: function (data) { + layer.msg('提交失败,请稍后再试'); + } + }); + }); + + // 留言提交 + $('#message-submit-en').click(function () { + var companyName = $("#message-form input[name='company_name']").val(); + var name = $("#message-form input[name='name']").val(); + var phone = $("#message-form input[name='phone']").val(); + var email = $("#message-form input[name='email']").val(); + var content = $("#message-form textarea[name='content']").val(); + var url = $("#message-form").data('action'); + var token = $('#token').attr('content'); + if(companyName.length == 0 && name.length == 0) { + layer.msg('At least one company name and contact person signature must be entered'); + return; + } + if(companyName.length > 0 && (companyName.length < 2 || companyName.length > 100)) { + layer.msg('The length of the company name is limited to 2~100 characters'); + return; + } + if(name.length > 0 && (name.length < 2 || name.length > 100)) { + layer.msg('The length of the contact signature is limited to 2~100 characters'); + return; + } + if(phone.length == 0 && email.length == 0) { + layer.msg('At least one contact number and email address need to be filled'); + return; + } + if(content.length == 0 || (content.length < 6 || content.length > 500)) { + layer.msg('Please enter 4 ~ 500 characters for your inquiry'); + return; + } + + $.ajax({ + dataType: "json", + type: "post", + async:true, + url: url, + data: { + 'company_name':companyName, + 'name':name, + 'phone':phone, + 'email':email, + 'content':content, + '_token':token, + }, + success: function(data) { + if(data.code == 0) { + layer.msg('Successfully submitted, thank you for your feedback!'); + $("#message-form input").val(''); + $("#message-form textarea").val(''); + } else { + layer.msg(data.msg); + } + }, + error: function (data) { + layer.msg('Submission failed, please try again later'); + } + }); + }); + +}); diff --git a/view/en/layout.html b/view/en/layout.html index 5e3a43c..c341a09 100755 --- a/view/en/layout.html +++ b/view/en/layout.html @@ -21,6 +21,7 @@ + @@ -30,6 +31,6 @@ {:widget('menu/index', ['categoryId' => $categoryId, 'lang' => 'en'])} {__CONTENT__} {:widget('footer/index', ['lang' => 'en'])} - + \ No newline at end of file