前端页面优化

master
Bosen 2021-05-30 22:52:12 +08:00
parent a232935a67
commit 1f91165b65
23 changed files with 302 additions and 132 deletions

View File

@ -11,7 +11,7 @@
Target Server Version : 50716
File Encoding : 65001
Date: 22/04/2021 14:57:16
Date: 30/05/2021 17:25:45
*/
SET NAMES utf8mb4;
@ -119,6 +119,7 @@ INSERT INTO `sys_comment` VALUES (19, 1, 44, 8, '测试测试测试测试测试
INSERT INTO `sys_comment` VALUES (20, 1, 44, 8, '测试测试测试测试测试测试测试测试测试测试测试测试测试', 1610247780833);
INSERT INTO `sys_comment` VALUES (21, 1, 44, 8, '测试测试测试测试测试测试测试测试测试测试测试测试测试', 1610247784508);
INSERT INTO `sys_comment` VALUES (22, 1, 44, 8, '测试测试测试测试测试测试测试测试测试测试测试测试测试', 1610247789686);
-- ----------------------------
-- Table structure for sys_goods
-- ----------------------------
@ -285,7 +286,7 @@ CREATE TABLE `sys_order` (
`merchant_ratio` float(11, 1) NOT NULL DEFAULT 1.0 COMMENT '订单创建时商户的费率',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `order_id`(`order_id`) USING BTREE COMMENT '订单号唯一'
) ENGINE = InnoDB AUTO_INCREMENT = 95 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 94 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_order
@ -384,6 +385,6 @@ CREATE TABLE `sys_user` (
INSERT INTO `sys_user` VALUES (1, 'test', 'e10adc3949ba59abbe56e057f20f883e', 'bosen_once@163.com', 1, '/data/header/user/1.jpg');
INSERT INTO `sys_user` VALUES (3, 'bosen_once@qq.com', 'e10adc3949ba59abbe56e057f20f883e', 'bosen_once@qq.com', 1, '/data/header/user/default.jpg');
INSERT INTO `sys_user` VALUES (4, 'test111', 'e10adc3949ba59abbe56e057f20f883e', '806317173@qq.com', 0, '/data/header/user/default.jpg');
INSERT INTO `sys_user` VALUES (5, 'lalalal', 'e10adc3949ba59abbe56e057f20f883e', '2390025289@qq.com', 0, '/data/header/user/default.jpg');
INSERT INTO `sys_user` VALUES (5, 'lalalal', 'e10adc3949ba59abbe56e057f20f883e', '2390025288@qq.com', 0, '/data/header/user/default.jpg');
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -67,34 +67,27 @@ public class AdminLoginController {
*
*/
@RequestMapping("sign-up")
public ModelAndView signUp(ModelAndView modelAndView,String name,String email,String password){
int result = service.singup(email,email,password);
public String signUp(String name,String email,String password){
int result = service.singup(email,name,password);
if (result==0){
// 必填信息不能为空!
modelAndView.addObject("msg","必填信息不能为空!");
return "必填信息不能为空!";
}
if (result==4){
// 该邮箱已被注册
modelAndView.addObject("msg","该邮箱已被注册");
return "该邮箱已被注册";
}
if (result==3){
// 邮箱格式不正确
modelAndView.addObject("msg","邮箱格式不正确");
return "邮箱格式不正确";
}
if (result==2){
// 两次密码输入不一致
modelAndView.addObject("msg","两次密码输入不一致");
return "两次密码输入不一致";
}
if (result==1){
// 验证邮件已发送,请留意您的邮箱
modelAndView.addObject("msg","验证邮件已发送,请留意您的邮箱");
return "验证邮件已发送,请留意您的邮箱";
}
if (result==-1){
// 验证邮件发送失败,请重试
modelAndView.addObject("msg","注册超时,请重试");
return "注册超时,请重试";
}
modelAndView.setViewName("redirect:login");
return modelAndView;
return null;
}
/*
@ -107,11 +100,11 @@ public class AdminLoginController {
modelAndView.setViewName("redirect:/error");
}
if (res==0){
modelAndView.addObject("网络超时请重试");
modelAndView.addObject("msg", "网络超时请重试");
modelAndView.setViewName("redirect:login");
}
if (res==1){
modelAndView.addObject("msg","注册成功");
modelAndView.addObject("msg","注册成功,请完成登录!");
modelAndView.setViewName("redirect:login");
}
return modelAndView;

View File

@ -107,7 +107,7 @@ public class AdminLoginService {
}
}
// 发送注册验证邮件
boolean res = mailService.sendHtmlMail(email,"捷阅网管理员注册验证","<a href='http://"+this.sitrUrl+"admin/sign-check?email="+email+"'>点击此链接完成注册验证</a>");
boolean res = mailService.sendHtmlMail(email,"捷阅网管理员注册验证","<a href='http://"+this.sitrUrl+"/admin/sign-check?email="+email+"'>点击此链接完成注册验证</a>");
if (res){
return 1;
}else{
@ -129,11 +129,11 @@ public class AdminLoginService {
int res1 = adminMapper.updateMark(1,email);
if (res1==1){
// 设置用户角色,设置失败则回滚
if (adminRoleMapper.updateStatus(1,admin.getId()) != 1){
/*if (adminRoleMapper.updateStatus(1,admin.getId()) != 1){
// 执行回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return 0;
}
}*/
return 1;
}else{
return 0;

View File

@ -50,5 +50,5 @@ public interface SysOrderMapper {
// 收益
float websiteProfitCount();
float merchantProfitCount(int merchantId);
Float merchantProfitCount(int merchantId);
}

View File

@ -29,7 +29,10 @@ public class MerchantHomeController {
int commentCount = homeService.getCommandCount(merchant.getId());
int userCount = homeService.getUserCount(merchant.getId());
int orderCount = homeService.getOrderCount(merchant.getId());
float profit = orderMapper.merchantProfitCount(merchant.getId());
float profit = 0;
if (orderMapper.merchantProfitCount(merchant.getId()) != null) {
profit = orderMapper.merchantProfitCount(merchant.getId());
}
modelAndView.addObject("commentCount",commentCount);
modelAndView.addObject("profit",profit);

View File

@ -45,6 +45,10 @@ public class MerchantLoginController {
case 1:
// 登陆成功
SysMt merchant = loginService.getMerchantInfo(email);
if (merchant.getState() == 0) {
modelAndView.addObject("msg","您的账号处于停用状态,请等待管理员处理");
break;
}
session.setAttribute("merchant",merchant);
break;
}
@ -65,27 +69,21 @@ public class MerchantLoginController {
*
*/
@RequestMapping("sign-up")
public ModelAndView signUp(ModelAndView modelAndView,String email,String name,String password){
modelAndView.setViewName("redirect:/merchant/login");
public String signUp(String email,String name,String password){
int serviceRes = loginService.signUp(email,name,password);
switch (serviceRes){
case -1:
modelAndView.addObject("msg","验证邮件发送失败,请重试");
break;
return "验证邮件发送失败,请重试";
case 0:
modelAndView.addObject("msg","必填信息不能为空");
break;
return "必填信息不能为空";
case 1:
modelAndView.addObject("msg","验证信息已发送至邮箱,请留意接收");
break;
return "验证信息已发送至邮箱,请留意接收";
case 2:
modelAndView.addObject("msg","该邮箱已被注册");
break;
return "该邮箱已被注册";
case 3:
modelAndView.addObject("msg","邮箱格式不正确");
break;
return "邮箱格式不正确";
}
return modelAndView;
return null;
}
/*
@ -104,7 +102,7 @@ public class MerchantLoginController {
break;
case 1:
modelAndView.setViewName("redirect:/merchant/login");
modelAndView.addObject("msg","注册成功");
modelAndView.addObject("msg","注册成功,请等待管理员的审核");
break;
}
return modelAndView;

View File

@ -83,7 +83,7 @@ public class MerchantLoginService {
}
}
// 发送注册验证邮件
boolean res = mailService.sendHtmlMail(email,"捷阅网商户注册验证","<a href='http://"+this.sitrUrl+"merchant/sign-check?email="+email+"'>点击此链接完成注册验证</a>");
boolean res = mailService.sendHtmlMail(email,"捷阅网商户注册验证","<a href='http://"+this.sitrUrl+"/merchant/sign-check?email="+email+"'>点击此链接完成注册验证</a>");
if (res){
return 1;
}else{

View File

@ -68,34 +68,27 @@ public class UserLoginController {
*
*/
@RequestMapping("sign-up")
public ModelAndView signUp(ModelAndView modelAndView,String email,String username,String password,String repwd){
public String signUp(String email,String username,String password,String repwd){
int result = service.singup(email,username,password,repwd);
if (result==0){
// 必填信息不能为空!
modelAndView.addObject("msg","必填信息不能为空!");
return "必填信息不能为空!";
}
if (result==4){
// 该邮箱已被注册
modelAndView.addObject("msg","该邮箱已被注册");
return "该邮箱已被注册";
}
if (result==3){
// 邮箱格式不正确
modelAndView.addObject("msg","邮箱格式不正确");
return "邮箱格式不正确";
}
if (result==2){
// 两次密码输入不一致
modelAndView.addObject("msg","两次密码输入不一致");
return "两次密码输入不一致";
}
if (result==1){
// 验证邮件已发送,请留意您的邮箱
modelAndView.addObject("msg","验证邮件已发送,请留意您的邮箱");
return "验证邮件已发送,请留意您的邮箱";
}
if (result==-1){
// 验证邮件发送失败,请重试
modelAndView.addObject("msg","注册超时,请重试");
return "注册超时,请重试";
}
modelAndView.setViewName("redirect:login");
return modelAndView;
return "网络出现错误!!";
}
/*
@ -112,7 +105,7 @@ public class UserLoginController {
modelAndView.setViewName("redirect:login");
}
if (res==1){
modelAndView.addObject("msg","注册成功");
modelAndView.addObject("msg","注册成功,请完成登录");
modelAndView.setViewName("redirect:login");
}

View File

@ -1,4 +1,4 @@
site-url: 47.115.118.34
site-url: 127.0.0.1
server:
port: 80
tomcat:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -69,11 +69,11 @@
select * from sys_order where order_mark = #{orderMark};
</select>
<select id="merchantProfitCount" resultType="FLOAT">
<select id="merchantProfitCount" resultType="java.lang.Float">
select sum((order_price-merchant_ratio*order_price)/1) from sys_order where order_merchant = #{merchantId} and order_state = 1;
</select>
<select id="websiteProfitCount" resultType="FLOAT">
<select id="websiteProfitCount" resultType="java.lang.Float">
select sum((merchant_ratio*order_price)/1) from sys_order where order_state = 1;
</select>

View File

@ -16,7 +16,7 @@
</select>
<select id="selectByEmail" resultType="com.example.jieyue.common.entity.SysUser">
select email,password from sys_user where email = #{email};
select email,password,mark from sys_user where email = #{email};
</select>
<select id="getUserInfo" resultType="com.example.jieyue.common.entity.SysUser">

View File

@ -20,11 +20,14 @@
</div>
<div class="form">
<div class="thumbnail"><img th:src="@{/css/admin/hat.svg}"/></div>
<form class="register-form" th:action="@{/admin/sign-up}" method="post">
<input type="text" placeholder="昵称" name="name"/>
<input type="password" placeholder="密码" name="password"/>
<input type="text" placeholder="邮箱" name="email"/>
<button>注册</button>
<form class="register-form">
<input id="name" type="text" placeholder="昵称" name="name"/>
<input id="email" type="text" placeholder="邮箱" name="email"/>
<input id="password" type="password" placeholder="密码" name="password"/>
<div style="text-align: center;width: 100%;height: 50px;background: #EF3B3A;color: white;border-radius: 5px"
id="button" onclick="button();">
<br/>注册
</div>
<p class="message">已注册账号? <a href="#">登录</a></p>
</form>
<form class="login-form" th:action="@{/admin/do-login}" method="post">
@ -35,6 +38,77 @@
</form>
</div>
<script th:src="@{/js/admin/jquery.min.js}"></script>
<script>
if (sessionStorage.getItem("admin_sign_num") > 0) {
sessionStorage.setItem("admin_sign_num", sessionStorage.getItem("admin_sign_num"));
change();
}
function button() {
var email = document.getElementById("email").value;
var name = document.getElementById("name").value;
var password = document.getElementById("password").value;
if (email == "") {
alert("邮箱不能为空!!");
return;
}
$.ajax({
type: "POST",
url: "/admin/sign-up?email="+email+"&name="+name+"&password="+password,
contentType: "application/json; charset=utf-8",
success: function (msg) {
alert(msg);
},
error: function () {
alert("网络出现了问题!!")
}
});
sessionStorage.setItem("admin_sign_num", 60);
change();
}
function change() {
var button = document.getElementById("button");
button.style.background = "grey";
button.disabled = true;
var time = setInterval(function () {
var num = sessionStorage.getItem("admin_sign_num");
if (num <= 0) {
button.style.background = "#EF3B3A";
button.disabled = false;
button.innerHTML = "<br/>重新发送验证码";
clearInterval(time);
} else {
button.innerHTML = "<br/>重新发送验证码("+num+"";
}
sessionStorage.setItem("admin_sign_num", --num);
} , 1000);
}
</script>
<script>
// 发送验证码
function sendCode(){
$(document).ready(function(){
//请求参数对象
var email = document.getElementById("email").value;
//执行Ajax请求
$.ajax({
url: "/admin/sign/send/code?email="+email,
success : function(result) {
if (result){
alert("验证码已成功发送至您的邮箱,请注意查收");
} else {
alert("邮箱格式不正确");
}
},
error : function (result) {
alert("验证码发送失败");
}
});
});
}
</script>
<script th:src="@{/js/admin/index.js}"></script>
<script th:include="admin/common/model::alertMsg"></script>
</body>

View File

@ -23,7 +23,7 @@
color: grey;
height: 35px;
width: 80px;
font-size: 16px;
font-size: 12px;
border-radius: 10px;
}
form input:hover{
@ -65,7 +65,7 @@
这里还没有任何商户信息!!
</h3>
<!-- /. PAGE INNER -->
<table style="text-align: center;background:ghostwhite;font-size: 18px;position: relative;left: 5%;width: 90%">
<table style="text-align: center;background:ghostwhite;font-size: 14px;position: relative;left: 5%;width: 90%">
<tr style="height: 35px;background: orangered;color: white">
<th>商户logo</th>
<th>ID</th>
@ -77,14 +77,14 @@
</tr>
<!--/*@thymesVar id="mtList" type="jdk"*/-->
<tr th:each="mt : ${mtList} " style="height: 100px">
<td>
<img th:src="@{${mt.getHeader()}}" style="border-radius: 100%;width: 80px">
<td height="80px">
<img th:src="@{${mt.getHeader()}}" style="border-radius: 100%;width: 60px">
</td>
<td>[[${mt.getId()}]]</td>
<td>[[${mt.getName()}]]</td>
<td>[[${mt.getEmail()}]]</td>
<td th:if="${mt.getState()}==1">已启用</td>
<td th:if="${mt.getState()}==0">未启用</td>
<td th:if="${mt.getState()}==1" style="font-weight: bold; color: deepskyblue">已启用</td>
<td th:if="${mt.getState()}==0" style="font-weight: bold; color: orangered">未启用</td>
<td>
<form th:action="@{/admin/merchant/update-ratio}" method="post">
<br/>
@ -99,12 +99,12 @@
<input type="submit" value="删除" style="width: 65px;"
onclick="if (confirm('确认删除该商户?')==false)return false;">
</form>
<form th:action="@{/admin/merchant/update-merchant(email=${mt.getEmail()},state=0)}" method="post">
<input th:if="${mt.getState()}==1" type="submit" value="停用" style="width: 65px;background: deepskyblue;color: white"
<form th:action="@{/admin/merchant/update-merchant(email=${mt.getEmail()},state=0,id=${mt.getId()})}" method="post">
<input th:if="${mt.getState()}==1" type="submit" value="停用" style="width: 65px;background: deepskyblue; color: white; font-weight: bold"
onclick="if (confirm('确认停用该商户?')==false)return false; ">
</form>
<form th:action="@{/admin/merchant/update-merchant(email=${mt.getEmail()},state=1)}" method="post">
<input th:if="${mt.getState()}==0" type="submit" value="启用" style="width: 65px;background: gold;color: white"
<form th:action="@{/admin/merchant/update-merchant(email=${mt.getEmail()},state=1,id=${mt.getId()})}" method="post">
<input th:if="${mt.getState()}==0" type="submit" value="启用" style="width: 65px;background: orangered; color: white; font-weight: bold"
onclick="if (confirm('确认启用商户?')==false)return false; ">
</form>
</td>

View File

@ -32,13 +32,13 @@
<textarea style="background: white;height: 50px" name="title" placeholder="通知标题"></textarea>
<textarea style="background: white;height: 300px" name="context" placeholder="通知内容"></textarea>
<label>
<input name="type" value="0" type="radio" style="width: 10px;height: 10px" checked="checked"><b style="color: red;">管理员</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="type" value="0" type="radio" style="width: 10px;height: 10px" disabled><b style="color: red;">管理员</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<label>
<input name="type" value="1" type="radio" style="width: 10px;height: 10px"><b style="color: mediumpurple;">商户</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="type" value="1" type="radio" style="width: 10px;height: 10px" disabled><b style="color: mediumpurple;">商户</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<label>
<input name="type" value="2" type="radio" style="width: 10px;height: 10px"><b style="color: limegreen;">会员</b>
<input name="type" value="2" type="radio" style="width: 10px;height: 10px" checked><b style="color: limegreen;">会员</b>
</label>
<label style="float: right">
<input style="background: deepskyblue;color: white;font-weight: bold" value="发送" type="submit">

View File

@ -64,13 +64,21 @@
<th>会员标记</th>
</tr>
<tr th:each="user : ${userList}" style="height: 100px">
<td>
<img th:src="@{${user.getHeader()}}" style="width: 80px;border-radius: 100%">
<td height="80px">
<img th:src="@{${user.getHeader()}}" style="width: 60px;border-radius: 100%">
</td>
<td>
<b>[[${user.getId()}]]</b>
</td>
<td>
<b>[[${user.getUsername()}]]</b>
</td>
<td>
<b>[[${user.getEmail()}]]</b>
</td>
<td>
<b>[[${user.getMark()}]]</b>
</td>
<td th:text="${user.getId()}"></td>
<td th:text="${user.getUsername()}"></td>
<td th:text="${user.getEmail()}"></td>
<td th:text="${user.getMark()}"></td>
</tr>
<tr style="height: 100px">
<td colspan="5">

View File

@ -33,18 +33,16 @@
<div class="card-body">
<h2 class="card-title">商户注册</h2>
<p>请使用您的电子邮箱进行注册</p>
<form th:action="@{/merchant/sign-up}" method="post">
<div class="form-group">
<input class="form-control" type="text" placeholder="名称" name="name">
</div>
<div class="form-group">
<input class="form-control" type="email" placeholder="邮箱" name="email">
</div>
<div class="form-group">
<input class="form-control" type="password" placeholder="密码" name="password">
</div>
<button class="btn btn-lg">注册</button>
</form>
<div class="form-group">
<input id="name" class="form-control" type="text" placeholder="名称" name="name">
</div>
<div class="form-group">
<input id="email" class="form-control" type="email" placeholder="邮箱" name="email">
</div>
<div class="form-group">
<input id="password" class="form-control" type="password" placeholder="密码" name="password">
</div>
<button id="button" onclick="button()" class="btn btn-lg">注册</button>
</div>
<button class="btn btn-back js-btn" data-target="welcome"><i class="fas fa-angle-left"></i></button>
</div>
@ -60,7 +58,6 @@
<div class="form-group">
<input class="form-control" type="password" placeholder="密码" name="password">
</div>
<p><a href="#">忘记密码?</a></p>
<button class="btn btn-lg">登录</button>
</form>
</div>
@ -70,10 +67,55 @@
</div>
</div>
<script th:src="@{/js/merchant/index.js}"></script>
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
<script>
if (sessionStorage.getItem("admin_sign_num") > 0) {
sessionStorage.setItem("admin_sign_num", sessionStorage.getItem("admin_sign_num"));
change();
}
function button() {
var email = document.getElementById("email").value;
var name = document.getElementById("name").value;
var password = document.getElementById("password").value;
if (email == "") {
alert("邮箱不能为空!!");
return;
}
$.ajax({
type: "POST",
url: "/merchant/sign-up?email="+email+"&name="+name+"&password="+password,
contentType: "application/json; charset=utf-8",
success: function (msg) {
alert(msg);
},
error: function () {
alert("网络出现了问题!!")
}
});
sessionStorage.setItem("admin_sign_num", 60);
change();
}
function change() {
var button = document.getElementById("button");
button.style.background = "grey";
button.disabled = true;
var time = setInterval(function () {
var num = sessionStorage.getItem("admin_sign_num");
if (num <= 0) {
button.style.background = "orangered";
button.style.color = "white";
button.disabled = false;
button.innerText = "重新发送验证码";
clearInterval(time);
} else {
button.innerText = "重新发送验证码("+num+"";
}
sessionStorage.setItem("admin_sign_num", --num);
} , 1000);
}
</script>
<script th:inline="javascript">
$(document).ready(function(){
if ([[${param.msg}]] != null){

View File

@ -54,22 +54,24 @@
<section class="wrapper">
<table style="text-align: center">
<tr>
<td>
<td colspan="2">
<h4>商户头像推荐logo长宽比例1:1</h4>
<form th:action="@{/merchant/update-header}" method="post" enctype="multipart/form-data">
<!--/*@thymesVar id="lowImg" type="com.example.jieyue.common.entity.SysMtUi"*/-->
<img th:src="@{${session.merchant.getHeader()}}" width="320px" height="320" onclick="upImg('headerInput')" id="header">
<img th:src="@{${session.merchant.getHeader()}}" width="240" height="240" onclick="upImg('headerInput')" id="header" style="border-radius: 100%">
<input style="display: none;" id="headerInput" type="file" name="img" onchange="showImg(this,'header')">
<br/>
<input type="submit" value="修改" style="background: purple;border-radius: 5px;color: white">
</form>
</td>
</tr>
<tr>
<td>
<h4>商城首页的店铺推荐海报推荐400x320</h4>
<form th:action="@{/merchant/update-home-img}" method="post" enctype="multipart/form-data">
<!--/*@thymesVar id="homeImg" type="com.example.jieyue.common.entity.SysMtUi"*/-->
<img th:if="${homeImg}!=null" th:src="@{${homeImg.getUrl()}}" width="400px" height="320px" onclick="upImg('homeInput400')" id="home400">
<img th:unless="${homeImg}!=null" th:src="@{/image/user/home/banner/7.jpg}" width="400px" height="320px" onclick="upImg('homeInput400')" id="home400">
<img th:if="${homeImg}!=null" th:src="@{${homeImg.getUrl()}}" width="300" height="240" onclick="upImg('homeInput400')" id="home400">
<img th:unless="${homeImg}!=null" th:src="@{/image/user/home/banner/7.jpg}" width="300" height="240" onclick="upImg('homeInput400')" id="home400">
<input style="display: none;" id="homeInput400" type="file" name="img" onchange="showImg(this,'home400')">
<input type="number" name="width" value="400" hidden>
<input type="number" name="height" value="320" hidden>
@ -78,14 +80,12 @@
<a style="color: purple" th:if="${homeImg}!=null" th:href="@{/merchant/del-home-img(id=${homeImg.getId()})}">删除</a>
</form>
</td>
</tr>
<tr>
<td colspan="2">
<td>
<h4>商城首页的店铺推荐海报推荐600x310,点击图片选择)</h4>
<form th:action="@{/merchant/update-home-img}" method="post" enctype="multipart/form-data">
<!--/*@thymesVar id="lowImg" type="com.example.jieyue.common.entity.SysMtUi"*/-->
<img th:if="${lowImg}!=null" th:src="@{${lowImg.getUrl()}}" width="600px" height="310px" onclick="upImg('homeInput600')" id="home600">
<img th:unless="${lowImg}!=null" th:src="@{/image/user/home/blog/blog1.jpg}" width="600px" height="310px" onclick="upImg('homeInput600')" id="home600">
<img th:if="${lowImg}!=null" th:src="@{${lowImg.getUrl()}}" width="450" height="235" onclick="upImg('homeInput600')" id="home600">
<img th:unless="${lowImg}!=null" th:src="@{/image/user/home/blog/blog1.jpg}" width="450" height="235" onclick="upImg('homeInput600')" id="home600">
<input style="display: none;" id="homeInput600" type="file" name="img" onchange="showImg(this,'home600')">
<input type="number" name="width" value="600" hidden>
<input type="number" name="height" value="310" hidden>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>商品列表</title>
<title>用户列表</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
@ -78,8 +78,8 @@
<th>会员标记</th>
</tr>
<tr th:each="user : ${userList}" style="height: 100px">
<td>
<img th:src="@{${user.getHeader()}}" style="width: 80px;border-radius: 100%">
<td height="80px">
<img th:src="@{${user.getHeader()}}" style="width: 60px;border-radius: 100%">
</td>
<td th:text="${user.getId()}"></td>
<td th:text="${user.getUsername()}"></td>

View File

@ -150,7 +150,7 @@
</td>
<td class="product-thumbnail">
<a th:href="@{/user/product(id=${cart.get('goodsId')})}">
<img th:src="@{${cart.get('goodsImg')}}" alt=""/>
<img th:src="@{${cart.get('goodsImg')}}" width="100%" alt=""/>
</a>
</td>
<td class="product-name">
@ -162,20 +162,20 @@
</a>
</td>
<td class="product-price">
<span class="amount">
<span class="amount" style="color: gold">
¥[[${cart.get("goodsPrice")}]]
</span>
</td>
<td class="product-quantity">
[[${cart.get("goodsMerchant")}]]
<a th:href="@{/user/shop(id = ${cart.get('merchantId')})}">[[${cart.get("goodsMerchant")}]]</a>
</td>
<td class="product-subtotal">
<td class="product-subtotal" style="color: red">
<input hidden="hidden" th:id="'goodsStock'+${stat.index}" th:value="${cart.get('goodsStock')}">
<input hidden="hidden" th:id="'goodsState'+${stat.index}" th:value="${cart.get('goodsState')}">
[[${cart.get("goodsStock")}]]
</td>
<td class="product-subtotal">
<input onclick="cartGoods()" th:id="'goodsNum'+${stat.index}" type="number" min="1" th:value="${cart.get('goodsNum')}"/>
<input onclick="cartGoods()" th:id="'goodsNum'+${stat.index}" type="number" min="1" th:max="${cart.get('goodsStock')}" th:value="${cart.get('goodsNum')}"/>
</td>
<td class="product-remove">
<a onclick="if (confirm('将该商品移出购物车?')==false)return false; "
@ -239,7 +239,7 @@
var checkbox = document.getElementById("checkbox" + i);
if (goodsStock.value < 1 || goodsStock.value < goodsNum.value || goodsState.value != 1){
checkbox.checked = false;
alert("购物车中存在库存不足,或已下架的商品!");
alert("您的购物车中存在超出库存,或已下架的商品!");
}
if (checkbox.checked){
var goodsId = document.getElementById("goodsId" + i);

View File

@ -43,18 +43,65 @@
</div>
<div class="cont_form_sign_up"> <a href="#" onClick="ocultar_login_sign_up()"><i class="material-icons">&#xE5C4;</i></a>
<h2>SIGN UP</h2>
<form th:action="@{/user/sign-up}" method="post">
<input type="text" placeholder="邮箱" name="email"/>
<input type="text" placeholder="昵称" name="username"/>
<input type="password" placeholder="密码" name="password"/>
<input type="password" placeholder="确认密码" name="repwd"/>
<button class="btn_sign_up" onClick="cambiar_sign_up()">注册</button>
</form>
<br/><br/>
<input style="border: 0;width: 80%;height: 40px;border-radius: 5px;text-align: left;padding-left: 10px" id="email" type="text" placeholder="邮箱" name="email"/>
<br/><br/>
<input style="border: 0;width: 80%;height: 40px;border-radius: 5px;text-align: left;padding-left: 10px" id="username" type="text" placeholder="昵称" name="username"/>
<br/><br/>
<input style="border: 0;width: 80%;height: 40px;border-radius: 5px;text-align: left;padding-left: 10px" id="password" type="password" placeholder="密码" name="password"/>
<br/><br/>
<input style="border: 0;width: 80%;height: 40px;border-radius: 5px;text-align: left;padding-left: 10px" id="repwd" type="password" placeholder="确认密码" name="repwd"/>
<br/><br/>
<button type="button" id="button" class="btn_sign_up" onclick="button()">注册</button>
</div>
</div>
</div>
</div>
</div>
<script>
if (sessionStorage.getItem("user_sign_num") > 0) {
sessionStorage.setItem("user_sign_num", sessionStorage.getItem("user_sign_num"));
change();
}
function button() {
var email = document.getElementById("email").value;
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var repwd = document.getElementById("repwd").value;
$.ajax({
type: "POST",
url: "/user/sign-up?email="+email+"&username="+username+"&password="+password+"&repwd="+repwd,
contentType: "application/json; charset=utf-8",
success: function (msg) {
alert(msg);
},
error: function () {
alert("网络出现了问题!!")
}
});
sessionStorage.setItem("user_sign_num", 60);
change();
}
function change() {
var button = document.getElementById("button");
button.style.background = "grey";
button.disabled = true;
var time = setInterval(function () {
var num = sessionStorage.getItem("user_sign_num");
if (num <= 0) {
button.style.background = "orangered";
button.disabled = false;
button.innerText = "重新发送验证码";
clearInterval(time);
} else {
button.innerText = "重新发送验证码("+num+")";
}
sessionStorage.setItem("user_sign_num", --num);
} , 1000);
}
</script>
<script th:src="@{/js/user/index.js}"></script>
<script th:include="user/common/model::alertMsg"></script>
</body>

View File

@ -80,12 +80,16 @@
<script th:src="@{/js/user/home/vendor/modernizr-2.8.3.min.js}"></script>
<style>
table {
background: #bcc2d8;
background: #bcc2e4;
border-radius: 20px;
width: 85%;
height: 100px;
color: darkslategrey;
}
pre {
background: #bcc2e4;
border: 0;
}
.context{
position: relative;
height: 100px;
@ -117,6 +121,9 @@
</div>
</div>
</div>
<!-- entry-header-area end -->
<!-- cart-main-area start -->
<div class="cart-main-area">
<div class="container">
<div class="row">
@ -131,8 +138,10 @@
<table th:each="notice : ${noticeList}">
<tr style="height: 36px">
<td style="width: 50px;"></td>
<td style="position:relative;font-size: 24px"
th:text="${notice.getTitle()}">
<td style="position:relative;font-size: 24px">
<br/><br/>
<b>[[${notice.getTitle()}]]</b>
<br/><br/>
</td>
<td>
<a href="#" th:onclick="delNotice('[[${notice.getId()}]]')" style="font-weight: bold;font-size: 30px;float: right;
@ -158,12 +167,14 @@
</tr>
<tr>
<td colspan="3">
<hr/>
<hr style="color: black"/>
</td>
</tr>
<tr style="overflow-x: hidden;">
<td style="width: 50px;"></td>
<td class="context" th:text="'系统消息:'+${notice.getContext()}"></td>
<td class="context">
<pre>[[${notice.getContext()}]]</pre>
</td>
</tr>
<tr>
<td colspan="3">

View File

@ -131,7 +131,7 @@
<table th:if="${orderList.size()} == 0">
<tr style="height: 400px">
<td style="font-size: 24px">
您还未在本网站购买任何商品
!!!这里是空的!!!
</td>
</tr>
</table>
@ -152,7 +152,7 @@
<td class="product-thumbnail">
<a target="_blank"
th:href="@{/user/product(id=${goodsList.get(stat.index).getId()})}">
<img th:src="@{${goodsList.get(stat.index).getImg()}}" alt=""/>
<img th:src="@{${goodsList.get(stat.index).getImg()}}" width="100%" alt=""/>
</a>
</td>
<td class="product-name">