Commit fb63b2df by 梁建民

js

parent 9eb032c6
Showing with 17 additions and 18 deletions
......@@ -20,19 +20,20 @@
return object[value];
},
getData: function (params, type, callback) {
var index=layer.load(1, {
if (type == 1) {
var index = layer.load(1, {
offset: ['50%', "50%"], shade: false
});
if (type == 1) {
$.ajax({
type: "GET",
url: "https://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);
layer.close(index);
}
}
});
......@@ -43,7 +44,6 @@
data: params,
xhrFields: {withCredentials: true},
success: function (data) {
layer.close(index);
if (data.err_code == 0) {
typeof callback == 'function' && callback(data);
}
......@@ -53,6 +53,18 @@
},
handleBind: function (opt) {
//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 () {
$(this).children('dl').slideDown('slow');
......@@ -139,20 +151,7 @@
}
});
if($("#temp").length > 0){
//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(''));
});
if ($("#temp").length > 0) {
//产品详情
var id = opt.getRequest('id');
if (id) {
......
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