Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
Europa-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
58609247
authored
Nov 08, 2024
by
孙志鹏
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat: 前端暂存
parent
0482e451
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
14 deletions
pages/item/components/DetailHead.tsx
pages/item/index.module.scss
server/postShoppingCart.tsx
pages/item/components/DetailHead.tsx
View file @
58609247
import
QqIcon
from
"@/components/QqIcon"
import
type
{
skuInfoResponseType
}
from
'@/types/detailTypes'
import
styles
from
'../index.module.scss'
import
{
Checkbox
}
from
"antd"
;
import
{
useQq
}
from
"@/hooks/useQq"
import
{
useState
}
from
"react"
const
DetailHead
=
(
props
:
skuInfoResponseType
)
=>
{
const
{
QQURL
,
PHONE
}
=
useQq
()
const
sku_info
=
props
!
const
[
purNum
,
setPurNum
]
=
useState
()
const
[
seArea
,
setSeArea
]
=
useState
(
'1'
)
const
handlePurNumChange
=
(
num
:
any
)
=>
setPurNum
(
num
)
const
handlecheckBoxChange
=
(
type
:
any
)
=>
setSeArea
(
type
)
const
handleAddCart
=
()
=>
{}
return
(
<>
<
div
className=
{
`${styles.detailHeaders} w1226 row bothSide boxsiz`
}
>
...
...
@@ -37,16 +47,30 @@ const DetailHead = (props: skuInfoResponseType) => {
<
div
className=
{
`${styles.r} boxsiz`
}
>
<
p
className=
'row'
>
<
span
className=
{
styles
.
items
}
>
库存:
{
sku_info
.
stock
}
</
span
>
<
span
className=
{
styles
.
items
}
>
交期(HK):
{
sku_info
.
hk_delivery_time
||
'--'
}
</
span
>
<
span
className=
{
styles
.
items
}
>
<
Checkbox
checked=
{
seArea
===
'2'
}
onChange=
{
()
=>
handlecheckBoxChange
(
'2'
)
}
>
A
</
Checkbox
>
交期(HK):
{
sku_info
.
hk_delivery_time
||
'--'
}
</
span
>
</
p
>
<
p
className=
'row'
>
<
span
className=
{
`${styles.items} row`
}
><
strong
>
批次:
</
strong
>
<
strong
dangerouslySetInnerHTML=
{
{
__html
:
sku_info
.
batch_sn
||
'--'
}
}
></
strong
></
span
>
<
span
className=
{
styles
.
items
}
>
交期(大陆):
{
sku_info
.
cn_delivery_time
||
'--'
}
</
span
>
<
span
className=
{
styles
.
items
}
>
<
Checkbox
checked=
{
seArea
===
'1'
}
onChange=
{
()
=>
handlecheckBoxChange
(
'1'
)
}
>
A
</
Checkbox
>
交期(大陆):
{
sku_info
.
cn_delivery_time
||
'--'
}
</
span
>
</
p
>
<
p
className=
{
`
${styles.mb23}
row`
}
>
<
p
className=
{
`row`
}
>
<
span
className=
{
styles
.
items
}
>
起订量:
{
sku_info
.
moq
}
</
span
>
<
span
className=
{
styles
.
items
}
>
递增:
{
sku_info
.
multiple
}
</
span
>
</
p
>
<
div
className=
"row"
>
<
span
className=
{
styles
.
items
}
>
<
input
className=
{
styles
.
numInput
}
value=
{
purNum
}
onChange=
{
handlePurNumChange
}
/>
</
span
>
<
span
className=
{
styles
.
items
}
>
<
button
className=
{
styles
.
btn
}
onClick=
{
handleAddCart
}
>
加入购物车
</
button
>
<
button
className=
{
styles
.
buyBtn
}
>
立即购买
</
button
>
</
span
>
</
div
>
{
(
sku_info
.
ladder_price
||
[]).
map
((
item
,
index
)
=>
{
return
(
...
...
pages/item/index.module.scss
View file @
58609247
...
...
@@ -59,22 +59,22 @@
}
}
}
.btn
{
width
:
80px
;
height
:
30px
;
background
:
#FF9A00
;
line-height
:
30px
;
text-align
:
center
;
color
:
#fff
;
}
}
}
.btn
{
width
:
80px
;
height
:
30px
;
background
:
#FF9A00
;
line-height
:
30px
;
text-align
:
center
;
color
:
#fff
;
}
.r
{
width
:
452px
;
min-height
:
222px
;
background
:
#FFFCF8
;
padding
:
10px
5
0px
;
padding
:
10px
3
0px
;
.mb23
{
margin-bottom
:
24px
;
}
...
...
@@ -83,10 +83,32 @@
font-size
:
12px
;
color
:
#000000
;
line-height
:
25px
;
span
{
>
span
{
width
:
50%
;
}
}
.numInput
{
width
:
80px
;
height
:
30px
;
text-align
:
center
;
background
:
#FFFFFF
;
border
:
1px
solid
#999999
;
cursor
:
pointer
;
margin-top
:
10px
;
}
.buyBtn
{
width
:
80px
;
height
:
30px
;
color
:
#FF9A00
;
margin-left
:
10px
;
background
:
#FFFFFF
;
border
:
1px
solid
#FF9A00
;
cursor
:
pointer
;
margin-top
:
10px
;
margin-bottom
:
15px
;
}
}
}
...
...
server/postShoppingCart.tsx
0 → 100644
View file @
58609247
import
useRequest
from
"@/hooks/useRequest"
export
async
function
postShoppingCart
(
data
:
any
)
{
const
{
request
:
userRequest
}
=
useRequest
<
any
>
({
manual
:
true
,
loading
:
true
})
const
res
=
await
userRequest
({
url
:
'/api/cart/cartAdd'
,
method
:
'post'
,
data
:
data
})
return
res
}
\ No newline at end of file
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