Explorar el Código

新闻列表、客户列表开发

Signed-off-by: anderx <312518615@qq.com>
anderx hace 5 años
padre
commit
5efeb6e2be

+ 36 - 1
src/main/java/com/kede/common/controller/WebpageController.java

@@ -95,7 +95,7 @@ public class WebpageController extends BaseController {
 	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/portal/newsDetails", method = RequestMethod.GET)
 	public ModelAndView portalNewsDetails(HttpServletRequest request, ModelAndView modelview,Integer id) {
-		modelview.setViewName("/portal/news/newsDetails");
+		modelview.setViewName("/portal/newsDetails");
 		InputBannerDetails ibd=new InputBannerDetails(1,4);
 		OutBannerDetails o=new OutBannerDetails();
 		List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
@@ -104,6 +104,41 @@ public class WebpageController extends BaseController {
 		modelview.addObject("news",newsService.selectNews(new InputNews(id)));
 		return modelview;
 	}
+	/**
+	 * 新闻列表
+	 * @param request
+	 * @param modelview
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	@RequestMapping(value = "/portal/news", method = RequestMethod.GET)
+	public ModelAndView portalNews(HttpServletRequest request, ModelAndView modelview,Integer id) {
+		modelview.setViewName("/portal/news");
+		InputBannerDetails ibd=new InputBannerDetails(1,4);
+		OutBannerDetails o=new OutBannerDetails();
+		List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
+		o=list.size()>0?list.get(0):null;
+		modelview.addObject("banners",o);
+		return modelview;
+	}
+	
+	/**
+	 * 客户列表
+	 * @param request
+	 * @param modelview
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	@RequestMapping(value = "/portal/client", method = RequestMethod.GET)
+	public ModelAndView portalClient(HttpServletRequest request, ModelAndView modelview,Integer id) {
+		modelview.setViewName("/portal/client");
+		InputBannerDetails ibd=new InputBannerDetails(1,3);
+		OutBannerDetails o=new OutBannerDetails();
+		List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
+		o=list.size()>0?list.get(0):null;
+		modelview.addObject("banners",o);
+		return modelview;
+	}
 	
 	@RequestMapping(value = "/", method = RequestMethod.GET)
 	public ModelAndView home(HttpServletRequest request, ModelAndView modelview) {

+ 3 - 3
src/main/webapp/WEB-INF/views/common.html

@@ -139,9 +139,9 @@
                             </div>
                         </div>
                     </li>
-                    <li><a th:href="${basePath+'/strategic'}">战略合作</a></li>
-                    <li><a th:href="${basePath+'/client'}">服务客户</a></li>
-                    <li><a th:href="${basePath+'/news'}">新闻动态</a></li>
+                    <li><a th:href="${basePath+'/portal/strategic'}">战略合作</a></li>
+                    <li><a th:href="${basePath+'/portal/client'}">服务客户</a></li>
+                    <li><a th:href="${basePath+'/portal/news'}">新闻动态</a></li>
                     <li><a th:href="${basePath+'/portal/aboutKede'}">关于科德</a></li>
                     <li><a th:href="${basePath+'/portal/contactUs'}">联系我们</a></li>
                     </ul>

+ 421 - 0
src/main/webapp/WEB-INF/views/portal/client.html

@@ -0,0 +1,421 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head th:replace="common::header(~{::title},~{::link})">
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>科德信息咨询</title>
+    <link rel="icon" th:href="${portalHost+'/images/icon/kedexinxi.ico'}"  type="image/x-icon">
+    <!-- 二级页面CSS -->
+    <link rel="stylesheet" th:href="${portalHost+'/css/secode.css'}">
+    <!-- 自定义动画样式 -->
+    <link rel="stylesheet" th:href="${portalHost+'/css/swiper.min.css'}">
+</head>
+
+<body>
+    <div class="app">
+        <!-- 头部 -->
+        <header>
+           <div th:replace="common::nav('','')"></div>
+            <!-- 新闻轮播图  -->
+            <div class="swiper-containerx">
+                 <img th:src="${banners}==null?${portalHost+'/images/banner/news_bg.png'}:${avatarUploadHost}+${banners.bannerUrl}" />
+            </div>
+            <!-- 新闻轮播图 end -->
+        </header>
+        <!-- 头部  end -->
+        <!-- 主体内容 -->
+        <div class="client main">
+            <div class="product-title">
+                <h4>服务客户</h4>
+                <p>已为26000+企业,获得国家高新技术企业认证!</p>
+            </div>
+            <div class="container">
+                <div class="client-list">
+                    <div id="trigger1">请选择选择区域、省份</div>
+                    <div class="quyu">
+                        <span>所属区域</span>
+                        <ul>
+                            <li class="active">全国</li>
+                            <li data-id="1">华中</li>
+                            <li data-id="2">华东</li>
+                            <li data-id="3">东北</li>
+                            <li data-id="4">华南</li>
+                            <li data-id="5">华北</li>
+                            <li data-id="6">西南</li>
+                            <li data-id="7">西北</li>
+                        </ul>
+                    </div>
+                    <div class="shengfen">
+                        <span>所属省份</span>
+                        <ul>
+                            
+                        </ul>
+                    </div>
+                </div>
+                <div class="client-list-box">
+                    <div class="client-item">
+                       
+                    </div>
+                    <!-- 分页 -->
+                    <div class="page_2"></div>
+                    <!-- 分页 end -->
+                </div>
+            </div>
+        </div>
+        <!-- 主体内容  end -->
+        <!-- 底部 -->
+        <footer>
+          <div th:replace="common::copyright"></div>
+        </footer>
+        <!-- 底部  end -->
+    </div>
+    
+     <div th:replace="common::footer(~{::script})">
+      
+    <!-- 手机端省级联动 -->
+    <script type="text/javascript">
+        var mobileSelect = new MobileSelect({
+            trigger: '#trigger1',
+            title: '区域/省份-选择',
+            wheels: [
+                {
+                    data: [
+                        {
+                            id: '1',
+                            value: '全国',
+                            childs: [
+                                {
+                                    id: undefined,
+                                    value: "全部"
+                                },
+                                {
+                                    id: "7",
+                                    value: "安徽"
+                                },
+                                {
+                                    id: "15",
+                                    value: "北京"
+                                },
+                                {
+                                    id: "27",
+                                    value: "重庆"
+                                },
+                                {
+                                    id: "8",
+                                    value: "福建"
+                                },
+                                {
+                                    id: "30",
+                                    value: "甘肃"
+                                },
+                                {
+                                    id: "24",
+                                    value: "广东"
+                                },
+                                {
+                                    id: "20",
+                                    value: "广西"
+                                },
+                                {
+                                    id: "25",
+                                    value: "贵州"
+                                },
+                                {
+                                    id: "21",
+                                    value: "海南"
+                                },
+                                {
+                                    id: "13",
+                                    value: "河北"
+                                },
+                                {
+                                    id: "1",
+                                    value: "黑龙江"
+                                },
+                                {
+                                    id: "19",
+                                    value: "河南"
+                                },
+                                {
+                                    id: "22",
+                                    value: "香港"
+                                },
+                                {
+                                    id: "17",
+                                    value: "湖北"
+                                },
+                                {
+                                    id: "18",
+                                    value: "湖南"
+                                },
+                                {
+                                    id: "5",
+                                    value: "江苏"
+                                },
+                                {
+                                    id: "9",
+                                    value: "江西"
+                                },
+                                {
+                                    id: "3",
+                                    value: "辽宁"
+                                },
+                                {
+                                    id: "2",
+                                    value: "吉林"
+                                },
+                                {
+                                    id: "23",
+                                    value: "澳门"
+                                },
+                                {
+                                    id: "14",
+                                    value: "内蒙古"
+                                },
+                                {
+                                    id: "32",
+                                    value: "宁夏"
+                                },
+                                {
+                                    id: "31",
+                                    value: "青海"
+                                },
+                                {
+                                    id: "10",
+                                    value: "山东"
+                                },
+                                {
+                                    id: "4",
+                                    value: "上海"
+                                },
+                                {
+                                    id: "12",
+                                    value: "山西"
+                                },
+                                {
+                                    id: "34",
+                                    value: "陕西"
+                                },
+                                {
+                                    id: "29",
+                                    value: "四川"
+                                },
+                                {
+                                    id: "11",
+                                    value: "台湾"
+                                },
+                                {
+                                    id: "16",
+                                    value: "天津"
+                                },
+                                {
+                                    id: "33",
+                                    value: "新疆"
+                                },
+                                {
+                                    id: "28",
+                                    value: "西藏"
+                                },
+                                {
+                                    id: "26",
+                                    value: "云南"
+                                },
+                                {
+                                    id: "6",
+                                    value: "浙江"
+                                },
+                            ]
+                        },
+                        {
+                            id: '2',
+                            value: '东北',
+                            childs: [
+                                { id: '1', value: '黑龙江' },
+                                { id: '2', value: '吉林' },
+                                { id: '3', value: '辽宁' }
+                            ]
+                        },
+                        {
+                            id: '3',
+                            value: '华东',
+                            childs: [
+                                { id: '4', value: '上海' },
+                                { id: '5', value: '江苏' },
+                                { id: '6', value: '浙江' },
+                                { id: '7', value: '安徽' },
+                                { id: '8', value: '福建' },
+                                { id: '9', value: '江西' },
+                                { id: '10', value: '山东' },
+                                { id: '11', value: '台湾' }
+                            ]
+                        },
+                        {
+                            id: '4',
+                            value: '华北',
+                            childs: [
+                                { id: '15', value: '北京' },
+                                { id: '16', value: '天津' },
+                                { id: '12', value: '山西' },
+                                { id: '13', value: '河北' },
+                                { id: '14', value: '内蒙古' }
+                            ]
+                        },
+                        {
+                            id: '4',
+                            value: '华中',
+                            childs: [
+                                { id: '19', value: '河南' },
+                                { id: '17', value: '湖北' },
+                                { id: '18', value: '湖南' }
+                            ]
+                        },
+                        {
+                            id: '5',
+                            value: '华南',
+                            childs: [
+                                { id: '24', value: '广东' },
+                                { id: '20', value: '广西' },
+                                { id: '21', value: '海南' },
+                                { id: '22', value: '香港' },
+                                { id: '23', value: '澳门' }
+                            ]
+                        },
+                        {
+                            id: '6',
+                            value: '西南',
+                            childs: [
+                                { id: '29', value: '四川' },
+                                { id: '25', value: '贵州' },
+                                { id: '26', value: '云南' },
+                                { id: '27', value: '重庆' },
+                                { id: '28', value: '西藏' }
+                            ]
+                        },
+                        {
+                            id: '6',
+                            value: '西北',
+                            childs: [
+                                { id: '34', value: '陕西' },
+                                { id: '30', value: '甘肃' },
+                                { id: '31', value: '青海' },
+                                { id: '32', value: '宁夏' },
+                                { id: '33', value: '新疆' }
+                            ]
+                        },
+                    ]
+                }
+            ],
+            position: [0, 1],
+            callback: function (indexArr, data) {
+                let province = data[1].id
+                $.ajax({
+                    url: api + "/open/listCustomerCase",
+                    data: {
+                        province
+                    },
+                    type: "GET",
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.error && data.error.length) {
+                            alert("系统繁忙,请刷新页面");
+                        } else {
+                            var dataList = data.data.list;
+                            var html = "";
+                            if (dataList.length) {
+                                for (var d = 0; d < dataList.length; d++) {
+                                    html +=
+                                        "<div><img src=" +
+                                        avatarUploadHost +
+                                        dataList[d].pictureUrl +
+                                        " /></div>";
+                                }
+                                $(".page_ctrl").css({
+                                    display: "block"
+                                });
+                                window.sessionStorage.setItem("total", data.data.totalCount);
+                                window.sessionStorage.setItem("province", province);
+                                page()
+                            } else {
+                                var html = "<h4 style='text-align:center;margin-top:90px;color:#666' >暂无服务客户</h4>"
+                                $(".page_ctrl").css({
+                                    display: "none"
+                                })
+                            }
+                            $(".client-item").html(html);
+                        }
+                    }
+                });
+            }
+        });
+    </script>
+    <!-- 引入分页 -->
+    <script th:src="${portalHost+'/js/page.js'}"></script>
+    <script>
+        function page() {
+            var obj_1 = {
+                obj_box: ".page_2",
+                total_item: +window.sessionStorage.getItem("total"), //总共数据
+                province: +window.sessionStorage.getItem("province"),
+                per_num: 10, //每页显示数据
+                current_page: 1, //当前页
+                change_content: function (per_num, current_page) {
+                    per_num = per_num ? per_num : 10;
+                    current_page = current_page ? current_page : 1;
+                    var province = window.sessionStorage.getItem("province");
+                    if (province == "undefined") {
+                        var data = {
+                            pageNo: current_page
+                        };
+                    } else {
+                        var data = {
+                            province,
+                            pageNo: current_page
+                        };
+                    }
+                    $.ajax({
+                        url: api + "/open/listCustomerCase",
+                        data,
+                        type: "GET",
+                        dataType: "json",
+                        success: function (data) {
+                            if (data.error && data.error.length) {
+                                alert("系统繁忙,请刷新页面");
+                            } else {
+                                var dataList = data.data.list;
+                                var html = "";
+                                if (dataList.length) {
+                                    for (var d = 0; d < dataList.length; d++) {
+                                        html +=
+                                            "<div><img src=" +
+                                            avatarUploadHost +
+                                            dataList[d].pictureUrl +
+                                            " /></div>";
+                                    }
+                                    $(".page_ctrl").css({
+                                        display: "block"
+                                    });
+                                    window.sessionStorage.setItem("total", data.data.totalCount);
+                                    window.sessionStorage.setItem("province", province);
+                                } else {
+                                    var html =
+                                        "<h4 style='text-align:center;margin-top:90px;color:#666' >暂无服务客户</h4>";
+                                    $(".page_ctrl").css({
+                                        display: "none"
+                                    });
+                                }
+                                $(".client-item").html(html);
+                            }
+                        }
+                    });
+                }
+            };
+            //调用分页
+            page_ctrl(obj_1);
+        }
+    </script>
+     </div>
+
+</body>
+
+</html>

+ 65 - 0
src/main/webapp/WEB-INF/views/portal/news.html

@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head th:replace="common::header(~{::title},~{::link})">
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>新闻动态</title>
+    <!-- 二级页面CSS -->
+    <link rel="stylesheet" th:href="${portalHost+'/css/secode.css'}">
+</head>
+
+<body>
+    <div class="app">
+        <!-- 头部 -->
+        <header>
+          <div th:replace="common::nav('','')"></div>
+            <!-- 轮播图  -->
+            <div class="swiper-containerx">
+                <img th:src="${banners}==null?${portalHost+'/images/banner/about_bg.png'}:${avatarUploadHost}+${banners.bannerUrl}" />
+                <div class="swiper_title">
+                    <h6>新闻动态</h6>
+                </div>
+            </div>
+            <!-- 轮播图 end -->
+        </header>
+        <!-- 头部  end -->
+        <!-- 二级导航 -->
+        <div class="secondary-menu">
+            <div class="container">
+                <ul>
+                    <li class="active"><a href="javascript:;">全部</a> </li>
+                    <li><a href="javascript:;">公司公告</a> </li>
+                    <li><a href="javascript:;">行业资讯</a> </li>
+                </ul>
+            </div>
+        </div>
+        <!-- 二级导航 end -->
+        <!-- 主体内容 -->
+        <div class="news main">
+            <div class="container">
+                <!-- 新闻列表 -->
+                <ul class="newslist">
+                    
+                </ul>
+                <!-- 新闻列表  end -->
+                <!-- 分页 -->
+                <div class="page_1"></div>
+                <!-- 分页 end -->
+            </div>
+        </div>
+        <!-- 主体内容  end -->
+        <!-- 底部 -->
+        <footer>
+           	<div th:replace="common::copyright"></div>
+        </footer>
+        <!-- 底部  end -->
+    </div>
+    <div th:replace="common::footer(~{::script})">
+    <!-- 引入分页 -->
+    <script th:src="${portalHost+'/js/page.js'}"></script>
+    <script th:src="${portalHost+'/js/new.js'}"></script>
+    </div>
+</body>
+
+</html>

src/main/webapp/WEB-INF/views/portal/news/newsDetails.html → src/main/webapp/WEB-INF/views/portal/newsDetails.html