1
This commit is contained in:
Generated
+1
-1
@@ -7,7 +7,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11 (2)" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="12" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -30,6 +30,7 @@
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:Release2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-springsecurity4:Release" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring4:Release" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.4" level="project" />
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package edu.neu.neumall.controller;
|
||||
|
||||
import edu.neu.neumall.entity.User;
|
||||
import edu.neu.neumall.repository.ShoppingCartRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -10,9 +12,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@Controller
|
||||
@RequestMapping("/cart")
|
||||
public class ShoppingCartController {
|
||||
private ShoppingCartRepository shoppingCartRepository;
|
||||
|
||||
@Autowired
|
||||
public ShoppingCartController(ShoppingCartRepository shoppingCartRepository){
|
||||
this.shoppingCartRepository = shoppingCartRepository;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String shoppingCartPage(@AuthenticationPrincipal User user, Model model) {
|
||||
model.addAttribute("cart", user.getShoppingCart());
|
||||
return "";
|
||||
// model.addAttribute("cart", user.getShoppingCart());
|
||||
model.addAttribute("cart", shoppingCartRepository.findAll());
|
||||
return "car.html";
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head lang="en">
|
||||
<meta charset="utf-8" />
|
||||
<title>cart</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/public.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/proList.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!--/*@thymesVar id="cart" type="java.util.Set<.neu.neumall.entity.ShoppingCart>"*/-->
|
||||
<div th:each="item:${cart}" class="cart mt">
|
||||
<!-----------------site------------------->
|
||||
<div class="site">
|
||||
<p class=" wrapper clearfix">
|
||||
<span class="fl">购物车</span>
|
||||
<img class="top" src="img/temp/cartTop01.png">
|
||||
<a href="index.html" class="fr">继续购物></a>
|
||||
</p>`
|
||||
</div>
|
||||
<!-----------------table------------------->
|
||||
<div class="table wrapper">
|
||||
<div class="tr">
|
||||
<div>商品</div>
|
||||
<div>单价</div>
|
||||
<div>数量</div>
|
||||
<div>小计</div>
|
||||
<div>操作</div>
|
||||
</div>
|
||||
<div class="th">
|
||||
<div class="pro clearfix">
|
||||
<label class="fl">
|
||||
<input type="checkbox"/>
|
||||
<span></span>
|
||||
</label>
|
||||
<a class="fl" href="#">
|
||||
<dl class="clearfix">
|
||||
<dt class="fl"><img src="img/temp/cart01.jpg"></dt>
|
||||
<dd class="fl">
|
||||
<p th:text="${item}"></p>
|
||||
</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</div>
|
||||
<div class="price">¥20.00</div>
|
||||
<div class="number">
|
||||
<p class="num clearfix">
|
||||
<img class="fl sub" src="img/temp/sub.jpg">
|
||||
<span class="fl">1</span>
|
||||
<img class="fl add" src="img/temp/add.jpg">
|
||||
</p>
|
||||
</div>
|
||||
<div class="price sAll">¥20.00</div>
|
||||
<div class="price"><a class="del" href="#2">删除</a></div>
|
||||
</div>
|
||||
<div class="goOn">空空如也~<a href="index.html">去逛逛</a></div>
|
||||
<div class="tr clearfix">
|
||||
<label class="fl">
|
||||
<input class="checkAll" type="checkbox"/>
|
||||
<span></span>
|
||||
</label>
|
||||
<p class="fl">
|
||||
<a href="#">全选</a>
|
||||
<a href="#" class="del">删除</a>
|
||||
</p>
|
||||
<p class="fr">
|
||||
<span>共<small id="sl">0</small>件商品</span>
|
||||
<span>合计: <small id="all">¥0.00</small></span>
|
||||
<a href="order.html" class="count">结算</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mask"></div>
|
||||
<div class="tipDel">
|
||||
<p>确定要删除该商品吗?</p>
|
||||
<p class="clearfix">
|
||||
<a class="fl cer" href="#">确定</a>
|
||||
<a class="fr cancel" href="#">取消</a>
|
||||
</p>
|
||||
</div>
|
||||
<!--返回顶部-->
|
||||
<div class="gotop">
|
||||
<a href="cart.html">
|
||||
<dl>
|
||||
<dt><img src="img/gt1.png"/></dt>
|
||||
<dd>去购<br />物车</dd>
|
||||
</dl>
|
||||
</a>
|
||||
<a href="mygxin.html">
|
||||
<dl>
|
||||
<dt><img src="img/gt3.png"/></dt>
|
||||
<dd>个人<br />中心</dd>
|
||||
</dl>
|
||||
</a>
|
||||
<a href="#" class="toptop" style="display: none;">
|
||||
<dl>
|
||||
<dt><img src="img/gt4.png"/></dt>
|
||||
<dd>返回<br />顶部</dd>
|
||||
</dl>
|
||||
</a>
|
||||
</div>
|
||||
<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="js/pro.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="js/cart.js" type="text/javascript" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,13 +5,165 @@
|
||||
<meta charset="UTF-8">
|
||||
<!--/*@thymesVar id="product" type="edu.neu.neumall.entity.Product"*/-->
|
||||
<title th:text="${product.name}"></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/font-awesome.min.css">
|
||||
<script src="/js/jquery.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" href="/css/mall.css">
|
||||
<style>
|
||||
body{
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<!--<body>-->
|
||||
<!--<ul>-->
|
||||
<!--<!–/*@thymesVar id="product" type="edu.neu.neumall.entity.Product"*/–>-->
|
||||
<!--<li th:each="comment:${product.getCommentList()}">-->
|
||||
<!--<span th:text="${comment.content}"></span>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--</body>-->
|
||||
<body>
|
||||
<ul>
|
||||
<!--/*@thymesVar id="product" type="edu.neu.neumall.entity.Product"*/-->
|
||||
<li th:each="comment:${product.getCommentList()}">
|
||||
<span th:text="${comment.content}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 商品信息展示 -->
|
||||
<div class="item-detail-show">
|
||||
<div class="item-detail-left">
|
||||
<div class="item-detail-big-img">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-detail-right">
|
||||
<div class="item-detail-title">
|
||||
<p><span class="item-detail-express">校园配送</span > <span class="item-detail-express" th:text="${product.name}"></span ></p>
|
||||
</div>
|
||||
<div class="item-detail-price-row">
|
||||
<div class="item-price-left">
|
||||
<div class="item-price-row">
|
||||
<p><span class="item-price-title">京 东 价</span> <span class="item-price" th:text="${product.price}"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-price-right">
|
||||
<div class="item-remarks-sum">
|
||||
<p>累计评价</p>
|
||||
<p><span class="item-remarks-num">7.5万+</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 选择颜色 -->
|
||||
<div class="item-select">
|
||||
<div class="item-select-title">
|
||||
<p>选择颜色</p>
|
||||
</div>
|
||||
<div class="item-select-column">
|
||||
<div class="item-select-row">
|
||||
<div class="item-select-box">
|
||||
|
||||
<div class="item-select-intro">
|
||||
<p th:text="${product.name}"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="add-buy-car-box">
|
||||
<a href="car.html">
|
||||
<button class="btn-add-buy-car btn btn-danger">
|
||||
加入购物车
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 商品详细展示 -->
|
||||
<div class="item-intro-show">
|
||||
<div class="item-intro-recommend">
|
||||
<div class="item-recommend-title">
|
||||
<p>店铺热销</p>
|
||||
</div>
|
||||
<div class="item-intro-recommend-column">
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/1.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">1</span> 热销165077件</span>
|
||||
<span class="item-recommend-price">¥28.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/2.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">2</span> 热销112892件</span>
|
||||
<span class="item-recommend-price">¥36.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/3.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">3</span> 热销84980件</span>
|
||||
<span class="item-recommend-price">¥28.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/4.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">4</span> 热销36051件</span>
|
||||
<span class="item-recommend-price">¥48.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/5.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">5</span> 热销20858件</span>
|
||||
<span class="item-recommend-price">¥25.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-recommend-column">
|
||||
<div class="item-recommend-img">
|
||||
<img src="./img/sidebar/6.jpg" alt="">
|
||||
</div>
|
||||
<div class="item-recommend-intro">
|
||||
<span><span class="item-recommend-top-num">6</span> 热销15672件</span>
|
||||
<span class="item-recommend-price">¥62.00</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-intro-detail">
|
||||
<div class="item-intro-nav">
|
||||
<ul>
|
||||
<li>商品介绍</li>
|
||||
<li>规格包装</li>
|
||||
<li>售后保障</li>
|
||||
<li>商品评价(7.5万+)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="item-intro-img">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
<img th:src="${product.main_img}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
$('.item-detail-img-small img').hover(function () {
|
||||
$('.item-detail-big-img img').attr('src', $(this).attr('src'));
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Vendored
+2
-2
@@ -6,8 +6,8 @@
|
||||
* -------------------------- */
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.2.0');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
|
||||
src: url('../../src/main/resources/static/fonts/fontawesome-webfont.eot?v=4.2.0');
|
||||
src: url('../../src/main/resources/static/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../../src/main/resources/static/fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../../src/main/resources/static/fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../../src/main/resources/static/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
Vendored
+4
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user