新页面拆分、登陆

1、agriculture-mvc-servlet.xml

<!-- thymeleaf的视图解析器 -->

<bean id="templateResolver"

class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">

关键代码:<property name="prefix" value="/WEB-INF/html1" />

<property name="suffix" value=".html" />

<property name="templateMode" value="HTML5" />

</bean>

2、index

<body>

<div class="top" >

<div th:replace="shop/userBar :: page-user-bar"></div>

</div>

<!-- top over -->


<div class="header">

<div th:replace="shop/topBar :: page-top-bar"></div>

</div>

<!-- header -->

<div class="navBox yh">

<div class="container">

<div th:replace="shop/navBar :: page-nav-bar"></div></div>

</div>

<!-- nav over -->


<div class="banner">

   <ul>

       <li><a href="##"><img src="images1/001.jpg" alt=""/></a></li>

       <li><a href="##"><img src="images1/002.jpg" alt=""/></a></li>

       <li><a href="##"><img src="images1/003.jpg" alt=""/></a></li>

       <li><a href="##"><img src="images1/004.jpg" alt=""/></a></li>

   </ul>

</div>

<!-- banner over -->

3、topbar

<div class="container cf" th:fragment="page-top-bar">

<div class="row">

<div class="col-md-4 logo">

<a th:href="@{/}">

<img src="images1/logo.jpg" alt=""/></a>

</div>

<div class="col-md-7 col-md-offset-1 cf">

<div class="row">

<div class="col-sm-8 ">

<div class="seachBar mt25 nobox">

<i class="ico-s"></i>

<form action="selectGoods" th:object="${goodsForm}" method="post">

<input type="text" class="inpt" placeholder="请输入关键字"/>

<button class="btnS">搜索</button></form>

</div>

</div>

<div class="col-sm-4">

<p class="cartbar nobox mt25 yh"><a th:href="@{initCart}"><i class="ico"></i>购物车<i class="num">99</i>件</a></p>

</div>

</div>

</div>

</div>

</div>

4、userbar.html

<div class="container cf" th:fragment="page-top-bar">

<div class="row">

<div class="col-md-4 logo">

<a th:href="@{/}">

<img src="images1/logo.jpg" alt=""/></a>

</div>

<div class="col-md-7 col-md-offset-1 cf">

<div class="row">

<div class="col-sm-8 ">

<div class="seachBar mt25 nobox">

<i class="ico-s"></i>

<form action="selectGoods" th:object="${goodsForm}" method="post">

<input type="text" class="inpt" placeholder="请输入关键字"/>

<button class="btnS">搜索</button></form>

</div>

</div>

<div class="col-sm-4">

<p class="cartbar nobox mt25 yh"><a th:href="@{initCart}"><i class="ico"></i>购物车<i class="num">99</i>件</a></p>

</div>

</div>

</div>

</div>

</div>

6、navbar,html

<div class="navbar navbar-inverse " rple="navigation" th:fragment="page-nav-bar">

 <div class="navbar-header">

   <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse">

     <span class="sr-only">Toggle Navigation</span>

     <span class="icon-bar"></span>

     <span class="icon-bar"></span>

     <span class="icon-bar"></span>

   </button>

   <a href="##" class="navbar-brand">好农易商城</a>

 </div>

 <div class="collapse navbar-collapse navbar-responsive-collapse cf ">

   <ul class="nav navbar-nav">

         <li class="active"><a href="##"><i class="ico-nav ico-nav-1"></i>首页</a></li>

         <li><a href="list.html"><i class="ico-nav ico-nav-2"></i>粮食</a></li>

         <li><a href="##"><i class="ico-nav ico-nav-3"></i>调料</a></li>

         <li><a href="##"><i class="ico-nav ico-nav-4"></i>化妆品</a></li>

         <li><a href="##"><i class="ico-nav ico-nav-5"></i>冲饮</a></li>

         <li><a href="##"><i class="ico-nav ico-nav-6"></i>零食</a></li>

         <li><a href="##"><i class="ico-nav ico-nav-7"></i>茗茶</a></li>

   </ul> 

 </div>

</div>

7、登陆

在userbar.html中

<p class="userInfo">您好,<a class="link" th:if="${not #strings.isEmpty(session.UVO.guestName)}" style="width:24px;">

<a th:href="@{initEditGuest}"><span class="button-t" th:text="${session.UVO.guestName}">张三</span></a>

</a>

请  <a class="link" th:if="${not #strings.isEmpty(session.UVO.guestName)}" style="width:24px;">

     <a th:href="@{/}">退出</a>

</a>

<a th:href="@{initGuestLogin}" class="link"><span th:if="${#strings.isEmpty(session.UVO.guestName)}">登录</span></a><i class="line">|</i><a href="register-1.html" class="link">注册</a><i class="line">|</i><a href="#" class="link">分销商入口</a></p>

</div>



你可能感兴趣的:(新页面拆分、登陆)