dida 5 years ago
parent dfb8cc9aa6
commit a1fde26761

@ -1,5 +1,5 @@
#MyEclipse Hibernate Properties
#Sun Jan 05 17:23:45 CST 2020
#Mon Jan 06 17:30:52 CST 2020
sessionFactoryName=
genBasicCompId=false
profile=

@ -0,0 +1,749 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>MyDay-我的美好一天</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<style>
*{
margin: 0;
padding: 0;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 11;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
height:100%;
}
.homeback{
z-index: -1;
position:absolute;
width:1520px;
height:1431px;
top:60px;
}
</style>
<body>
<img class="homeback" alt="" src="./img/p1.png" style="z-index: -1">
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="./Market/buy.jsp" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="./LostAndFound/found.jsp">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="./Register/register.jsp" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<style>
*::selection{
background: none;
}
#box ul li{
margin: 0;
padding:0;
list-style: none;
text-align: center;
line-height: 270px;
font-size: 30px;
}
#box{
width:650px;
height:320px;
position:relative;
bottom: -180px;
}
#box li{
width:100%;
height:100%;
position:absolute;
opacity:0;
transition:1s;
}
#box ul li:FIRST-CHILD {
opacity:1;
}
.btn{
witdh:80px;
height:30px;
background: rgba(0,0,0,0);
color:#fff;
top:135px;
position:absolute;
text-align: center;
line-height: 30px;
cursor: pointer;
}
#nextt{
right:0;
}
.btn:HOVER {
background: rgba(0,0,0,0.05);
}
.btn:ACTIVE {
background: rgba(0,0,0,0.5);
}
.shouye{
height:500px;
position: relative;
width:1520px;
}
.sub{
text-decoration:none;
text-align:center;
width:100px;
height:35px;
padding-top:5px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: block;
vertical-align: bottom;
margin-top: 20px;
outline: none;
position: relative;
top:180px;
left:250px;
}
.sub:HOVER{
background: #EEAD0E;
}
.sub:ACTIVE{
background: #FFB90F;
}
</style>
<div class="shouye">
<a href="./Login/login.jsp" type="button" class="sub" >登录</a>
<div id="box">
<ul>
<li class="ll" id=0>美好的一天从MyDay开始</li>
<li class="ll" id=1>校园超市为你方便购物</li>
<li class="ll" id=2>失物招领让你的宝贝回家</li>
<li class="ll" id=2>资源共享丰富你的知识</li>
<li class="ll" id=2>跳蚤市场轻松解决你不需要的物品</li>
</ul>
<div class="btn" id="prevv" onclick="clickprev()">prev</div>
<div class="btn" id="nextt" onclick="clicknext()">next</div>
</div>
</div>
<script type="text/javascript">
var ll = document.getElementsByClassName("ll");
var pre = document.getElementById("prevv");
var next = document.getElementById("nextt");
var index = 0;
var int;
//定时器
int=self.setInterval("wrapernext()",3000);
//3秒后开始定时
//setTimeout("SetInterval()",3000);
function wrapernext(){
index++;
if(index == ll.length) index=0;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clicknext(){
window.clearInterval(int) ;
int=null;
wrapernext();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
};
function wraperprev(){
index--;
if(index == -1) index=ll.length-1;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clickprev(){
window.clearInterval(int) ;
int=null;
wraperprev();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
}
</script>
<!-- 以上是主题介绍 -->
<!--
<style>
.adv{
: 4px solid yellow;
position: relative;
height: 600px;
}
.circle{
width:150px;
height:150px;
border-radius:50%;
background: #48D1CC;
position: relative;
float:left;
color:white;
line-height:120px;
display:inline-block;
text-align: center;
}
.cir-one,.cir-one+a{
left:150px;
}
.cir-two,.cir-two+a{
right:-700px;
}
.cir-three,.cir-three+a{
left:350px;
}
.cir-four,.cir-four+a{
right:-1200px;
}
.good{
: 4px solid yellow;
float:left;
color:#ADD8E6;
position:relative;
display:inline-block;
}
.inline{
height:150px;
padding: 0px;
position: relative;
}
</style>
<div class="adv">
<div style="border: 1px solid red;" class="inline">
<div class="circle cir-one">跳蚤市场</div>
<a class="good">
很好不错特别棒
</a>
</div>
<div style="border: 1px solid red;" class="inline">
<div class="circle cir-two">校园超市</div>
<a class="good">
很好不错特别棒
</a>
</div>
<div style="border: 1px solid red;" class="inline">
<div class="circle cir-three">失物招领</div>
<a class="good">
很好不错特别棒
</a>
</div>
<div style="border: 1px solid red;" class="inline">
<div class="circle cir-four">资源共享</div>
<a class="good">
很好不错特别棒
</a>
</div>
</div>
</div>
-->
<!-- background-image:url('./img/timg.jfif');
-->
<!-- 彩虹 -->
<style>
*{
padding: 0;
margin: 0;
}
.rain{
position: relative;
top:690px;
width:1520px;
height:2px;
}
.rain ul li {
width:302px;
height:400px;
position: relative;
float:left;
display: block;
margin: 0;
top:50px;
}
.rain ul li img{
width:302px;
position: relative;
z-index: -5;
top:-100px;
transition: all 0.4s ease-in-out;
transition-timing-function:cubic-bezier(0.05,0.3,0.4,0.2);
}
.text{
position:relative;
width:302px;
bottom: 0px;
height:400px;
}
.text:HOVER img{
top:0px;
}
.text h1,h2,p{
position:relative;
bottom: 400px;
color: white;
width:302px;
}
.text h2{
position:relative;
transform: translateX(-130px);
transition: all 0.4s ease-out;
opacity:0;
transition-delay: 0.4s
}
.text:HOVER h2{
transform: translateX(0px);
opacity:1;
}
.text p{
position:relative;
transform: translateY(130px);
transition: all 0.4s ease-out;
opacity:0;
transition-delay: 0.4s
}
.text:HOVER p{
transform: translateX(0px);
opacity:1;
}
}
</style>
<div class="rain">
<ul>
<li>
<div class="text" onclick="window.location.href='./Market/buy.jsp';">
<img alt="" src="./img/rainbow1.png">
<h1>跳蚤市场</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</li>
<li>
<div class="text" onclick="window.location.href='./LostAndFound/found.jsp';">
<img alt="" src="./img/rainbow2.png">
<h1>失物招领</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</li>
<li>
<div class="text" onclick="window.location.href='./404.jsp';">
<img alt="" src="./img/rainbow3.png">
<h1>校园超市</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</li>
<li>
<div class="text" onclick="window.location.href='./404.jsp';">
<img alt="" src="./img/rainbow4.png">
<h1>兴趣论坛</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</li>
<li>
<div class="text" onclick="window.location.href='./404.jsp';">
<img alt="" src="./img/rainbow5.png">
<h1>资源共享</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</li>
</ul>
</div>
<!-- 小组介绍 -->
<style>
.team {
position:relative;
z-index:-6;
width:1520px;
top:-1050px;
}
.team img{
position:relative;
z-index:-6;
width:1520px;
}
</style>
<div class="team">
<img alt="" src="./img/p3.png">
</div>
<!-- 以下功能介绍 -->
<!--
<style>
.homepage_introduce{
position: relative;
bottom: -950px;
width:1520px;
height:360px;
}
.active{
width: 258.4px;
height: 300px;
position: relative;
display: inline-block;
vertical-align: top;
background-image: url('./img/one.png');
background-size:contain;
background-repeat:no-repeat;
z-index:2;
border-radius:10px;
margin-top: 30px;
margin-right: 20px;
}
.action img{
width: 258.4px;
height: 300px;
position: relative;
z-index: -1;
}
/*
.active:HOVER{
background-image: linear-gradient(45deg, #FBDA61 0%, #FF5ACD 100% );
background:rgba(,,,0.1);
color:white;
height: 320px;
margin-top: 20px;
}*/
.homepage_introduce ul{
list-style-type:none;
padding-top: 0;
position:relative;
text-align: center;
display: inline-block;
height:360px;
width:1520px;
}
.colorWhite{
text-decoration: none;
}
.active div{
visibility: hidden;
}
</style>
<div class="homepage_introduce" >
<ul>
<li class="active one" onmouseenter="onmove(this,'hover1') " onmouseleave="onout(this,'hover1')" >
<div id="hover1" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" onmouseenter="onmove(this,'hover2') " onmouseleave="onout(this,'hover2')" >
<div id="hover2" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" onmouseenter="onmove(this,'hover3') " onmouseleave="onout(this,'hover3')" >
<div id="hover3" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" onmouseenter="onmove(this,'hover4') " onmouseleave="onout(this,'hover4')" >
<div id="hover4" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" onmouseenter="onmove(this,'hover') " onmouseleave="onout(this,'hover')" ">
<div id="hover" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
</ul>
</div>
-->
<!--
<script type="text/javascript">
function onmove(x,ho){
x.style.visibility="hidden";
document.getElementById(ho).style.visibility="visible";
}
function onout(x,ho){
x.style.visibility="visible";
document.getElementById(ho).style.visibility="hidden";
}
</script>
-->
<!--
<ul >
<li class="active">
<div>
<p class="f18 floatingName"><a href="https://www.trustie.net" class="colorWhite">TrustieForge</a></p>
<p class="f16 mb20"></p>
<p class="f12 mb30 break_full_word floatingContent">开源创作与软件生产相结合,支持大规模群体开展软件协同创新活动。</p>
</div>
</li>
<li class="active">
<div>
<p class="f18 floatingName"><a href="http://codepedia.trustie.net/" class="colorWhite">Codepedia</a></p>
<p class="f16 mb20">众包标注平台</p>
<p class="f12 mb30 break_full_word floatingContent">也为软件领域积累丰富的自然语言标注。</p>
</div>
</li>
<li class="active">
<div>
<p class="f18 floatingName"><a href="https://www.trustie.net" class="colorWhite">TrustieForge</a></p>
<p class="f16 mb20"></p>
<p class="f12 mb30 break_full_word floatingContent"></p>
</div>
</li>
<li class="active">
<div>
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active">
<div>
<p class="f18 floatingName"><a href="https://www.trustie.net" class="colorWhite">TrustieForge</a></p>
<p class="f16 mb20"></p>
<p class="f12 mb30 break_full_word floatingContent"></p>
</div>
</li>
</ul>
-->
</div>
</body>
</html>

@ -0,0 +1,264 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>登录</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<script src="js/jquery-1.11.3.js"></script>
<style>
*{
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
}
body{
left:0;
padding: 0 0;
}
#back{
background-image:url('./img/login2.png');
background-repeat: no-repeat,no-repeat;
background-size:contain,contain;
background-position: bottom;
background-position:0 20px;
height:78%;
width:100%;
}
.loginform{
position: relative;
width:350px;
margin-top: 8%;
margin-left: 15%
}
.loginform .logtype{
text-align: center;
margin-bottom: 30px;
letter-spacing: 1px;
}
.loginform .logtype a{
margin-right: 10px;
font-weight: bold;
font-size: 23px;
cursor: pointer;
}
.loginform .logtype a:ACTIVE{
color:#EEAD0E;
}
form{
}
form .info{
margin-bottom: 20px;
width:100%;
height:43px;
border-radius:7px;
background: rgb(235 ,235, 235);
border: none;
text-indent: 15px;
letter-spacing: 1px;
font-size: 95%;
outline-color: #FFB90F;
}
form .info:FOCUS{
background: white;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.sub{
width:40%;
height:35px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: inline;
vertical-align: top;
margin-top: 20px;
outline: none;
}
.sub:HOVER{
background: #EEAD0E;
}
.sub:ACTIVE{
background: #EEAD0E;
}
.reg{
display: inline-block;
vertical-align: top;
margin-left: 40%;
text-align: right;
margin-top: 20px;
}
.reg p{
font-size: 80%;
color: rgb(180 ,180, 180);
margin-top: 0px;
margin-bottom: 5px;
cursor: pointer;
}
.reg p:ACTIVE {
color: #EEAD0E;
}
</style>
<style>/*导航*/
*{
margin: 0;
padding: 0;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 11;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
height:100%;
}
</style>
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="./Market/buy.jsp" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="./LostAndFound/found.jsp">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">兴趣论坛</a>
</li>
</ul>
</div>
</div>
<div id="back" >
<div class="loginform">
<div class="logtype">
<a>登录</a>
</div>
<s:form action="Login" method="post" autocomplete="on">
<input type="text" class="info" name="user.username" placeholder="请输入用户名" required/><br/>
<input type="password" class="info" name="user.password" placeholder="请输入密码" required/><br/>
<input type="submit" class="sub" value="登录">
<div class="reg">
<p onclick="window.location.href='./Register/register.jsp';">注册</p>
<p onclick="window.location.href='./404.jsp';">忘记密码</p>
</div>
</s:form>
<p style="text-align: center;font-family:cursive;">———其他登录方式 ———</p>
</div>
<div>
<script type="text/javascript">
var h=document.getElementById("back").clientHeight;
var w=document.getElementById("back").clientWidth;
if(h==null) console.log(0);
console.log(h);
console.log(w);
</script>
</body>
</html>

@ -0,0 +1,376 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>发布寻物</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<style>
body{
width:1520px;
}
.bg{
position:absolute;
width:1520px;
z-index: -10;
left:-300px;
top:-340px;
}
.nav{
position:relative;
width:900px;
margin: 0 auto;
height:100px;
text-align: center;
background: #3CB371;
}
.bord{
top:300px;
position:relative;
width:900px;
margin: 0 auto;
background: white;
z-index: 2;
}
.nav a{
position: relative;
margin-top: 10px;
color: black;
top:30px;
font-size: 30px;
color: white;
}
select{
height:40px;
width:400px;
border: 1px solid #D4D4D4;
}
.form-control{
height:40px;
width:263px;
border: 1px solid #D4D4D4;
}
.container{
position:relative;
border: 1px solid #DCDCDC;
padding-left: 50px;
padding-top: 30px;
padding-bottom:100px;
top:80px;
left:10px;
background: white;
}
input {
outline-color: #FFB90F;
height:40px;
border-radius:5px;
border: 1px solid #D4D4D4;
text-indent: 20px;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
textarea::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
textarea::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.row{
margin-top: 10px;
}
.lbl{
margin-bottom: 5px;
}
input{
width:800px;
}
.submit{
margin-top: 40px;
}
.in{
width:800px;
outline-color: #FFB90F;
}
.submit{
background: #00CD64;
color: white;
}
</style>
<body>
<div class="bord">
<img class="bg" alt="" src="./img/fbxw.png">
<div class="container">
<s:form class="contact" action="Fbxw" method="post" id="form_example" enctype="multipart/form-data" >
<div class="row clearfix">
<div class="lbl">
<label for="name">
标题</label>
</div>
<div class="ctrl">
<input type="text" id="name" name="xw.title" data-required="true" data-validation="text" data-msg="Invalid Name" placeholder="丢了什么呢">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="message">
描述</label>
</div>
<div class="ctrl">
<textarea class="in" id="message" name="xw.miao" rows="6" cols="10" placeholder="描述越详细找到的可能性越大哦~"></textarea>
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
丢失地点</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xw.address" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="在哪里丢的啊~">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
丢失时间</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xw.time" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="在哪里丢的啊~">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
微信号</label>
</div>
<div class="ctrl">
<input type="text" calss="in" id="phone" name="xw.wx" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
手机号</label>
</div>
<div class="ctrl">
<input type="text"class="in" id="phone" name="xw.tel" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的 ">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
QQ</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xw.qq" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<!--
<div class="row clearfix"><div class="lbl">
<label>上传图片:</label></div>
<div class="ctrl">
<div style="display: none" id="myss"> <img id="img" src="">
<div style="height: 20px"></div>
</div>
<input id="files" type="file" onchange="compress()" multiple name="file" style="height:25px;border:none" >
<input type="hidden" value="" name="image" id="image">
<script type="text/javascript">
$(document).ready(function () {
var fileList = [];
var fileCatcher = document.getElementById('form_example');
var files = document.getElementById("files"), renderFileList;
var fileListDisplay = document.getElementById('file-list-display'), sendFile;
fileCatcher.addEventListener("submit", function (event) {
event.preventDefault();
//上传文件
sendFile();
console.log(1);
});
files.addEventListener("change", function (event) {
for (var i = 0; i < files.files.length; i++) {
console.log("file"+i);
fileList.push(files.files[i]);
}
console.log(2);
renderFileList();
console.log(3);
});
renderFileList = function () {
fileListDisplay.innerHTML = '';
fileList.forEach(function (file, index) {
{}
let fileObj = file ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log("data");
var imgg = document.createElement("img");
imgg.src =data ;
fileListDisplay.appendChild(imgg);
}};
console.log(4);
var fileDisplayEl = document.createElement("p");
fileDisplayEl.innerHTML = (index + 1) + ":" + file.name;
fileListDisplay.appendChild(fileDisplayEl);
})
};
sendFile = function () {
console.log(5);
var formData = new FormData();
var request = new XMLHttpRequest();
//循环添加到formData中
fileList.forEach(function (file) {
console.log(6);
formData.append('files', file, file.name);
})
request.open("POST", "/test/upload.do");
request.send(formData);
}
})
</script>
<!--
<script>
// 对图片进行压缩
function compress() {
let fileObj = document.getElementById('file').files[0] ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log(data);
//压缩完成
document.getElementById('img').src = data;
//document.getElementById('image').value =data;
var div = document.getElementById("myss");
div.style.setProperty('display','block');
}
}
}
</script>
-->
<input type="hidden" value="1577948535" name="senddate">
<input type="hidden" value="1577948535" name="sortrank">
<input type="hidden" value="1577948535" name="arcrank">
<input type="hidden" value="1" name="typeid">
<input type="hidden" value="20" name="channelid">
<input type="hidden" value="1" name="type">
<div class="row clearfix">
<div class="span10 offset2">
<input type="submit" name="submit" class="submit" value="确认发布">
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div></div>
</div>
</body>
</html>

@ -0,0 +1,375 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>发布闲置</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<style>
body{
width:1520px;
}
.bg{
position:absolute;
width:1520px;
z-index: -10;
left:-300px;
top:-340px;
}
.nav{
position:relative;
width:900px;
margin: 0 auto;
height:100px;
text-align: center;
background: #3CB371;
}
.bord{
top:300px;
position:relative;
width:900px;
margin: 0 auto;
background: white;
z-index: 2;
}
.nav a{
position: relative;
margin-top: 10px;
color: black;
top:30px;
font-size: 30px;
color: white;
}
select{
height:40px;
width:400px;
border: 1px solid #D4D4D4;
}
.form-control{
height:40px;
width:263px;
border: 1px solid #D4D4D4;
}
.container{
position:relative;
border: 1px solid #DCDCDC;
padding-left: 50px;
padding-top: 30px;
padding-bottom:100px;
top:80px;
left:10px;
background: white;
}
input {
outline-color: #FFB90F;
height:40px;
border-radius:5px;
border: 1px solid #D4D4D4;
text-indent: 20px;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
textarea::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
textarea::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.row{
margin-top: 10px;
}
.lbl{
margin-bottom: 5px;
}
input{
width:800px;
}
.submit{
margin-top: 40px;
}
.in{
width:800px;
outline-color: #FFB90F;
}
.submit{
background: #00CD64;
color: white;
}
</style>
<body>
<div class="bord">
<img class="bg" alt="" src="./img/fbzl.png">
<div class="container">
<s:form class="contact" action="Fbzl" method="post" id="form_example" enctype="multipart/form-data" >
<div class="row clearfix">
<div class="lbl">
<label for="name">
标题</label>
</div>
<div class="ctrl">
<input type="text" id="name" name="zl.title" data-required="true" data-validation="text" data-msg="Invalid Name" placeholder="很重要,显示在列表页">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="message">
描述</label>
</div>
<div class="ctrl">
<textarea class="in" id="message" name="zl.miao" rows="6" cols="10" placeholder="介绍一下你曾经的宝贝吧~"></textarea>
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
拾物地点</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="zl.address" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="约个地点见面吧~">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
拾物时间</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="zl.time" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="约个地点见面吧~">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
微信号</label>
</div>
<div class="ctrl">
<input type="text" calss="in" id="phone" name="zl.wx" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
手机号</label>
</div>
<div class="ctrl">
<input type="text"class="in" id="phone" name="zl.tel" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的 ">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
QQ</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="zl.qq" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<!--
<div class="row clearfix"><div class="lbl">
<label>上传图片:</label></div>
<div class="ctrl">
<div style="display: none" id="myss"> <img id="img" src="">
<div style="height: 20px"></div>
</div>
<input id="files" type="file" onchange="compress()" multiple name="file" style="height:25px;border:none" >
<input type="hidden" value="" name="image" id="image">
<script type="text/javascript">
$(document).ready(function () {
var fileList = [];
var fileCatcher = document.getElementById('form_example');
var files = document.getElementById("files"), renderFileList;
var fileListDisplay = document.getElementById('file-list-display'), sendFile;
fileCatcher.addEventListener("submit", function (event) {
event.preventDefault();
//上传文件
sendFile();
console.log(1);
});
files.addEventListener("change", function (event) {
for (var i = 0; i < files.files.length; i++) {
console.log("file"+i);
fileList.push(files.files[i]);
}
console.log(2);
renderFileList();
console.log(3);
});
renderFileList = function () {
fileListDisplay.innerHTML = '';
fileList.forEach(function (file, index) {
{}
let fileObj = file ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log("data");
var imgg = document.createElement("img");
imgg.src =data ;
fileListDisplay.appendChild(imgg);
}};
console.log(4);
var fileDisplayEl = document.createElement("p");
fileDisplayEl.innerHTML = (index + 1) + ":" + file.name;
fileListDisplay.appendChild(fileDisplayEl);
})
};
sendFile = function () {
console.log(5);
var formData = new FormData();
var request = new XMLHttpRequest();
//循环添加到formData中
fileList.forEach(function (file) {
console.log(6);
formData.append('files', file, file.name);
})
request.open("POST", "/test/upload.do");
request.send(formData);
}
})
</script>
<!--
<script>
// 对图片进行压缩
function compress() {
let fileObj = document.getElementById('file').files[0] ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log(data);
//压缩完成
document.getElementById('img').src = data;
//document.getElementById('image').value =data;
var div = document.getElementById("myss");
div.style.setProperty('display','block');
}
}
}
</script>
-->
<input type="hidden" value="1577948535" name="senddate">
<input type="hidden" value="1577948535" name="sortrank">
<input type="hidden" value="1577948535" name="arcrank">
<input type="hidden" value="1" name="typeid">
<input type="hidden" value="20" name="channelid">
<input type="hidden" value="1" name="type">
<div class="row clearfix">
<div class="span10 offset2">
<input type="submit" name="submit" class="submit" value="确认发布">
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div></div>
</div>
</body>
</html>

@ -0,0 +1,500 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'found.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #F5F5F5;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
}
</style>
<img class="back" alt="" src="./img/tzsc.png">
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="./Market/buy.jsp" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="./LostAndFound/found.jsp">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下两大类别 -->
<style>
*{
padding: 0;
margin: 0;
}
.twobord{
position:absolute;
height: 100px;
top:600px;
width:1520px;
}
.twotypes{
position:absolute;
width:1000px;
height: 100px;
left:260px;
text-align: center;
}
.chose{
height:100px;
float:left;
display: inline-block;
position: absolute;
}
.chose1{
width:400px;
z-index:11;
left:50px;
cursor: pointer;
}
.chose2{
width:370px;
right: 50px;
position: absolute;
z-index: 11;
cursor: pointer;
}
.chose div{
position:absolute;
width: 300px;
height:100px;
display: inline-block;
float: left;
left:100px;
background: rgba(5,5,5,0);
}
.chose img{
position:absolute;
width:100px;
display: inline-block;
left:0px;
float: left;
top:0px;
height:100px;
}
.chose p{
text-align: left;
text-indent: 10px;
z-index: 10;
}
.chose div p:FIRST-CHILD {
margin-top: 10px;
font-size: 30px;
} .chose div p:LAST-CHILD{
}
</style>
<div class="twobord">
<div class="twotypes">
<div class=" chose chose1" onclick="tiao()">
<img alt="" src="./img/look.png" >
<div>
<p > 查看寻物</p>
<p >逛市场可以赚大钱哦~</p>
</div>
</div>
<div class="chose chose2" onclick="tiao()">
<img alt="" src="./img/fabu.png">
<div>
<p>发布招领</p>
<p>逛市场可以赚大钱哦~</p>
</div>
</div>
</div>
<script type="text/javascript">
function tiao(){
window.location.href='http://www.baidu.com';
}
</script>
<!-- 商品列表 -->
<style>
.qg{
position:relative;
border: 1px solid white ;
width:1000px;
height:auto ;
margin :10px auto;
top:150px;
}
.ul{
border: 1px solid black ;
width:1000px;
height:200px;
}
.li{
border: 1px solid yellow ;
width:100%;
height: 100%;
list-style: none;
padding: 0;
position:relative;
margin-bottom:10px;
background: white;
}
.info{
border: 1px solid red ;
width:700px;
height: 200px;
display: inline-block;
position: relative;
bottom: 20px;
}
.li img{
position:relative;
left:25px;
border: 1px solid black ;
width:250px;
height: 150px;
top:20px;
}
.dul{
border: 1px solid white ;
position: relative;
top:10px;
}
.dclass{
border: 1px solid black ;
list-style: none;
position: relative;
height:40px;
margin-top:10px;
}
</style>
<%
int a[]={1,2,3,4,5};
request.setAttribute("name", a);
%>
<div class="qg">
<ul class="ul">
<c:forEach items="${name}" var="val" >
<li class="li" onclick="qiu(${val})">
<div class="info">
<ul class="dul">
<li class="dclass dcone">查看闲置</li>
<li class="dclass dctwo">逛市场可以赚大钱哦~</li>
<li class="dclass dcthree">发布求购</li>
</ul>
</div>
<img>
</li>
</c:forEach>
</ul>
</div>
<script type="text/javascript">
function qiu(id){
window.location.href="http://www.baidu.com";
//window.location.href='./Home/index.jsp?id='+id;
};
</script>
<!-- 分页 -->
<style type="text/css">
.pagination{
position:relative;
text-align: center;
top:1050px;
z-index: 2;
}
.pagination ul li{
position: relative;
display: inline-block;
border-radius:50%;
width:25px;
height:25px;
background: white;
cursor: pointer;
transition: all 0.4s ease-out;
}
.pagination ul li a{
text-decoration: none;
color: black;
}
#firstpage{
background: #00CD66;
}
#a{
color: white;
}
</style>
<div>
<div class="pagination">
<%! int dd[]={1,2,3,4,5,6,7,8,9,10};
%>
<%
request.setAttribute("dd", dd);
%>
<ul class="on">
<li class="prev"><a><</a></li>
<c:forEach items="${name}" var="val" varStatus="index">
<c:if test="${index.index<4}">
<li class="li li${index.index} lii"><a>${val}</a></li>
</c:if>
</c:forEach>
<!--
<li class="li" id="firstpage"><a id="a">1</a></li>
<li class="li"><a>2</a></li>
<li class="li"><a>3</a></li>
<li class="li"><a>4</a></li>
-->
<li class="next" ><a> > </a></li>
</ul>
</div>
</div>
<script type="text/javascript">
$(".li0").attr('id','firstpage');
$("#firstpage a").attr('id','a');
$(".pagination .li").click(function(){
var a = $(this).html();
console.log(a);
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
$(this).attr('id','firstpage');
$("#firstpage a").attr('id','a');
})
$(".pagination .prev").click(function(){
if(($("#firstpage").children().text()!='1')&&($("#firstpage").prev().attr("class")=="prev"))
{
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a-1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='1')
{
var pre = $("#firstpage").prev();
var prea = $("#firstpage").prev().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
}
})
$(".pagination .next").click(function(){
if($("#firstpage").children().html()!='${fn:length(name)}')
console.log("y");
if("qq"=="qq")
console.log("yy");
if(($("#firstpage").children().text()!='${fn:length(name)}')&&($("#firstpage").next().attr("class")=="next"))
{
console.log('大于4');
var te = $(".lii a").text();
console.log(te);
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a+1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='${fn:length(name)}')
{
var pre = $("#firstpage").next();
var prea = $("#firstpage").next().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
var page = parseInt($("#firstpage").children().text());
//发送page页号
}
})
</script> </body>
</html>

@ -0,0 +1,501 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'lost.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #F5F5F5;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
}
</style>
<img class="back" alt="" src="./img/tzsc.png">
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="/paths" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="/courses" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="/shixuns">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="/competitions">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="/moop_cases">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下两大类别 -->
<style>
*{
padding: 0;
margin: 0;
}
.twobord{
position:absolute;
height: 100px;
top:600px;
width:1520px;
}
.twotypes{
position:absolute;
width:1000px;
height: 100px;
left:260px;
text-align: center;
}
.chose{
height:100px;
float:left;
display: inline-block;
position: absolute;
}
.chose1{
width:400px;
z-index:11;
left:50px;
cursor: pointer;
}
.chose2{
width:370px;
right: 50px;
position: absolute;
z-index: 11;
cursor: pointer;
}
.chose div{
position:absolute;
width: 300px;
height:100px;
display: inline-block;
float: left;
left:100px;
background: rgba(5,5,5,0);
}
.chose img{
position:absolute;
width:100px;
display: inline-block;
left:0px;
float: left;
top:0px;
height:100px;
}
.chose p{
text-align: left;
text-indent: 10px;
z-index: 10;
}
.chose div p:FIRST-CHILD {
margin-top: 10px;
font-size: 30px;
} .chose div p:LAST-CHILD{
}
</style>
<div class="twobord">
<div class="twotypes">
<div class=" chose chose1" onclick="tiao()">
<img alt="" src="./img/look.png" >
<div>
<p > 查看招领</p>
<p >逛市场可以赚大钱哦~</p>
</div>
</div>
<div class="chose chose2" onclick="tiao()">
<img alt="" src="./img/fabu.png">
<div>
<p>发布寻物</p>
<p>逛市场可以赚大钱哦~</p>
</div>
</div>
</div>
<script type="text/javascript">
function tiao(){
window.location.href='http://www.baidu.com';
}
</script>
<!-- 商品列表 -->
<style>
.qg{
position:relative;
border: 1px solid white ;
width:1000px;
height:auto ;
margin :10px auto;
top:150px;
}
.ul{
border: 1px solid black ;
width:1000px;
height:200px;
}
.li{
border: 1px solid yellow ;
width:100%;
height: 100%;
list-style: none;
padding: 0;
position:relative;
margin-bottom:10px;
background: white;
}
.info{
border: 1px solid red ;
width:700px;
height: 200px;
display: inline-block;
position: relative;
bottom: 20px;
}
.li img{
position:relative;
left:25px;
border: 1px solid black ;
width:250px;
height: 150px;
top:20px;
}
.dul{
border: 1px solid white ;
position: relative;
top:10px;
}
.dclass{
border: 1px solid black ;
list-style: none;
position: relative;
height:40px;
margin-top:10px;
}
</style>
<%
int a[]={1,2,3,4,5};
request.setAttribute("name", a);
%>
<div class="qg">
<ul class="ul">
<c:forEach items="${name}" var="val" >
<li class="li" onclick="qiu(${val})">
<div class="info">
<ul class="dul">
<li class="dclass dcone">查看闲置</li>
<li class="dclass dctwo">逛市场可以赚大钱哦~</li>
<li class="dclass dcthree">发布求购</li>
</ul>
</div>
<img>
</li>
</c:forEach>
</ul>
</div>
<script type="text/javascript">
function qiu(id){
window.location.href="http://www.baidu.com";
//window.location.href='./Home/index.jsp?id='+id;
};
</script>
<!-- 分页 -->
<style type="text/css">
.pagination{
position:relative;
text-align: center;
top:1050px;
z-index: 2;
}
.pagination ul li{
position: relative;
display: inline-block;
border-radius:50%;
width:25px;
height:25px;
background: white;
cursor: pointer;
transition: all 0.4s ease-out;
}
.pagination ul li a{
text-decoration: none;
color: black;
}
#firstpage{
background: #00CD66;
}
#a{
color: white;
}
</style>
<div>
<div class="pagination">
<%! int dd[]={1,2,3,4,5,6,7,8,9,10};
%>
<%
request.setAttribute("dd", dd);
%>
<ul class="on">
<li class="prev"><a><</a></li>
<c:forEach items="${name}" var="val" varStatus="index">
<c:if test="${index.index<4}">
<li class="li li${index.index} lii"><a>${val}</a></li>
</c:if>
</c:forEach>
<!--
<li class="li" id="firstpage"><a id="a">1</a></li>
<li class="li"><a>2</a></li>
<li class="li"><a>3</a></li>
<li class="li"><a>4</a></li>
-->
<li class="next" ><a> > </a></li>
</ul>
</div>
</div>
<script type="text/javascript">
$(".li0").attr('id','firstpage');
$("#firstpage a").attr('id','a');
$(".pagination .li").click(function(){
var a = $(this).html();
console.log(a);
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
$(this).attr('id','firstpage');
$("#firstpage a").attr('id','a');
})
$(".pagination .prev").click(function(){
if(($("#firstpage").children().text()!='1')&&($("#firstpage").prev().attr("class")=="prev"))
{
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a-1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='1')
{
var pre = $("#firstpage").prev();
var prea = $("#firstpage").prev().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
}
})
$(".pagination .next").click(function(){
if($("#firstpage").children().html()!='${fn:length(name)}')
console.log("y");
if("qq"=="qq")
console.log("yy");
if(($("#firstpage").children().text()!='${fn:length(name)}')&&($("#firstpage").next().attr("class")=="next"))
{
console.log('大于4');
var te = $(".lii a").text();
console.log(te);
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a+1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='${fn:length(name)}')
{
var pre = $("#firstpage").next();
var prea = $("#firstpage").next().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
var page = parseInt($("#firstpage").children().text());
//发送page页号
}
})
</script>
</body>
</html>

@ -0,0 +1,690 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'buy.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #F5F5F5;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
height:100%;
}
</style>
<img class="back" alt="" src="./img/tzsc.png">
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="./Market/buy.jsp" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="./LostAndFound/found.jsp">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="./Register/register.jsp" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下两大类别 -->
<style>
*{
padding: 0;
margin: 0;
}
.twobord{
position:absolute;
height: 100px;
top:600px;
width:1520px;
}
.twotypes{
position:absolute;
width:1000px;
height: 100px;
left:260px;
text-align: center;
}
.chose{
height:100px;
float:left;
display: inline-block;
position: absolute;
}
.chose1{
width:400px;
z-index:11;
left:50px;
cursor: pointer;
}
.chose2{
width:370px;
right: 50px;
position: absolute;
z-index: 11;
cursor: pointer;
}
.chose div{
position:absolute;
width: 300px;
height:100px;
display: inline-block;
float: left;
left:100px;
background: rgba(5,5,5,0);
}
.chose img{
position:absolute;
width:100px;
display: inline-block;
left:0px;
float: left;
top:0px;
height:100px;
}
.chose p{
text-align: left;
text-indent: 10px;
z-index: 10;
}
.chose div p:FIRST-CHILD {
margin-top: 10px;
font-size: 30px;
} .chose div p:LAST-CHILD{
}
</style>
<div class="twobord">
<div class="twotypes">
<div class=" chose chose1" >
<img alt="" src="./img/look.png" >
<div>
<p onclick="window.location.href='./Market/qiugou.jsp';"> 查看求购</p>
<p onclick="window.location.href='./Market/qiugou.jsp';">逛市场可以赚大钱哦~</p>
</div>
</div>
<div class="chose chose2" >
<img alt="" src="./img/fabu.png">
<div>
<p onclick="window.location.href='./Market/fbxz.jsp';">发布闲置</p>
<p onclick="window.location.href='./Market/fbxz.jsp';">逛市场可以赚大钱哦~</p>
</div>
</div>
</div>
<script type="text/javascript">
function tiao(){
window.location.href='http://www.baidu.com';
}
</script>
<!-- 以下类别导航 -->
<style>
.bord-nav{
border-radius:7px;
position: relative;
top:150px;
height:60px;
width:1070px;
margin: 0 auto;
background: white;
}
#buy-nav{
position:relative;
padding:10px auto;
height:60px;
width:1070px;
}
.type{
float: left;
margin-left: 100px;
position: relative;
top:35%;
}
.type a{
font-size: 20px;
text-decoration: none;
}
</style>
<div style="position: relative;">
<div class="bord-nav">
<ul id="buy-nav">
<li class="type" style="display: block;">
<a href="./PagingServlet?typeid=2&pageid=1">书籍</a>
</li>
<li class="type" style="display: block;">
<a href="" >美妆</a>
</li>
<li class="type" style="display: block;">
<a href="">宠物粮</a>
</li>
<li class="type" style="display: block;">
<a href="">笔记</a>
</li>
<li class="type" style="display: block;">
<a href="">手机</a>
</li>
<li class="type" style="display: block;">
<a href="">手机</a>
</li>
<li class="type" style="display: block;">
<a href="">手机</a>
</li>
</ul>
</div>
</div>
<!-- 商品显示 -->
<style>
.homepage_introduce{
top:320px;
position: relative;
width:1100px;
height:auto;
margin: 0 auto;
padding: 0 0;
top:160px;
}
.active{
width: 207px;
height: 300px;
position: relative;
left:-20px;
display: inline-block;
vertical-align: top;
background:white;
background-size:contain;
background-repeat:no-repeat;
z-index:2;
border-radius:5px;
margin-left: 0px;
margin-right: 10px;
margin-bottom: 10px;
}
.active img{
width: 207px;
height: 300px;
}
.active:HOVER{
height: 300px;
margin-top: -5px;
}
.homepage_introduce ul{
list-style-type:none;
padding-top: 0;
position:relative;
display: inline-block;
height:auto;
width:1150px;
margin-bottom: 10px;
left:30px;
}
.colorWhite{
text-decoration: none;
}
</style>
<!-- <li class="active" >
<div id="hover2" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover3" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover4" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<!-- </ul>
<ul >
<li class="active one" >
<div id="hover1" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover2" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover3" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover4" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
<li class="active" >
<div id="hover" style="height:100% ;">
<p class="f18 floatingName"><a href="http://ossean.trustie.net/" class="colorWhite">OSSEAN</a></p>
<p class="f16 mb20">资源共享平台</p>
<p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p>
</div>
</li>
-->
<!--
<div class="homepage_introduce" >
<ul class="exam">
<li class="active one" v-for="item in items" >
<div id="hover1" style="height:100% ;">
{{item}}
</div>
</li>
</ul>
</div>
-->
<div class="homepage_introduce" >
<ul class="exam">
<%! int id[]={1,2,3,4,5,6,7,8,9,10}; int ii;String img[]={"","","","","","","","","",""};
int im[]={1,2};
%>
<%
img[0]="./img/one.png";
img[1]="./img/look.png";
img[2]="./img/p1.png";
img[3]="./img/one.png";
img[4]="./img/look.png";
img[5]="./img/p1.png";
img[6]="./img/one.png";
img[7]="./img/look.png";
img[8]="./img/p1.png";
img[9]="./img/one.png";
request.setAttribute("na",img);
request.setAttribute("id", id);
%>
<c:forEach items="${na}" var="val">
<li class="active one" onclick="act(${val})">
<div id="hover1" style="height:100% ;">
<img alt="" src="${val}">
</div>
</li>
</c:forEach>
</ul>
</div>
<script type="text/javascript">
function act(i){
console.log('./Home/index.jsp?id='+i);
//这个就是跳转,在后面加参数
//window.location.href='./Home/index.jsp?id='+id;
}
</script>
<!-- 分页 -->
<style type="text/css">
.pagination{
position:relative;
text-align: center;
top:150px;
margin-bottom: 20px;
z-index: 2;
}
.pagination ul li{
position: relative;
display: inline-block;
border-radius:50%;
width:25px;
height:25px;
background: white;
cursor: pointer;
transition: all 0.4s ease-out;
}
.pagination ul li a{
text-decoration: none;
color: black;
}
#firstpage{
background: #00CD66;
}
#a{
color: white;
}
</style>
<div>
<div class="pagination">
<%! int dd[]={1,2,3,4,5,6,7,8,9,10};
%>
<%
request.setAttribute("dd", dd);
%>
<ul class="on">
<li class="prev"><a><</a></li>
<c:forEach items="${dd}" var="val" varStatus="index">
<c:if test="${index.index<4}">
<li class="li li${index.index} lii"><a>${val}</a></li>
</c:if>
</c:forEach>
<!--
<li class="li" id="firstpage"><a id="a">1</a></li>
<li class="li"><a>2</a></li>
<li class="li"><a>3</a></li>
<li class="li"><a>4</a></li>
-->
<li class="next" ><a> > </a></li>
</ul>
</div>
</div>
<script type="text/javascript">
$(".li0").attr('id','firstpage');
$("#firstpage a").attr('id','a');
$(".pagination .li").click(function(){
var a =parseInt($(this).text());
console.log(a);
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
$(this).attr('id','firstpage');
$("#firstpage a").attr('id','a');
window.location.href='./PagingServlet?pageid='+a;
})
$(".pagination .prev").click(function(){
if(($("#firstpage").children().text()!='1')&&($("#firstpage").prev().attr("class")=="prev"))
{
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a-1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
window.location.href='./PagingServlet?pageid='+page;
}
else if($("#firstpage").children().html()!='1')
{
var pre = $("#firstpage").prev();
var prea = $("#firstpage").prev().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
}
})
$(".pagination .next").click(function(){
if($("#firstpage").children().html()!='${fn:length(dd)}')
console.log("y");
if("qq"=="qq")
console.log("yy");
if(($("#firstpage").children().text()!='${fn:length(dd)}')&&($("#firstpage").next().attr("class")=="next"))
{
console.log('大于4');
var te = $(".lii a").text();
console.log(te);
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a+1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
window.location.href='./PagingServlet?pageid='+page;
}
else if($("#firstpage").children().html()!='${fn:length(dd)}')
{
var pre = $("#firstpage").next();
var prea = $("#firstpage").next().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
var page = parseInt($("#firstpage").children().text());
//发送page页号
window.location.href='./PagingServlet?pageid='+page;
}
})
</script>
</body>
</html>

@ -0,0 +1,370 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>发布求购</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<style>
body{
width:1520px;
}
.bg{
position:absolute;
width:1520px;
z-index: -10;
left:-300px;
top:-340px;
}
.nav{
position:relative;
width:900px;
margin: 0 auto;
height:100px;
text-align: center;
background: #3CB371;
}
.bord{
top:300px;
position:relative;
width:900px;
margin: 0 auto;
background: white;
z-index: 2;
}
.nav a{
position: relative;
margin-top: 10px;
color: black;
top:30px;
font-size: 30px;
color: white;
}
select{
height:40px;
width:400px;
border: 1px solid #D4D4D4;
}
.form-control{
height:40px;
width:263px;
border: 1px solid #D4D4D4;
}
.container{
position:relative;
border: 1px solid #DCDCDC;
padding-left: 50px;
padding-top: 30px;
padding-bottom:100px;
top:80px;
left:10px;
background: white;
}
input {
outline-color: #FFB90F;
height:40px;
border-radius:5px;
border: 1px solid #D4D4D4;
text-indent: 20px;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
textarea::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
textarea::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.row{
margin-top: 10px;
}
.lbl{
margin-bottom: 5px;
}
input{
width:800px;
}
.submit{
margin-top: 40px;
}
.in{
width:800px;
outline-color: #FFB90F;
}
.submit{
background: #00CD64;
color: white;
}
</style>
<body>
<div class="bord">
<img class="bg" alt="" src="./img/fbqg.png">
<div class="container">
<s:form class="contact" action="Fbqg" method="post" id="form_example" enctype="multipart/form-data" >
<div class="row clearfix">
<div class="lbl">
<label for="name">
标题</label>
</div>
<div class="ctrl">
<input type="text" id="name" name="qg.title" data-required="true" data-validation="text" data-msg="Invalid Name" placeholder="很重要,显示在列表页">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="message">
描述</label>
</div>
<div class="ctrl">
<textarea class="in" id="message" name="qg.miao" rows="6" cols="10" placeholder="介绍一下你曾经的宝贝吧~"></textarea>
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
预期价格</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="qg.price" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="想多少钱出手呢?">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
微信号</label>
</div>
<div class="ctrl">
<input type="text" calss="in" id="phone" name="qg.wx" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
手机号</label>
</div>
<div class="ctrl">
<input type="text"class="in" id="phone" name="qg.tel" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的 ">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
QQ</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="qg.qq" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<!--
<div class="row clearfix"><div class="lbl">
<label>上传图片:</label></div>
<div class="ctrl">
<div style="display: none" id="myss"> <img id="img" src="">
<div style="height: 20px"></div>
</div>
<input id="files" type="file" onchange="compress()" multiple name="file" style="height:25px;border:none" >
<input type="hidden" value="" name="image" id="image">
<script type="text/javascript">
$(document).ready(function () {
var fileList = [];
var fileCatcher = document.getElementById('form_example');
var files = document.getElementById("files"), renderFileList;
var fileListDisplay = document.getElementById('file-list-display'), sendFile;
fileCatcher.addEventListener("submit", function (event) {
event.preventDefault();
//上传文件
sendFile();
console.log(1);
});
files.addEventListener("change", function (event) {
for (var i = 0; i < files.files.length; i++) {
console.log("file"+i);
fileList.push(files.files[i]);
}
console.log(2);
renderFileList();
console.log(3);
});
renderFileList = function () {
fileListDisplay.innerHTML = '';
fileList.forEach(function (file, index) {
{}
let fileObj = file ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log("data");
var imgg = document.createElement("img");
imgg.src =data ;
fileListDisplay.appendChild(imgg);
}};
console.log(4);
var fileDisplayEl = document.createElement("p");
fileDisplayEl.innerHTML = (index + 1) + ":" + file.name;
fileListDisplay.appendChild(fileDisplayEl);
})
};
sendFile = function () {
console.log(5);
var formData = new FormData();
var request = new XMLHttpRequest();
//循环添加到formData中
fileList.forEach(function (file) {
console.log(6);
formData.append('files', file, file.name);
})
request.open("POST", "/test/upload.do");
request.send(formData);
}
})
</script>
<!--
<script>
// 对图片进行压缩
function compress() {
let fileObj = document.getElementById('file').files[0] ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log(data);
//压缩完成
document.getElementById('img').src = data;
//document.getElementById('image').value =data;
var div = document.getElementById("myss");
div.style.setProperty('display','block');
}
}
}
</script>
-->
<input type="hidden" value="1577948535" name="senddate">
<input type="hidden" value="1577948535" name="sortrank">
<input type="hidden" value="1577948535" name="arcrank">
<input type="hidden" value="1" name="typeid">
<input type="hidden" value="20" name="channelid">
<input type="hidden" value="1" name="type">
<div class="row clearfix">
<div class="span10 offset2">
<input type="submit" name="submit" class="submit" value="确认发布">
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div></div>
</div>
</body>
</html>

@ -0,0 +1,404 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>发布闲置</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<style>
body{
width:1520px;
}
.bg{
position:absolute;
width:1520px;
z-index: -10;
left:-300px;
top:-340px;
}
.nav{
position:relative;
width:900px;
margin: 0 auto;
height:100px;
text-align: center;
background: #3CB371;
}
.bord{
top:300px;
position:relative;
width:900px;
margin: 0 auto;
background: white;
z-index: 2;
}
.nav a{
position: relative;
margin-top: 10px;
color: black;
top:30px;
font-size: 30px;
color: white;
}
select{
height:40px;
width:400px;
border: 1px solid #D4D4D4;
}
.form-control{
height:40px;
width:263px;
border: 1px solid #D4D4D4;
}
.container{
position:relative;
border: 1px solid #DCDCDC;
padding-left: 50px;
padding-top: 30px;
padding-bottom:100px;
top:80px;
left:10px;
background: white;
}
input {
outline-color: #FFB90F;
height:40px;
border-radius:5px;
border: 1px solid #D4D4D4;
text-indent: 20px;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
textarea::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
textarea::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.row{
margin-top: 10px;
}
.lbl{
margin-bottom: 5px;
}
input{
width:800px;
}
.submit{
margin-top: 40px;
}
.in{
width:800px;
outline-color: #FFB90F;
}
.submit{
background: #00CD64;
color: white;
}
</style>
<body>
<div class="bord">
<img class="bg" alt="" src="./img/fbxz.png">
<div class="container">
<s:form class="contact" action="Fbxz" method="post" id="form_example" enctype="multipart/form-data" >
<div class="row clearfix">
<div class="row clearfix">
<div class="lbl">
<label for="name">
物品种类</label>
</div>
<div class="ctrl">
<select class="sele" name="xz.typeid" style="width:40%;outline-color: #FFB90F;">
<option value=1>数码产品</option><option value=2>书籍教材</option><option value=3>衣物鞋帽</option><option value=4>代步工具</option><option value=5>美妆洗护</option><option value=6>饰品配件</option><option value=7>生活用品 </option></select>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="name">
标题</label>
</div>
<div class="ctrl">
<input type="text" id="name" name="xz.title" data-required="true" data-validation="text" data-msg="Invalid Name" placeholder="很重要,显示在列表页">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="message">
描述</label>
</div>
<div class="ctrl">
<textarea class="in" id="message" name="xz.miao" rows="6" cols="10" placeholder="介绍一下你曾经的宝贝吧~"></textarea>
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
标价</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xz.sep" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="想多少钱出手呢?">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
原价</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xz.orp" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="购买时的价格哦">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
地点</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xz.address" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="约个地点见面吧~">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
微信号</label>
</div>
<div class="ctrl">
<input type="text" calss="in" id="phone" name="xz.wx" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="微信号">
手机号</label>
</div>
<div class="ctrl">
<input type="text"class="in" id="phone" name="xz.tel" data-required="true" data-validation="custom" data-msg="Invalid Phone #" placeholder="微信号手机号QQ号要至少填一项的 ">
</div>
</div>
<div class="row clearfix">
<div class="lbl">
<label for="email">
QQ</label>
</div>
<div class="ctrl">
<input type="text" id="email" name="xz.qq" data-required="true" data-validation="email" data-msg="Invalid E-Mail" placeholder="微信号手机号QQ号要至少填一项的">
</div>
</div>
<!--
<div class="row clearfix"><div class="lbl">
<label>上传图片:</label></div>
<div class="ctrl">
<div style="display: none" id="myss"> <img id="img" src="">
<div style="height: 20px"></div>
</div>
<input id="files" type="file" onchange="compress()" multiple name="file" style="height:25px;border:none" >
<input type="hidden" value="" name="image" id="image">
<script type="text/javascript">
$(document).ready(function () {
var fileList = [];
var fileCatcher = document.getElementById('form_example');
var files = document.getElementById("files"), renderFileList;
var fileListDisplay = document.getElementById('file-list-display'), sendFile;
fileCatcher.addEventListener("submit", function (event) {
event.preventDefault();
//上传文件
sendFile();
console.log(1);
});
files.addEventListener("change", function (event) {
for (var i = 0; i < files.files.length; i++) {
console.log("file"+i);
fileList.push(files.files[i]);
}
console.log(2);
renderFileList();
console.log(3);
});
renderFileList = function () {
fileListDisplay.innerHTML = '';
fileList.forEach(function (file, index) {
{}
let fileObj = file ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log("data");
var imgg = document.createElement("img");
imgg.src =data ;
fileListDisplay.appendChild(imgg);
}};
console.log(4);
var fileDisplayEl = document.createElement("p");
fileDisplayEl.innerHTML = (index + 1) + ":" + file.name;
fileListDisplay.appendChild(fileDisplayEl);
})
};
sendFile = function () {
console.log(5);
var formData = new FormData();
var request = new XMLHttpRequest();
//循环添加到formData中
fileList.forEach(function (file) {
console.log(6);
formData.append('files', file, file.name);
})
request.open("POST", "/test/upload.do");
request.send(formData);
}
})
</script>
<!--
<script>
// 对图片进行压缩
function compress() {
let fileObj = document.getElementById('file').files[0] ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log(data);
//压缩完成
document.getElementById('img').src = data;
//document.getElementById('image').value =data;
var div = document.getElementById("myss");
div.style.setProperty('display','block');
}
}
}
</script>
-->
<input type="hidden" value="1577948535" name="senddate">
<input type="hidden" value="1577948535" name="sortrank">
<input type="hidden" value="1577948535" name="arcrank">
<input type="hidden" value="1" name="typeid">
<input type="hidden" value="20" name="channelid">
<input type="hidden" value="1" name="type">
<div class="row clearfix">
<div class="span10 offset2">
<input type="submit" name="submit" class="submit" value="确认发布">
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div></div>
</div>
</body>
</html>

@ -0,0 +1,409 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'qginfo.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #F5F5F5;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
height:100%;
}
</style>
<!--
<img class="back" alt="" src="./img/tzsc.png">
-->
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="/paths" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="/courses" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="/shixuns">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="/competitions">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="/moop_cases">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下商品图片 -->
<style>
*::selection{
background: none;
}
#box ul li{
margin: 0;
padding:0;
list-style: none;
text-align: center;
line-height: 270px;
font-size: 30px;
}
#box{
width:650px;
height:500px;
position:relative;
left:70px;
border: 1px solid green;
}
#box li{
width:100%;
height:100%;
position:absolute;
opacity:0;
transition:1s;
}
#box ul li:FIRST-CHILD {
opacity:1;
}
.btn{
witdh:80px;
height:30px;
color:black;
top:200px;
position:absolute;
text-align: center;
line-height: 30px;
cursor: pointer;
background: ;
}
#prevv{
left:-50px;
}
#nextt{
right:-50px;
}
.btn:HOVER {
background: rgba(0,0,0,0.05);
}
.btn:ACTIVE {
background: rgba(0,0,0,0.5);
}
.shouye{
height:500px;
position: relative;
width:800px;
border: 1px red solid;
}
.sub{
text-decoration:none;
text-align:center;
width:100px;
height:35px;
padding-top:5px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: block;
vertical-align: bottom;
margin-top: 20px;
outline: none;
position: relative;
top:180px;
left:250px;
}
.picture{
border: 1px black solid;
height:500px;
position: relative;
top:100px;
left:50px;
width:800px; }
.sub:HOVER{
background: #EEAD0E;
}
.sub:ACTIVE{
background: #FFB90F;
}
</style>
<div class="picture">
<div class="shouye">
<div id="box">
<div class="btn" id="prevv" onclick="clickprev()">prev</div>
<ul>
<%! String img[]={"","",""};
int im[]={1,2};
%>
<% im[0]=1;
img[0]="./img/one.png";
img[1]="./img/look.png";
img[2]="./img/p1.png";
request.setAttribute("qq", img);
request.getAttribute("qq");
%>
<c:forEach items="${qq}" var="val">
<li class="ll" id=0><img alt="" src="${val}"> </li>
</c:forEach>
<li class="ll" id=0>美好的一天从MyDay开始</li>
<li class="ll" id=1>校园超市为你方便购物</li>
<li class="ll" id=2>失物招领让你的宝贝回家</li>
<li class="ll" id=2>资源共享丰富你的知识</li>
<li class="ll" id=2>跳蚤市场轻松解决你不需要的物品</li>
</ul>
<div class="btn" id="nextt" onclick="clicknext()">next</div>
</div>
</div>
<script type="text/javascript">
var ll = document.getElementsByClassName("ll");
var pre = document.getElementById("prevv");
var next = document.getElementById("nextt");
var index = 0;
var int;
//定时器
int=self.setInterval("wrapernext()",3000);
//3秒后开始定时
//setTimeout("SetInterval()",3000);
function wrapernext(){
index++;
if(index == ll.length) index=0;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clicknext(){
window.clearInterval(int) ;
int=null;
wrapernext();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
};
function wraperprev(){
index--;
if(index == -1) index=ll.length-1;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clickprev(){
window.clearInterval(int) ;
int=null;
wraperprev();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
}
</script>
</div>
<!-- 以下商品介绍 -->
<style>
.intro{
border: 1px black solid;
width:600px;
height:500px;
position: relative;
top:-400px;
left:900px;
}
.But{
border: 1px red solid;
}
.But a{
border: 1px red solid;
}
.lie0{
color: red;
}
</style>
<%! int aa[]={1,2,3,4,5,6,7,88}; %>
<% request.setAttribute("nn", aa); %>
<div class="intro" >
<ul class="eeight">
<c:forEach items="${nn}" var="val" varStatus="index">
<c:if test="${index.index<7}">
<li class="lie${index.index }"><a>${val}</a></li>
</c:if>
</c:forEach>
</ul>
<div class="But" onclick="">
<a >
查看联系方式
</a>
</div>
</div>
<%! String a[]={""};int b[]={11,22,33,44,55,66,77,88}; %>
<% b[7]=1;a[0]="zz"; %>
<script type="text/javascript">
$
$(document).ready(function () {
$(".But").click(function(){
console.log();
$(this).children().text("${nn[7]}");
});
});
</script> </body>
</html>

@ -0,0 +1,540 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'qiugou.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #F5F5F5;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
}
</style>
<img class="back" alt="" src="./img/tzsc.png">
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="./Market/buy.jsp" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="./LostAndFound/found.jsp">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="./404.jsp">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="./Register/register" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下两大类别 -->
<style>
*{
padding: 0;
margin: 0;
}
.twobord{
position:absolute;
height: 100px;
top:600px;
width:1520px;
}
.twotypes{
position:absolute;
width:1000px;
height: 100px;
left:260px;
text-align: center;
}
.chose{
height:100px;
float:left;
display: inline-block;
position: absolute;
}
.chose1{
width:400px;
z-index:11;
left:50px;
cursor: pointer;
}
.chose2{
width:370px;
right: 50px;
position: absolute;
z-index: 11;
cursor: pointer;
}
.chose div{
position:absolute;
width: 300px;
height:100px;
display: inline-block;
float: left;
left:100px;
background: rgba(5,5,5,0);
}
.chose img{
position:absolute;
width:100px;
display: inline-block;
left:0px;
float: left;
top:0px;
height:100px;
}
.chose p{
text-align: left;
text-indent: 10px;
z-index: 10;
}
.chose div p:FIRST-CHILD {
margin-top: 10px;
font-size: 30px;
} .chose div p:LAST-CHILD{
}
</style>
<div class="twobord">
<div class="twotypes">
<div class=" chose chose1" >
<img alt="" src="./img/look.png" >
<div>
<p onclick="window.location.href='./Market/buy.jsp';"> 查看闲置</p>
<p onclick="window.location.href='./Market/buy.jsp';">逛市场可以赚大钱哦~</p>
</div>
</div>
<div class="chose chose2" >
<img alt="" src="./img/fabu.png">
<div>
<p onclick="window.location.href='./Market/fbqg.jsp';">发布求购</p>
<p onclick="window.location.href='./Market/fbqg.jsp';">逛市场可以赚大钱哦~</p>
</div>
</div>
</div>
<script type="text/javascript">
function tiao(){
window.location.href='http://www.baidu.com';
}
</script>
<!-- 商品列表 -->
<style>
.qg{
position:relative;
width:1000px;
height:auto ;
margin :10px auto;
top:150px;
}
.ul{
width:1000px;
height:200px;
position:relative;
}
.li{
width:100%;
height: 200px;
list-style: none;
padding-top: 0px;
position:relative;
margin-bottom:10px;
background: white;
border-radius:10px;
}
.li:HOVER{
background: #FFFFE0;
}
.info{
width:700px;
height: 200px;
display: inline-block;
position: relative;
top: 0px;c
}
.li img{
position:relative;
left:25px;
width:250px;
height: 150px;
top:20px;
}
.dul{
position: relative;
top:10px;
display:block;
}
.dclass{
list-style: none;
position: relative;
height:auto;
display:block;
margin-bottom: 10px;
text-indent: 30px;
}
.dctwo{
color:#333333;
font-family: ;
font-size: 20px;
font-weight: bold;
}
.dctwo:HOVER{
color: #00CD64;
}
.dcthree div{
position:relative;
display: inline-block;
left: -30px;
}
.dcthree :LAST-CHILD{
color: red;
text-indent:5px;
display: inline-block;
font-size: 20px;
font-weight: bold;
}
.dcfour{
color:#363636;
font-family: cursive;
}
.dcfive div{
display: inline-block;
color: #424242;
text-indent: 10px;
}
</style>
<%
int a[]={1,2,3,4,5};
request.setAttribute("name", a);
%>
<div class="qg">
<ul class="ul">
<c:forEach items="${name}" var="val" >
<li class="li" onclick="qiu(${val})">
<div class="info">
<ul class="dul">
<li class="dclass dcone">${val.name}</li>
<li class="dclass dctwo">${val.title}</li>
<li class="dclass dcthree"><div>预期价格:</div><div>${val.price}</div></li>
<li class="dclass dcfour">${val.miao}</li>
<li class="dclass dcfive"><div>wx:</div><div>${val.wx}</div><div>phone:</div><div>${val.tel}</div><div>qq:</div><div>${val.qq}</div></a>
</li>
</ul>
</div>
<img src="${val.picture}">
</li>
</c:forEach>
</ul>
</div>
<script type="text/javascript">
function qiu(id){
window.location.href="http://www.baidu.com";
//window.location.href='./Home/index.jsp?id='+id;
};
</script>
<!-- 分页 -->
<style type="text/css">
.pagination{
position:relative;
text-align: center;
top:1050px;
z-index: 2;
}
.pagination ul li{
position: relative;
display: inline-block;
border-radius:50%;
width:25px;
height:25px;
background: white;
cursor: pointer;
transition: all 0.4s ease-out;
}
.pagination ul li a{
text-decoration: none;
color: black;
}
#firstpage{
background: #00CD66;
}
#a{
color: white;
}
</style>
<div>
<div class="pagination">
<%! int dd[]={1,2,3,4,5,6,7,8,9,10};
%>
<%
request.setAttribute("dd", dd);
%>
<ul class="on">
<li class="prev"><a><</a></li>
<c:forEach items="${name}" var="val" varStatus="index">
<c:if test="${index.index<4}">
<li class="li li${index.index} lii"><a>${val}</a></li>
</c:if>
</c:forEach>
<!--
<li class="li" id="firstpage"><a id="a">1</a></li>
<li class="li"><a>2</a></li>
<li class="li"><a>3</a></li>
<li class="li"><a>4</a></li>
-->
<li class="next" ><a> > </a></li>
</ul>
</div>
</div>
<script type="text/javascript">
$(".li0").attr('id','firstpage');
$("#firstpage a").attr('id','a');
$(".pagination .li").click(function(){
var a = $(this).html();
console.log(a);
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
$(this).attr('id','firstpage');
$("#firstpage a").attr('id','a');
})
$(".pagination .prev").click(function(){
if(($("#firstpage").children().text()!='1')&&($("#firstpage").prev().attr("class")=="prev"))
{
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a-1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='1')
{
var pre = $("#firstpage").prev();
var prea = $("#firstpage").prev().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
}
})
$(".pagination .next").click(function(){
if($("#firstpage").children().html()!='${fn:length(name)}')
console.log("y");
if("qq"=="qq")
console.log("yy");
if(($("#firstpage").children().text()!='${fn:length(name)}')&&($("#firstpage").next().attr("class")=="next"))
{
console.log('大于4');
var te = $(".lii a").text();
console.log(te);
$(".lii a").each(function () {
var a=parseInt($(this).text());
a=a+1;
$(this).text(a);
})
var page = parseInt($("#firstpage").children().text());
page=page+1;
//发送page页号
}
else if($("#firstpage").children().html()!='${fn:length(name)}')
{
var pre = $("#firstpage").next();
var prea = $("#firstpage").next().children();
$("#firstpage").removeAttr("id");
$("#a").removeAttr("id");
pre.attr('id','firstpage');
prea.attr('id','a');
var page = parseInt($("#firstpage").children().text());
//发送page页号
}
})
</script>
</body>
</html>

@ -0,0 +1,474 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'sell.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<style>
*::selection{
background: none;
}
*{
margin: 0;
padding: 0;
}
body{
width:1520px;
position:relative;
background: #FDF5E6;
}
.back{
width:1520px;
z-index: -1;
position: absolute;
}
.newheader{
height: 60px;
background-color: #00CD66;
width:1520px;
position: fixed;
z-index: 110;
top:0;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 60px;
width: 60px;
float: left;
margin: auto 20px;
position:relative;
top:-15px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
.color-white{
margin: 10px 10px 10px 10px;
}
.mr5{
position:relative;
bottom: -20px;
}
body{
background-repeat: no-repeat;
background-size:cover;
background-position: 0 60px;
height:100%;
}
</style>
<!--
<img class="back" alt="" src="./img/tzsc.png">
-->
<div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="/paths" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="/courses" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="/shixuns">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="/competitions">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="/moop_cases">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="./Login/login.jsp" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
<!-- 以上导航 -->
<!-- 以下商品图片 -->
<style>
*::selection{
background: none;
}
#box ul li{
margin: 0;
padding:0;
list-style: none;
text-align: center;
line-height: 270px;
font-size: 30px;
}
#box{
width:650px;
height:500px;
position:relative;
left:px;
}
#box li{
width:100%;
height:100%;
position:absolute;
opacity:0;
transition:1s;
}
#box ul li:FIRST-CHILD {
opacity:1;
}
.btn{
width:40px;
height:500px;
color:black;
position:absolute;
text-align: center;
line-height: 450px;
cursor: pointer;
background: rgba(0,0,0,0.05);
color: white;
}
#prevv{
left:0px;
z-index: 10;
}
#nextt{
right:-15px;
}
.btn:HOVER {
background: rgb(220 ,220, 220,0.8);
}
.btn:ACTIVE {
background: rgba(220 ,220, 220,0.5);
}
.shouye{
height:500px;
position: relative;
width:650px;
}
.sub{
text-decoration:none;
text-align:center;
width:100px;
height:35px;
padding-top:5px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: block;
vertical-align: bottom;
margin-top: 20px;
outline: none;
position: relative;
top:180px;
left:250px;
}
.pic{
height:600px;
position: absolute;
top:80px;
left:125px;
width:1250px;
background: #F5F5F5;
z-index: -20;
opacity:1;
box-shadow:10px 10px 20px 10px rgba(220 ,220 ,220,0.5);
border-radius:7px;
}
.picture{
height:500px;
position: relative;
top:100px;
left:150px;
width:630px;
z-index: 10;
background:white;
opacity:1;
}
.sub:HOVER{
background: #EEAD0E;
}
.sub:ACTIVE{
background: #FFB90F;
}
.ll img{
width:600px;
height:500px;
}
</style>
<div class="pic">
</div>
<div class="picture">
<div class="shouye">
<div id="box">
<div class="btn" id="prevv" onclick="clickprev()"><<</div>
<ul>
<%! String img[]={"","",""};
int im[]={1,2};
%>
<% im[0]=1;
img[0]="./img/one.png";
img[1]="./img/look.png";
img[2]="./img/p1.png";
request.setAttribute("qq", img);
request.getAttribute("qq");
%>
<c:forEach items="${qq}" var="val">
<li class="ll" id=0><img alt="" src="${val}"> </li>
</c:forEach>
</ul>
<div class="btn" id="nextt" onclick="clicknext()">>></div>
</div>
</div>
<script type="text/javascript">
var ll = document.getElementsByClassName("ll");
var pre = document.getElementById("prevv");
var next = document.getElementById("nextt");
var index = 0;
var int;
//定时器
int=self.setInterval("wrapernext()",3000);
//3秒后开始定时
//setTimeout("SetInterval()",3000);
function wrapernext(){
index++;
if(index == ll.length) index=0;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clicknext(){
window.clearInterval(int) ;
int=null;
wrapernext();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
};
function wraperprev(){
index--;
if(index == -1) index=ll.length-1;
console.log(ll.length);
for(var i=0;i<ll.length;i++){
ll[i].style.opacity=0;
}
ll[index].style.opacity=1;
};
function clickprev(){
window.clearInterval(int) ;
int=null;
wraperprev();
if(int==null){
int=self.setInterval("wrapernext()",3000);
}
}
</script>
</div>
<!-- 以下商品介绍 -->
<style>
.intro{
border-left: 1px #DCDCDC solid;
box-shadow:10px 10px 20px 10px rgba(220 ,220 ,220,0.5);
border-radius:7px;
width:450px;
height:500px;
position: relative;
top:-400px;
left:850px;
background: #FDF5E6;
}
.But{
position:relative;
bottom:-60px;
width:200px;
height:40px;
text-align: center;
margin-left: 30px;
background: #00CD66;
line-height: 35px;
letter-spacing: 3px;
color: white;
}
.lie0{
color: black;
font-size: large;
font-weight: bold;
}
.lie{
margin-top: 10px;
list-style: none;
display: inline-block;
margin-left: 30px;
}
.lie1{
font-size: x-large;
font-weight: bolder;
}
.lie3{
font-size: xx-large;
font-weight: bolder;
color: red;
}
.lie4:FIRST-CHILD{
margin-right: 10px;
display: inline-block;
}
.uname{
margin-left: 10px;
letter-spacing: 5px;
color: #949494;
}
</style>
<%! String aa[]={"滴答","自行车新货出售","没有划痕,全新","8折","1000","湖师大","00000000","88000000000"}; %>
<% request.setAttribute("nn", aa); %>
<div class="intro" >
<ul class="eeight">
<!-- <c:forEach items="${nn}" var="val" varStatus="index">
<c:if test="${index.index<7}">
<li class="lie${index.index } lie"><a>${val}</a></li>
</c:if>
</c:forEach>
-->
<a class="uname">账户名:</a><li class="lie lie0"><a>滴答</a></li> <br/>
<a class="uname">标题:</a><li class="lie lie1"><a>滴答</a></li> <br/>
<a class="uname">描述:</a><li class="lie lie2"><a>滴答</a></li> <br/>
<a class="uname">转卖价格:</a><li class="lie lie3"><a style="color: black;font-size:medium;">RMB</a><a>790</a></li> <br/>
<a class="uname">原价:</a><li class="lie lie4"><a style="color: black;font-size:medium;font-weight:normal;"></a><a>1300</a></li> <br/>
<a class="uname">交易地点:</a><li class="lie lie5"><a>湖南师大</a></li> <br/>
<a class="uname">微信:</a><li class="lie lie6"><a>滴答12334455</a></li> <br/>
</ul>
<div class="But" onclick="">
查看联系方式
</div>
</div>
<%! String a[]={""};int b[]={11,22,33,44,55,66,77,88}; %>
<% b[7]=1;a[0]="zz"; %>
<script type="text/javascript">
$
$(document).ready(function () {
$(".But").click(function(){
console.log();
$(this).text("${nn[7]}");
});
});
</script>
</body>
</html>

@ -0,0 +1,308 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>注册</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<script src="js/jquery-1.11.3.js"></script>
<style>
*{
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
}
#back{
background-image:url('./img/login2.png');
background-repeat: no-repeat,no-repeat;
background-size:contain,contain;
background-position:0 150px;
height:100%;
width:1520px;
}
.logback{
position:relative;
top:50px;
padding-top:0.5px;
border-radius:7px;
width:450px;
height:600px;
margin-left: 300px;
z-index: 6;
background: #F8F8FF;
opacity:0.95;
box-shadow:10px 10px 20px 10px rgba(220 ,220 ,220,0.5)
}
.loginform{
position: relative;
width:350px;
margin:auto auto;
margin-top: 12%;
}
.loginform .logtype{
text-align: center;
margin-bottom: 30px;
letter-spacing: 1px;
}
.loginform .logtype a{
margin-right: 10px;
font-weight: bold;
font-size: 23px;
cursor: pointer;
}
.loginform .logtype a:ACTIVE{
color:#EEAD0E;
}
form{
}
form .info{
margin-bottom: 20px;
width:100%;
height:43px;
border-radius:7px;
background: rgb(235 ,235, 235);
border: none;
text-indent: 15px;
letter-spacing: 1px;
font-size: 95%;
outline-color: #FFB90F;
}
form .info:FOCUS{
background: white;
}
select:FOCUS{
background: white;
outline-color: #FFB90F;
}
input::-moz-placeholder { /* Mozilla Firefox 4 to 18 适配火狐 */
color: rgb(180 ,180, 180);;
}
input::-webkit-input-placeholder { /* WebKit browsers 适配谷歌 */
color: rgb(180 ,180, 180);
}
.sub{
width:40%;
height:35px;
border-radius:7px;
border: none;
background: #FFB90F;
color: white;
font-size:120%;
letter-spacing: 4px;
display: inline;
vertical-align: top;
margin-top: 20px;
outline: none;
}
.sub:HOVER{
background: #EEAD0E;
}
.sub:ACTIVE{
background: #EEAD0E;
}
.reg{
display: inline-block;
vertical-align: top;
margin-left: 40%;
text-align: right;
margin-top: 20px;
}
.reg p{
font-size: 80%;
color: rgb(180 ,180, 180);
margin-top: 0px;
margin-bottom: 5px;
cursor: pointer;
}
.reg p:ACTIVE {
color: #EEAD0E;
}
select {
width:350px;
height:43px;
margin-bottom: 20px;
background: rgb(235 ,235, 235);
border: none;
}
#tip{
display: block;
}
</style>
<style>/*导航*/
/*
.newheader{
height: 60px;
background-color: #3CB371;
}
.head-nav{
height: 60px;
color: yellow;
position:relative;
left:-20px;
}
.head-nav #header-nav{
height: 60px;
color: yellow;
margin-top:0;
}
.logo{
}
.logo img{
height: 40px;
width: 40px;
float: left;
margin: auto 20px;
position:relative;
top:-10px;
}
.pr{
float: left;
margin: auto 10px;
}
.pr a{
color: white;
text-decoration: none;
position:relative;
top:20px;
}
.login{
height:60px;
}
*/
</style>
<!-- <div class="newheader">
<div class="head-nav pr" id="head-navpre1">
<ul id="header-nav">
<a class="logo">
<img alt="" src="./img/sLogo.png" >
</a>
<li class="pr" style="display: block;">
<a href="/paths" >跳蚤市场</a>
</li>
<li class="pr" style="display: block;">
<a href="/courses" >校园超市</a>
</li>
<li class="pr" style="display: block;">
<a href="/shixuns">失物招领</a>
</li>
<li class="pr" style="display: block;">
<a href="/competitions">资源共享</a>
</li>
<li class="pr" style="display: block;">
<a href="/moop_cases">兴趣论坛</a>
</li>
</ul>
</div>
<span class="login pr" style="float: right;">
<a href="" class="mr5 color-white" >登录</a>
<em class="vertical-line" ></em>
<a href="/register" class="mr5 color-white">注册</a>
</span>
</div>
-->
<div id="back" >
<div class="logback">
<div class="loginform">
<div class="logtype">
<a class="register">注册</a>
</div>
<s:form action="Register" method="post" autocomplete="on">
<input type="text" name="user.username" class="info" placeholder="请使用用户名进行注册" required/><br/>
<select class="form-control" id="cmbProvince" name="" ><option value="请选择所在校">请选择所在校</option><option value="湖南师范大学">湖南师范大学</option><option value="湖南大学">湖南大学</option></select>
<input type="password" class="info" name="user.password" placeholder="设置新密码" id="pwd1" required/><br/>
<input type="password" class="info" placeholder="再次输入密码" id="pwd2" required/ onkeyup="validate()"><br/>
<a id="tip"><font color='red' style='visibility: hidden;'>12</font></a>
<input type="submit" id="submit" class="sub" onkeyup="" value="注册" />
<script>
function validate() {
var pwd1 = document.getElementById("pwd1").value;
var pwd2 = document.getElementById("pwd2").value;
console.log(pwd1);
if(pwd1 == pwd2) {
document.getElementById("tip").innerHTML="<font color='green'>√</font>";
if(document.getElementById("submit").disabled==null)
console.log("null");
else console.log("not null");
document.getElementById("submit").disabled = false;
document.getElementById("submit").style.background="#FFB90F";
console.log("same");
}else if(pwd2=="")
{
document.getElementById("tip").innerHTML="<font color='red' style='visibility: hidden;'>12</font>";
}
else {
console.log("same");
document.getElementById("tip").innerHTML="<font color='red'>两次密码不相同</font>";
document.getElementById("submit").disabled=true;
document.getElementById("submit").style.background="rgb(235 ,235, 235)";
}
}
</script>
<div class="reg">
<p onclick="window.location.href='./Login/login.jsp';" >直接登录</p>
</div>
</s:form>
</div>
</div>
<div>
<script type="text/javascript">
var h=document.getElementById("back").clientHeight;
var w=document.getElementById("back").clientWidth;
if(h==null) console.log(0);
console.log(h);
console.log(w);
</script>
</body>
</html>

@ -13,7 +13,6 @@
<property name="title" type="java.lang.String">
<column name="title" length="45" />
</property>
<property name="miao" type="java.lang.String">
<column name="miao" length="45" />
</property>
@ -29,5 +28,8 @@
<property name="qq" type="java.lang.String">
<column name="qq" length="45" />
</property>
<property name="userid" type="java.lang.Integer">
<column name="userid" />
</property>
</class>
</hibernate-mapping>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.Xw" table="xw" catalog="postgres">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="title" type="java.lang.String">
<column name="title" length="45" />
</property>
<property name="miao" type="java.lang.String">
<column name="miao" length="45" />
</property>
<property name="address" type="java.lang.String">
<column name="address" length="45" />
</property>
<property name="time" type="java.lang.String">
<column name="time" length="45" />
</property>
<property name="wx" type="java.lang.String">
<column name="wx" length="45" />
</property>
<property name="tel" type="java.lang.String">
<column name="tel" length="45" />
</property>
<property name="qq" type="java.lang.String">
<column name="qq" length="45" />
</property>
<property name="userid" type="java.lang.Integer">
<column name="userid" length="45" />
</property>
</class>
</hibernate-mapping>

@ -10,6 +10,10 @@
<column name="id" />
<generator class="identity" />
</id>
<property name="typeid" type="java.lang.Integer">
<column name="typeid" length="45" />
</property>
<property name="title" type="java.lang.String">
<column name="title" length="45" />
</property>
@ -22,8 +26,8 @@
<property name="orp" type="java.lang.Integer">
<column name="orp" />
</property>
<property name="postage" type="java.lang.String">
<column name="postage" length="45" />
<property name="address" type="java.lang.String">
<column name="address" length="45" />
</property>
<property name="wx" type="java.lang.String">
<column name="wx" length="45" />
@ -36,9 +40,6 @@
</property>
<property name="userid" type="java.lang.Integer">
<column name="userid" length="45" />
</property>
<property name="typeid" type="java.lang.Integer">
<column name="typeid" length="45" />
</property>
</property>
</class>
</hibernate-mapping>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="com.Zl" table="zl" catalog="postgres">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="title" type="java.lang.String">
<column name="title" length="45" />
</property>
<property name="miao" type="java.lang.String">
<column name="miao" length="45" />
</property>
<property name="address" type="java.lang.String">
<column name="address" length="45" />
</property>
<property name="time" type="java.lang.String">
<column name="time" length="45" />
</property>
<property name="wx" type="java.lang.String">
<column name="wx" length="45" />
</property>
<property name="tel" type="java.lang.String">
<column name="tel" length="45" />
</property>
<property name="qq" type="java.lang.String">
<column name="qq" length="45" />
</property>
<property name="userid" type="java.lang.Integer">
<column name="userid" length="45" />
</property>
</class>
</hibernate-mapping>

@ -26,6 +26,8 @@
<mapping resource="com/Xz.hbm.xml" />
<mapping resource="com/Qg.hbm.xml" />
<mapping resource="com/Xztype.hbm.xml" />
<mapping resource="com/Xw.hbm.xml" />
<mapping resource="com/Zl.hbm.xml" />
</session-factory>

@ -16,14 +16,22 @@
<action name="Login" class="RegisterAction" method="login">
<result name="success">/Home/index.jsp</result>
<result name="error">/success.jsp</result></action>
<action name="Fbxz" class="RegisterAction" method="submitxz">
<result name="success">/welcome.jsp</result>
<result name="error">/success.jsp</result></action>
<action name="Fbqg" class="RegisterAction" method="submitqg">
<result name="success">/welcome.jsp</result>
<result name="error">/success.jsp</result></action>
<action name="Fbxz" class="RegisterAction" method="submit">
<action name="Fbxw" class="RegisterAction" method="submitxw">
<result name="success">/welcome.jsp</result>
<result name="error">/success.jsp</result></action>
<action name="Fbqg" class="SubmitQgAction" method="submit">
<action name="Fbzl" class="RegisterAction" method="submitzl">
<result name="success">/welcome.jsp</result>
<result name="error">/success.jsp</result></action>

@ -24,6 +24,20 @@
<servlet-name>PagingServlet</servlet-name>
<servlet-class>PagingServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>XzListServlet</servlet-name>
<servlet-class>XzListServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>QgListServlet</servlet-name>
<servlet-class>QgListServlet</servlet-class>
</servlet>
@ -41,6 +55,14 @@
<servlet-name>PagingServlet</servlet-name>
<url-pattern>/PagingServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>XzListServlet</servlet-name>
<url-pattern>/XzListServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>QgListServlet</servlet-name>
<url-pattern>/QgListServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>

@ -0,0 +1,535 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'aaa.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<style>
.div {
width: 100px;
height: 100px;
border: 1px solid black;
margin: 10px;
float: left;
padding: 30px;
text-align: center;
background-color: lightgray;
visibility: hidden;
}
.p {
background-color: white;
}
</style>
<div class="div" onmousemove="myMoveFunction()">
<p>onmousemove: <br> <span id="demo">鼠标移动到我这!</span></p>
</div>
<div class="div"onmouseenter="myEnterFunction(this)" onmouseleave="l(this)">
<p>onmouseenter: <br> <span id="demo2">鼠标移动到我这!</span></p>
</div>
<div class="div"onmouseover="myOverFunction()">
<p>onmouseover: <br> <span id="demo3">鼠标移动到我这!</span></p>
</div>
<script>
x = 0;
y = 0;
z = 0;
function myMoveFunction() {
document.getElementById("demo").innerHTML = z+=1;
}
function myEnterFunction(t) {
document.getElementById("demo2").innerHTML = x+=1;
t.style.width="10px";
}
function l(t) {
document.getElementById("demo2").innerHTML = x+=1;
t.style.width="20px";
}
function myOverFunction() {
document.getElementById("demo3").innerHTML = y+=1;
}
</script>
<input type="text" id="test1">
<script src="./laydate/laydate.js"></script> <!-- 改成你的路径 -->
<script>
//执行一个laydate实例
laydate.render({
elem: '#test1' //指定元素
});
</script>
<div class="ctrl">
<div style="display: none" id="myss"> <img id="img" src="">
<div style="height: 20px"></div>
</div>
<input id="file" type="file" onchange="compress()" name="file">
<input type="hidden" value="" name="image" id="image">
<script>
// 对图片进行压缩
function compress() {
let fileObj = document.getElementById('file').files[0] //上传文件的对象
let reader = new FileReader()
reader.readAsDataURL(fileObj)
reader.onload = function(e) {
let image = new Image() //新建一个img标签还没嵌入DOM节点)
image.src = e.target.result
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = ''
canvas.width = imageWidth
canvas.height = imageHeight
context.drawImage(image, 0, 0, imageWidth, imageHeight)
data = canvas.toDataURL('image/jpeg')
//压缩完成
document.getElementById('img').src = data
document.getElementById('image').value =data
var div = document.getElementById("myss");
div.style.setProperty('display','block');
}
}
}
</script>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<option value="请选择">请选择</option>
<select class="form-control" id="cmbProvince" name="cmbProvince" ></select>
<select class="form-control" id="cmbCity" name="cmbCity" ></select>
<select class="form-control" id="cmbArea" name="cmbArea" ></select>
<script type="text/javascript" src="./Address.js" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function(){
addressInit('cmbProvince', 'cmbCity', 'cmbArea');
});
</script>
</div>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script src="jquery-2.1.4.min.js"></script>
<form method="post" action="">
   <ul>
<li>输入你要使用的帐号:<input class="easyui-validatebox" required="true" missingMessage="姓名必须填写" size="20" 
type="text" name="id"></input></li>
<li>输入你要使用的密码:<input class="easyui-validatebox" required="true" missingMessage="密码必须填写" size="20" type="password" name="passwd" id="pwd1"></input></li>
<li>重新输入一样的密码:<input class="easyui-validatebox" required="true" missingMessage="密码必须填写" size="20" type="password" name="passwd" id="pwd2" onkeyup="validate()"/><span id="tishi"></span></input></li>
<li><input id="submit" type="submit" disabled="disabled" value="提交"><input type="reset" value="重新输入"></li>
   </ul>
  </form>
  <a href="index.html">返回主菜单</a>
<script>
function validate() {
var pwd1 = document.getElementById("pwd1").value;
var pwd2 = document.getElementById("pwd2").value;
console.log(pwd1);
if(pwd1 == pwd2) {
document.getElementById("tishi").innerHTML="<font color='green'>两次密码相同</font>";
if(document.getElementById("submit").disabled==null)
console.log("null");
else console.log("not null");
document.getElementById("submit").disabled = false;
console.log("same");
}
else {
console.log("same");
document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
document.getElementById("submit").disabled=true;
}
}
</script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<ul class="onn">
<li v-on:click="onn">111111</li>
</ul>
<script type="text/javascript">
var on = new Vue({
el:'.onn',
methods:{
onn:function(){
console.log(11);
}
}
})
</script>
<style>
body {
background-color: #eee
}
.wrap {
margin: 50px auto 0 auto;
width: 100%;
display: flex;
align-items: space-around;
max-width: 1200px;
}
.tile {
width: 380px;
height: 380px;
margin: 10px;
background-color: #99aeff;
display: inline-block;
background-size: cover;
position: relative;
cursor: pointer;
transition: all 0.4s ease-out;
box-shadow: 0px 35px 77px -17px rgba(0, 0, 0, 0.44);
overflow: hidden;
color: white;
font-family: 'Roboto';
}
.tile img {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
transition: all 0.4s ease-out;
}
.tile .text {
z-index: 99;
position: absolute;
padding: 30px;
height: calc(100% - 60px);
height: calc(100% - 60px);
}
.tile h1 {
font-weight: 300;
margin: 0;
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}
.tile h2 {
font-weight: 100;
margin: 20px 0 0 0;
font-style: italic;
transform: translateX(200px);
}
.tile p {
font-weight: 300;
margin: 20px 0 0 0;
line-height: 25px;
/* opacity:0; */
transform: translateX(-200px);
transition-delay: 0.2s;
}
.animate-text {
opacity: 0;
transition: all 0.6s ease-in-out;
}
.tile:hover {
/* background-color:#99aeff; */
box-shadow: 0px 35px 77px -17px rgba(0, 0, 0, 0.64);
transform: scale(1.05);
}
.tile:hover img {
opacity: 0.2;
}
.tile:hover .animate-text {
transform: translateX(0);
opacity: 1;
}
.dots {
position: absolute;
bottom: 20px;
right: 30px;
margin: 0 auto;
width: 30px;
height: 30px;
color: currentColor;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.dots span {
width: 5px;
height: 5px;
background-color: currentColor;
border-radius: 50%;
display: block;
opacity: 0;
transition: transform 0.4s ease-out, opacity 0.5s ease;
transform: translateY(30px);
}
.tile:hover span {
opacity: 1;
transform: translateY(0px);
}
.dots span:nth-child(1) {
transition-delay: 0.05s;
}
.dots span:nth-child(2) {
transition-delay: 0.1s;
}
.dots span:nth-child(3) {
transition-delay: 0.15s;
}
@media (max-width: 1000px) {
.wrap {
flex-direction: column;
width: 400px;
}
}
.div{
width:150px;
height:150px;
border: 1px solid red;
z-index: 410;
visibility: visible;
position: relative;
}
.aa{
position:relative;
}
</style>
<div class="div">
<a class="aa">123444</a>
</div>
<div class="wrap">
<div class="tile">
<img src='https://images.unsplash.com/photo-1464054313797-e27fb58e90a9?dpr=1&auto=format&crop=entropy&fit=crop&w=1500&h=996&q=80' />
<div class="text">
<h1>Lorem ipsum.</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
<div class="text">
<h1>Lorem ipsum.</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="tile">
<img src='https://images.unsplash.com/photo-1458668383970-8ddd3927deed?dpr=1&auto=format&crop=entropy&fit=crop&w=1500&h=1004&q=80' />
<div class="text">
<h1>Lorem ipsum.</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
<div class="tile">
<img src='https://images.unsplash.com/photo-1422393462206-207b0fbd8d6b?dpr=1&auto=format&crop=entropy&fit=crop&w=1500&h=1000&q=80' />
<div class="text">
<h1>Lorem ipsum.</h1>
<h2 class="animate-text">More lorem ipsum bacon ipsum.</h2>
<p class="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
<div class="dots">
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
{}
let fileObj = file ;//上传文件的对象
let reader = new FileReader();
reader.readAsDataURL(fileObj);
reader.onload = function(e) {
let image = new Image() ;//新建一个img标签还没嵌入DOM节点)
image.src = e.target.result;
image.onload = function() {
let canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
may=300/image.width,
imageWidth =300, //压缩后图片的大小
imageHeight = image.height*may,
data = '';
canvas.width = imageWidth;
canvas.height = imageHeight;
context.drawImage(image, 0, 0, imageWidth, imageHeight);
data = canvas.toDataURL('image/jpeg');
console.log(data);
}};
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<button class="order"><span class="default">Complete Order</span><span class="success">Order Placed
<input type="submit" class="order"><span class="default">Complete Order</span><span class="success">Order Placed
<svg viewbox="0 0 12 10">
<polyline points="1.5 6 4.5 9 10.5 1"></polyline>
</svg></span>
@ -20,7 +20,9 @@
<use xlink:href="#droneGrab"></use>
</svg>
</div>
</button>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 14" id="droneBody" fill="currentColor" stroke="none">
<path d="M38,0.5 C38,0.223857625 38.2238576,5.07265313e-17 38.5,0 C38.7761424,-5.07265313e-17 39,0.223857625 39,0.5 L39,4 C39.5522847,4 40,4.44771525 40,5 L40,6 L40.5,6 C41.3284271,6 42,6.67157288 42,7.5 C42,8.32842712 41.3284271,9 40.5,9 L30,9 L30,9.86761924 C30,10.5701449 29.6314023,11.2211586 29.0289915,11.5826051 L25.4750236,13.7149859 C25.1641928,13.9014843 24.80852,14 24.4460321,14 L17.5539679,14 C17.19148,14 16.8358072,13.9014843 16.5249764,13.7149859 L12.9710085,11.5826051 C12.3685977,11.2211586 12,10.5701449 12,9.86761924 L12,9 L1.5,9 C0.671572875,9 1.01453063e-16,8.32842712 0,7.5 C-1.01453063e-16,6.67157288 0.671572875,6 1.5,6 L2,6 L2,5 C2,4.44771525 2.44771525,4 3,4 L3,0.5 C3,0.223857625 3.22385763,5.07265313e-17 3.5,0 C3.77614237,-5.07265313e-17 4,0.223857625 4,0.5 L4,4 C4.55228475,4 5,4.44771525 5,5 L5,6 L12.005,6 L12.0064818,5.97128221 C12.0580908,5.33141252 12.414937,4.75103782 12.9710085,4.41739491 L16.5249764,2.28501415 C16.8358072,2.09851567 17.19148,2 17.5539679,2 L24.4460321,2 C24.80852,2 25.1641928,2.09851567 25.4750236,2.28501415 L29.0289915,4.41739491 C29.5934099,4.75604592 29.952577,5.34889137 29.9956355,6.0001358 L37,6 L37,5 C37,4.44771525 37.4477153,4 38,4 L38,0.5 Z"></path>

@ -0,0 +1,254 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'cc.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
.float{
float:left;
width : 200px;
height: 200px;
overflow: hidden;
border: 1px solid #CCCCCC;
border-radius: 10px;
padding: 5px;
margin: 5px;
}
img{
position: relative;
}
.result{
width: 200px;
height: 200px;
text-align: center;
box-sizing: border-box;
}
#file_input{
display: none;
}
.delete{
width: 200px;
height:200px;
position: absolute;
text-align: center;
line-height: 200px;
z-index: 10;
font-size: 30px;
background-color: rgba(255,255,255,0.8);
color: #777;
opacity: 0;
transition-duration: 0.7s;
-webkit-transition-duration: 0.7s;
}
.delete:hover{
cursor: pointer;
opacity: 1;
}
</style>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var input = document.getElementById("file_input");
var result;
var dataArr = []; // 储存所选图片的结果(文件名和base64数据)
var fd; //FormData方式发送请求
var oSelect = document.getElementById("select");
var oAdd = document.getElementById("add");
var oSubmit = document.getElementById("submit");
var oInput = document.getElementById("file_input");
if(typeof FileReader==='undefined'){
alert("抱歉,你的浏览器不支持 FileReader");
input.setAttribute('disabled','disabled');
}else{
input.addEventListener('change',readFile,false);
}
//handler
function readFile(){
fd = new FormData();
var iLen = this.files.length;
for(var i=0;i<iLen;i++){
if (!input['value'].match(/.jpg|.gif|.png|.jpeg|.bmp/i)){//判断上传文件格式
return alert("上传的图片格式不正确,请重新选择");
}
var reader = new FileReader();
fd.append(i,this.files[i]);
reader.readAsDataURL(this.files[i]); //转成base64
reader.fileName = this.files[i].name;
reader.onload = function(e){
var imgMsg = {
name : this.fileName,//获取文件名
base64 : this.result //reader.readAsDataURL方法执行完后base64数据储存在reader.result里
}
dataArr.push(imgMsg);
result = '<div class="delete">delete</div><div class="result"><img class="subPic" src="'+this.result+'" alt="'+this.fileName+'"/></div>';
var div = document.createElement('div');
div.innerHTML = result;
div['className'] = 'float';
document.getElementsByTagName('body')[0].appendChild(div); //插入dom树
var img = div.getElementsByTagName('img')[0];
img.onload = function(){
var nowHeight = ReSizePic(this); //设置图片大小
this.parentNode.style.display = 'block';
var oParent = this.parentNode;
if(nowHeight){
oParent.style.paddingTop = (oParent.offsetHeight - nowHeight)/2 + 'px';
}
}
div.onclick = function(){
$(this).remove(); // 在页面中删除该图片元素
}
}
}
}
function send(){
var submitArr = [];
$('.subPic').each(function () {
submitArr.push({
name: $(this).attr('alt'),
base64: $(this).attr('src')
});
}
);
$.ajax({
url : 'http://123.206.89.242:9999',
type : 'post',
data : JSON.stringify(submitArr),
dataType: 'json',
//processData: false, 用FormData传fd时需有这两项
//contentType: false,
success : function(data){
console.log('返回的数据:'+JSON.stringify(data))
}
})
}
oSelect.onclick=function(){
oInput.value = ""; // 先将oInput值清空否则选择图片与上次相同时change事件不会触发
//清空已选图片
$('.float').remove();
oInput.click();
}
oAdd.onclick=function(){
oInput.value = ""; // 先将oInput值清空否则选择图片与上次相同时change事件不会触发
oInput.click();
}
oSubmit.onclick=function(){
if(!dataArr.length){
return alert('请先选择文件');
}
send();
}
}
/*
用ajax发送fd参数时要告诉jQuery不要去处理发送的数据
不要去设置Content-Type请求头才可以发送成功否则会报“Illegal invocation”的错误
也就是非法调用所以要加上“processData: false,contentType: false,”
* */
function ReSizePic(ThisPic) {
var RePicWidth = 200; //这里修改为您想显示的宽度值
var TrueWidth = ThisPic.width; //图片实际宽度
var TrueHeight = ThisPic.height; //图片实际高度
if(TrueWidth>TrueHeight){
//宽大于高
var reWidth = RePicWidth;
ThisPic.width = reWidth;
//垂直居中
var nowHeight = TrueHeight * (reWidth/TrueWidth);
return nowHeight; //将图片修改后的高度返回,供垂直居中用
}else{
//宽小于高
var reHeight = RePicWidth;
ThisPic.height = reHeight;
}
}
</script>
</head>
<body>
<div class="container">
<label>请选择一个图像文件:</label>
<button id="select">(重新)选择图片</button>
<button id="add">(追加)图片</button>
<input type="file" id="file_input" multiple/> <!--用input标签并选择type=file记得带上multiple不然就只能单选图片了-->
<button id="submit">提交</button>
</div>
</body>
</html>

@ -97,7 +97,7 @@ width:800px;
</div>
<div class="bord">
<div class="container" >
<s:form class="contact" action="Fbxz" method="post" id="form_example" enctype="multipart/form-data" onsubmit="" name="form">
<s:form class="contact" action="Fbxz" method="post" id="form_example" enctype="multipart/form-data" name="form">
@ -194,11 +194,24 @@ width:800px;
</div>
<input id="files" multiple type="file" onchange="compress()" name="file" style="height:25px;border:none">
<input type="hidden" value="" name="image" id="image">
</div>
</div>
<div class="row clearfix">
<div class="span10 offset2">
<s:submit cssClass="submit" value="确认发布" />
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var fileList = [];
@ -388,17 +401,6 @@ function compress() {
<input type="hidden" value="1" name="type">
-->
<div class="row clearfix">
<div class="span10 offset2">
<s:submit cssClass="submit" value="确认发布" />
</div>
</div>
<div style="clear: both"></div>
</s:form>
<div id='file-list-display'></div>
<div style="clear: both"></div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@ -1,18 +1,27 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Hello World</title>
</head>
<head><title>添加学生信息</title></head>
<body>
<h1>Hello World From Struts2</h1>
<form action="hello">
<label for="name">Please enter your name</label><br/>
<input type="text" name="name"/>
<input type="submit" value="Say Hello"/>
</form>
</body>
</html>
<form action="studentManage?action=addStudent" method="post">
<p>请输入学生信息</p>
ID<input type="text" name="id" /><br>
学号<input type="text" name="sno" />
姓名<input type="text" name="name" /><br>
年龄<input type="text" name="age" />
专业<input type="text" name="major" /><br>
<input type ="submit" value="确定"/>
<input type="reset" value="重置"/></form>
${msg}<hr/>
<table>
<tr><td>ID</td><td>学号</td><td>姓名</td><td>年龄</td><td>专业</td><td>删除</td><td>修改</td></tr>
<c:forEach var="s" items="${studentList }">
<tr>
<td>${s.id }</td>
<td>${s.studentNo }</td><td>${s.studentName}</td>
<td>${s.sage }</td><td>${s.major}</td>
<td><a href="studentManager?action=delete&id=${s.id} ">删除</a></td>
<td><a href="studentManager?action=edit&id=${s.id} ">修改</a></td>
</tr>
</c:forEach>
</table></body></html>

@ -9,7 +9,7 @@
<c:forEach var="s" items="${xz }">
<tr>
<td>${s.id }</td>
<td>${s.title }</td>
<td>${s.wx }</td>
</tr>
</c:forEach>
</table></body></html>

@ -1,354 +0,0 @@
package action;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import model.Classify;
import model.PageBean;
import model.Goods;
import model.User;
//import model.UserAdmin;
import org.apache.struts2.ServletActionContext;
import org.aspectj.util.FileUtil;
import service.IUserService;
import util.AddJson;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
public class GoodsAction extends ActionSupport implements ModelDriven<Goods>{
IUserService iUserService;
public void setiUserService(IUserService iUserService) {
this.iUserService = iUserService;
}
Goods good=new Goods();
@Override
public Goods getModel() {
return good;
}
HttpServletRequest req=ServletActionContext.getRequest();
AddJson json=new AddJson();
private int currPage=1;//当前页
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
private File proPictureFile;
private String proPictureFileFileName;
private String proPictureContentType;
private final int BUFFER_SIZE=16*1024;
private Integer classifyId;
public Integer getClassifyId() {
return classifyId;
}
public void setClassifyId(Integer classifyId) {
this.classifyId = classifyId;
}
public File getProPictureFile() {
return proPictureFile;
}
public void setProPictureFile(File proPictureFile) {
this.proPictureFile = proPictureFile;
}
public String getProPictureContentType() {
return proPictureContentType;
}
public void setProPictureContentType(String proPictureContentType) {
this.proPictureContentType = proPictureContentType;
}
public String getProPictureFileFileName() {
return proPictureFileFileName;
}
public void setProPictureFileFileName(String proPictureFileFileName) {
this.proPictureFileFileName = proPictureFileFileName;
}
/**
*
*/
public String addLostGood() throws Exception{
String newFileName=new Date().getTime()+getExtention(proPictureFileFileName);
String path=ServletActionContext.getServletContext().getRealPath("/upload");
File picFile=new File(path);
if(!picFile.exists()){
picFile.mkdir();
}
FileUtil.copyFile(proPictureFile, new File(picFile,newFileName));
//copy(proPictureFile,picFile);
good.setPicture(newFileName);
good.setCreateTime(new Date());
Classify c=this.iUserService.getClassifyById(good.getClassifyId());
User u=this.iUserService.getUserById(good.getCreatorId());
good.setClassify(c);
good.setUser(u);
good.setGoodsstatus(0);
this.iUserService.saveGood(good);
this.addActionMessage("发布成功!");
return "uploadSuccess";
}
public String addFoundGood() throws Exception{
String newFileName=new Date().getTime()+getExtention(proPictureFileFileName);
String path=ServletActionContext.getServletContext().getRealPath("/upload");
File picFile=new File(path);
if(!picFile.exists()){
picFile.mkdir();
}
FileUtil.copyFile(proPictureFile, new File(picFile,newFileName));
//copy(proPictureFile,picFile);
good.setPicture(newFileName);
good.setCreateTime(new Date());
Classify c=this.iUserService.getClassifyById(good.getClassifyId());
User u=this.iUserService.getUserById(good.getCreatorId());
good.setClassify(c);
good.setUser(u);
good.setGoodsstatus(1);
this.iUserService.saveGood(good);
this.addActionMessage("发布成功!");
return "uploadSuccess";
}
/**
* io
* @param src
* @param dst
* @throws Exception
*/
private void copy(File src, File dst)throws Exception {
InputStream in=null;
OutputStream out=null;
try {
in=new BufferedInputStream(new FileInputStream(src),BUFFER_SIZE);
out=new BufferedOutputStream(new FileOutputStream(dst),BUFFER_SIZE);
byte[] buffer=new byte[BUFFER_SIZE];
while(in.read(buffer)>0){
out.write(buffer);
}
} catch (Exception e) {
throw e;
}finally{
try {
in.close();
} catch (Exception e2) {
}
try {
out.close();
} catch (Exception e2) {
}
}
}
/**
*
* @param filename
* @return
*/
private String getExtention(String filename) {
int pos=filename.lastIndexOf(".");
return filename.substring(pos);
}
/**
*
* @throws IOException
*/
public void searchClassifyList() throws IOException{
List<Classify> list=this.iUserService.searchClassifyList();
this.json.toJsonArray(list);
}
/**
*
*/
public void searchLostGoodList() throws Exception{
//String keyword=req.getParameter("keyword");
String cid=req.getParameter("cid");
//String conditon=req.getParameter("condition");
Map<Object,String> map=new HashMap<Object,String>();
/*if(keyword!=null&&keyword!=""){
map.put("keyword", keyword);
}*/
if(cid!=null&&cid!=""){
map.put("cid", cid);
}
/*if(conditon!=null&&conditon!=""){
map.put("conditon", conditon);
}*/
map.put("currPage", currPage+"");
PageBean<Goods> proList=this.iUserService.searchLostGoodList(map);
this.json.toJsonObj(proList);
}
public void searchFoundGoodList() throws Exception{
String cid=req.getParameter("cid");
Map<Object,String> map=new HashMap<Object,String>();
if(cid!=null&&cid!=""){
map.put("cid", cid);
}
map.put("currPage", currPage+"");
PageBean<Goods> proList=this.iUserService.searchFoundGoodList(map);
this.json.toJsonObj(proList);
}
/**
*
*/
public void getLostGoodDetail() throws Exception{
String id=req.getParameter("id");
Goods good=this.iUserService.getLostGoodDetail(id);
this.json.toJson(good);
}
public void getFoundGoodDetail() throws Exception{
String id=req.getParameter("id");
Goods good=this.iUserService.getFoundGoodDetail(id);
this.json.toJson(good);
}
/**
*
* @throws Exception
*/
public void searchMyLostProductByPage() throws Exception{
User user=(User) req.getSession().getAttribute("User");
if(user==null){
throw new Exception("用户帐户为空,请重新登录!");
}else{
Map<Object, String> map=new HashMap<Object, String>();
map.put("currPage", currPage+"");
map.put("userId", user.getId()+"");
PageBean<Goods> myproList=this.iUserService.searchMyLostGoodByPage(map);
this.json.toJson(myproList);
}
}
public void searchMyProductByPage() throws Exception{
User user=(User) req.getSession().getAttribute("User");
if(user==null){
throw new Exception("用户帐户为空,请重新登录!");
}else{
Map<Object, String> map=new HashMap<Object, String>();
map.put("currPage", currPage+"");
map.put("userId", user.getId()+"");
PageBean<Goods> myproList=this.iUserService.searchMyFoundGoodByPage(map);
this.json.toJson(myproList);
}
}
private String repContent;
private String content;
public String getRepContent() {
return repContent;
}
public void setRepContent(String repContent) {
this.repContent = repContent;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
/**
*
* <p>Description: </p>
* @throws Exception
*/
public void deleteMyGoodById() throws Exception{
User user=(User) req.getSession().getAttribute("User");
if(user==null){
throw new Exception("用户帐户为空,请重新登录!");
}else{
int pid=Integer.parseInt(req.getParameter("id"));
this.iUserService.delectGoodById(pid);
}
}
/**
*
* @throws Exception
* @param flag 0,1
*/
/* public String searchMessageByPage() throws Exception{
User user=(User) req.getSession().getAttribute("User");
String flag="";
if(user==null){
throw new Exception("用户帐户为空,请重新登录!");
}else{
flag=req.getParameter("flag");//0系统消息,1用户消息
Map<Object, String> map=new HashMap<Object, String>();
map.put("currPage", currPage+"");
map.put("userId", user.getId()+"");
map.put("flag", flag);
PageBean<UserAdmin> message=this.iUserService.searchMessageByPage(map);
if(message!=null){
ActionContext.getContext().getValueStack().push(message);
}
}
if(flag=="0"||"0".equals(flag)){
return "sysmessage";
}else{
return "usermessage";
}
}
private String flag;
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
/**
*
* @return
* @throws Exception
*/
/* public String deleteMessage() throws Exception{
User user=(User) req.getSession().getAttribute("User");
//String flag=req.getParameter("flag");
if(user==null){
throw new Exception("用户帐户为空,请重新登录!");
}else{
String id=req.getParameter("id");
this.iUserService.deleteMessage(Integer.parseInt(id));
}
if(flag=="0"||"0".equals(flag)){
return "sysmsgDelete";
}else{
return "usermsgDelete";
}
}*/
}

@ -1,162 +0,0 @@
package action;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import service.ILoginService;
import util.AddJson;
import model.User;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
public class UserAction extends ActionSupport implements ModelDriven<User>{
User user=new User();
@Override
public User getModel() {
return user;
}
ILoginService iLoginService;
public void setiLoginService(ILoginService iLoginService) {
this.iLoginService = iLoginService;
}
HttpServletRequest req=ServletActionContext.getRequest();
/**
*
* @return
*/
public String UserLogin(){
//HttpServletRequest req=ServletActionContext.getRequest();
if(user==null){
this.addActionError("请输入账号和密码!");
return "login";
}
User u=this.iLoginService.findByUser(user);
if(u==null){
this.addActionError("用户名或密码错误!");
return "login";
}else{
req.getSession().setAttribute("User", u);
return "index";
}
}
/**
*
*/
public String userRegister(){
//通过用户名先查询该用户是否已经注册
User u=this.iLoginService.findUserByName(user.getUsername());
if(u!=null){
this.addActionError("该用户已被注册!");
return "registerFail";
}
//user.setHeadPic("images/logo-s.jpg");
this.iLoginService.saveUser(user);
return "registerSuccess";
}
/**
* 1
*/
public String forgetPwd(){
//HttpServletRequest req=ServletActionContext.getRequest();
String userName=req.getParameter("userName");
User u=this.iLoginService.findUserByName(userName);
if(u==null){
this.addFieldError(userName, "用户名错误!");
return "getPwdFail";
}
if(u.getQusetion()==null){
this.addActionError("抱歉!你没有设置问题和密码!");
return "getPwdFail";
}
req.getSession().setAttribute("User", u);
return "getPwdSuccess";
}
/**
* 2
*/
public String checkAnswer(){
//HttpServletRequest req=ServletActionContext.getRequest();
String answertext=req.getParameter("answer");
User u=this.iLoginService.findUserByName(user.getUsername());
if(u!=null){
String answer=u.getAnswer();
if(!answer.equals(answertext)){
this.addActionError("抱歉!回答错误!");
return "answerFalse";
}
}
req.getSession().setAttribute("User", u);
return "answerTrue";
}
/**
* 3
*/
public String updatePwd(){
this.iLoginService.updatePed(user);
return "updatePwdSuccess";
}
/**
*
* @throws Exception
*/
public void searchPersonalInfo() throws Exception{
//HttpServletRequest req=ServletActionContext.getRequest();
int uid=Integer.parseInt(req.getParameter("uid"));
if(uid==0){
throw new Exception("用户不存在!");
}
user=this.iLoginService.searchUserInfoById(uid);
AddJson json=new AddJson();
json.toJson(user);
//return "findUserInfoSuccess";
}
/**
*
*/
public void updateUserInfoById(){
int uid=Integer.parseInt(req.getParameter("id"));
String uname=req.getParameter("userName");
String pass=req.getParameter("password");
String phone=req.getParameter("phone");
String qusetion=req.getParameter("qusetion");
String answer=req.getParameter("answer");
int sex=Integer.parseInt(req.getParameter("sex"));
User uu=new User();
uu.setAnswer(answer);
uu.setPassword(pass);
uu.setPhone(phone);
uu.setId(uid);
uu.setUsername(uname);
uu.setQusetion(qusetion);
uu.setSex(sex);
this.iLoginService.updateUser(uu);
}
/**
* 退
*/
public String userExitLogin(){
req.getSession().removeAttribute("User");
return "UserexitSuccess";
}
}

@ -1,53 +0,0 @@
package dao;
//import model.Admin;
import model.User;
public interface ILoginDao {
/**
*
* @param user
* @return
*/
User findByUser(User user);
/**
*
* @param admin
* @return
*/
//Admin findByAdmin(Admin admin);
/**
*
* @param userName
* @return
*/
User findUserByName(String userName);
/**
*
* @param user
*/
void saveUser(User user);
/**
*
* @param user
*/
void updatePed(User user);
/**
* id
* @param uid
* @return
*/
User searchUserInfoById(int uid);
/**
*
* @param user
*/
void updateUser(User user);
}

@ -1,111 +0,0 @@
package dao;
import java.util.List;
import java.util.Map;
import model.Classify;
import model.Goods;
import model.User;
//import model.UserAdmin;
public interface IUserDao {
/**
*
* @param product
*/
void saveGood(Goods good);
/**
*
* @return
*/
List<Classify> searchClassifyList();
/**
*
* @param map
* @return
*/
List<Goods> searchLostGoodList(Map<Object, String> map);
List<Goods> searchFoundGoodList(Map<Object, String> map);
/**
*
* @param map
* @return
*/
int searchLostGoodCount(Map<Object, String> map);
int searchFoundGoodCount(Map<Object, String> map);
/**
*
* @param id
* @return
*/
Goods getLostGoodDetail(String id);
Goods getFoundGoodDetail(String id);
/**
* id
* @param classifyId
*/
Classify getClassifyById(Integer classifyId);
User getUserById(Integer creatorId);
/*void updateProduct(Product product);*/
/**
* <p>Description: </p>
* @param parseInt
* @return
*/
int searchMyLostGoodCount(int parseInt);
int searchMyFoundGoodCount(int parseInt);
/**
* <p>Description: </p>
* @param map
* @return
*/
List<Goods> getMyLostGoodList(Map<Object, String> map);
List<Goods> getMyFoundGoodList(Map<Object, String> map);
/**
* <p>Description: </p>
* @param pid
*/
void delectGoodById(int pid);
/**
* <p>Description: </p>
* @param map
* @return
*/
// void saveUserMessage(UserAdmin uaa);
/**
* <p>Description: </p>
* @param map
* @return
*/
// int searchMessageCount(int uid, String flag);
/**
* <p>Description: </p>
* @param map
* @return
*/
// List<UserAdmin> getMessageList(Map<Object, String> map);
/**
* id
*/
void deleteMessage(int id);
}

@ -1,96 +0,0 @@
package dao.impl;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
//import model.Admin;
import model.User;
import dao.ILoginDao;
public class LoginDao extends HibernateDaoSupport implements ILoginDao {
/**
*
*/
@Override
public User findByUser(User user) {
String hql="from User u where u.userName=? and u.password=?";
@SuppressWarnings("unchecked")
List<User> list=this.getHibernateTemplate().find(hql,user.getUsername(),user.getPassword());
if(list.size()>0){
return list.get(0);
}else{
return null;
}
}
/**
*
*/
/* @Override
public Admin findByAdmin(Admin admin) {
String hql="from Admin a where a.name=? and a.password=?";
@SuppressWarnings("unchecked")
List<Admin> list=this.getHibernateTemplate().find(hql, admin.getName(),admin.getPassword());
if(list.size()>0){
return list.get(0);
}else{
return null;
}
}*/
/**
*
*/
@Override
public User findUserByName(String userName) {
String hql="from User where userName=?";
@SuppressWarnings("unchecked")
List<User> list=this.getHibernateTemplate().find(hql,userName);
if(list.size()>0){
return list.get(0);
}
return null;
}
/**
*
*/
@Override
public void saveUser(User user) {
this.getHibernateTemplate().save(user);
}
/**
*
*/
@Override
public void updatePed(User user) {
User u=this.getHibernateTemplate().get(User.class, user.getId());
u.setPassword(user.getPassword());
this.getHibernateTemplate().update(u);
}
/**
* id
*/
@Override
public User searchUserInfoById(int uid) {
User u=this.getHibernateTemplate().get(User.class, uid);
return u;
}
/**
*
*/
@Override
public void updateUser(User user) {
this.getHibernateTemplate().update(user);
}
}

@ -1,362 +0,0 @@
package dao.impl;
import java.util.List;
import java.util.Map;
import model.Classify;
import model.Goods;
import model.User;
//import model.UserAdmin;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import dao.IUserDao;
public class UserDao extends HibernateDaoSupport implements IUserDao {
/**
*
*/
@Override
public void saveGood(Goods good) {
this.getHibernateTemplate().saveOrUpdate (good);
}
/**
*
*/
@SuppressWarnings("unchecked")
@Override
public List<Classify> searchClassifyList() {
String hql="from Classify";
return this.getHibernateTemplate().find(hql);
}
/**
*
*/
@SuppressWarnings("unchecked")
@Override
public List<Goods> searchLostGoodList(Map<Object, String> map) {
String cid=map.get("cid");
DetachedCriteria dc=DetachedCriteria.forClass(Goods.class);
//dc.addOrder(Order.desc("createTime"));
//dc.add(Restrictions.ne("proHassum", 0));
/*if(proName!=null){
proName="%"+map.get("keyword")+"%";
dc.add(Restrictions.like("proName",proName, MatchMode.ANYWHERE));
}*/
if(cid!=null){
dc.add(Restrictions.eq("classify.cid",Integer.parseInt(cid)));
}
dc.add(Restrictions.eq("goodsStatus",0));
/*if(condition!=null){
int con=Integer.parseInt(condition);
switch(con){
case 5:
dc.add(Restrictions.eq("type",1));
break;
case 4:
dc.add(Restrictions.eq("type",0));
break;
case 1:
dc.addOrder(Order.desc("proClicknum"));
break;
case 2:
dc.addOrder(Order.asc("proPrice"));
break;
case 3:
dc.addOrder(Order.desc("proPrice"));
break;
}
}*/
List<Goods> list=this.getHibernateTemplate().findByCriteria(dc,Integer.parseInt(map.get("begin")),Integer.parseInt(map.get("pageSize")));
return list;
}
/**
*
*/
@SuppressWarnings("unchecked")
@Override
public int searchLostGoodCount(Map<Object, String> map) {
StringBuffer br=new StringBuffer();
StringBuffer order=new StringBuffer();
//String proName=map.get("keyword");
String cid=map.get("cid");
//String condition=map.get("conditon");
String count_hql="select count(*) from Product where goodsstatus='0'";
/*if(proName!=null){
proName="%"+map.get("keyword")+"%";
br.append(" and proName like '"+proName+"'");
}*/
if(cid!=null){
br.append(" and classify.cid='"+Integer.parseInt(cid)+"'");
}
/*if(condition!=null){
int con=Integer.parseInt(condition);
order.append(" order by createTime DESC");
switch(con){
case 1:
order.append(" ,proClicknum DESC");
break;
case 2:
order.append(" ,proPrice ASC");
break;
case 3:
order.append(" ,proPrice DESC");
break;
case 4:
br.append(" and type=0");
break;
case 5:
br.append(" and type=1");
break;
}
}*/
List<Long> list=this.getHibernateTemplate().find(count_hql+br.toString()+order.toString());
if(list.size()>0){
return list.get(0).intValue();
}
return 0;
}
@SuppressWarnings("unchecked")
@Override
public List<Goods> searchFoundGoodList(Map<Object, String> map) {
String cid=map.get("cid");
DetachedCriteria dc=DetachedCriteria.forClass(Goods.class);
if(cid!=null){
dc.add(Restrictions.eq("classify.cid",Integer.parseInt(cid)));
}
dc.add(Restrictions.eq("goodsStatus",0));
List<Goods> list=this.getHibernateTemplate().findByCriteria(dc,Integer.parseInt(map.get("begin")),Integer.parseInt(map.get("pageSize")));
return list;
}
/**
*
*/
@SuppressWarnings("unchecked")
@Override
public int searchFoundGoodCount(Map<Object, String> map) {
StringBuffer br=new StringBuffer();
StringBuffer order=new StringBuffer();
String cid=map.get("cid");
String count_hql="select count(*) from Product where goodsstatus='1'";
if(cid!=null){
br.append(" and classify.cid='"+Integer.parseInt(cid)+"'");
}
List<Long> list=this.getHibernateTemplate().find(count_hql+br.toString()+order.toString());
if(list.size()>0){
return list.get(0).intValue();
}
return 0;
}
/**
*
*/
@SuppressWarnings("unchecked")
@Override
public Goods getLostGoodDetail(String id) {
int pid=0;
if(id!=null&&id!=""){
pid=Integer.parseInt(id);
}
String hql=" from Product where id=?";
List<Goods> list=this.getHibernateTemplate().find(hql,pid);
if(list.size()>0){
Goods p=list.get(0);
return p;
}
return null;
}
@SuppressWarnings("unchecked")
@Override
public Goods getFoundGoodDetail(String id) {
int pid=0;
if(id!=null&&id!=""){
pid=Integer.parseInt(id);
}
String hql=" from Product where id=?";
List<Goods> list=this.getHibernateTemplate().find(hql,pid);
if(list.size()>0){
Goods p=list.get(0);
return p;
}
return null;
}
@Override
public Classify getClassifyById(Integer classifyId) {
String hql="from Classify where cid=?";
@SuppressWarnings("unchecked")
List<Classify> c=this.getHibernateTemplate().find(hql, classifyId);
if(c.size()>0){
Classify cla=c.get(0);
return cla;
}
return null;
}
@Override
public User getUserById(Integer creatorId) {
String hql="from User where uid=?";
@SuppressWarnings("unchecked")
List<User> u=this.getHibernateTemplate().find(hql, creatorId);
if(u.size()>0){
User user=u.get(0);
return user;
}
return null;
}
/*@Override
public void updateProduct(Product product) {
this.getHibernateTemplate().update(product);
}*/
/**
* <p>Description: </p>
* @param parseInt
* @return
*/
@SuppressWarnings("unchecked")
@Override
public int searchMyLostGoodCount(int uid) {
String hql="select count(*) from Product where user.uid = ? and goodsstatus='0'";
List<Long> list=this.getHibernateTemplate().find(hql,uid);
if(list.size()>0){
return list.get(0).intValue();
}
return 0;
}
@SuppressWarnings("unchecked")
@Override
public int searchMyFoundGoodCount(int uid) {
String hql="select count(*) from Product where user.uid = ? and goodsstatus='1'";
List<Long> list=this.getHibernateTemplate().find(hql,uid);
if(list.size()>0){
return list.get(0).intValue();
}
return 0;
}
/**
* <p>Description: </p>
* @param map
* @return
*/
@SuppressWarnings("unchecked")
@Override
public List<Goods> getMyLostGoodList(Map<Object, String> map) {
DetachedCriteria dc=DetachedCriteria.forClass(model.Goods.class);
dc.add(Restrictions.eq("user.uid",Integer.parseInt(map.get("userId"))));
dc.add(Restrictions.eq("goodsstatus",0));
dc.addOrder(Order.desc("createTime"));
List<model.Goods> list=this.getHibernateTemplate().findByCriteria(dc,Integer.parseInt(map.get("begin")),Integer.parseInt(map.get("pageSize")));
return list;
}
@SuppressWarnings("unchecked")
@Override
public List<Goods> getMyFoundGoodList(Map<Object, String> map) {
DetachedCriteria dc=DetachedCriteria.forClass(model.Goods.class);
dc.add(Restrictions.eq("user.uid",Integer.parseInt(map.get("userId"))));
dc.add(Restrictions.eq("goodsstatus",1));
dc.addOrder(Order.desc("createTime"));
List<model.Goods> list=this.getHibernateTemplate().findByCriteria(dc,Integer.parseInt(map.get("begin")),Integer.parseInt(map.get("pageSize")));
return list;
}
/**
* <p>Description: </p>
* @param pid
*/
@Override
public void delectGoodById(int pid) {
Goods good=this.getHibernateTemplate().get(Goods.class, pid);
if(good!=null){
this.getHibernateTemplate().delete(good);
}
}
/**
* <p>Description: </p>
* @param map
* @return
*/
/*@Override
public void saveUserMessage(UserAdmin uaa) {
this.getHibernateTemplate().save(uaa);
}
@SuppressWarnings("unchecked")
@Override
public int searchMessageCount(int uid, String flag) {
StringBuffer sb=new StringBuffer();
String hql="select count(*) from UserAndAdmin where 1=1 ";
if(flag=="0"||"0".equals(flag)){
sb.append(" and status='0' and userId="+uid);
}else{
sb.append(" and status='1' and userId="+uid);
}
List<Long> list=this.getHibernateTemplate().find(hql+sb.toString());
if(list.size()>0){
return list.get(0).intValue();
}
return 0;
}
@SuppressWarnings("unchecked")
@Override
public List<UserAdmin> getMessageList(Map<Object, String> map) {
DetachedCriteria dc=DetachedCriteria.forClass(model.UserAdmin.class);
String flag=map.get("flag");
if(flag=="0"||"0".equals(flag)){
dc.add(Restrictions.eq("userId",Integer.parseInt( map.get("userId"))));
dc.add(Restrictions.eq("status",0));
}else{
dc.add(Restrictions.eq("userId",Integer.parseInt( map.get("userId"))));
dc.add(Restrictions.eq("status",1));
}
List<model.UserAdmin> list=this.getHibernateTemplate().findByCriteria(dc,Integer.parseInt(map.get("begin")),Integer.parseInt(map.get("pageSize")));
return list;
}*/
/**
* id
*/
@Override
public void deleteMessage(int id) {
String hql="delete from UserAndAdmin where id="+id;
SessionFactory factory=this.getHibernateTemplate().getSessionFactory();
Session session=factory.openSession();
Query query=session.createQuery(hql);
query.executeUpdate();
session.close();
}
}

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="model.TClassify" table="t_classify" catalog="lostfound">
<id name="cid" type="java.lang.Integer">
<column name="CID" />
<generator class="identity" />
</id>
<property name="cname" type="java.lang.String">
<column name="CNAME" />
</property>
<property name="csort" type="java.lang.Integer">
<column name="CSORT" />
</property>
<set name="TGoodses" inverse="true">
<key>
<column name="classify_id" />
</key>
<one-to-many class="model.TGoods" />
</set>
</class>
</hibernate-mapping>

@ -1,57 +0,0 @@
package model;
import java.util.HashSet;
import java.util.Set;
/**
* TClassify entity. @author MyEclipse Persistence Tools
*/
public class Classify implements java.io.Serializable {
// Fields
private Integer cid;
private String cname;
private Integer csort;
// Constructors
/** default constructor */
public Classify() {
}
/** full constructor */
public Classify(String cname, Integer csort) {
this.cname = cname;
this.csort = csort;
}
// Property accessors
public Integer getCid() {
return this.cid;
}
public void setCid(Integer cid) {
this.cid = cid;
}
public String getCname() {
return this.cname;
}
public void setCname(String cname) {
this.cname = cname;
}
public Integer getCsort() {
return this.csort;
}
public void setCsort(Integer csort) {
this.csort = csort;
}
}

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="model.Goods" table="t_goods" catalog="lostfound">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="assigned" />
</id>
<many-to-one name="user" class="model.User" fetch="select">
<column name="creator_id" not-null="true" />
</many-to-one>
<many-to-one name="classify" class="model.Classify" fetch="select">
<column name="classify_id" />
</many-to-one>
<property name="goodsdescribe" type="java.lang.String">
<column name="goodsdescribe" />
</property>
<property name="goodsname" type="java.lang.String">
<column name="goodsname" length="30" />
</property>
<property name="goodsstatus" type="java.lang.Integer">
<column name="goodsstatus" not-null="true" />
</property>
<property name="goodstime" type="java.sql.Timestamp">
<column name="goodstime" length="19" />
</property>
<property name="area" type="java.lang.String">
<column name="area" length="30" />
</property>
<property name="contact" type="java.lang.String">
<column name="contact" length="30" />
</property>
<property name="qq" type="java.lang.String">
<column name="qq" length="30" />
</property>
<property name="picture" type="java.lang.String">
<column name="picture" length="255" />
</property>
<property name="createTime" type="java.sql.Timestamp">
<column name="createtime" length="19" />
</property>
</class>
</hibernate-mapping>

@ -1,168 +0,0 @@
package model;
import java.sql.Timestamp;
import java.util.Date;
/**
* TGoods entity. @author MyEclipse Persistence Tools
*/
public class Goods implements java.io.Serializable {
// Fields
private Integer id;
private User user;
private Classify classify;
private String goodsdescribe;
private String goodsname;
private Integer goodsstatus;//区分招领和寻物
private Date goodstime;//什么时候捡到的、丢的
private String area;
private String contact;//联系人姓名
private String qq;
private String picture;
private Date createTime;
private Integer creatorId;//发布者id
private Integer classifyId;//分类id
// Constructors
/** default constructor */
public Goods() {
}
/** minimal constructor */
/*public Goods(Integer id, User TUser, Integer goodsstatus) {
this.id = id;
this.User = TUser;
this.goodsstatus = goodsstatus;
}
/** full constructor */
/*public Goods(Integer id, User TUser, Classify TClassify,
String goodsdescribe, String goodsname, Integer goodsstatus,
Timestamp goodstime, String area, String contact, String qq) {
this.id = id;
this.TUser = TUser;
this.TClassify = TClassify;
this.goodsdescribe = goodsdescribe;
this.goodsname = goodsname;
this.goodsstatus = goodsstatus;
this.goodstime = goodstime;
this.area = area;
this.contact = contact;
this.qq = qq;
}*/
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getGoodsdescribe() {
return this.goodsdescribe;
}
public void setGoodsdescribe(String goodsdescribe) {
this.goodsdescribe = goodsdescribe;
}
public String getGoodsname() {
return this.goodsname;
}
public void setGoodsname(String goodsname) {
this.goodsname = goodsname;
}
public Integer getGoodsstatus() {
return this.goodsstatus;
}
public void setGoodsstatus(Integer goodsstatus) {
this.goodsstatus = goodsstatus;
}
public Date getGoodstime() {
return this.goodstime;
}
public void setGoodstime(Timestamp goodstime) {
this.goodstime = goodstime;
}
public String getArea() {
return this.area;
}
public void setArea(String area) {
this.area = area;
}
public String getContact() {
return this.contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getQq() {
return this.qq;
}
public void setQq(String qq) {
this.qq = qq;
}
public Integer getCreatorId() {
return creatorId;
}
public void setCreatorId(Integer creatorId) {
this.creatorId = creatorId;
}
public Integer getClassifyId() {
return classifyId;
}
public void setClassifyId(Integer classifyId) {
this.classifyId = classifyId;
}
public Classify getClassify() {
return classify;
}
public void setClassify(Classify classify) {
this.classify = classify;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -1,118 +0,0 @@
package model;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
/**
* Configures and provides access to Hibernate sessions, tied to the
* current thread of execution. Follows the Thread Local Session
* pattern, see {@link http://hibernate.org/42.html }.
*/
public class HibernateSessionFactory {
/**
* Location of hibernate.cfg.xml file.
* Location should be on the classpath as Hibernate uses
* #resourceAsStream style lookup for its configuration file.
* The default classpath location of the hibernate config file is
* in the default package. Use #setConfigFile() to update
* the location of the configuration file for the current session.
*/
private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";
private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>();
private static Configuration configuration = new Configuration();
private static org.hibernate.SessionFactory sessionFactory;
private static String configFile = CONFIG_FILE_LOCATION;
static {
try {
configuration.configure(configFile);
sessionFactory = configuration.buildSessionFactory();
} catch (Exception e) {
System.err
.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
private HibernateSessionFactory() {
}
/**
* Returns the ThreadLocal Session instance. Lazy initialize
* the <code>SessionFactory</code> if needed.
*
* @return Session
* @throws HibernateException
*/
public static Session getSession() throws HibernateException {
Session session = (Session) threadLocal.get();
if (session == null || !session.isOpen()) {
if (sessionFactory == null) {
rebuildSessionFactory();
}
session = (sessionFactory != null) ? sessionFactory.openSession()
: null;
threadLocal.set(session);
}
return session;
}
/**
* Rebuild hibernate session factory
*
*/
public static void rebuildSessionFactory() {
try {
configuration.configure(configFile);
sessionFactory = configuration.buildSessionFactory();
} catch (Exception e) {
System.err
.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
/**
* Close the single hibernate session instance.
*
* @throws HibernateException
*/
public static void closeSession() throws HibernateException {
Session session = (Session) threadLocal.get();
threadLocal.set(null);
if (session != null) {
session.close();
}
}
/**
* return session factory
*
*/
public static org.hibernate.SessionFactory getSessionFactory() {
return sessionFactory;
}
/**
* return session factory
*
* session factory will be rebuilded in the next call
*/
public static void setConfigFile(String configFile) {
HibernateSessionFactory.configFile = configFile;
sessionFactory = null;
}
/**
* return hibernate configuration
*
*/
public static Configuration getConfiguration() {
return configuration;
}
}

@ -1,47 +0,0 @@
package model;
import java.util.List;
public class PageBean<T> {
private int currPage;//当前页
private int pageSize;//每页记录数
private int totalCount;//总记录数
private int totalPage;//总页数
List<T> list;//每页显示的数据
public PageBean() {
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
}

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="model.TUser" table="t_user" catalog="lostfound">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="username" type="java.lang.String">
<column name="username" />
</property>
<property name="sex" type="java.lang.Integer">
<column name="SEX" />
</property>
<property name="phone" type="java.lang.String">
<column name="PHONE" />
</property>
<property name="password" type="java.lang.String">
<column name="PASSWORD" />
</property>
<property name="qusetion" type="java.lang.String">
<column name="QUSETION" />
</property>
<property name="answer" type="java.lang.String">
<column name="ANSWER" />
</property>
<set name="TGoodses" inverse="true">
<key>
<column name="user_id" not-null="true" />
</key>
<one-to-many class="model.TGoods" />
</set>
</class>
</hibernate-mapping>

@ -1,95 +0,0 @@
package model;
import java.util.HashSet;
import java.util.Set;
/**
* TUser entity. @author MyEclipse Persistence Tools
*/
public class User implements java.io.Serializable {
// Fields
private Integer id;
private String username;
private Integer sex;
private String phone;
private String password;
private String qusetion;
private String answer;
// Constructors
/** default constructor */
public User() {
}
/** full constructor */
public User(String username, String password,String qusetion, String answer) {
this.username = username;
this.password = password;
this.qusetion = qusetion;
this.answer = answer;
}
// Property accessors
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getSex() {
return this.sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getQusetion() {
return this.qusetion;
}
public void setQusetion(String qusetion) {
this.qusetion = qusetion;
}
public String getAnswer() {
return this.answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
}

@ -1,53 +0,0 @@
package service;
//import model.Admin;
import model.User;
public interface ILoginService {
/**
*
* @param user
* @return
*/
User findByUser(User user);
/**
*
* @param admin
* @return
*/
//Admin findByAdmin(Admin admin);
/**
*
* @param userName
* @return
*/
User findUserByName(String userName);
/**
*
* @param user
*/
void saveUser(User user);
/**
*
* @param user
*/
void updatePed(User user);
/**
* id
* @param uid
* @return
*/
User searchUserInfoById(int uid);
/**
*
* @param user
*/
void updateUser(User user);
}

@ -1,95 +0,0 @@
package service;
import java.util.List;
import java.util.Map;
import model.Classify;
import model.PageBean;
import model.Goods;
import model.User;
//import model.UserAdmin;
public interface IUserService {
/**
*
* @param product
*/
void saveGood(Goods good);
/**
*
* @return
*/
List<Classify> searchClassifyList();
/**
*
* @param map
* @return
*/
PageBean<Goods> searchLostGoodList(Map<Object, String> map);
PageBean<Goods> searchFoundGoodList(Map<Object, String> map);
/**
*
* @param id
* @return
*/
Goods getLostGoodDetail(String id);
Goods getFoundGoodDetail(String id);
/**
* id
* @param classifyId
*/
Classify getClassifyById(Integer classifyId);
User getUserById(Integer creatorId);
/*void updateProduct(Product product);*/
/**
* <p>Description: </p>
* @param map
* @return
*/
PageBean<Goods> searchMyLostGoodByPage(Map<Object, String> map);
PageBean<Goods> searchMyFoundGoodByPage(Map<Object, String> map);
/**
* <p>Description: </p>
* @param pid
*/
void delectGoodById(int pid);
/**
*
* @param uaa
*/
//void saveUserMessage(UserAdmin uaa);
/**
*
* @throws Exception
* @param flag 0,1
*/
//PageBean<UserAdmin> searchMessageByPage(Map<Object, String> map);
/**
* id
* @param parseInt
*/
void deleteMessage(int id);
}

@ -1,79 +0,0 @@
package service.impl;
import org.springframework.transaction.annotation.Transactional;
import dao.ILoginDao;
//import model.Admin;
import model.User;
import service.ILoginService;
@Transactional
public class LoginService implements ILoginService{
private ILoginDao iLoginDao;
public void setiLoginDao(ILoginDao iLoginDao) {
this.iLoginDao = iLoginDao;
}
/**
*
*/
@Override
public User findByUser(User user) {
return iLoginDao.findByUser(user);
}
/**
*
*/
/* @Override
public Admin findByAdmin(Admin admin) {
return iLoginDao.findByAdmin(admin);
}*/
/**
*
*/
@Override
public User findUserByName(String userName) {
return this.iLoginDao.findUserByName(userName);
}
/**
*
*/
@Override
public void saveUser(User user) {
this.iLoginDao.saveUser(user);
}
/**
*
*/
@Override
public void updatePed(User user) {
this.iLoginDao.updatePed(user);
}
/**
* id
*/
@Override
public User searchUserInfoById(int uid) {
return this.iLoginDao.searchUserInfoById(uid);
}
/**
*
*/
@Override
public void updateUser(User user) {
this.iLoginDao.updateUser(user);
}
}

@ -1,264 +0,0 @@
package service.impl;
import java.util.List;
import java.util.Map;
import model.Classify;
import model.PageBean;
import model.Goods;
import model.User;
//import model.UserAdmin;
import org.springframework.transaction.annotation.Transactional;
import service.IUserService;
import dao.IUserDao;
@Transactional
public class UserService implements IUserService {
private IUserDao iUserDao;
public void setiUserDao(IUserDao iUserDao) {
this.iUserDao = iUserDao;
}
Integer currPage=1;
/**
*
*/
@Override
public void saveGood(Goods good) {
this.iUserDao.saveGood(good);
}
/**
*
*/
@Override
public List<Classify> searchClassifyList() {
return this.iUserDao.searchClassifyList();
}
/**
*
*/
@Override
public PageBean<Goods> searchLostGoodList(Map<Object, String> map) {
PageBean<Goods> pageBean=new PageBean<Goods>();
//封装当前页
currPage=Integer.parseInt(map.get("currPage"));
pageBean.setCurrPage(currPage);
//封装每页记录数
int pageSize=12;
pageBean.setPageSize(pageSize);
//封装总记录数
int totalCount=this.iUserDao.searchLostGoodCount(map);
pageBean.setTotalCount(totalCount);
//封装总页数
double tc=totalCount;
Double num=Math.ceil(tc/pageSize);
if(num==0){
num=(double) 1;
}
pageBean.setTotalPage(num.intValue());
//封装每页显示的数据
int begin=(currPage-1)*pageSize;
map.put("begin", begin+"");
map.put("pageSize", pageSize+"");
List<Goods> list=this.iUserDao.searchLostGoodList(map);
pageBean.setList(list);
return pageBean;
}
@Override
public PageBean<Goods> searchFoundGoodList(Map<Object, String> map) {
PageBean<Goods> pageBean=new PageBean<Goods>();
//封装当前页
currPage=Integer.parseInt(map.get("currPage"));
pageBean.setCurrPage(currPage);
//封装每页记录数
int pageSize=12;
pageBean.setPageSize(pageSize);
//封装总记录数
int totalCount=this.iUserDao.searchFoundGoodCount(map);
pageBean.setTotalCount(totalCount);
//封装总页数
double tc=totalCount;
Double num=Math.ceil(tc/pageSize);
if(num==0){
num=(double) 1;
}
pageBean.setTotalPage(num.intValue());
//封装每页显示的数据
int begin=(currPage-1)*pageSize;
map.put("begin", begin+"");
map.put("pageSize", pageSize+"");
List<Goods> list=this.iUserDao.searchFoundGoodList(map);
pageBean.setList(list);
return pageBean;
}
/**
*
*/
@Override
public Goods getLostGoodDetail(String id) {
return this.iUserDao.getLostGoodDetail(id);
}
@Override
public Goods getFoundGoodDetail(String id) {
return this.iUserDao.getFoundGoodDetail(id);
}
@Override
public Classify getClassifyById(Integer classifyId) {
return this.iUserDao.getClassifyById(classifyId);
}
@Override
public User getUserById(Integer creatorId) {
return this.iUserDao.getUserById(creatorId);
}
/*@Override
public void updateProduct(Product product) {
this.iUserDao.updateProduct(product);
}*/
/**
* <p>Description: </p>
* @param map
* @return
*/
@Override
public PageBean<Goods> searchMyLostGoodByPage(Map<Object, String> map) {
PageBean<Goods> pageBean=new PageBean<Goods>();
//封装当前页
currPage=Integer.parseInt(map.get("currPage"));
pageBean.setCurrPage(currPage);
//封装每页记录数
int pageSize=5;
pageBean.setPageSize(pageSize);
//封装总记录数
int totalCount=this.iUserDao.searchMyLostGoodCount(Integer.parseInt(map.get("userId")));
pageBean.setTotalCount(totalCount);
//封装总页数
double tc=totalCount;
Double num=Math.ceil(tc/pageSize);
if(num==0){
num=(double) 1;
}
pageBean.setTotalPage(num.intValue());
//封装每页显示的数据
int begin=(currPage-1)*pageSize;
map.put("begin", begin+"");
map.put("pageSize", pageSize+"");
List<Goods> list=this.iUserDao.getMyLostGoodList(map);
pageBean.setList(list);
return pageBean;
}
public PageBean<Goods> searchMyFoundGoodByPage(Map<Object, String> map) {
PageBean<Goods> pageBean=new PageBean<Goods>();
//封装当前页
currPage=Integer.parseInt(map.get("currPage"));
pageBean.setCurrPage(currPage);
//封装每页记录数
int pageSize=5;
pageBean.setPageSize(pageSize);
//封装总记录数
int totalCount=this.iUserDao.searchMyFoundGoodCount(Integer.parseInt(map.get("userId")));
pageBean.setTotalCount(totalCount);
//封装总页数
double tc=totalCount;
Double num=Math.ceil(tc/pageSize);
if(num==0){
num=(double) 1;
}
pageBean.setTotalPage(num.intValue());
//封装每页显示的数据
int begin=(currPage-1)*pageSize;
map.put("begin", begin+"");
map.put("pageSize", pageSize+"");
List<Goods> list=this.iUserDao.getMyFoundGoodList(map);
pageBean.setList(list);
return pageBean;
}
/**
* <p>Description: </p>
* @param pid
*/
@Override
public void delectGoodById(int pid) {
this.iUserDao.delectGoodById(pid);
}
/**
*
* @param uaa
*/
/* @Override
public void saveUserMessage(UserAdmin uaa) {
this.iUserDao.saveUserMessage(uaa);
}
/**
*
* @throws Exception
* @param flag 0,1
*/
/* @Override
public PageBean<UserAdmin> searchMessageByPage(Map<Object, String> map) {
PageBean<UserAdmin> pageBean=new PageBean<UserAdmin>();
//封装当前页
currPage=Integer.parseInt(map.get("currPage"));
pageBean.setCurrPage(currPage);
//封装每页记录数
int pageSize=10;
pageBean.setPageSize(pageSize);
//封装总记录数
int totalCount=this.iUserDao.searchMessageCount(Integer.parseInt(map.get("userId")),map.get("flag"));
pageBean.setTotalCount(totalCount);
//封装总页数
double tc=totalCount;
Double num=Math.ceil(tc/pageSize);
if(num==0){
num=(double) 1;
}
pageBean.setTotalPage(num.intValue());
//封装每页显示的数据
int begin=(currPage-1)*pageSize;
map.put("begin", begin+"");
map.put("pageSize", pageSize+"");
List<UserAdmin> list=this.iUserDao.getMessageList(map);
pageBean.setList(list);
return pageBean;
}*/
/**
* id
*/
@Override
public void deleteMessage(int id) {
this.iUserDao.deleteMessage(id);
}
}

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_5_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.hibernate.MYECLIPSE_HIBERNATE3_3_CORE"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/mysql-connector-java-5.1.47.jar"/>
<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>

@ -1,25 +0,0 @@
#MyEclipse Hibernate Properties
#Sat Jan 04 23:52:24 CST 2020
sessionFactoryName=hib.HibernateSessionFactory
genBasicCompId=false
profile=
daoSFId=
version=3.3
jndiPath=
detectM2M=false
reStrategyClass=
detectO2O=false
springDaoFile=
useJavaTypes=true
keyGenerator=
libInstallFolder=WebRoot/WEB-INF/lib
addLibs2Project=true
genVersionTag=false
sessionFactoryId=
basePersistenceClass=
genAnnotations=false
reSettingsFile=
configFile=/pagebean/src/hibernate.cfg.xml
createConfigFile=true
addLibs2Classpath=true
baseDaoClass=BaseHibernateDAO

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-module
type="WEB"
name="pagebean"
id="myeclipse.1578151183785"
context-root="/pagebean"
j2ee-spec="5.0"
archive="pagebean.war">
<attributes>
<attribute name="webrootdir" value="WebRoot" />
</attributes>
</project-module>

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pagebean</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.hibernate.HibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
<nature>com.genuitec.eclipse.hibernate.hibernatenature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="WebRoot"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

@ -1,12 +0,0 @@
#Sat Jan 04 23:57:23 CST 2020
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="pagebean">
<wb-resource deploy-path="/" source-path="/WebRoot"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="/pagebean"/>
<property name="java-output-path" value="/pagebean/WebRoot/WEB-INF/classes"/>
</wb-module>
</project-modules>

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.5"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

@ -1 +0,0 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Class-Path:

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="hib.Products" table="products" catalog="myday">
<composite-id name="id" class="hib.ProductsId">
<key-property name="proId" type="java.lang.Integer">
<column name="proId" />
</key-property>
<key-property name="userId" type="java.lang.Integer">
<column name="userId" />
</key-property>
<key-property name="proName" type="java.lang.String">
<column name="proName" />
</key-property>
<key-property name="contact" type="java.lang.String">
<column name="contact" />
</key-property>
<key-property name="price" type="java.lang.Float">
<column name="price" precision="12" scale="0" />
</key-property>
<key-property name="oprice" type="java.lang.Float">
<column name="oprice" precision="12" scale="0" />
</key-property>
<key-property name="type" type="java.lang.Integer">
<column name="type" />
</key-property>
<key-property name="classifyId" type="java.lang.Integer">
<column name="classifyId" />
</key-property>
</composite-id>
</class>
</hibernate-mapping>

@ -1,26 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/myday
</property>
<property name="connection.username">root</property>
<property name="connection.password">mysql123</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">myday</property>
<mapping resource="hib/Products.hbm.xml" />
</session-factory>
</hibernate-configuration>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save