Commit 6fcfc139 by hank

fix bug

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