Commit 6fcfc139 by hank

fix bug

parent f181a51b
......@@ -215,6 +215,7 @@
var input = $(".search input");
var button = $(".search .button");
var searchValue = ""
var activeIndex = 0
input.keyup(function (e) {
searchValue = e.target.value
})
......@@ -286,14 +287,14 @@
var html = ""
res.data.forEach(function (item, index) {
if (index == 0) {
if (index == activeIndex) {
html += '<div class="menu-item active">' + item.catname + '</div>'
} else {
html += '<div class="menu-item">' + item.catname + '</div>'
}
})
$(".menu-list").html(html)
update2(res.data[0].news)
update2(res.data[activeIndex].news)
tab2();
})
update2()
......@@ -338,6 +339,7 @@
.removeClass('active');
$(this).addClass('active');
var index = $(this).index();
activeIndex = index
mySwiper.swipeTo(0, 1000, false);
update2(ideal.produtsList[index].news)
});
......@@ -408,14 +410,14 @@
var html = ""
res.data.forEach(function (item, index) {
if (index == 0) {
if (index == activeIndex) {
html += '<div class="menu-item active">' + item.catname + '</div>'
} else {
html += '<div class="menu-item">' + item.catname + '</div>'
}
})
$(".menu-list").html(html)
update(createHtml(res.data[0].news))
update(createHtml(res.data[activeIndex].news))
tab();
}
function update(html) {
......@@ -447,6 +449,7 @@
.removeClass('active');
$(this).addClass('active');
var index = $(this).index();
activeIndex = index
mySwiper.slideTo(0, 1000, false);
update(createHtml(ideal.produtsList[index].news));
});
......
......@@ -51,17 +51,17 @@
<li><a id="nav-index" href="./index.html">首页</a></li>
<li><a id="nav-about" href="./about.html">关于我们</a></li>
<li id="nav-products">
<a href="./products.html">
<a href="./products.html">
我们的产品
</a>
<ul class="dropdown-menu">
<li>
<a href="./products.html">智慧城市可视化管控平台</a>
</li>
<li>
<a href="./products2.html">企业智慧可视化管控平台</a>
</li>
<li>
<a href="./products.html">智慧城市可视化管控平台</a>
</li>
<li>
<a href="./products2.html">企业智慧可视化管控平台</a>
</li>
</ul>
</li>
<li>
......@@ -103,7 +103,7 @@
<div class="col-xs-12 col-sm-12 col-md-8 left">
<div class="title">迈动互联“车辆管理系统”碧桂园成功上线</div>
<div class="blockquote">
</div>
<br>
<div class="prev">
......@@ -150,7 +150,7 @@
</div>
</div>
</div>
<div class="social-share" style="padding: 10px;"></div>
<div class="social-share2" id="fenxiang" style="padding: 10px;"></div>
</div>
</div>
</div>
......@@ -187,10 +187,10 @@
<p class="weixin-img">
<img src="/img//weixin.png" alt="">
<object data="" type="">
<div>扫一扫获取更多资讯</div>
<div>扫一扫获取更多资讯</div>
</object>
</p>
</div>
</div>
</div>
......@@ -217,31 +217,36 @@
"></script>
<script src="../js/partticles.js"></script>
<!-- css & js -->
<!-- css & js -->
<link rel="stylesheet" href="../style/share.min.css">
<script src="../js/jquery.share.min.js"></script>
</body>
<script>
$(document).ready(function () {
$('#fenxiang').share({ sites: ['qzone', 'qq', 'weibo', 'wechat','google', 'facebook', 'twitter','douban','linkedin','diandian']});
$('#nav-products>a').click(function (e) {
e.preventDefault();
$('#nav-products .dropdown-menu').toggle(function() {
$('#nav-products .dropdown-menu').toggle(function () {
},
function() {
})
function () {
})
})
ideal.getDetail().done(function (res) {
console.log(JSON.parse(res))
var result = JSON.parse(res).data
$('.dynamic-detail .title').text(result.title)
$('title').text(result.title)
if(result.next_page) {
if (result.next_page) {
$('.dynamic-detail .next a').attr('href', "./dynamicDetail.html?id=" + result.next_page.id)
$('.dynamic-detail .next a').text(result.next_page.title)
} else {
$('.dynamic-detail .next').hide()
}
if(result.previous_page) {
if (result.previous_page) {
$('.dynamic-detail .prev a').attr('href', "./dynamicDetail.html?id=" + result.previous_page.id)
$('.dynamic-detail .prev a').text(result.previous_page.title)
} else {
......@@ -251,10 +256,10 @@
$('.hot-list').html(createHtml(result.hotNews))
})
function createHtml(data) {
function getSimpleText(html){
function getSimpleText(html) {
console.log(html)
var re1 = new RegExp("<.+?>","g");//匹配html标签的正则表达式,"g"是搜索匹配多个符合的内容
var msg = html.replace(re1,'');//执行替换成空字符
var re1 = new RegExp("<.+?>", "g");//匹配html标签的正则表达式,"g"是搜索匹配多个符合的内容
var msg = html.replace(re1, '');//执行替换成空字符
return msg;
}
var html = '';
......@@ -262,7 +267,7 @@
html +=
' <div class="hot-item">' +
'<a href="./dynamicDetail.html?id='+ item.id +'" >' +
'<a href="./dynamicDetail.html?id=' + item.id + '" >' +
'<div class="row">' +
'<div class="col-md-4">' +
' <div class="img-container">' +
......@@ -275,10 +280,10 @@
item.title +
'</div>' +
'<div class="des">' +
item.description.slice(0, 46) +
item.description.slice(0, 46) +
' </div>' +
'<div class="date">' +
item.inputtime +
item.inputtime +
'</div>' +
'</div>' +
'</div>' +
......@@ -288,7 +293,7 @@
});
return html;
}
});
</script>
......
......@@ -1292,7 +1292,7 @@ ul {
padding-bottom: 1rem;
}
.solution .list .item {
width: 3.29rem;
width: 3.27rem;
height: 1.59rem;
margin: 0.08rem;
float: left;
......@@ -1349,7 +1349,7 @@ ul {
transition: all 0.5s;
}
.industry-dynamics .list .item {
width: 3.38rem;
width: 3.36rem;
height: 3.21rem;
background: #fff;
margin-right: 0;
......
......@@ -1390,7 +1390,7 @@ ul {
padding-bottom: 1rem;
}
.item {
width: 3.29rem;
width: 3.27rem;
height: 1.59rem;
margin: 0.08rem;
float: left;
......@@ -1453,7 +1453,7 @@ ul {
.item {
// width: 6.92rem;
// height: 6.1rem;
width: 3.38rem;
width: 3.36rem;
height:3.21rem;
background: #fff;
margin-right: 0;
......
......@@ -928,7 +928,7 @@ ul {
display: none;
}
.solution .list .item {
width: 3.4rem;
width: 3.38rem;
height: 2.9rem;
margin-right: 0rem;
margin-bottom: 0.2rem;
......
......@@ -993,7 +993,7 @@ ul {
}
}
.item {
width: 3.4rem;
width: 3.38rem;
height: 2.9rem;
margin-right: 0rem;
margin-bottom: 0.2rem;
......
......@@ -858,6 +858,10 @@ ul {
max-width: 100%;
height: auto;
}
.dynamic-detail .blockquote video {
max-width: 100%;
height: auto;
}
.dynamic-detail .hot {
background: #f1f1f1;
padding: 12px 43px;
......@@ -1059,7 +1063,7 @@ ul {
display: none;
}
.solution .list .item {
width: 3.4rem;
width: 3.38rem;
height: 2.9rem;
margin-right: 0rem;
margin-bottom: 0.2rem;
......
......@@ -919,6 +919,10 @@ ul {
max-width: 100%;
height: auto;
}
video {
max-width: 100%;
height: auto;
}
}
.hot {
width: 382px;
......@@ -1125,7 +1129,7 @@ ul {
}
}
.item {
width: 3.4rem;
width: 3.38rem;
height: 2.9rem;
margin-right: 0rem;
margin-bottom: 0.2rem;
......
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