Commit a5389acb by 梁建民

js

parent 88ffae1e
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -19,21 +19,52 @@ ...@@ -19,21 +19,52 @@
} }
return object[value]; return object[value];
}, },
getData: function (params, callback) { getData: function (params, type, callback) {
var index=layer.load(1, {
offset: ['50%', "50%"], shade: false
});
if (type == 1) {
$.ajax({
type: "GET",
url: "http://api.ichunt.com/xht/companyinfo",
data: params,
xhrFields: {withCredentials: true},
success: function (data) {
layer.close(index);
if (data.err_code == 0) {
typeof callback == 'function' && callback(data);
}
}
});
} else {
$.ajax({ $.ajax({
type: "POST", type: "GET",
url: "https://api.ichunt.com/xht/companyinfo", url: "http://api.ichunt.com/xht/company",
data: params, data: params,
xhrFields: {withCredentials: true}, xhrFields: {withCredentials: true},
success: function (data) { success: function (data) {
layer.close(index);
if (data.err_code == 0) { if (data.err_code == 0) {
typeof callback == 'function' && callback(data); typeof callback == 'function' && callback(data);
} }
} }
}); });
}
}, },
handleBind: function (opt) { handleBind: function (opt) {
//nav
//menu
this.getData(null, 2, function (res) {
var html = [];
for (var i = 0; i < res.data.length; i++) {
html.push('<dd><a target="_blank" href="product_tep.html?id=' + (parseInt(i) + 1) + '">' + res.data[i].sample_name + '</a></dd>')
}
$("#menu").empty().append(html.join(''));
});
//nav hover
$(".pc-nav-wrap").find('li').hover(function () { $(".pc-nav-wrap").find('li').hover(function () {
$(this).children('dl').slideDown('slow'); $(this).children('dl').slideDown('slow');
}, function () { }, function () {
...@@ -124,11 +155,11 @@ ...@@ -124,11 +155,11 @@
if (id) { if (id) {
this.getData({ this.getData({
com_id: id com_id: id
}, function (res) { }, 1, function (res) {
var html_combg = [], html_cominfo = [], html_cominfotext = []; var html_combg = [], html_cominfo = [], html_cominfotext = [];
html_combg.push('<img src="' + res.data['company_bg_img'].images + '" alt="" class="img">' + html_combg.push('<img src="' + res.data['company_bg_img'].images + '" alt="" class="img">' +
' <div class="text">' + ' <div class="text">' +
' <a href="javascript:;" class="bg"><img src="'+res.data.logo_pc+'" alt=""></a>' + ' <a href="javascript:;" class="bg"><img src="' + res.data.logo_pc + '" alt=""></a>' +
' <p>' + res.data.slogan + '</p>' + ' <p>' + res.data.slogan + '</p>' +
' </div>'); ' </div>');
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,14 +37,7 @@ ...@@ -37,14 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
...@@ -37,15 +37,7 @@ ...@@ -37,15 +37,7 @@
<li class="lineBlock"><a href="about.html">关于我们</a></li> <li class="lineBlock"><a href="about.html">关于我们</a></li>
<li class="lineBlock"> <li class="lineBlock">
<a href="product.html">产品展示</a> <a href="product.html">产品展示</a>
<dl> <dl id="menu"></dl>
<dd><a target="_blank" href="product_tep.html?id=1">华新</a></dd>
<dd><a target="_blank" href="product_tep.html?id=2">三星</a></dd>
<dd><a target="_blank" href="product_tep.html?id=3">厚生</a></dd>
<dd><a target="_blank" href="product_tep.html?id=4">长电</a></dd>
<dd><a target="_blank" href="product_tep.html?id=5">乐山</a></dd>
<dd><a target="_blank" href="product_tep.html?id=6">风华</a></dd>
<dd><a target="_blank" href="product_tep.html?id=7">国巨</a></dd>
</dl>
</li> </li>
<li class="lineBlock"><a href="contact.html">联系我们</a></li> <li class="lineBlock"><a href="contact.html">联系我们</a></li>
</ul> </ul>
......
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 sign in to comment