Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shoei.kanno
Ecsite
Commits
ff3c2260
Commit
ff3c2260
authored
Oct 22, 2020
by
shoei.kanno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最終調整完了
parent
23386fd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
list.js
src/main/resources/static/js/list.js
+21
-6
list.html
src/main/resources/templates/list.html
+3
-0
No files found.
src/main/resources/static/js/list.js
View file @
ff3c2260
...
...
@@ -8,6 +8,7 @@ $(function(){
$
(
'#showSize'
).
empty
();
$
(
'#showPrice'
).
empty
();
$
(
'#showId'
).
empty
();
$
(
'#showStock'
).
empty
();
//以下デモ参照
//キーボード操作などにより、オーバーレイが多重起動するのを防止する
// $( this ).blur() ; //ボタンからフォーカスを外す
...
...
@@ -29,16 +30,19 @@ $(function(){
let
nameField
=
document
.
createElement
(
"p"
);
let
sizeField
=
document
.
createElement
(
"p"
);
let
priceField
=
document
.
createElement
(
"p"
);
let
stockField
=
document
.
createElement
(
"p"
);
let
idField
=
document
.
createElement
(
"input"
);
idField
.
setAttribute
(
"type"
,
"hidden"
);
// let name = $(event.target.parentNode.children[1].textContent);
// let price =$(event.target.parentNode.children[2].textContent);
// let id =$(event.target.parentNode.children[3].value);
let
src
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
).
children
(
'img'
).
attr
(
'src'
);
let
name
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
size
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
price
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
id
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
value
);
let
src
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
).
children
(
'img'
).
attr
(
'src'
);
let
name
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
size
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
price
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
textContent
);
let
id
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
previousElementSibling
.
value
);
let
stock
=
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
value
);
console
.
log
(
stock
);
nameField
.
textContent
=
name
.
selector
;
$
(
'#showName'
).
append
(
nameField
);
sizeField
.
textContent
=
size
.
selector
;
...
...
@@ -48,6 +52,17 @@ $(function(){
idField
.
value
=
id
.
selector
;
$
(
'#showId'
).
append
(
idField
);
$
(
'#showImage'
).
attr
(
'src'
,
src
);
stockField
.
textContent
=
"点在庫有"
;
stockField
.
insertAdjacentHTML
(
'afterbegin'
,
stock
.
selector
);
$
(
'#showStock'
).
append
(
stockField
);
//stock0の時BTN非表示
if
(
$
(
event
.
target
.
parentNode
.
previousElementSibling
.
value
)
==
"0"
){
$
(
'#cartBtn'
).
hide
();
}
//[#modal-overlay]、または[#modal-close]をクリックしたら…
$
(
"#modal-overlay,#modal-close"
).
unbind
().
click
(
function
(){
...
...
@@ -97,7 +112,7 @@ $('.cartBtn').on('click', function(event){
sumQuantity
=
parseInt
(
$
(
"#shoping-cart-span"
).
text
())
+
parseInt
(
$
(
event
.
target
.
previousElementSibling
.
previousElementSibling
).
children
(
'select'
).
val
());
// let totalQuantity = sumQuantity + parseInt($("#shoping-cart-span").text());
let
data
=
{
shoesId
:
parseInt
(
$
(
event
.
target
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
).
children
(
'input'
).
val
()),
shoesId
:
parseInt
(
$
(
event
.
target
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
.
previousElementSibling
).
children
(
'input'
).
val
()),
quantity
:
parseInt
(
$
(
event
.
target
.
previousElementSibling
.
previousElementSibling
).
children
(
'select'
).
val
())
};
...
...
src/main/resources/templates/list.html
View file @
ff3c2260
...
...
@@ -19,6 +19,7 @@
<div
class=
"modalShow"
id=
"showSize"
></div>
<div
class=
"modalShow"
id=
"showPrice"
></div>
<div
class=
"modalShow"
id=
"showId"
></div>
<div
class=
"modalShow"
id=
"showStock"
></div>
<div
class=
"modalShow"
id=
"showQuantity"
>
<span>
Quantity
</span>
<select
name=
"quantity"
>
...
...
@@ -122,6 +123,7 @@
<p
th:text=
"${limitedShoes.size} + ' cm'"
class=
"shoeSize shoeLimited"
></p>
<p
th:text =
"'¥' +${limitedShoes.price}"
class=
"shoePrice shoeLimited"
>
¥10,000
</p>
<input
type=
"hidden"
th:value=
"${limitedShoes.id}"
/>
<input
type=
"hidden"
th:value=
"${limitedShoes.stock}"
/>
<div
class=
"detailsBtn"
><button
type=
"button"
id=
"modal-open"
class=
"details"
>
Datails
</button></div>
<!-- <button class="js-modal-open" id="sign-up">Details</button>-->
</div>
...
...
@@ -134,6 +136,7 @@
<p
th:text=
"${generalShoes.size} + ' cm'"
class=
"shoeSize"
></p>
<p
th:text =
"'¥' +${generalShoes.price}"
class=
"shoePrice"
>
¥10,000
</p>
<input
type=
"hidden"
th:value=
"${generalShoes.id}"
/>
<input
type=
"hidden"
th:value=
"${generalShoes.stock}"
/>
<div
class=
"detailsBtn"
><button
type=
"button"
id=
"modal-open"
class=
"details"
>
Datails
</button></div>
<!-- <button class="js-modal-open" id="sign-up">Details</button>-->
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment