123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /**
- * Created by admin on 2018/1/11.
- */
- require(['config'], function () {
- require(['jquery', 'pagination'], function ($, pagination) {
- $(function () {
- $('.about-us_nav a').on('click',function(){
- var index = $(this).index();
- $(this).addClass('active').siblings().removeClass('active');
- $('.inner>div').eq(index).show().siblings().hide();
- });
- function getHtmlDocName() {
- var str = window.location.href;
- str = str.substring(str.lastIndexOf("/") + 1);
- str = str.substring(0, str.lastIndexOf("."));
- return str;
- }
-
- var idx;
- switch (getHtmlDocName()) {
- case 'about_us':
- idx = 0
- break;
- case 'business_cooperation':
- idx = 1
- break;
- case 'cooperative_partner':
- idx = 2
- break;
- case 'contact_us':
- idx = 3
- break;
- case 'parental_supervision':
- idx = 4
- break;
- }
- $('.about-us_nav a').eq(idx).click();
-
- $('#js-submit_feedback').on('click', function () {
- var emailReg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
- var dt = {
- details: $('.js-feedback_cnt').val() ,
- contact: $('.js-feedback_eamil').val()
- }
- if (!dt.contact || !emailReg.test(dt.contact)) {
- layer.msg('请检查输入邮箱可是是否正确!');
- return;
- }
- if (!dt.details || !emailReg.test(dt.details)) {
- layer.msg('内容不能为空!!');
- return;
- }
-
-
- $.ajax({
- url: $('.js-feedback_url').val(),
- data: dt,
- type: 'post',
- success: function (res) {
- if (res.error == 0 ) {
- layer.msg(res.msg, {time: 700})
- $('.js-feedback_eamil').val('');
- $('.js-feedback_cnt').val('');
- } else {
- layer.msg(res.msg, {icon: 5, time: 700})
- }
- }
- })
- })
- })
- })
- })
|