Commit eba13d5d authored by superman's avatar superman

Merge branch 'express' of gitlab.yanky.cn:liaili/www.fudou6.com into express

parents af987356 e51a331f
/**
* Created by liaili on 16/7/29.
*/
/**
* 动态添加project-intro的内容
*/
var textJson=[
['精选稀缺产品','非区非县,市级资产端一手政信'],
['尽享高额佣金','远高市场佣金比例的返佣制度'],
['完善风控体系','原招商银行风控团队层层把关'],
['佣金快速结算','项目成立 T+0 ,帮您快速结佣']
];
var lis=[];
var str='';
for( var i=0, len=textJson.length; i<len; i++){
lis.push(['<li>',textJson[i][0],'<br/>', textJson[i][1] ,'</li>'].join(''));
}
$('.project-intro').html(lis.join(''));
//$('.product-intro').html(textJson.map(item=>(`<li>${item[0]}<br/>${item[1]}</li>`)).join('')); ES6方法
...@@ -55,78 +55,9 @@ ...@@ -55,78 +55,9 @@
})(); })();
(function () { (function () {
var $submit = $('#submit');
var $errorPhone = $('.error-phone');
var $errorDescription = $('.error-description');
var $introducerMobile = $('#introducerMobile');
var $projectDescription = $('#projectDescription');
var $modalBoxProject = $('.modal-box-project'); var $modalBoxProject = $('.modal-box-project');
var $modalBoxSuccess = $('.modal-box-success'); var $modalBoxSuccess = $('.modal-box-success');
var $introducer = $('#introducer');
/**
* 验证手机号
* @param tel
* @returns {boolean}
*/
function valiTel(tel) {
var msg = /^[\d]/g.test(tel) ? '' : '电话号码有误,请再次输入!';
//!msg && $introducerMobile.val('');
/^[\d]/g.test(tel[tel.length - 1]) ? $introducerMobile.val(tel) : $introducerMobile.val(tel.slice(0, tel.length - 1));
console.log(tel[tel.length - 1]);
console.log(/^[\d]/g.test(tel[tel.length - 1]));
!msg && $errorPhone.html(msg);
$errorPhone.data('vali', !msg);
disableSubmit();
return !msg;
}
/**
* 验证项目描述不能为空
* @param text
* @returns {boolean}
*/
function valiDescription(text) {
$errorDescription.html(text ? '' : '项目描述不能为空!');
$errorDescription.data('vali', text);
disableSubmit();
return !text;
}
/**
* 提交按钮是否可用
*/
function disableSubmit() {
$errorPhone.data('vali') && $errorDescription.data('vali') && $submit.attr('disabled', false).css('background', '#ff4a4b');
}
$introducerMobile.on({
keyup: function keyup(e) {
valiTel(($introducerMobile.val() + '').trim());
}
});
$projectDescription.on({
keyup: function keyup(e) {
valiDescription(($projectDescription.val() + '').trim());
}
});
/*
* 不需要在再次验证
$introducer.on('submit', function (e) {
if (!valiTel(($introducerMobile.val() + '').trim())) {
$introducerMobile.focus();
$errorPhone.html('电话号码有误!');
e.preventDefault();
return;
}
if (valiDescription(($projectDescription.val() + '').trim())) {
$projectDescription.focus();
$errorDescription.html('项目描述不能为空!');
e.preventDefault();
return;
}
});
*/
/** /**
* 地图项目地址弹框 * 地图项目地址弹框
......
{"version":3,"sources":["project.jsx"],"names":[],"mappings":";;AAAA;;;AAGA,CAAC,YAAI;AACD,QAAM,QAAQ,EAAE,wBAAF,CAAd;AACA,QAAM,oBAAoB,EAAE,mBAAF,EAAuB,KAAvB,CAA1B;AACA,QAAM,sBAAsB,EAAE,qBAAF,EAAyB,KAAzB,CAA5B;AACA,QAAM,cAAc,EAAE,cAAF,EAAkB,KAAlB,CAApB;AACA,QAAM,oBAAqB,EAAE,oBAAF,EAAwB,KAAxB,CAA3B;;AAEA,QAAM,oBAAoB,SAApB,iBAAoB,CAAC,OAAD,EAAW;AACjC,gBAAQ,GAAR,CAAY,CAAC,QAAQ,GAAR,KAAc,EAAf,EAAmB,OAAnB,CAA2B,QAA3B,EAAqC,EAArC,CAAZ;AACH,KAFD;;AAIA,QAAM,iBAAiB,SAAjB,cAAiB,CAAC,MAAD,EAAU;AAC7B,eAAO,eAAc,IAAd,CAAmB,MAAnB;AAAP;AACH,KAFD;;AAIA,QAAM,kBAAkB,SAAlB,eAAkB,CAAC,KAAD,EAAS;AAC7B,eAAO,MAAM,MAAb;AACH,KAFD;;AAIA,sBAAkB,EAAlB,CAAqB,OAArB,EAA8B,UAAC,CAAD,EAAK;AAC/B,0BAAkB,iBAAlB;AACH,KAFD,EAEG,EAFH,CAEM,aAFN,EAEqB,U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AArB;AAKA,wBAAoB,EAApB,CAAuB;AACnB,eAAO,eAAU,CAAV,EAAa;AAChB,4BAAgB,CAAC,oBAAoB,GAApB,KAA4B,EAA7B,EAAiC,IAAjC,EAAhB;AACH;AAHkB,KAAvB;AAKA;;;;;;;;;;;;;;;;;;AAkBA;;;AAGA,MAAE,wBAAF,EAA4B,KAA5B,CAAkC,UAAU,CAAV,EAAa;AAC3C,UAAE,cAAF;AACA,kBAAU,MAAV,CAAiB,GAAjB;AACH,KAHD;AAIA,MAAE,iBAAF,EAAqB,KAArB,CAA2B,UAAU,CAAV,EAAa;AACpC,UAAE,cAAF;AACA,kBAAU,OAAV,CAAkB,GAAlB;AACH,KAHD;;AAKA;;;AAGA,YAAQ,EAAR,CAAW,OAAX,EAAmB,UAAS,CAAT,EAAW;AAC1B,UAAE,cAAF;AACA,yBAAiB,MAAjB,CAAwB,GAAxB;AACH,KAHD;AAIA,MAAE,sBAAF,EAA0B,EAA1B,CAA6B,OAA7B,EAAqC,UAAS,CAAT,EAAW;AAC5C,UAAE,cAAF;AACA,yBAAiB,OAAjB,CAAyB,GAAzB;AACH,KAHD;AAMH,CAtGD","file":"project.js","sourcesContent":["/**\n * Created by Administrator on 2016/7/27.\n */\n(()=>{\n const $form = $('#container .introducer');\n const $introducerMobile = $('#introducerMobile', $form);\n const $projectDescription = $('#projectDescription', $form);\n const $errorPhone = $('.error-phone', $form);\n const $errorDescription = $('.error-description', $form);\n\n const filterMobileInput = ($mobile)=>{\n $mobile.val(($mobile.val()+'').replace(/[^\\d]/g, ''));\n };\n\n const validateMobile = (mobile)=>{\n return /^[\\d]{11}$/g.test(mobile);\n };\n\n const validateRequire = (value)=>{\n return value.length;\n };\n\n $introducerMobile.on('keyup', (e)=>{\n filterMobileInput($introducerMobile);\n }).on('change blur', (e)=>{\n validateMobile($.trim($introducerMobile.val()+'')) ?\n $errorPhone.empty() :\n $errorPhone.html('手机号输入错误!');\n });\n\n $projectDescription.on('change blur', (e)=>{\n validateRequire($.trim($projectDescription.val()+'')) ?\n $errorDescription.empty() :\n $errorDescription.html('请输入项目描述内容!');\n });\n\n $form.on('submit', (e)=>{\n let mobile = $.trim($introducerMobile.val()+'');\n let desc = $.trim($projectDescription.val()+'');\n if(validateMobile(mobile)){\n $errorPhone.empty()\n }else{\n $errorPhone.html('手机号输入错误!');\n return;\n }\n if(validateRequire(desc)){\n $errorDescription.empty()\n }else {\n $errorDescription.html('请输入项目描述内容!');\n return;\n }\n request('', {}, 'POST').then((result)=>{\n console.log(result);\n });\n });\n})();\n\n(function () {\n var $submit = $('#submit');\n var $errorPhone = $('.error-phone');\n var $errorDescription = $('.error-description');\n var $introducerMobile = $('#introducerMobile');\n var $projectDescription = $('#projectDescription');\n var $modalBoxProject = $('.modal-box-project');\n var $modalBoxSuccess = $('.modal-box-success');\n var $introducer = $('#introducer');\n\n\n\n /**\n * 验证手机号\n * @param tel\n * @returns {boolean}\n */\n function valiTel(tel) {\n var msg = /^[\\d]/g.test(tel) ? '' : '电话号码有误,请再次输入!';\n //!msg && $introducerMobile.val('');\n /^[\\d]/g.test(tel[tel.length-1])? $introducerMobile.val(tel) : $introducerMobile.val(tel.slice(0,tel.length-1));\n console.log(tel[tel.length-1]);\n console.log(/^[\\d]/g.test(tel[tel.length-1]));\n !msg && $errorPhone.html(msg);\n $errorPhone.data('vali', !msg);\n disableSubmit();\n return !msg;\n }\n\n /**\n * 验证项目描述不能为空\n * @param text\n * @returns {boolean}\n */\n function valiDescription(text) {\n $errorDescription.html(text ? '' : '项目描述不能为空!');\n $errorDescription.data('vali', text);\n disableSubmit();\n return !text;\n }\n\n /**\n * 提交按钮是否可用\n */\n function disableSubmit() {\n $errorPhone.data('vali') && $errorDescription.data('vali') &&\n $submit.attr('disabled', false).css('background', '#ff4a4b');\n }\n\n $introducerMobile.on({\n keyup: function (e) {\n valiTel(($introducerMobile.val() + '').trim());\n }\n });\n $projectDescription.on({\n keyup: function (e) {\n valiDescription(($projectDescription.val() + '').trim());\n }\n });\n /*\n * 不需要在再次验证\n $introducer.on('submit', function (e) {\n if (!valiTel(($introducerMobile.val() + '').trim())) {\n $introducerMobile.focus();\n $errorPhone.html('电话号码有误!');\n e.preventDefault();\n return;\n }\n if (valiDescription(($projectDescription.val() + '').trim())) {\n $projectDescription.focus();\n $errorDescription.html('项目描述不能为空!');\n e.preventDefault();\n return;\n }\n });\n */\n\n /**\n * 地图项目地址弹框\n */\n $('.hot-project-address a').click(function (e) {\n e.preventDefault();\n $modalBox.fadeIn(300);\n });\n $('#modalBoxHidden').click(function (e) {\n e.preventDefault();\n $modalBox.fadeOut(300);\n });\n\n /**\n * 项目提交弹框\n */\n $submit.on('click',function(e){\n e.preventDefault();\n $modalBoxSuccess.fadeIn(300);\n });\n $('.modal-box-success a').on('click',function(e){\n e.preventDefault();\n $modalBoxSuccess.fadeOut(300);\n });\n\n\n})();"]} {"version":3,"sources":["project.jsx"],"names":[],"mappings":";;AAAA;;;AAGA,CAAC,YAAI;AACD,QAAM,QAAQ,EAAE,wBAAF,CAAd;AACA,QAAM,oBAAoB,EAAE,mBAAF,EAAuB,KAAvB,CAA1B;AACA,QAAM,sBAAsB,EAAE,qBAAF,EAAyB,KAAzB,CAA5B;AACA,QAAM,cAAc,EAAE,cAAF,EAAkB,KAAlB,CAApB;AACA,QAAM,oBAAqB,EAAE,oBAAF,EAAwB,KAAxB,CAA3B;;AAEA,QAAM,oBAAoB,SAApB,iBAAoB,CAAC,OAAD,EAAW;AACjC,gBAAQ,GAAR,CAAY,CAAC,QAAQ,GAAR,KAAc,EAAf,EAAmB,OAAnB,CAA2B,QAA3B,EAAqC,EAArC,CAAZ;AACH,KAFD;;AAIA,QAAM,iBAAiB,SAAjB,cAAiB,CAAC,MAAD,EAAU;AAC7B,eAAO,eAAc,IAAd,CAAmB,MAAnB;AAAP;AACH,KAFD;;AAIA,QAAM,kBAAkB,SAAlB,eAAkB,CAAC,KAAD,EAAS;AAC7B,eAAO,MAAM,MAAb;AACH,KAFD;;AAIA,sBAA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AkC,UAAU,CAAV,EAAa;AAC3C,UAAE,cAAF;AACA,kBAAU,MAAV,CAAiB,GAAjB;AACH,KAHD;AAIA,MAAE,iBAAF,EAAqB,KAArB,CAA2B,UAAU,CAAV,EAAa;AACpC,UAAE,cAAF;AACA,kBAAU,OAAV,CAAkB,GAAlB;AACH,KAHD;;AAKA;;;AAGA,YAAQ,EAAR,CAAW,OAAX,EAAmB,UAAS,CAAT,EAAW;AAC1B,UAAE,cAAF;AACA,yBAAiB,MAAjB,CAAwB,GAAxB;AACH,KAHD;AAIA,MAAE,sBAAF,EAA0B,EAA1B,CAA6B,OAA7B,EAAqC,UAAS,CAAT,EAAW;AAC5C,UAAE,cAAF;AACA,yBAAiB,OAAjB,CAAyB,GAAzB;AACH,KAHD;AAMH,CArCD","file":"project.js","sourcesContent":["/**\n * Created by Administrator on 2016/7/27.\n */\n(()=>{\n const $form = $('#container .introducer');\n const $introducerMobile = $('#introducerMobile', $form);\n const $projectDescription = $('#projectDescription', $form);\n const $errorPhone = $('.error-phone', $form);\n const $errorDescription = $('.error-description', $form);\n\n const filterMobileInput = ($mobile)=>{\n $mobile.val(($mobile.val()+'').replace(/[^\\d]/g, ''));\n };\n\n const validateMobile = (mobile)=>{\n return /^[\\d]{11}$/g.test(mobile);\n };\n\n const validateRequire = (value)=>{\n return value.length;\n };\n\n $introducerMobile.on('keyup', (e)=>{\n filterMobileInput($introducerMobile);\n }).on('change blur', (e)=>{\n validateMobile($.trim($introducerMobile.val()+'')) ?\n $errorPhone.empty() :\n $errorPhone.html('手机号输入错误!');\n });\n\n $projectDescription.on('change blur', (e)=>{\n validateRequire($.trim($projectDescription.val()+'')) ?\n $errorDescription.empty() :\n $errorDescription.html('请输入项目描述内容!');\n });\n\n $form.on('submit', (e)=>{\n let mobile = $.trim($introducerMobile.val()+'');\n let desc = $.trim($projectDescription.val()+'');\n if(validateMobile(mobile)){\n $errorPhone.empty()\n }else{\n $errorPhone.html('手机号输入错误!');\n return;\n }\n if(validateRequire(desc)){\n $errorDescription.empty()\n }else {\n $errorDescription.html('请输入项目描述内容!');\n return;\n }\n request('', {}, 'POST').then((result)=>{\n console.log(result);\n });\n });\n})();\n\n(function () {\n\n\n\n\n\n var $modalBoxProject = $('.modal-box-project');\n var $modalBoxSuccess = $('.modal-box-success');\n\n\n\n\n /**\n * 地图项目地址弹框\n */\n $('.hot-project-address a').click(function (e) {\n e.preventDefault();\n $modalBox.fadeIn(300);\n });\n $('#modalBoxHidden').click(function (e) {\n e.preventDefault();\n $modalBox.fadeOut(300);\n });\n\n /**\n * 项目提交弹框\n */\n $submit.on('click',function(e){\n e.preventDefault();\n $modalBoxSuccess.fadeIn(300);\n });\n $('.modal-box-success a').on('click',function(e){\n e.preventDefault();\n $modalBoxSuccess.fadeOut(300);\n });\n\n\n})();"]}
\ No newline at end of file \ No newline at end of file
...@@ -56,81 +56,16 @@ ...@@ -56,81 +56,16 @@
})(); })();
(function () { (function () {
var $submit = $('#submit');
var $errorPhone = $('.error-phone');
var $errorDescription = $('.error-description');
var $introducerMobile = $('#introducerMobile');
var $projectDescription = $('#projectDescription');
var $modalBoxProject = $('.modal-box-project');
var $modalBoxSuccess = $('.modal-box-success');
var $introducer = $('#introducer');
/**
* 验证手机号
* @param tel
* @returns {boolean}
*/
function valiTel(tel) {
var msg = /^[\d]/g.test(tel) ? '' : '电话号码有误,请再次输入!';
//!msg && $introducerMobile.val('');
/^[\d]/g.test(tel[tel.length-1])? $introducerMobile.val(tel) : $introducerMobile.val(tel.slice(0,tel.length-1));
console.log(tel[tel.length-1]);
console.log(/^[\d]/g.test(tel[tel.length-1]));
!msg && $errorPhone.html(msg);
$errorPhone.data('vali', !msg);
disableSubmit();
return !msg;
}
/**
* 验证项目描述不能为空
* @param text
* @returns {boolean}
*/
function valiDescription(text) {
$errorDescription.html(text ? '' : '项目描述不能为空!');
$errorDescription.data('vali', text);
disableSubmit();
return !text;
}
/** var $modalBoxProject = $('.modal-box-project');
* 提交按钮是否可用 var $modalBoxSuccess = $('.modal-box-success');
*/
function disableSubmit() {
$errorPhone.data('vali') && $errorDescription.data('vali') &&
$submit.attr('disabled', false).css('background', '#ff4a4b');
}
$introducerMobile.on({
keyup: function (e) {
valiTel(($introducerMobile.val() + '').trim());
}
});
$projectDescription.on({
keyup: function (e) {
valiDescription(($projectDescription.val() + '').trim());
}
});
/*
* 不需要在再次验证
$introducer.on('submit', function (e) {
if (!valiTel(($introducerMobile.val() + '').trim())) {
$introducerMobile.focus();
$errorPhone.html('电话号码有误!');
e.preventDefault();
return;
}
if (valiDescription(($projectDescription.val() + '').trim())) {
$projectDescription.focus();
$errorDescription.html('项目描述不能为空!');
e.preventDefault();
return;
}
});
*/
/** /**
* 地图项目地址弹框 * 地图项目地址弹框
......
"use strict";(function(){var $form=$("#container .introducer");var $introducerMobile=$("#introducerMobile",$form);var $projectDescription=$("#projectDescription",$form);var $errorPhone=$(".error-phone",$form);var $errorDescription=$(".error-description",$form);var filterMobileInput=function filterMobileInput($mobile){$mobile.val(($mobile.val()+"").replace(/[^\d]/g,""))};var validateMobile=function validateMobile(mobile){return/^[\d]{11}$/g.test(mobile)};var validateRequire=function validateRequire(value){return value.length};$introducerMobile.on("keyup",function(e){filterMobileInput($introducerMobile)}).on("change blur",function(e){validateMobile($.trim($introducerMobile.val()+""))?$errorPhone.empty():$errorPhone.html("手机号输入错误!")});$projectDescription.on("change blur",function(e){validateRequire($.trim($projectDescription.val()+""))?$errorDescription.empty():$errorDescription.html("请输入项目描述内容!")});$form.on("submit",function(e){var mobile=$.trim($introducerMobile.val()+"");var desc=$.trim($projectDescription.val()+"");if(validateMobile(mobile)){$errorPhone.empty()}else{$errorPhone.html("手机号输入错误!");return}if(validateRequire(desc)){$errorDescription.empty()}else{$errorDescription.html("请输入项目描述内容!");return}request("",{},"POST").then(function(result){console.log(result)})})})();(function(){var $submit=$("#submit");var $errorPhone=$(".error-phone");var $errorDescription=$(".error-description");var $introducerMobile=$("#introducerMobile");var $projectDescription=$("#projectDescription");var $modalBoxProject=$(".modal-box-project");var $modalBoxSuccess=$(".modal-box-success");var $introducer=$("#introducer");function valiTel(tel){var msg=/^[\d]/g.test(tel)?"":"电话号码有误,请再次输入!";/^[\d]/g.test(tel[tel.length-1])?$introducerMobile.val(tel):$introducerMobile.val(tel.slice(0,tel.length-1));console.log(tel[tel.length-1]);console.log(/^[\d]/g.test(tel[tel.length-1]));!msg&&$errorPhone.html(msg);$errorPhone.data("vali",!msg);disableSubmit();return!msg}function valiDescription(text){$errorDescription.html(text?"":"项目描述不能为空!");$errorDescription.data("vali",text);disableSubmit();return!text}function disableSubmit(){$errorPhone.data("vali")&&$errorDescription.data("vali")&&$submit.attr("disabled",false).css("background","#ff4a4b")}$introducerMobile.on({keyup:function keyup(e){valiTel(($introducerMobile.val()+"").trim())}});$projectDescription.on({keyup:function keyup(e){valiDescription(($projectDescription.val()+"").trim())}});$(".hot-project-address a").click(function(e){e.preventDefault();$modalBox.fadeIn(300)});$("#modalBoxHidden").click(function(e){e.preventDefault();$modalBox.fadeOut(300)});$submit.on("click",function(e){e.preventDefault();$modalBoxSuccess.fadeIn(300)});$(".modal-box-success a").on("click",function(e){e.preventDefault();$modalBoxSuccess.fadeOut(300)})})(); "use strict";(function(){var $form=$("#container .introducer");var $introducerMobile=$("#introducerMobile",$form);var $projectDescription=$("#projectDescription",$form);var $errorPhone=$(".error-phone",$form);var $errorDescription=$(".error-description",$form);var filterMobileInput=function filterMobileInput($mobile){$mobile.val(($mobile.val()+"").replace(/[^\d]/g,""))};var validateMobile=function validateMobile(mobile){return/^[\d]{11}$/g.test(mobile)};var validateRequire=function validateRequire(value){return value.length};$introducerMobile.on("keyup",function(e){filterMobileInput($introducerMobile)}).on("change blur",function(e){validateMobile($.trim($introducerMobile.val()+""))?$errorPhone.empty():$errorPhone.html("手机号输入错误!")});$projectDescription.on("change blur",function(e){validateRequire($.trim($projectDescription.val()+""))?$errorDescription.empty():$errorDescription.html("请输入项目描述内容!")});$form.on("submit",function(e){var mobile=$.trim($introducerMobile.val()+"");var desc=$.trim($projectDescription.val()+"");if(validateMobile(mobile)){$errorPhone.empty()}else{$errorPhone.html("手机号输入错误!");return}if(validateRequire(desc)){$errorDescription.empty()}else{$errorDescription.html("请输入项目描述内容!");return}request("",{},"POST").then(function(result){console.log(result)})})})();(function(){var $modalBoxProject=$(".modal-box-project");var $modalBoxSuccess=$(".modal-box-success");$(".hot-project-address a").click(function(e){e.preventDefault();$modalBox.fadeIn(300)});$("#modalBoxHidden").click(function(e){e.preventDefault();$modalBox.fadeOut(300)});$submit.on("click",function(e){e.preventDefault();$modalBoxSuccess.fadeIn(300)});$(".modal-box-success a").on("click",function(e){e.preventDefault();$modalBoxSuccess.fadeOut(300)})})();
\ No newline at end of file \ No newline at end of file
...@@ -251,22 +251,22 @@ ...@@ -251,22 +251,22 @@
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
} }
.hot-project-tabs ul li:nth-child(1) dt { .hot-project-tabs ul li:nth-child(1) dt {
background: url("../images/hot_project/tabs05_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/nbrdGFiczA1X2I=_115x115.png") no-repeat;
} }
.hot-project-tabs ul li:nth-child(2) { .hot-project-tabs ul li:nth-child(2) {
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
} }
.hot-project-tabs ul li:nth-child(2) dt { .hot-project-tabs ul li:nth-child(2) dt {
background: url("../images/hot_project/tabs04_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/dgndGFiczA0X2I=_115x115.png") no-repeat;
} }
.hot-project-tabs ul li:nth-child(3) { .hot-project-tabs ul li:nth-child(3) {
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
} }
.hot-project-tabs ul li:nth-child(3) dt { .hot-project-tabs ul li:nth-child(3) dt {
background: url("../images/hot_project/tabs03_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/p8edGFiczAzX2I=_115x115.png") no-repeat;
} }
.hot-project-tabs ul li:nth-child(4) dt { .hot-project-tabs ul li:nth-child(4) dt {
background: url("../images/hot_project/tabs02_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/6jpdGFiczAyX2I=_115x115.png") no-repeat;
} }
.hot-project-tabs ul li:hover { .hot-project-tabs ul li:hover {
color: #fff; color: #fff;
...@@ -278,13 +278,13 @@ ...@@ -278,13 +278,13 @@
@-webkit-keyframes changeOne { @-webkit-keyframes changeOne {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs05_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/nbrdGFiczA1X2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
background: url("../images/hot_project/tabs05_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/u42dGFiczA1X2E=_115x115.png") no-repeat;
opacity: 1; opacity: 1;
} }
} }
...@@ -296,13 +296,13 @@ ...@@ -296,13 +296,13 @@
@-webkit-keyframes changeTwo { @-webkit-keyframes changeTwo {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs04_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/dgndGFiczA0X2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
background: url("../images/hot_project/tabs04_a.png ") no-repeat -1px -1px; background: url("https://res.fudou6.com/c/4/20160801/n3ndGFiczA0X2E=_115x115.png") no-repeat;
opacity: 1; opacity: 1;
} }
} }
...@@ -314,14 +314,14 @@ ...@@ -314,14 +314,14 @@
@-webkit-keyframes changeThree { @-webkit-keyframes changeThree {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs03_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/p8edGFiczAzX2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs03_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/za5dGFiczAzX2E=_115x115.png") no-repeat;
} }
} }
.hot-project-tabs ul li:nth-child(3):hover dt { .hot-project-tabs ul li:nth-child(3):hover dt {
...@@ -331,14 +331,14 @@ ...@@ -331,14 +331,14 @@
} }
@-webkit-keyframes changeFour { @-webkit-keyframes changeFour {
0% { 0% {
background: url("../images/hot_project/tabs02_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/6jpdGFiczAyX2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs02_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/zsedGFiczAyX2E=_115x115.png") no-repeat;
} }
} }
.hot-project-tabs ul li:nth-child(4):hover dt { .hot-project-tabs ul li:nth-child(4):hover dt {
......
...@@ -332,24 +332,24 @@ ...@@ -332,24 +332,24 @@
li:nth-child(1) { li:nth-child(1) {
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
dt { dt {
background: url("../images/hot_project/tabs05_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/nbrdGFiczA1X2I=_115x115.png") no-repeat;
} }
} }
li:nth-child(2) { li:nth-child(2) {
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
dt { dt {
background: url("../images/hot_project/tabs04_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/dgndGFiczA0X2I=_115x115.png") no-repeat;
} }
} }
li:nth-child(3) { li:nth-child(3) {
border-right: 1px solid #43abb6; border-right: 1px solid #43abb6;
dt { dt {
background: url("../images/hot_project/tabs03_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/p8edGFiczAzX2I=_115x115.png") no-repeat;
} }
} }
li:nth-child(4) { li:nth-child(4) {
dt { dt {
background: url("../images/hot_project/tabs02_b.png") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/6jpdGFiczAyX2I=_115x115.png") no-repeat;
} }
} }
li:hover { li:hover {
...@@ -363,13 +363,13 @@ ...@@ -363,13 +363,13 @@
@-webkit-keyframes changeOne { @-webkit-keyframes changeOne {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs05_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/nbrdGFiczA1X2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
background: url("../images/hot_project/tabs05_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/u42dGFiczA1X2E=_115x115.png") no-repeat;
opacity: 1; opacity: 1;
} }
} }
...@@ -383,13 +383,13 @@ ...@@ -383,13 +383,13 @@
@-webkit-keyframes changeTwo { @-webkit-keyframes changeTwo {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs04_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/dgndGFiczA0X2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
background: url("../images/hot_project/tabs04_a.png ") no-repeat -1px -1px; background: url("https://res.fudou6.com/c/4/20160801/n3ndGFiczA0X2E=_115x115.png") no-repeat;
opacity: 1; opacity: 1;
} }
} }
...@@ -403,14 +403,14 @@ ...@@ -403,14 +403,14 @@
@-webkit-keyframes changeThree { @-webkit-keyframes changeThree {
0% { 0% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs03_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/p8edGFiczAzX2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs03_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/za5dGFiczAzX2E=_115x115.png") no-repeat;
} }
} }
dt { dt {
...@@ -422,14 +422,14 @@ ...@@ -422,14 +422,14 @@
li:nth-child(4):hover { li:nth-child(4):hover {
@-webkit-keyframes changeFour { @-webkit-keyframes changeFour {
0% { 0% {
background: url("../images/hot_project/tabs02_b.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/6jpdGFiczAyX2I=_115x115.png") no-repeat;
} }
50% { 50% {
opacity: 0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
background: url("../images/hot_project/tabs02_a.png ") no-repeat; background: url("https://res.fudou6.com/c/4/20160801/zsedGFiczAyX2E=_115x115.png") no-repeat;
} }
} }
dt { dt {
......
...@@ -7,7 +7,7 @@ var product = require('./product'); ...@@ -7,7 +7,7 @@ var product = require('./product');
router.get('/', function (req, res) { router.get('/', function (req, res) {
res.render('index', { res.render('index', {
styles: ['index'], styles: ['index'],
scripts:['index'], scripts:[],
character: [ character: [
{ {
sum: '526亿', sum: '526亿',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment