Commit 5ebe065a authored by issei.miyajima's avatar issei.miyajima

Merge branch 'master' of http://gitlab.fox-hound.co.jp/shoei.kanno/Ecsite into 検索機能

# Conflicts:
#	src/main/java/com/example/repository/ShoesRepository.java
#	src/main/java/com/example/service/ShoesService.java
parents f7b06b21 6c5981d6
import org.springframework.web.multipart.MultipartFile;
import lombok.Getter;
import lombok.Setter;
//靴新規登録用フォーム
@Getter
@Setter
public class ShoesForm {
private String name;
private Integer price;
private Integer stock;
private Integer size;
private Integer product_status;
//画像を受け取る変数
private MultipartFile multipartFile;
}
...@@ -22,6 +22,7 @@ public class SalesLog { ...@@ -22,6 +22,7 @@ public class SalesLog {
private Integer id; private Integer id;
private Integer userId; private Integer userId;
private Integer shoesId; private Integer shoesId;
private Integer quantity;
private Integer price; private Integer price;
private Date created; private Date created;
......
...@@ -11,10 +11,13 @@ import com.example.domain.SalesLog; ...@@ -11,10 +11,13 @@ import com.example.domain.SalesLog;
@Repository @Repository
public interface SalesLogRepository extends JpaRepository<SalesLog, Integer>{ public interface SalesLogRepository extends JpaRepository<SalesLog, Integer>{
@Query(value = "SELECT id,user_id, shoes_id, SUM(price) AS price, created FROM sales_logs AS sl WHERE sl.user_id = ?1 GROUP BY sl.created", @Query(value = "SELECT id,user_id, shoes_id, quantity, SUM(price) AS price, created FROM sales_logs AS sl WHERE sl.user_id = ?1 GROUP BY sl.created",
nativeQuery = true) nativeQuery = true)
public List <SalesLog> history(Integer id); public List <SalesLog> history(Integer id);
@Query(value = "SELECT id, user_id, shoes_id, price, created FROM sales_logs AS sl WHERE sl.created = ?1 && sl.user_id = ?2", @Query(value = "SELECT id, user_id, shoes_id, quantity, price, created FROM sales_logs AS sl WHERE sl.created = ?1 && sl.user_id = ?2",
nativeQuery = true) nativeQuery = true)
public List <SalesLog> historyDetails(Date created, Integer id); public List <SalesLog> historyDetails(Date created, Integer id);
@Query(value = "SELECT id, user_id, shoes_id, quantity, price, created FROM sales_logs AS sl WHERE sl.price >= ?1 && sl.price <= ?2 && sl.user_id = ?3",
nativeQuery = true)
public List <SalesLog> searchPrice(Integer lowPrice, Integer highPrice, Integer id);
} }
...@@ -13,6 +13,7 @@ import com.example.domain.Shoes; ...@@ -13,6 +13,7 @@ import com.example.domain.Shoes;
public interface ShoesRepository extends JpaRepository<Shoes, Integer>{ public interface ShoesRepository extends JpaRepository<Shoes, Integer>{
@Query(value = "SELECT * FROM shoes WHERE product_status = ?1 ORDER BY id DESC", nativeQuery = true) @Query(value = "SELECT * FROM shoes WHERE product_status = ?1 ORDER BY id DESC", nativeQuery = true)
public List <Shoes> findAllByStatus(Integer status); public List <Shoes> findAllByStatus(Integer status);
<<<<<<< HEAD
//商品名あいまい検索 //商品名あいまい検索
@Query(value = "SELECT * FROM shoes WHERE name LIKE %:keyword% ORDER BY id DESC", nativeQuery = true) @Query(value = "SELECT * FROM shoes WHERE name LIKE %:keyword% ORDER BY id DESC", nativeQuery = true)
...@@ -22,3 +23,11 @@ public interface ShoesRepository extends JpaRepository<Shoes, Integer>{ ...@@ -22,3 +23,11 @@ public interface ShoesRepository extends JpaRepository<Shoes, Integer>{
@Query(value = "SELECT * FROM shoes WHERE size =?1 ORDER BY id DESC", nativeQuery = true) @Query(value = "SELECT * FROM shoes WHERE size =?1 ORDER BY id DESC", nativeQuery = true)
public List <Shoes> findAllBySize(Integer size); public List <Shoes> findAllBySize(Integer size);
} }
=======
//管理画面で使用
@Query(value = "SELECT * FROM shoes WHERE name = ?1 && size = ?2", nativeQuery = true)
public Shoes findOneAddStock(String name, Integer size);
}
>>>>>>> 6c5981d65b423f7ba8b4f9fef90d0047960002bb
...@@ -46,6 +46,7 @@ public class SalesLogService { ...@@ -46,6 +46,7 @@ public class SalesLogService {
SalesLog salesLog = new SalesLog(); SalesLog salesLog = new SalesLog();
salesLog.setUserId(userId); salesLog.setUserId(userId);
salesLog.setShoesId((cart.get(i)).getShoesId()); salesLog.setShoesId((cart.get(i)).getShoesId());
salesLog.setQuantity((cart.get(i)).getQuantity());
salesLog.setPrice((cart.get(i)).getPrice()); salesLog.setPrice((cart.get(i)).getPrice());
salesLog.setCreated(today); salesLog.setCreated(today);
salesLogRepository.save(salesLog); salesLogRepository.save(salesLog);
...@@ -59,4 +60,8 @@ public class SalesLogService { ...@@ -59,4 +60,8 @@ public class SalesLogService {
public List <SalesLog> historyDetails(Date created, Integer id) { public List <SalesLog> historyDetails(Date created, Integer id) {
return salesLogRepository.historyDetails(created, id); return salesLogRepository.historyDetails(created, id);
} }
public List<SalesLog> searchPrice(Integer lowPrice, Integer highPrice, Integer id){
return salesLogRepository.searchPrice(lowPrice, highPrice, id);
}
} }
...@@ -60,4 +60,8 @@ public class ShoesService { ...@@ -60,4 +60,8 @@ public class ShoesService {
return shoesRepository.findAllBySize(shoesSize); return shoesRepository.findAllBySize(shoesSize);
} }
//管理画面、重複商品のバリデーション
public Shoes findOneAddStock(String name, Integer size) {
return shoesRepository.findOneAddStock(name, size);
}
} }
package com.example.web;
import java.sql.Date;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class DateSearchForm {
private Date date;
}
...@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -49,6 +50,16 @@ public class EcsiteController { ...@@ -49,6 +50,16 @@ public class EcsiteController {
return new WalletsForm(); return new WalletsForm();
} }
@ModelAttribute
DateSearchForm setForm() {
return new DateSearchForm();
}
@ModelAttribute
PriceSearchForm setPriceForm() {
return new PriceSearchForm();
}
int totalPrice = 0; int totalPrice = 0;
//写真の表示用メソッド //写真の表示用メソッド
public String photoView(String Photo) { public String photoView(String Photo) {
...@@ -88,6 +99,8 @@ public class EcsiteController { ...@@ -88,6 +99,8 @@ public class EcsiteController {
public String top(Model model, @AuthenticationPrincipal LoginUser userDetails) { public String top(Model model, @AuthenticationPrincipal LoginUser userDetails) {
User user = userDetails.getUser(); User user = userDetails.getUser();
model.addAttribute("user", user); model.addAttribute("user", user);
Wallets wallets = walletsService.findOne(user.getId());
model.addAttribute("wallets", wallets);
if(session.getAttribute("cartValue") == null) { if(session.getAttribute("cartValue") == null) {
model.addAttribute("cartValue", 0); model.addAttribute("cartValue", 0);
}else { }else {
...@@ -118,6 +131,8 @@ public class EcsiteController { ...@@ -118,6 +131,8 @@ public class EcsiteController {
//user情報取得、格納 //user情報取得、格納
User user = userDetails.getUser(); User user = userDetails.getUser();
model.addAttribute("user", user); model.addAttribute("user", user);
Wallets wallets = walletsService.findOne(user.getId());
model.addAttribute("wallets", wallets);
//カート個数取得、格納 //カート個数取得、格納
if(session.getAttribute("cartValue") == null) { if(session.getAttribute("cartValue") == null) {
model.addAttribute("cartValue", 0); model.addAttribute("cartValue", 0);
...@@ -159,13 +174,19 @@ public class EcsiteController { ...@@ -159,13 +174,19 @@ public class EcsiteController {
public String history (@PathVariable Integer id, Model model, SalesLog salesLog, @AuthenticationPrincipal LoginUser userDetails) { public String history (@PathVariable Integer id, Model model, SalesLog salesLog, @AuthenticationPrincipal LoginUser userDetails) {
User user = userDetails.getUser(); User user = userDetails.getUser();
model.addAttribute("user", user); model.addAttribute("user", user);
Wallets wallets = walletsService.findOne(user.getId());
model.addAttribute("wallets", wallets);
if(session.getAttribute("cartValue") == null) { if(session.getAttribute("cartValue") == null) {
model.addAttribute("cartValue", 0); model.addAttribute("cartValue", 0);
}else { }else {
model.addAttribute("cartValue",session.getAttribute("cartValue")); model.addAttribute("cartValue",session.getAttribute("cartValue"));
} }
List<SalesLog> list = salesLogService.history(id); List<SalesLog> list = salesLogService.history(id);
model.addAttribute("log", list); ArrayList<SalesLog> newList = new ArrayList<SalesLog>();
for(int i = (list.size() - 1); i >= 0; i--){
newList.add(list.get(i));
}
model.addAttribute("log", newList);
return "log"; return "log";
} }
...@@ -174,6 +195,8 @@ public class EcsiteController { ...@@ -174,6 +195,8 @@ public class EcsiteController {
public String historyDetails (@PathVariable Date created, Model model, @AuthenticationPrincipal LoginUser userDetails) { public String historyDetails (@PathVariable Date created, Model model, @AuthenticationPrincipal LoginUser userDetails) {
User user = userDetails.getUser(); User user = userDetails.getUser();
model.addAttribute("user", user); model.addAttribute("user", user);
Wallets wallets = walletsService.findOne(user.getId());
model.addAttribute("wallets", wallets);
if(session.getAttribute("cartValue") == null) { if(session.getAttribute("cartValue") == null) {
model.addAttribute("cartValue", 0); model.addAttribute("cartValue", 0);
}else { }else {
...@@ -187,6 +210,39 @@ public class EcsiteController { ...@@ -187,6 +210,39 @@ public class EcsiteController {
return "logDetails"; return "logDetails";
} }
//購入履歴検索
@PostMapping("log/search/{id}")
public String searchHistory(@PathVariable Integer id, DateSearchForm dateSerchform, PriceSearchForm priceSearchform, Model model, @AuthenticationPrincipal LoginUser userDetails){
User user = userDetails.getUser();
model.addAttribute("user", user);
Wallets wallets = walletsService.findOne(user.getId());
model.addAttribute("wallets", wallets);
if(session.getAttribute("cartValue") == null) {
model.addAttribute("cartValue", 0);
}else {
model.addAttribute("cartValue",session.getAttribute("cartValue"));
}
//金額の指定がなく日付での検索のみ
if(priceSearchform.getHighPrice() == null && priceSearchform.getLowPrice() == null && dateSerchform.getDate() != null){
List<SalesLog> list = salesLogService.historyDetails(dateSerchform.getDate(), user.getId());
model.addAttribute("log", list);
return "log";
}
//金額のみの検索
if(dateSerchform.getDate() == null && priceSearchform.getLowPrice() != null && priceSearchform.getHighPrice() != null){
if(priceSearchform.getLowPrice() == null){
priceSearchform.setLowPrice(0);
}
if(priceSearchform.getHighPrice() == null){
priceSearchform.setHighPrice(1000000000);
}
List<SalesLog> list = salesLogService.searchPrice(priceSearchform.getLowPrice(), priceSearchform.getHighPrice(), user.getId());
model.addAttribute("log", list);
return "log";
}
return "log";
}
//カート画面 //カート画面
@GetMapping("cart") @GetMapping("cart")
public String Cart(Model model, @AuthenticationPrincipal LoginUser userDetails, LinkedHashMap<String, Items> items, ArrayList <Items> cart){ public String Cart(Model model, @AuthenticationPrincipal LoginUser userDetails, LinkedHashMap<String, Items> items, ArrayList <Items> cart){
......
...@@ -57,67 +57,90 @@ public class ManagementController { ...@@ -57,67 +57,90 @@ public class ManagementController {
} }
//靴の登録処理 //靴の登録処理
@PostMapping("addShoes") @PostMapping("addShoes")
public String CreateShoes(@Validated ShoesForm form, BindingResult result, MultipartFile multipartFile) throws Exception { public String CreateShoes(@Validated ShoesForm form, BindingResult result, MultipartFile multipartFile) throws Exception {
if(result.hasErrors()) { if(result.hasErrors()) {
return "management"; return "management";
} }
multipartFile = form.getMultipartFile();
Shoes shoes = new Shoes(); multipartFile = form.getMultipartFile();
if (!multipartFile.isEmpty()) { System.out.println(multipartFile);
try {
// ファイル名をリネイム //以前に登録されている商品の場合に登録できないバリデーション
File oldFileName = new File(multipartFile.getOriginalFilename()); Shoes sameShoes = shoesService.findOneAddStock(form.getName(), form.getSize());
System.out.println(sameShoes);
//File newFileName = new File(oldFileName + ".jpg"); if (!(sameShoes == null)) {
//oldFileName.renameTo(newFileName); Integer sumStock = form.getStock() + sameShoes.getStock();
if (sumStock >= 10) {
// 保存先を定義 sameShoes.setStock(10);
String uploadPath = "src/main/resources/static/upload/"; shoesService.update(sameShoes);
byte[] bytes = multipartFile.getBytes(); } else {
sameShoes.setStock(sumStock);
// 指定ファイルへ読み込みファイルを書き込み shoesService.update(sameShoes);
BufferedOutputStream stream = new BufferedOutputStream( }
new FileOutputStream(new File(uploadPath + oldFileName))); } else {
// BufferedOutputStream stream = new BufferedOutputStream( Shoes shoes = new Shoes();
// new FileOutputStream(new File(uploadPath + newFileName))); if (!multipartFile.isEmpty()) {
stream.write(bytes); try {
stream.close(); // ファイル名をリネイム
File oldFileName = new File(multipartFile.getOriginalFilename());
// 圧縮
//File input = new File(uploadPath + newFileName); //File newFileName = new File(oldFileName + ".jpg");
File input = new File(uploadPath + oldFileName); //oldFileName.renameTo(newFileName);
BufferedImage image = ImageIO.read(input);
OutputStream os = new FileOutputStream(input); // 保存先を定義
Iterator<ImageWriter> writers = ImageIO String uploadPath = "src/main/resources/static/upload/";
.getImageWritersByFormatName("jpg"); byte[] bytes = multipartFile.getBytes();
ImageWriter writer = (ImageWriter) writers.next();
ImageOutputStream ios = ImageIO.createImageOutputStream(os); // 指定ファイルへ読み込みファイルを書き込み
writer.setOutput(ios); BufferedOutputStream stream = new BufferedOutputStream(
ImageWriteParam param = new JPEGImageWriteParam(null); new FileOutputStream(new File(uploadPath + oldFileName)));
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); // BufferedOutputStream stream = new BufferedOutputStream(
param.setCompressionQuality(0.30f); // new FileOutputStream(new File(uploadPath + newFileName)));
writer.write(null, new IIOImage(image, null, null), param); stream.write(bytes);
os.close(); stream.close();
ios.close();
writer.dispose(); // 圧縮
//File input = new File(uploadPath + newFileName);
// shoes entity に写真の名前を格納する File input = new File(uploadPath + oldFileName);
//shoes.setPhoto(newFileName.toString()); BufferedImage image = ImageIO.read(input);
shoes.setPhoto(oldFileName.toString()); OutputStream os = new FileOutputStream(input);
Iterator<ImageWriter> writers = ImageIO
} catch (Exception e) { .getImageWritersByFormatName("jpg");
System.out.println(e); ImageWriter writer = (ImageWriter) writers.next();
} ImageOutputStream ios = ImageIO.createImageOutputStream(os);
} else { writer.setOutput(ios);
shoes.setPhoto("noimage.jpg"); ImageWriteParam param = new JPEGImageWriteParam(null);
} param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
shoes.setName(form.getName()); param.setCompressionQuality(0.30f);
shoes.setPrice(form.getPrice()); writer.write(null, new IIOImage(image, null, null), param);
shoes.setStock(form.getStock()); os.close();
shoes.setSize(form.getSize()); ios.close();
shoes.setProductStatus(form.getProductStatus()); writer.dispose();
shoesService.update(shoes);
// shoes entity に写真の名前を格納する
//shoes.setPhoto(newFileName.toString());
shoes.setPhoto(oldFileName.toString());
} catch (Exception e) {
System.out.println(e);
}
} else {
shoes.setPhoto("noimage.jpg");
}
shoes.setName(form.getName());
shoes.setPrice(form.getPrice());
shoes.setStock(form.getStock());
shoes.setSize(form.getSize());
shoes.setProductStatus(form.getProductStatus());
shoesService.update(shoes);
}
//遷移先 //遷移先
return "redirect:/limited/admin/management"; return "redirect:/limited/admin/management";
} }
......
package com.example.web;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class PriceSearchForm {
private Integer lowPrice;
private Integer highPrice;
}
/* Slider */
.slick-slider
{
position: relative;
display: block;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
}
.slick-list
{
position: relative;
display: block;
overflow: hidden;
margin: 0;
padding: 0;
}
.slick-list:focus
{
outline: none;
}
.slick-list.dragging
{
cursor: pointer;
cursor: hand;
}
.slick-slider .slick-track,
.slick-slider .slick-list
{
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.slick-track
{
position: relative;
top: 0;
left: 0;
display: block;
margin-left: auto;
margin-right: auto;
}
.slick-track:before,
.slick-track:after
{
display: table;
content: '';
}
.slick-track:after
{
clear: both;
}
.slick-loading .slick-track
{
visibility: hidden;
}
.slick-slide
{
display: none;
float: left;
height: 100%;
min-height: 1px;
}
[dir='rtl'] .slick-slide
{
float: right;
}
.slick-slide img
{
display: block;
}
.slick-slide.slick-loading img
{
display: none;
}
.slick-slide.dragging img
{
pointer-events: none;
}
.slick-initialized .slick-slide
{
display: block;
}
.slick-loading .slick-slide
{
visibility: hidden;
}
.slick-vertical .slick-slide
{
display: block;
height: auto;
border: 1px solid transparent;
}
.slick-arrow.slick-hidden {
display: none;
}
...@@ -1816,6 +1816,14 @@ label { ...@@ -1816,6 +1816,14 @@ label {
color: #000; color: #000;
} }
#sortButton{
margin: 100px;
}
#sort {
margin-left:200px;
}
/* 管理画面(宮嶋) */ /* 管理画面(宮嶋) */
#management_wrapper { #management_wrapper {
height: 100%; height: 100%;
...@@ -2062,3 +2070,8 @@ th, td { ...@@ -2062,3 +2070,8 @@ th, td {
#top-footer { #top-footer {
margin-top: 70px; margin-top: 70px;
} }
/* ヘッダーにBalance表示 */
#balance-li {
margin-top: 19px;
}
\ No newline at end of file
$('.slick01').slick({ //{}を入れる
autoplay: true, //「オプション名: 値」の形式で書く
dots: true //複数書く場合は「,」でつなぐ
});
\ No newline at end of file
$(function(){
$('#sort').click(function(){
window.location.href = ($('#purchase').attr('href'));
});
});
\ No newline at end of file
This diff is collapsed.
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<li><a id="wallets" th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a id="wallets" th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallets.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li class="active"><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li> <li class="active"><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
</div> </div>
<br/> <br/>
<div id="walletAmount"> <div id="walletAmount">
<p id="total-price">Wallet Amount<span id="total-price-span" th:text="'&yen;' + ${wallets.amount}">10000</span></p> <p id="total-price">Balance<span id="total-price-span" th:text="'&yen;' + ${wallets.amount}">10000</span></p>
</div> </div>
<div id="buy"> <div id="buy">
<button class="js-modal-open" id="buy-btn">Buy</button> <button class="js-modal-open" id="buy-btn">Buy</button>
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="images/favicon.png" th:href="@{/images/favicon.png}"/> <link rel="icon" href="images/favicon.png" th:href="@{/images/favicon.png}"/>
<link rel="stylesheet" href="css/style.css" th:href="@{/css/style.css}"/> <link rel="stylesheet" href="css/style.css" th:href="@{/css/style.css}"/>
<!-- スライドショー -->
<link rel="stylesheet" type="text/css" th:href="@{css/slick.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{css/commmon.css}"/>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"/> --> integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"/> -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
...@@ -69,6 +72,7 @@ ...@@ -69,6 +72,7 @@
<li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallets.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li> <li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
...@@ -117,7 +121,7 @@ ...@@ -117,7 +121,7 @@
</ol> </ol>
<!-- Wrapper for slides --> <!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox"> <div class="carousel-inner slick01" role="listbox">
<div class="item active"> <div class="item active">
<img th:src="@{/images/スニーカー1.jpg}" width="1648" height="600" alt=""/> <img th:src="@{/images/スニーカー1.jpg}" width="1648" height="600" alt=""/>
<div class="carousel-caption"> <div class="carousel-caption">
...@@ -271,5 +275,9 @@ ...@@ -271,5 +275,9 @@
integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"
integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script> integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<!-- スライドショー -->
<script type="text/javascript" th:src="@{js/slick.min.js}"></script>
<script type="text/javascript" th:src="@{js/common.js}"></script>
</body> </body>
</html> </html>
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
<li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallets.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" id="shoping-cart-span" th:text="${cartValue}">0</span></a></li> <li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" id="shoping-cart-span" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
......
...@@ -66,10 +66,11 @@ ...@@ -66,10 +66,11 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li><a th:href="@{/limited/top}">Home</a></li> <li><a th:href="@{/limited/top}">Home</a></li>
<li><a th:href="@{/limited/list}">Shop</a></li> <li><a th:href="@{/limited/list}">Shop</a></li>
<li class="active"><a th:href="@{/limited/log/{id}(id=${user.id})}">My Purchase Log</a></li> <li class="active"><a id="purchase" th:href="@{/limited/log/{id}(id=${user.id})}">My Purchase Log</a></li>
<li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallets.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" id="shoping-cart-span" th:text="${cartValue}">0</span></a></li> <li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" id="shoping-cart-span" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
...@@ -81,22 +82,33 @@ ...@@ -81,22 +82,33 @@
<!-- ログインフォーム --> <!-- ログインフォーム -->
<div class="container"> <div class="container">
<p id="log-p-text"><span id="log-text" >Purchase History</span></p> <p id="log-p-text"><span id="log-text" >Purchase History</span></p>
<!--<form id="login-form" method="post" th:action="@{/login}"> <form id="dateSearch-form" method="post" th:action="@{/limited/log/search/{id}(id=${user.id})}" th:object="${DateSearchForm}">
<div id="email-form"> <!-- <div id="email-form">
<label for="login-email">Email</label> <label for="login-email">Email</label>
<input type="email" class="login" name="email" id="login-email" placeholder="Email" required="required"/> <input type="email" class="login" name="email" id="login-email" placeholder="Email" required="required"/>
</div>-->
<div id="date-form">
<label for="date-form">Date Search</label>
<input type="date" class="date" name="date" id="date"/>
</div> </div>
<div id="password-form"> <div id="submit-form">
<label for="login-password">Password</label> <button type="submit" class="search-submit details-btn" id="dateserach-submit">Go</button>
<input type="password" class="login" name="password" id="login-password" placeholder="Password" required="required"/> </div>
</form>
<form id="PriceSearch-form" method="post" th:action="@{/limited/log/search/{id}(id=${user.id})}" th:object="${PriceSearchForm}">
<!-- <div id="email-form">
<label for="login-email">Email</label>
<input type="email" class="login" name="email" id="login-email" placeholder="Email" required="required"/>
</div>-->
<div id="Price-form">
<label for="Price-form">Price Search</label>
<input type="number" class="lowPrice" name="lowPrice" id="lowPrice" required="required"/><span><input type="number" class="highPrice" name="highPrice" id="highPrice" required="required"/></span>
</div> </div>
<div id="submit-form"> <div id="submit-form">
<input type="submit" class="login" id="btn" value="Login"/> <button type="submit" class="search-submit details-btn" id="serach-submit">Go</button>
会員登録ボタン
<button class="js-modal-open" id="sign-up">Sign Up</button>
</div> </div>
</form>--> </form>
<!-- 購入履歴一覧 --> <!-- 購入履歴一覧 -->
<div id="log"> <div id="log">
<table id="log-table"> <table id="log-table">
...@@ -140,7 +152,7 @@ ...@@ -140,7 +152,7 @@
<script src="js/owl.carousel.min.js" th:src="@{/js/owl.carousel.min.js}"></script> <script src="js/owl.carousel.min.js" th:src="@{/js/owl.carousel.min.js}"></script>
<script src="js/wow.min.js" th:src="@{/js/wow.min.js}"></script> <script src="js/wow.min.js" th:src="@{/js/wow.min.js}"></script>
<script src="js/custom.js" th:src="@{/js/custom.js}"></script>--> <script src="js/custom.js" th:src="@{/js/custom.js}"></script>-->
<script src="js/cart.js" th:src="@{/js/cart.js}"></script> <script src="js/log.js" th:src="@{/js/log.js}"></script>
<!-- BootStrap --> <!-- BootStrap -->
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallets.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li class="active"><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li> <li class="active"><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
......
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>商品名</th> <th>商品名</th>
<th>サイズ</th>
<th>価格</th> <th>価格</th>
<th>在庫数</th> <th>在庫数</th>
<th>商品画像</th> <th>商品画像</th>
...@@ -144,6 +145,7 @@ ...@@ -144,6 +145,7 @@
<tr th:each="shoe : ${shoes}"> <tr th:each="shoe : ${shoes}">
<td th:text="${shoe.id}">1</td> <td th:text="${shoe.id}">1</td>
<td th:text="${shoe.name}">AirMax</td> <td th:text="${shoe.name}">AirMax</td>
<td th:text="${shoe.size}">27</td>
<td th:text="${shoe.price}">¥10,000</td> <td th:text="${shoe.price}">¥10,000</td>
<td th:text="${shoe.stock}">10</td> <td th:text="${shoe.stock}">10</td>
<td><img class="shoeImage" th:src="@{/upload/{photo}(photo=${shoe.photo})}" alt="productImage" width="100" height="50"/></td> <td><img class="shoeImage" th:src="@{/upload/{photo}(photo=${shoe.photo})}" alt="productImage" width="100" height="50"/></td>
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<li class="active"><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li> <li class="active"><a th:href="@{/limited/wallets/{id}(id=${user.id})}">Wallets</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right cart-menu"> <ul class="nav navbar-nav navbar-right cart-menu">
<li id="balance-li">Balance<span th:text="'&yen;' + ${wallet.amount}">10000</span></li>
<li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li> <li><a class="search-btn"><i class="fa fa-search" aria-hidden="true"></i></a></li>
<li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li> <li><a th:href="@{/limited/cart}"><span> Cart</span> <span class="shoping-cart" th:text="${cartValue}">0</span></a></li>
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment