Commit 0295c38f8007f6069a5872004e03e9cd33271135

Authored by Andy
1 parent 85c3efcc

add 首页新增新闻中心

images/news/index_news_1.jpg 0 → 100644

35.2 KB

images/news/index_news_2.jpg 0 → 100644

126 KB

images/news/index_news_3.jpg 0 → 100644

193 KB

images/news/point.png 0 → 100644

90 Bytes

index.html
... ... @@ -201,7 +201,52 @@
201 201 </div>
202 202 </div>
203 203 </section>
  204 +<section class="section index-news-section" style="background: #fff;">
  205 + <div class="container">
  206 + <div class="row">
  207 + <div class="col-md-12">
  208 + <div class="section-title">
  209 + <h2>新闻中心</h2>
  210 + </div>
  211 + </div>
  212 + </div>
  213 + <div class="news-bd">
  214 + <div class="focus swiper-container" id="swiper-container-news">
  215 + <div class="swiper-wrapper index_slide_list">
  216 +
  217 + <!--<div class="swiper-slide">
  218 + <a href="https://mp.weixin.qq.com/s/NcWXfcxjy5t-sqG2yFg6JQ" class="swiper-slide news_a">
  219 + <div class="news_title">
  220 + <p>中兴智能交通助力西部大发展,建设甘肃省周边“一带一路”沿线城市的智慧停车</p>
  221 + </div>
  222 + <img class="banner" src="images/news/index_news_1.jpg" alt="" width="100%">
  223 + </a>
  224 + </div>
  225 + <div class="swiper-slide swiper-slide-new2">
  226 + <a href="https://mp.weixin.qq.com/s/bO_1as7-8enGR7g4sI_6lw" class="swiper-slide news_a">
  227 + <div class="news_title">
  228 + <p>年度盘点丨2018,中兴智能交通铸就辉煌</p>
  229 + </div>
  230 + <img class="banner" src="images/news/index_news_2.jpg" alt="" width="100%">
  231 + </a>
  232 + </div>
  233 + <div class="swiper-slide swiper-slide-new3">
  234 + <a href="https://mp.weixin.qq.com/s/ZJCdWCWCkrxtmOCep9fvwQ" class="swiper-slide news_a">
  235 + <div class="news_title">
  236 + <p>中兴智能交通荣获”2018中国城市无人化停车十大创新方案”称号</p>
  237 + </div>
  238 + <img class="banner" src="images/news/index_news_3.jpg" alt="" width="100%">
  239 + </a>
  240 + </div>-->
  241 + </div>
  242 + </div>
  243 + <div class="newslist">
  244 + <ul></ul>
  245 + </div>
  246 + </div>
204 247  
  248 + </div>
  249 +</section>
205 250  
206 251  
207 252 <!-- Footer Area -->
... ... @@ -227,6 +272,7 @@
227 272 <!--<script type="text/javascript" src="js/particle-code.js"></script>-->
228 273 <script type="text/javascript" src="js/jquery.counterup.min.js"></script>
229 274 <script type="text/javascript" src="js/swiper.js"></script>
  275 +<!--<script type="text/javascript" src="js/idangero.swiper.js"></script>-->
230 276 <script type="text/javascript" src="js/gmaps.min.js"></script>
231 277 <script type="text/javascript" src="js/nav-footer.js?a=2"></script>
232 278 <script type="text/javascript" src="js/main.js?a=1"></script>
... ...
js/main.js
... ... @@ -170,8 +170,6 @@
170 170 });
171 171  
172 172  
173   -
174   -
175 173 // Preloader
176 174 $(window).on('load', function() {
177 175 $('.loader').fadeOut('slow', function(){
... ... @@ -179,6 +177,92 @@
179 177 });
180 178 });
181 179  
  180 + /*
  181 + @ chenbiao
  182 + @ 2018-01-23
  183 + @ 首页新闻列表 轮播
  184 + */
  185 + // 首页新闻图片轮播数据渲染
  186 + function indexImgSlide(){
  187 + var indexSlideList = $('.index_slide_list');
  188 + var imgList= [];
  189 + //直接使用ajax访问
  190 + $.ajax({
  191 + type:'get',
  192 + url:'newsdata/swipernewsdata.json',
  193 + dataType:'json',
  194 + success:function(data){
  195 + $.each(data, function(i, obj){
  196 + imgList.push(
  197 + '<div class="swiper-slide red-slide">',
  198 + '<a href="'+obj.href+'" class="swiper-slide news_a">',
  199 + '<div class="news_title">',
  200 + '<p>' + obj.newsTitle + '</p>',
  201 + '</div>',
  202 + '<img class="banner" src="'+obj.imgUrl+'" alt="" width="100%">',
  203 + '</a>',
  204 + '</div>'
  205 + )
  206 + });
  207 + indexSlideList.html(imgList.join(' '));
  208 + var mySwipernews = new Swiper ('#swiper-container-news', {
  209 + direction: 'horizontal',
  210 + loop: true,
  211 + speed: 500, //设置轮播时长 可以不设置 会有个默认值
  212 + autoplay: true,//可选选项,自动滑动
  213 + // 如果需要分页器
  214 + pagination: {
  215 + el: '.swiper-pagination',
  216 + clickable:true
  217 + },
  218 + autoplay: {
  219 + disableOnInteraction: false, //点击后继续轮播(这个很重要)
  220 + delay: 3000, //自动轮播的每次的时间 可以不设置 会有个默认值
  221 + },
  222 + // 如果需要前进后退按钮
  223 +
  224 +
  225 + });
  226 + }
  227 + });
  228 +
  229 + }
  230 +
  231 + indexImgSlide();
  232 +
  233 +
  234 + /*
  235 + @ chenbiao
  236 + @ 2018-01-23
  237 + @ 首页新闻列表 右侧
  238 + */
  239 + function indexNewsList(){
  240 + var newslist = $('.newslist ul');
  241 + var list= [];
  242 + //直接使用ajax访问
  243 + $.ajax({
  244 + type:'get',
  245 + url:'newsdata/newslistdata.json',
  246 + dataType:'json',
  247 + success:function(data){
  248 + $.each(data, function(i, obj){
  249 + list.push(
  250 + '<li>',
  251 + '<p class="pos-rel">',
  252 + '<a href="'+obj.href+'">' + commonStrandNum.cutString(obj.newsTitle, 26) +'</a>',
  253 + '<span class="pos-abs" style="bottom: 0px;right: 2px;color: rgba(0,0,0,0.5)">'+obj.time+'</span>',
  254 + '</p>',
  255 + '</li>'
  256 + )
  257 + });
  258 + newslist.html(list.join(' '));
  259 + }
  260 + })
  261 + }
  262 + indexNewsList();
  263 +
  264 +
  265 +
182 266 var mySwiper = new Swiper ('#swiper-container-index', {
183 267 direction: 'horizontal',
184 268 loop: true,
... ... @@ -196,5 +280,31 @@
196 280 // 如果需要前进后退按钮
197 281  
198 282  
199   - })
200   -
  283 + });
  284 +
  285 +
  286 +
  287 + /*
  288 + @ cb
  289 + @ 2018-01-23
  290 + @ 切割字符串方法 commonStrandNum.cutString(str, 25)
  291 + */
  292 +
  293 + var commonStrandNum = {
  294 + /*
  295 + @切割字符串
  296 + @str原字符串
  297 + @num字符位数
  298 + */
  299 + cutString: function (str, num) {
  300 + var _str = "";
  301 + if (str.length >= num) {
  302 + var strN = str.substring(0, num);
  303 + strN += "...";
  304 + _str = strN;
  305 + } else {
  306 + _str = str;
  307 + }
  308 + return _str;
  309 + },
  310 + }
201 311 \ No newline at end of file
... ...
newsdata/newslistdata.json 0 → 100644
  1 +[
  2 + {
  3 + "href":"https://mp.weixin.qq.com/s/NcWXfcxjy5t-sqG2yFg6JQ",
  4 + "newsTitle":"中兴智能交通助力西部大发展,建设甘肃省周边“一带一路”沿线城市的智慧停车",
  5 + "img":"http://www.zte-its.com/Upload/2019-01/20190107134910953.jpg",
  6 + "time":"2019-01-06"
  7 + },
  8 + {
  9 + "href":"https://mp.weixin.qq.com/s/bO_1as7-8enGR7g4sI_6lw",
  10 + "newsTitle":"年度盘点丨2018,中兴智能交通铸就辉煌",
  11 + "img":"http://www.zte-its.com/Upload/2019-01/20190107120328342.jpg",
  12 + "time":"2018-12-30"
  13 + },
  14 + {
  15 + "href":"https://mp.weixin.qq.com/s/ZJCdWCWCkrxtmOCep9fvwQ",
  16 + "newsTitle":"中兴智能交通荣获”2018中国城市无人化停车十大创新方案”称号",
  17 + "img":"http://www.zte-its.com/Upload/2019-01/20190114111641907.jpg",
  18 + "time":"2019-01-14"
  19 + },
  20 + {
  21 + "href":"https://mp.weixin.qq.com/s/ilplSVvIBUt0sDtqTgsgbw",
  22 + "newsTitle":"赤峰智慧停车项目正式上线运营",
  23 + "img":"http://www.zte-its.com/ckfinder/userfiles/images/Snap2(34).jpg",
  24 + "time":"2018-12-26"
  25 + },
  26 + {
  27 + "href":"https://mp.weixin.qq.com/s/j4FJmW-dAMAKK8WBilHSzw",
  28 + "newsTitle":"物联网下的智慧停车,中兴智能交通应邀出席“2018第三届中国物联网国际峰会”",
  29 + "img":"http://www.zte-its.com/Upload/2018-05/20180529172415999.jpg",
  30 + "time":"2018-05-15"
  31 + },
  32 + {
  33 + "href":"https://mp.weixin.qq.com/s/Q3V4F0PHm0cS7a-zlXx6OA",
  34 + "newsTitle":"【行业动态】贵州机动车停放收费新规5月起试行 小区停车费由业主大会决定",
  35 + "img":"http://www.zte-its.com/Upload/2018-08/20180808173733771.jpg",
  36 + "time":"2018-04-24"
  37 + },
  38 + {
  39 + "href":"https://mp.weixin.qq.com/s/BEyfUDkfrZqLokZxoKp04Q",
  40 + "newsTitle":"【行业动态】广州停车场条例10月起施行 小区停车收费标准先议价",
  41 + "img":"http://www.zte-its.com/Upload/2018-09/20180918095140370.jpg",
  42 + "time":"2018-04-24"
  43 + },
  44 + {
  45 + "href":"https://mp.weixin.qq.com/s/-ltsBzboxdeCzwz4-nOy0Q",
  46 + "newsTitle":"【行业动态】2018雄安新区停车设备设施投资建设高峰论坛暨博览会在雄安新区隆重召开!",
  47 + "img":"https://mmbiz.qpic.cn/mmbiz_jpg/eRs8EuRTNC1tBsAtYFuuFx3SgKrPpkMYib3bP9kBKnxqcwcosVOUc5iaF4hQ9JkHfZib0SWuANXAuzI8u4vzWgDFA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1",
  48 + "time":"2018-04-20"
  49 + },
  50 + {
  51 + "href":"https://mp.weixin.qq.com/s/3tWOAvnXl5T78TzBPgWszA",
  52 + "newsTitle":"【行业动态】滴滴发布企业公民报告:让城市交通更智慧 运行更高效",
  53 + "img":"https://mmbiz.qpic.cn/mmbiz_jpg/uWQ5Iz1kD2bHvLt6DEdN4ib00PeTsmxiaTye2BHMuxXSD7Z51HnBicxNc53FeZceD2ZiaJ4Eq4ft9cHY9Uib1CXNzIA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1",
  54 + "time":"2018-04-20"
  55 + }, {
  56 + "href":"https://mp.weixin.qq.com/s/ZrDwirjt0JTntmcCI5L4Ag",
  57 + "newsTitle":"【行业动态】昆明停车管理新规 力图破解“圈地收费”乱象",
  58 + "img":"http://www.zte-its.com/Upload/2018-05/20180529173902781.jpg",
  59 + "time":"2018-04-20"
  60 + }
  61 +
  62 + ]
... ...
newsdata/swipernewsdata.json 0 → 100644
  1 +[
  2 + {
  3 + "href":"https://mp.weixin.qq.com/s/NcWXfcxjy5t-sqG2yFg6JQ",
  4 + "newsTitle":"中兴智能交通助力西部大发展,建设甘肃省周边“一带一路”沿线城市的智慧停车",
  5 + "imgUrl":"http://www.zte-its.com/Upload/2019-01/20190107134910953.jpg",
  6 + "time":"2019-01-06"
  7 + },
  8 + {
  9 + "href":"https://mp.weixin.qq.com/s/bO_1as7-8enGR7g4sI_6lw",
  10 + "newsTitle":"年度盘点丨2018,中兴智能交通铸就辉煌",
  11 + "imgUrl":"http://www.zte-its.com/Upload/2019-01/20190107120328342.jpg",
  12 + "time":"2018-12-30"
  13 + },
  14 + {
  15 + "href":"https://mp.weixin.qq.com/s/ZJCdWCWCkrxtmOCep9fvwQ",
  16 + "newsTitle":"中兴智能交通荣获”2018中国城市无人化停车十大创新方案”称号",
  17 + "imgUrl":"http://www.zte-its.com/Upload/2019-01/20190114111641907.jpg",
  18 + "time":"2019-01-14"
  19 + }
  20 +]
... ...
style.css
... ... @@ -2538,3 +2538,113 @@ a:hover{
2538 2538 .slicknav_menu .slicknav_btn{
2539 2539 background: #49A4FE !important;
2540 2540 }
  2541 +
  2542 +
  2543 +/*news 新闻中心*/
  2544 +.index-news-section .news-bd{
  2545 + width: 100%;
  2546 + min-width: 1200px;
  2547 + overflow: hidden;
  2548 +}
  2549 +.index-news-section .focus {
  2550 + width: 476px;
  2551 + height: 289px;
  2552 + float: left;
  2553 + position: relative;
  2554 +}
  2555 +.index-news-section .newslist {
  2556 + width: 715px;
  2557 + float: left;
  2558 + margin-bottom: 10px;
  2559 +}
  2560 +.index-news-section .newslist ul {
  2561 + padding: 15px 0;
  2562 + overflow: hidden;
  2563 + list-style: initial;
  2564 + color: #797979;
  2565 +}
  2566 +.index-news-section .newslist li {
  2567 + width: 286px;
  2568 + height: 45px;
  2569 + line-height: 22px;
  2570 + float: left;
  2571 + margin-left: 70px;
  2572 + list-style: none;
  2573 +}
  2574 +.index-news-section .newslist li {
  2575 + margin-bottom: 10px;
  2576 + background-image: url(images/news/point.png);
  2577 + background-repeat: no-repeat;
  2578 + background-position: 5px 7px;
  2579 +}
  2580 +.index-news-section .newslist li p {
  2581 + padding-left: 10px;
  2582 + margin-left: 8px;
  2583 + height: 44px;
  2584 +}
  2585 +.newslist li a{
  2586 + color: rgba(0,0,0,.6);
  2587 +}
  2588 +.pos-rel{
  2589 + position: relative;
  2590 +}
  2591 +.pos-abs{
  2592 + position: absolute;
  2593 +}
  2594 +/*轮播 */
  2595 +.news_a {
  2596 + position: relative;
  2597 + overflow: hidden;
  2598 + display: block;
  2599 + width: 100%;
  2600 + height: 272px;
  2601 +}
  2602 +.news_title {
  2603 + display: block;
  2604 + position: absolute;
  2605 + bottom: 0;
  2606 + padding: 10px;
  2607 + width: 100%;
  2608 + background: rgba(0,0,0,0.5);
  2609 + color: #fff;
  2610 + font-size: 16px;
  2611 + border-radius: 0 0 5px 5px;
  2612 + text-align: left;
  2613 +}
  2614 +.news_title p {
  2615 + margin: 0;
  2616 + width: 65%;
  2617 + text-overflow: ellipsis;
  2618 + overflow: hidden;
  2619 + white-space: nowrap;
  2620 +}
  2621 +.news_a img {
  2622 + width: 100%;
  2623 + height: 272px;
  2624 +}
  2625 +.pagination{
  2626 + position: absolute;
  2627 + z-index: 20;
  2628 + right: 10px;
  2629 + bottom: 10px;
  2630 + margin: 0;
  2631 + height: 20px;
  2632 +}
  2633 +.swiper-notification {
  2634 + display: inline-block;
  2635 + width: 28px;
  2636 + height: 6px;
  2637 + border-radius: 0;
  2638 + background: none;
  2639 + margin: 0 5px;
  2640 + opacity: 0.8;
  2641 + border: 1px solid #fff;
  2642 + cursor: pointer;
  2643 +}
  2644 +.swiper-active-switch {
  2645 + background: #fff;
  2646 +}
  2647 +
  2648 +
  2649 +
  2650 +
... ...