易居住房信息平台

HouseController.java

import com.yiju.pojo.HouseView;
import com.yiju.service.IHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Controller
@RequestMapping("house")
public class HouseController {

    @Autowired
    IHouseService houseService;

    @RequestMapping("findFourHouseByType.do")
    public ModelAndView findFourHouseByType(){
        List<HouseView> newHouse = houseService.findFourHouseByType(0);
        List<HouseView> oldHouse = houseService.findFourHouseByType(1);
        List<HouseView> rentHouse = houseService.findFourHouseByType(2);
        ModelAndView mv=new ModelAndView();
        mv.addObject("newHouse",newHouse);
        mv.addObject("oldHouse",oldHouse);
        mv.addObject("rentHouse",rentHouse);
        mv.setViewName("../home");
        return mv;
    }

    @RequestMapping("searchHouseViewByType.do")
    public ModelAndView searchHouseViewByType(int houseType){
        List<HouseView> houses = houseService.searchHouseByType(houseType);
        for(HouseView houseView:houses){
            long createTime = houseView.getCreateTime();
            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
            String ct=sdf.format(new Date(createTime));
            houseView.setDate(ct);
        }
        ModelAndView mv=new ModelAndView();
        mv.addObject("houses",houses);
        if(houseType==0){
            mv.setViewName("newhouse");
        }else if(houseType==1){
            mv.setViewName("oldhouse");
        }else{
            mv.setViewName("renthouse");
        }
        return mv;
    }
}

IHouseView.java

import com.yiju.pojo.HouseView;

import java.util.List;

public interface IHouseDao {
    List<HouseView> findFourHouseByType(int houseType);

    List<HouseView> searchHouseByType(int houseType);
}

HouseView.java

import java.math.BigDecimal;

public class HouseView {

    private int houseId; //房源ID
    private String trueName; //发布人
    private String houseTitle; //房源标题
    private String houseHeadimg; //房源帖子头像
    private BigDecimal housePrice; //房屋价格
    private String priceUnit; //售价单位:元/每月 元/套 元/年
    private int houseFloor; //楼层
    private int floorAll; //全部楼层
    private String houseAddress; //房源地址
    private String houseLayout; //几室几厅几卫
    private String houseDecorate; //精装,简装
    private String houseArea; //房间面积
    private long createTime; //创建时间
    private String houseTurn; //房屋朝向
    private String houseNature; //房屋性质
    private String houseModel; //房屋类型
    private String houseYear; //建造年份
    private String houseValid; //有效期
    private int houseLift; //是否有电梯
    private String housePlanimg1;
    private String housePlanimg2;
    private String houseImg1; //房源室内图1
    private String houseImg2; //房源室内图2
    private String houseImg3; //房源室内图3
    private String houseImg4; //房源室内图4
    private String houseImg5; //房源室内图5
    private String houseImg6; //房源室内图6
    private String date; //获取年月日
    private int bed; //床:0无 1有
    private int washing; //洗衣机:0无 1有
    private int air; //空调: 0无 1有
    private int balcony; //阳台:0无 1有
    private int ice; //冰箱:0无 1有
    private int toilet; //卫生间:0无 1有
    private int kitchen; //厨房:0无 1有
    private int tv; //电视:0无 1有
    private int heater; //热水器:0无 1有
    private int wardrobe; //衣柜:0无 1有
    private int heating; //暖气:0无 1有
    private int internet; //宽带:0无 1有
    private int sofa; //沙发:0无 1有
    private int houseType;//房子: 0新房 1旧房 2租房

    public int getHouseId() {
        return houseId;
    }

    public void setHouseId(int houseId) {
        this.houseId = houseId;
    }

    public String getTrueName() {
        return trueName;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public String getHouseTitle() {
        return houseTitle;
    }

    public void setHouseTitle(String houseTitle) {
        this.houseTitle = houseTitle;
    }

    public String getHouseHeadimg() {
        return houseHeadimg;
    }

    public void setHouseHeadimg(String houseHeadimg) {
        this.houseHeadimg = houseHeadimg;
    }

    public BigDecimal getHousePrice() {
        return housePrice;
    }

    public void setHousePrice(BigDecimal housePrice) {
        this.housePrice = housePrice;
    }

    public String getPriceUnit() {
        return priceUnit;
    }

    public void setPriceUnit(String priceUnit) {
        this.priceUnit = priceUnit;
    }

    public int getHouseFloor() {
        return houseFloor;
    }

    public void setHouseFloor(int houseFloor) {
        this.houseFloor = houseFloor;
    }

    public int getFloorAll() {
        return floorAll;
    }

    public void setFloorAll(int floorAll) {
        this.floorAll = floorAll;
    }

    public String getHouseAddress() {
        return houseAddress;
    }

    public void setHouseAddress(String houseAddress) {
        this.houseAddress = houseAddress;
    }

    public String getHouseLayout() {
        return houseLayout;
    }

    public void setHouseLayout(String houseLayout) {
        this.houseLayout = houseLayout;
    }

    public String getHouseDecorate() {
        return houseDecorate;
    }

    public void setHouseDecorate(String houseDecorate) {
        this.houseDecorate = houseDecorate;
    }

    public String getHouseArea() {
        return houseArea;
    }

    public void setHouseArea(String houseArea) {
        this.houseArea = houseArea;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getHouseTurn() {
        return houseTurn;
    }

    public void setHouseTurn(String houseTurn) {
        this.houseTurn = houseTurn;
    }

    public String getHouseNature() {
        return houseNature;
    }

    public void setHouseNature(String houseNature) {
        this.houseNature = houseNature;
    }

    public String getHouseModel() {
        return houseModel;
    }

    public void setHouseModel(String houseModel) {
        this.houseModel = houseModel;
    }

    public String getHouseYear() {
        return houseYear;
    }

    public void setHouseYear(String houseYear) {
        this.houseYear = houseYear;
    }

    public String getHouseValid() {
        return houseValid;
    }

    public void setHouseValid(String houseValid) {
        this.houseValid = houseValid;
    }

    public int getHouseLift() {
        return houseLift;
    }

    public void setHouseLift(int houseLift) {
        this.houseLift = houseLift;
    }

    public String getHousePlanimg1() {
        return housePlanimg1;
    }

    public void setHousePlanimg1(String housePlanimg1) {
        this.housePlanimg1 = housePlanimg1;
    }

    public String getHousePlanimg2() {
        return housePlanimg2;
    }

    public void setHousePlanimg2(String housePlanimg2) {
        this.housePlanimg2 = housePlanimg2;
    }

    public String getHouseImg1() {
        return houseImg1;
    }

    public void setHouseImg1(String houseImg1) {
        this.houseImg1 = houseImg1;
    }

    public String getHouseImg2() {
        return houseImg2;
    }

    public void setHouseImg2(String houseImg2) {
        this.houseImg2 = houseImg2;
    }

    public String getHouseImg3() {
        return houseImg3;
    }

    public void setHouseImg3(String houseImg3) {
        this.houseImg3 = houseImg3;
    }

    public String getHouseImg4() {
        return houseImg4;
    }

    public void setHouseImg4(String houseImg4) {
        this.houseImg4 = houseImg4;
    }

    public String getHouseImg5() {
        return houseImg5;
    }

    public void setHouseImg5(String houseImg5) {
        this.houseImg5 = houseImg5;
    }

    public String getHouseImg6() {
        return houseImg6;
    }

    public void setHouseImg6(String houseImg6) {
        this.houseImg6 = houseImg6;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getBed() {
        return bed;
    }

    public void setBed(int bed) {
        this.bed = bed;
    }

    public int getWashing() {
        return washing;
    }

    public void setWashing(int washing) {
        this.washing = washing;
    }

    public int getAir() {
        return air;
    }

    public void setAir(int air) {
        this.air = air;
    }

    public int getBalcony() {
        return balcony;
    }

    public void setBalcony(int balcony) {
        this.balcony = balcony;
    }

    public int getIce() {
        return ice;
    }

    public void setIce(int ice) {
        this.ice = ice;
    }

    public int getToilet() {
        return toilet;
    }

    public void setToilet(int toilet) {
        this.toilet = toilet;
    }

    public int getKitchen() {
        return kitchen;
    }

    public void setKitchen(int kitchen) {
        this.kitchen = kitchen;
    }

    public int getTv() {
        return tv;
    }

    public void setTv(int tv) {
        this.tv = tv;
    }

    public int getHeater() {
        return heater;
    }

    public void setHeater(int heater) {
        this.heater = heater;
    }

    public int getWardrobe() {
        return wardrobe;
    }

    public void setWardrobe(int wardrobe) {
        this.wardrobe = wardrobe;
    }

    public int getHeating() {
        return heating;
    }

    public void setHeating(int heating) {
        this.heating = heating;
    }

    public int getInternet() {
        return internet;
    }

    public void setInternet(int internet) {
        this.internet = internet;
    }

    public int getSofa() {
        return sofa;
    }

    public void setSofa(int sofa) {
        this.sofa = sofa;
    }

    public int getHouseType() {
        return houseType;
    }

    public void setHouseType(int houseType) {
        this.houseType = houseType;
    }

    @Override
    public String toString() {
        return "HouseView{" +
                "houseId=" + houseId +
                ", trueName='" + trueName + '\'' +
                ", houseTitle='" + houseTitle + '\'' +
                ", houseHeadimg='" + houseHeadimg + '\'' +
                ", housePrice=" + housePrice +
                ", priceUnit='" + priceUnit + '\'' +
                ", houseFloor=" + houseFloor +
                ", floorAll=" + floorAll +
                ", houseAddress='" + houseAddress + '\'' +
                ", houseLayout='" + houseLayout + '\'' +
                ", houseDecorate='" + houseDecorate + '\'' +
                ", houseArea='" + houseArea + '\'' +
                ", createTime=" + createTime +
                ", houseTurn='" + houseTurn + '\'' +
                ", houseNature='" + houseNature + '\'' +
                ", houseModel='" + houseModel + '\'' +
                ", houseYear='" + houseYear + '\'' +
                ", houseValid='" + houseValid + '\'' +
                ", houseLift=" + houseLift +
                ", housePlanimg1='" + housePlanimg1 + '\'' +
                ", housePlanimg2='" + housePlanimg2 + '\'' +
                ", houseImg1='" + houseImg1 + '\'' +
                ", houseImg2='" + houseImg2 + '\'' +
                ", houseImg3='" + houseImg3 + '\'' +
                ", houseImg4='" + houseImg4 + '\'' +
                ", houseImg5='" + houseImg5 + '\'' +
                ", houseImg6='" + houseImg6 + '\'' +
                ", date='" + date + '\'' +
                ", bed=" + bed +
                ", washing=" + washing +
                ", air=" + air +
                ", balcony=" + balcony +
                ", ice=" + ice +
                ", toilet=" + toilet +
                ", kitchen=" + kitchen +
                ", tv=" + tv +
                ", heater=" + heater +
                ", wardrobe=" + wardrobe +
                ", heating=" + heating +
                ", internet=" + internet +
                ", sofa=" + sofa +
                ", houseType=" + houseType +
                '}';
    }
}

HouseServiceimpl.java

import com.yiju.dao.IHouseDao;
import com.yiju.pojo.HouseView;
import com.yiju.service.IHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HouseServiceimpl implements IHouseService {

    @Autowired
    IHouseDao houseDao;

    @Override
    public List<HouseView> findFourHouseByType(int houseType) {
        return houseDao.findFourHouseByType(houseType);
    }


    @Override
    public List<HouseView> searchHouseByType(int houseType) {
        return houseDao.searchHouseByType(houseType);
    }
}

IHouseService.java

import com.yiju.pojo.HouseView;

import java.util.List;

public interface IHouseService {
    List<HouseView> findFourHouseByType(int houseType);

    List<HouseView> searchHouseByType(int houseType);
}

HouseMapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yiju.dao.IHouseDao" >
    <select id="findFourHouseByType" resultType="com.yiju.pojo.HouseView" parameterType="int">
        SELECT * FROM tb_house a,tb_house_info  b WHERE a.house_id=b.house_id AND a.is_delete=0 AND a.house_type=#{houseType}
        order by rand() limit 4
    </select>

    <select id="searchHouseByType" parameterType="int" resultType="com.yiju.pojo.HouseView">
        select * from tb_house a,tb_house_info b,tb_user c where a.is_delete=0 and a.house_id=b.house_id
        and a.user_id=c.user_id and a.house_type=#{houseType}
        order by a.house_id desc
    </select>
</mapper>

index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<jsp:forward page="${pageContext.request.contextPath}/house/findFourHouseByType.do"></jsp:forward>
</body>
</html>

home.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>易居住房信息平台</title>

    <!--    下面是几个导入的包-->
    <link type="text/css" href="css/css.css" rel="stylesheet"/>
    <link type="text/css" href="css/searchInputStyle.css" rel="stylesheet"/>
    <link type="text/css" href="css/searchReset.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery2.min.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <!--    上面是几个导入的包-->

    <%--轮播图的CSS--%>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        li {
            list-style: none;
        }

        #adv {
            /*margin:110px auto;*/
            width: 1190px;
            position: relative;
        }

        #adv li {
            display: none;
        }

        #adv .show {
            display: block;
        }

        #next, #prev {
            position: absolute;
            top: 45%;
            cursor: pointer;
            transition: all .5s;
            opacity: .7;
        }

        #next:hover, #prev:hover {
            transform: scale(1.1);
            opacity: 1;
        }

        #prev {
            left: 10px;
            height: 15%;
        }

        #next {
            right: 10px;
            height: 15%;
        }
    </style>

</head>
<body>
<jsp:include page="/pages/basehead.jsp"></jsp:include>
<!--头部最上方的框-->

<!--Logo栏和手机号栏-->
<div class="logo-phone">
    <div class="width1190">
        <table align="center" width="100%">
            <tr>
                <td>
                    <h1 class="logo"><a href="index.jsp"><img src="images/logo.png" width="163" height="59"/></a></h1>
                </td>
                <td>
                    <div class="searchbox">
                        <div class="mod_select">
                            <div class="select_box">
                                <span class="select_txt">房屋</span>
                            </div>
                        </div>
                        <%--FIXME 这里是搜索栏,需要实现相应的模糊搜索功能 --%>
                        <form action="#" >
                            <input type="text" name="house_title" id="searchPlaceholder" class="import" placeholder="请输入搜索信息">
                            <input type="submit" value="搜   索" class="btn-search">
                        </form>
                    </div>
                </td>
                <td align="center">
                    <div class="phones"><strong>000-00000000</strong></div>
                    <div class="clears"></div>
                </td>

            </tr>
        </table>
    </div><!--width1190/-->
</div><!--logo-phone/-->
<!--Logo栏和手机号栏-->

<!--导航栏-->
<div class="list-nav">
    <div class="width1190">
        <ul class="nav">
            <li><a href="index.jsp">首页</a></li>
            <li><a href="#">新房</a></li>
            <li><a href="#">二手房</a></li>
            <li><a href="#">租房</a></li>
            <li class="zhiding"><a href="#">指定购房</a></li>
            <li><a href="#">发布房源</a></li>
            <li><a href="#">公告中心</a></li>
            <li><a href="#">关于我们</a></li>
            <div class="clears"></div>
        </ul><!--nav-->
        <div class="clears"></div>
    </div><!--width1190-->
</div><!--list-nav-->
<!--导航栏End-->

<br>

<!--广告轮播栏-->
<div class="width1190">
    <ul id="adv">
        <li style="display: block;"><img src="images/lunbotu/fang1.jpg" alt="" id="pic"></li>
        <img src="images/lunbotu/l.png" id="prev" alt="" onclick="showPre()">
        <img src="images/lunbotu/r.png" id="next" alt="" onclick="showNext()">
    </ul>
</div>
<%--广告轮播栏End --%>

<%--展示主页推荐栏--%>
<div class="content">
    <div class="width1190">
        <%--【新房推荐】--%>
        <%--FIXME 这里添加跳转事件--%>
        <h2 class="title"><a style="color:#F1323B">❤</a>新房推荐<a href="${pageContext.request.contextPath}/house/searchHouseViewByType.do?houseType=0">更多&gt;&gt;</a></h2>
            <div class="index-fang-list">
                <%--FIXME 这里使用Foreach循环,从数据库读取房屋信息 --%>
                <c:forEach var="nh" items="${newHouse}">
                <dl>
                    <dt><a href="#"><img src="http://image.cxhit.com/${nh.houseHeadimg}" width="286"
                                         height="188"/></a></dt>
                    <dd>
                        <h3><a href="#">${nh.houseTitle}</a></h3>
                        <div class="hui">${nh.houseLayout} | ${nh.houseArea}m² | ${nh.houseDecorate}</div>
                    </dd>
                </dl>
                </c:forEach>
                <div class="clears"></div>
            </div><!--index-fang-list/-->
            <%----%>

        <%--旧房推荐--%>
        <h2 class="title"><a style="color:#F1323B">❤</a>二手房推荐 <a href="${pageContext.request.contextPath}/house/searchHouseViewByType.do?houseType=1">更多&gt;&gt;</a></h2>
        <div class="index-fang-list">
            <c:forEach var="oh" items="${oldHouse}">
            <dl>
                <dt><a href="#"><img src="http://image.cxhit.com/${oh.houseHeadimg}" width="286"
                                    height="188"/></a></dt>
                <dd>
                    <h3><a href="#">${oh.houseTitle}</a></h3>
                    <div class="hui">${oh.houseLayout} | ${oh.houseArea}m² | ${oh.houseDecorate}</div>
                </dd>
            </dl>
            </c:forEach>
            <div class="clears"></div>
        </div><!--index-fang-list/-->

        <%--【二手房推荐】--%>
        <h2 class="title"><a style="color:#F1323B">❤</a>租房推荐 <a
                href="${pageContext.request.contextPath}/house/searchHouseViewByType.do?houseType=2">更多&gt;&gt;</a></h2>
        <div class="index-ershou">

            <%--左侧栏--%>
            <div class="in-er-left">
                <a href="#"><img src="images/fangt1.jpg" width="380" height="285"/></a>
                <div class="in-er-left-text"><strong class="fl">闵行南方发的撒的发的司法</strong><strong
                        class="fr alignRight">¥2841</strong></div>
            </div><!--in-er-left/-->

            <%--右侧栏--%>
            <div class="in-er-right">
                <c:forEach var="rh" items="${rentHouse}">
                <dl>
                    <dt><a href="#"><img src="http://image.cxhit.com/${rh.houseHeadimg}"
                            style="width: 150px; height: 115px;" width="150" height="115"/></a></dt>
                    <dd>
                        <h3>
                            <a href="#">${rh.houseTitle}</a>
                        </h3>
                        <br>
                        <div class="in-er-right-text">
                            ${rh.houseAddress}
                        </div>
                        <div class="price">¥<strong>${rh.housePrice}${rh.priceUnit}</strong></div>
                    </dd>
                    <div class="clears"></div>
                </dl>
                </c:forEach>
                <div class="clears"></div>

            </div><!--in-er-right/-->
            <div class="clears"></div>
        </div><!--index-ershou/-->
        <%--【二手房推荐END】--%>

    </div><!--width1190/-->
</div><!--content/-->

<!--这是页脚-->
<jsp:include page="/pages/basefoot.jsp"></jsp:include>

</body>
</html>

basehead.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>页头</title>
    <!--    下面是几个导入的包-->
    <link type="text/css" href="../css/css.css" rel="stylesheet" />
    <script type="text/javascript" src="../js/js.js"></script>
</head>
<body>

<!--头部最上方的框-->
<div class="header">
    <div class="width1190">
        <div class="fl" style="font-size: 14px">您好,欢迎来到<a href="../index.jsp">易居住房信息平台!</a></div>
        <div class="fr">
            <a href="#" style="font-size: 14px" target="_blank"><strong>登录</strong></a> |
            <a href="#" style="font-size: 14px" target="_blank"><strong>注册</strong></a>
            <a  style="font-size: 14px">欢迎使用</a> |
            <a href="#" style="font-size: 14px" target="_blank"><strong>个人中心</strong></a> |
            <a href="#" style="font-size: 14px"><strong>退出</strong></a> |
            <a href="javascript:;" onclick="" style="font-size: 14px">加入收藏</a> |
            <a href="javascript:;" onclick="" style="font-size: 14px">设为首页</a>
        </div>
        <div class="clears"></div>
    </div><!--width1190/-->
</div>
<!--头部最上方的框-->

</body>
</html>

details.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;

%>

<html>
<head>
   <title>房源详情页</title>

    <%--导入CSS文件--%>
    <link type="text/css" href="../css/css.css" rel="stylesheet" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Author" contect="http://www.webqin.net">
    <link rel="shortcut icon" href="../images/favicon.ico" />
    <scrip src="../js/jquery-2.1.1.min.js"></scrip>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/js.js"></script>
</head>



<body>
<!--头部最上方的框-->
<jsp:include page="../pages/basehead.jsp"></jsp:include>
<!--头部最上方的框-->

<!--Logo栏和手机号栏-->
<div class="logo-phone">
    <div class="width1190">

        <table align="center" width="100%">
            <tr>
                <td>
                    <h1 class="logo"><a href="../index.jsp"><img src="../images/logo.png" width="163" height="59" /></a></h1>
                </td>
                <td align="center">
                    <div class="phones"><strong>000-00000000</strong></div>
                    <div class="clears"></div>
                </td>

            </tr>
        </table>
    </div><!--width1190/-->
</div><!--logo-phone/-->
<!--Logo栏和手机号栏 END-->

<!--导航栏-->
<div class="list-nav">
    <div class="width1190">
        <ul class="nav">
            <li><a href="../index.jsp">首页</a></li>
            <li><a href="#">新房</a></li>
            <li><a href="#">二手房</a></li>
            <li><a href="#">租房</a></li>
            <li class="zhiding"><a href="#">指定购房</a></li>
            <li><a href="#">发布房源</a></li>
            <li><a href="#">公告中心</a></li>
            <li><a href="#">关于我们</a></li>
            <div class="clears"></div>
        </ul><!--nav-->
        <div class="clears"></div>
    </div><!--width1190-->
</div><!--list-nav-->
<!--导航栏End-->

<div class="content">
    <div class="width1190">
        <p style="font-size: 16px">当前位置:<a href="../index.jsp">首页</a> >> <a href="#">房源详情</a></p>
    </div>
</div>

<%--显示房屋详情--%>
<div class="content">
    <div class="width1190" style="width:1000px;">
        <div class="proImg fl">
            <img src="http://image.cxhit.com/${houseInfo.houseHeadimg}" />
        </div><!--proImg/-->
        <div style="width:535px;margin:30px 0;float: right;">
            <h3 class="proTitle">houseTitle </h3>

            <div class="proText1">

                <table width="90%" align="left" cellspacing="5" cellpadding="5" style="font-size: 130%">
                    <tr>
                        <td>房屋编号:<a name="house_id">houseId</a></td>
                        <td>房屋性质:houseNature</td>
                    </tr>
                    <tr>
                        <td>装  修:houseDecorate</td>
                        <td>售  价:housePrice priceUnit</td>
                    </tr>
                    <tr>
                        <td>面  积:houseArea㎡</td>
                        <td>户  型:houseLayout</td>
                    </tr>
                    <tr>
                        <td>朝  向:houseTurn</td>
                        <td>配套电梯:
                           有
                        </td>
                    </tr>
                    <tr>
                        <td>房屋类型:houseModel</td>
                        <td>楼  层:houseFloor层/floorAll层</td>
                    </tr>
                    <tr>
                        <td>建造年份:houseYear</td>
                        <td>居住期限:houseValid </td>
                    </tr>
                    <tr>
                        <td colspan="2">所在小区:houseAddress</td>
                    </tr>
                    <%--<tr><td colspan="2">&nbsp;</td></tr>--%>
                </table>
            </div>
            <div class="xun-car">
                <input class="pricebutton" type="button" value="¥ housePrice priceUnit">
                <input class="collectbutton" type="button" value="关注房源">
                <%--<a href="javascript:;" class="xwjg">¥<strong>${houseInfo.house_price}</strong>${houseInfo.price_unit}</a>--%>
                <%--<a href="/user/follow.do?house_id=${houseInfo.house_id}" class="projrgwc">关注房源</a>--%>
            </div>

        </div><!--proText/-->
        <div class="clears"></div>
    </div><!--width1190/-->

    <%--下面是房源详情页--%>
    <div class="proBox" style="width:1000px;margin:10px auto;">
        <div class="proEq">
            <ul class="fl">
                <li class="proEqCur">房源图片</li>
                <li>小区介绍</li>
                <li>用户评价</li>
            </ul>
            <div class="clears"></div>
        </div><!--proEq/-->

        <div class="proList">
            <h2 class="title"><a style="color:#F1323B"> </a>房源平面图</h2>
            <br>
            <c:if test="${!empty houseInfo.housePlanimg1}">
                <img src="http://image.cxhit.com/${houseInfo.housePlanimg1}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.housePlanimg2}">
                <img src="http://image.cxhit.com/${houseInfo.housePlanimg2}" style="width: 286px;height: 188px"/>
            </c:if>
            <h2 class="title"><a style="color:#F1323B"> </a>房源内饰图</h2>
            <br>
            <c:if test="${!empty houseInfo.houseImg1}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg1}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.houseImg2}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg2}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.houseImg3}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg3}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.houseImg4}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg4}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.houseImg5}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg5}" style="width: 286px;height: 188px"/>
            </c:if>
            <c:if test="${!empty houseInfo.houseImg6}">
                <img src="http://image.cxhit.com/${houseInfo.houseImg6}" style="width: 286px;height: 188px"/>
            </c:if>

        </div><!--proList/-->
        <div class="proList">
            暂无信息...
        </div>
        <div class="proList">
            暂无评论……
        </div>
        <!--proList/-->
    </div><!--proBox/-->
</div><!--content/-->

<%--引入页脚--%>
<iframe src="../pages/basefoot.jsp"frameborder="0" scrolling="no" height="263px" width="100%"></iframe>

</body>
</html>

basefoot.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>页脚</title>
    <link type="text/css" href="../css/css.css" rel="stylesheet" />
</head>
<body>

<!--这是页脚-->
<div class="xinren">
    <div class="width1190">
        <table>
            <tr>
                <td>
                    <dl style="background:url(../images/icon1.jpg) left center no-repeat;">
                        <dt>承诺</dt>
                        <dd>真实可信100%真房源<br />链家承诺,假一赔百</dd>
                    </dl>
                </td>

                <td>
                    <dl style="background:url(../images/icon2.jpg) left center no-repeat;">
                        <dt>权威</dt>
                        <dd>独家房源 覆盖全城<br />房源信息最权威覆盖最广</dd>
                    </dl>
                </td>

                <td>
                    <dl style="background:url(../images/icon3.jpg) left center no-repeat;">
                        <dt>信赖</dt>
                        <dd>万名置业顾问 专业服务<br />百万家庭的信赖之选</dd>
                    </dl>
                </td>

                <td>
                    <dl style="background:url(../images/icon4.jpg) left center no-repeat;">
                        <dt>安全</dt>
                        <dd>安心承诺 保驾护航<br />多重风险防范机制 无后顾之忧</dd>
                    </dl>
                </td>
            </tr>
        </table>
        <div class="clears"></div>
    </div><!--width1190/-->
</div><!--xinren/-->


<div class="footer">
    <div class="width1190">
        <!-- FIXME 这里把各个连接更换-->
        <div class="fl"><a href="/index.jsp" target="_blank"><strong>易居平台</strong></a><a href="#">关于我们</a><a href="#">联系我们</a><a href="#" target="_blank">个人中心</a></div>
        <div class="fr">
            <dl>
                <!-- FIXME 这里把图片更换-->
                <dt><img src="../images/erweima.png" width="76" height="76" /></dt>
                <dd>微信扫一扫<br />房价点评,精彩发布</dd>
            </dl>
            <dl>
                <dt><img src="../images/erweima.png" width="76" height="76" /></dt>
                <dd>微信扫一扫<br />房价点评,精彩发布</dd>
            </dl>
            <div class="clears"></div>
        </div>
        <div class="clears"></div>
    </div><!--width1190/-->
</div><!--footer/-->


<div class="copy">Copyright@ 2019 易居住房交易平台  鄂ICP备19009914号-1&nbsp;&nbsp;&nbsp;&nbsp;技术支持:<a target="_blank" href="#">中软国际</a> </div>

</body>
</html>

newhouse.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ page import="java.util.List" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: 36353
  Date: 2019-07-04
  Time: 22:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>新房房源列表</title>

    <%--导入CSS文件--%>
    <link type="text/css" href="../css/css.css" rel="stylesheet"/>
    <%--导航栏的JS--%>
    <script type="text/javascript" src="../js/js.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <%--搜索框的css--%>
    <link type="text/css" href="../css/searchInputStyle.css" rel="stylesheet"/>
    <link type="text/css" href="../css/searchReset.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery2.min.js"></script>

</head>


<body>

<!--头部最上方的框-->
<jsp:include page="../pages/basehead.jsp"></jsp:include>
<!--头部最上方的框-->


<%--<div class="content">--%>
<div class="width1190">
    <p style="font-size: 16px">当前位置:<a href="../index.jsp">首页</a> >> <a
            href="/house/searchHouseViewByType.do?house_type=0&page=1&size=6">新房房源</a></p>
</div>

<%--</div>--%>

<%--房源列表--%>

<div class="content">
    <div class="width1190">
        <form action="" method="get" class="pro-search">
            <div class="paixu">
                <strong>排序:</strong>
                <a href="javascript:;" class="pai-cur">默认</a>
                <a href="javascript:;">价格 &or;</a>
                <a href="javascript:;">最新 &or;</a>
            </div>
        </form><!--pro-search/-->
    </div><!--width1190/-->
    <div class="width1190">
        <div class="pro-left">
            <%--房屋信息分页显示--%>
            <c:forEach var="house" items="${houses}">
                <dl>
                    <dt><a href="#"><img
                            src="http://image.cxhit.com/${house.houseHeadimg}" style="width:286px;height:188px"
                            width="286" height="188"/></a></dt>
                    <dd>
                        <h3><a href="#">${house.houseTitle}</a></h3>
                        <div class="pro-wei">
                            <img src="../images/weizhi.png" width="12" height="16" style="width:12px;height:16px"/>
                            <strong class="red">${house.houseAddress}</strong>
                        </div>
                        <div class="pro-fang">${house.houseLayout} ${house.houseArea}平 ${house.houseTurn} ${house.houseFloor}层/${house.floorAll}层</div>
                        <div class="pra-fa">发布人:${house.trueName}先生 发布时间:${house.date}</div>
                    </dd>
                    <div class="price">¥ <strong>${house.housePrice}</strong><span
                            class="font12">${house.priceUnit}</span></div>
                    <div class="clears"></div>
                </dl>
            </c:forEach>

            <%--分页按钮--%>
            <div class="pull-right">
                <ul class="pagination">
                    <li><a href="#" aria-label="Previous">首页</a></li>
                    <li><a href="#">上一页</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">下一页</a></li>
                    <li><a href="#" aria-label="Next">尾页</a></li>
                </ul>
            </div><!--底部分页栏-->
        </div><!--pro-left/-->

        <div class="pro-right">
            <h2 class="right-title">推荐房源</h2>
            <div class="right-pro">
                <c:forEach var="randomHouse" items="${randomHouses}">
                    <dl>
                        <dt><a href="#"><img
                                src="http://image.cxhit.com/${randomHouse.houseHeadimg}"
                                style="width: 135px; height: 88px"/></a></dt>
                        <dd>
                            <h3>
                                <a href="#">${randomHouse.houseTitle}</a>
                            </h3>
                            <div class="pro-fang">${randomHouse.houseLayout} ${randomHouse.houseArea}平
                                朝${randomHouse.houseTurn}</div>
                            <div class="right-price">${randomHouse.housePrice}${randomHouse.priceUnit}</div>
                        </dd>
                    </dl>
                </c:forEach>
            </div><!--right-pro/-->
        </div><!--pro-right/-->
        <div class="clears"></div>
    </div><!--width1190/-->
</div><!--content/-->

<%--显示页脚--%>
<jsp:include page="../pages/basefoot.jsp"></jsp:include>


</body>
</html>

oldhouse.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 36353
  Date: 2019-07-04
  Time: 22:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>二手房房源列表</title>

    <%--导入CSS文件--%>
    <link type="text/css" href="../css/css.css" rel="stylesheet"/>
    <%--导航栏的JS--%>
    <script type="text/javascript" src="../js/js.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <%--搜索框的css--%>
    <link type="text/css" href="../css/searchInputStyle.css" rel="stylesheet"/>
    <link type="text/css" href="../css/searchReset.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery2.min.js"></script>

</head>


<body>

<!--头部最上方的框-->
<jsp:include page="../pages/basehead.jsp"></jsp:include>
<!--头部最上方的框-->

<%--<div class="content">--%>
<div class="width1190">
    <p style="font-size: 16px">当前位置:<a href="../index.jsp">首页</a> >> <a
            href="#">旧房房源</a></p>
</div>

<%--</div>--%>

<%--房源列表--%>

<div class="content">
    <div class="width1190">
        <form action="#" method="get" class="pro-search">
            <div class="paixu">
                <strong>排序:</strong>
                <a href="javascript:;" class="pai-cur">默认</a>
                <a href="javascript:;">价格 &or;</a>
                <a href="javascript:;">最新 &or;</a>
            </div>
        </form><!--pro-search/-->
    </div><!--width1190/-->
    <div class="width1190">
        <div class="pro-left">
            <%--房屋信息分页显示--%>
            <c:forEach var="house" items="${houses}">
                <dl>
                    <dt><a href="#"><img
                            src="http://image.cxhit.com/${house.houseHeadimg}" style="width:286px;height:188px"
                            width="286" height="188"/></a></dt>
                    <dd>
                        <h3><a href="#">${house.houseTitle}</a></h3>
                        <div class="pro-wei">
                            <img src="../images/weizhi.png" width="12" height="16" style="width:12px;height:16px"/>
                            <strong class="red">${house.houseAddress}</strong>
                        </div>
                        <div class="pro-fang">${house.houseLayout} ${house.houseArea}平 ${house.houseTurn} ${house.houseFloor}层/${house.floorAll}层</div>
                        <div class="pra-fa">发布人:${house.trueName}先生 发布时间:${house.date}</div>
                    </dd>
                    <div class="price">¥ <strong>${house.housePrice}</strong><span
                            class="font12">${house.priceUnit}</span></div>
                    <div class="clears"></div>
                </dl>
            </c:forEach>

            <%--分页按钮--%>
            <div class="pull-right">
                <ul class="pagination">
                    <li><a href="#" aria-label="Previous">首页</a></li>
                    <li><a href="#">上一页</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">下一页</a></li>
                    <li><a href="#" aria-label="Next">尾页</a></li>
                </ul>
            </div><!--底部分页栏-->
        </div><!--pro-left/-->

        <div class="pro-right">
            <h2 class="right-title">推荐房源</h2>
            <div class="right-pro">
                <c:forEach var="randomHouse" items="${randomHouses}">
                    <dl>
                        <dt><a href="#"><img
                                src="http://image.cxhit.com/${randomHouse.houseHeadimg}"
                                style="width: 135px; height: 88px"/></a></dt>
                        <dd>
                            <h3>
                                <a href="#">${randomHouse.houseTitle}</a>
                            </h3>
                            <div class="pro-fang">${randomHouse.houseLayout} ${randomHouse.houseArea}平
                                朝${randomHouse.houseTurn}</div>
                            <div class="right-price">${randomHouse.housePrice}${randomHouse.priceUnit}</div>
                        </dd>
                    </dl>
                </c:forEach>
            </div><!--right-pro/-->
        </div><!--pro-right/-->
        <div class="clears"></div>
    </div><!--width1190/-->
</div><!--content/-->

<%--显示页脚--%>
<!--这是页脚-->
<jsp:include page="../pages/basefoot.jsp"></jsp:include>


</body>
</html>

renthouse.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>租房房源列表</title>

    <%--导入CSS文件--%>
    <link type="text/css" href="../css/css.css" rel="stylesheet"/>
    <%--导航栏的JS--%>
    <script type="text/javascript" src="../js/js.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <%--搜索框的css--%>
    <link type="text/css" href="../css/searchInputStyle.css" rel="stylesheet"/>
    <link type="text/css" href="../css/searchReset.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery2.min.js"></script>
</head>

<body>

<!--头部最上方的框-->
<jsp:include page="../pages/basehead.jsp"></jsp:include>
<!--头部最上方的框-->


<%--<div class="content">--%>
<div class="width1190">
    <p style="font-size: 16px">当前位置:<a href="../index.jsp">首页</a> >> <a
            href="#">租房</a></p>
</div>

<%--</div>--%>

<%--房源列表--%>

<div class="content">
    <div class="width1190">
        <form action="#" method="get" class="pro-search">
            <div class="paixu">
                <strong>排序:</strong>
                <a href="javascript:;" class="pai-cur">默认</a>
                <a href="javascript:;">价格 &or;</a>
                <a href="javascript:;">最新 &or;</a>
            </div>
        </form><!--pro-search/-->
    </div><!--width1190/-->
    <div class="width1190">
        <div class="pro-left">
            <%--房屋信息分页显示--%>
            <c:forEach var="house" items="${renthouse}">
                <dl>
                    <dt><a href="#"><img
                            src="http://image.cxhit.com/${house.houseHeadimg}" style="width:286px;height:188px"
                            width="286" height="188"/></a></dt>
                    <dd>
                        <h3><a href="#">${house.houseTitle}</a></h3>
                        <div class="pro-wei">
                            <img src="../images/weizhi.png" width="12" height="16" style="width:12px;height:16px"/>
                            <strong class="red">${house.houseAddress}</strong>
                        </div>
                        <div class="pro-fang">${house.houseLayout} ${house.houseArea}平 ${house.houseTurn} ${house.houseFloor}层/${house.floorAll}层</div>
                        <div class="pra-fa">发布人:${house.trueName}先生 发布时间:${house.date}</div>
                    </dd>
                    <div class="price">¥ <strong>${house.housePrice}</strong><span
                            class="font12">${house.priceUnit}</span></div>
                    <div class="clears"></div>
                </dl>
            </c:forEach>

            <%--分页按钮--%>
            <div class="pull-right">
                <ul class="pagination">
                    <li><a href="#" aria-label="Previous">首页</a></li>
                    <li><a href="#">上一页</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">下一页</a></li>
                    <li><a href="#" aria-label="Next">尾页</a></li>
                </ul>
            </div><!--底部分页栏-->
        </div><!--pro-left/-->

        <div class="pro-right">
            <h2 class="right-title">推荐房源</h2>
            <div class="right-pro">
                <c:forEach var="random_house" items="${randomHouses}">
                    <dl>
                        <dt><a href="/house/todetails.do?house_id=${randomHouse.houseId}"><img
                                src="http://image.cxhit.com/${randomHouse.houseHeadimg}"
                                style="width: 135px; height: 88px"/></a></dt>
                        <dd>
                            <h3>
                                <a href="/house/todetails.do?house_id=${randomHouse.houseId}">${randomHouse.houseTitle}</a>
                            </h3>
                            <div class="pro-fang">${randomHouse.houseLayout} ${randomHouse.houseArea}平
                                朝${randomHouse.houseTurn}</div>
                            <div class="right-price">${randomHouse.housePrice}${randomHouse.priceUnit}</div>
                        </dd>
                    </dl>
                </c:forEach>
            </div><!--right-pro/-->
        </div><!--pro-right/-->
        <div class="clears"></div>
    </div><!--width1190/-->
</div><!--content/-->

<%--显示页脚--%>
<!--这是页脚-->
<jsp:include page="../pages/basefoot.jsp"></jsp:include>

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值