Commit 58609247 by 孙志鹏

feat: 前端暂存

parent 0482e451
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 (
......
......@@ -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 50px;
padding: 10px 30px;
.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;
}
}
}
......
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
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 sign in to comment