Commit cf8357af authored by GuanHua's avatar GuanHua

fix:进货单选中文字的问题

parent fbd2328f
...@@ -32,13 +32,15 @@ const InputNumber: React.FC<InputNumberPropsType> = (props) => { ...@@ -32,13 +32,15 @@ const InputNumber: React.FC<InputNumberPropsType> = (props) => {
} }
}, [min, max]) }, [min, max])
const handleReduce = () => { const handleReduce = (e) => {
e.stopPropagation()
if (value > minCount) { if (value > minCount) {
onChange(Number(value) - 1) onChange(Number(value) - 1)
} }
} }
const handleAdd = () => { const handleAdd = (e) => {
e.stopPropagation()
if (value < maxCount) { if (value < maxCount) {
onChange(Number(value) + 1) onChange(Number(value) + 1)
} }
......
...@@ -31,6 +31,17 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => { ...@@ -31,6 +31,17 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
} }
} }
const handleCollect = () => {
let param = {
shopId: shopInfo.shopId,
status: true
}
PublicApi.postTemplateShopCollect(param).then(res => {
if (res.code === 1000) {
}
})
}
return ( return (
<div className={styles.shop_info}> <div className={styles.shop_info}>
...@@ -72,7 +83,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => { ...@@ -72,7 +83,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.dashed_split}></div> <div className={styles.dashed_split}></div>
<div className={styles.shop_info_btn_group}> <div className={styles.shop_info_btn_group}>
<div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div> <div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div>
<div className={styles.shop_info_btn}>收藏本店</div> <div className={styles.shop_info_btn} onClick={() => handleCollect()}>收藏本店</div>
</div> </div>
<Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button> <Button loading={applyLoading} className={styles.apply_member_btn} onClick={() => applyFroVip()}>申请成为本店会员</Button>
</div> </div>
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
height: 130px; height: 130px;
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
user-select: none;
&_item { &_item {
display: flex; display: flex;
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
text-align: center; text-align: center;
margin-top: 10px; margin-top: 10px;
white-space: nowrap; white-space: nowrap;
user-select: none;
} }
} }
......
...@@ -604,7 +604,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -604,7 +604,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
</div> </div>
<div className={cx(styles.order_list_item_item, styles.count)}> <div className={cx(styles.order_list_item_item, styles.count)}>
<InputNumber disabled={true} max={childItem.stockCount || 0} min={childItem.commodityUnitPrice.commodity.minOrder || 1} value={childItem.count} onChange={(value) => handleCountChange(value, childItem.id)} /> <InputNumber disabled={true} max={childItem.stockCount || 0} min={childItem.commodityUnitPrice.commodity.minOrder || 1} value={childItem.count} onChange={(value) => handleCountChange(value, childItem.id)} />
<div className={styles.stock}>(库存{numFormat(childItem.stockCount)}{childItem.commodityUnitPrice.commodity.unitName})</div> <div className={styles.stock}>
<span>(库存{numFormat(childItem.stockCount)}{childItem.commodityUnitPrice.commodity.unitName})</span>
</div>
</div> </div>
<div className={cx(styles.order_list_item_item, styles.amount)}> <div className={cx(styles.order_list_item_item, styles.amount)}>
<span className={styles.order_list_item_item_price}>{priceFormat(computeItemPrice(childItem.commodityUnitPrice?.priceRange, childItem.count))}</span> <span className={styles.order_list_item_item_price}>{priceFormat(computeItemPrice(childItem.commodityUnitPrice?.priceRange, childItem.count))}</span>
......
...@@ -15,7 +15,7 @@ const Collection: React.FC = () => { ...@@ -15,7 +15,7 @@ const Collection: React.FC = () => {
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<div className={styles.collection_wrap}> <div className={styles.collection_wrap}>
<Tabs defaultActiveKey="commodity" className={styles.collection_tabs} > <Tabs defaultActiveKey="shops" className={styles.collection_tabs} >
<TabPane tab="商品收藏" key="commodity"> <TabPane tab="商品收藏" key="commodity">
<Commodity /> <Commodity />
</TabPane> </TabPane>
......
import React from 'react' import React, { useEffect, useState } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { Rate, Pagination } from 'antd' import { Rate, Pagination } from 'antd'
import { StarFilled } from '@ant-design/icons' import { StarFilled } from '@ant-design/icons'
import shop_icon from '@/assets/imgs/shop_icon.png' import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png' import credit_icon from '@/assets/imgs/credit_icon.png'
import { PublicApi } from '@/services/api'
import styles from './index.less' import styles from './index.less'
const Shops: React.FC = () => { const Shops: React.FC = () => {
const [list, setList] = useState([])
const [current, setCurrent] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(10)
const [totalCount, setTotalCount] = useState<number>(0)
let shopList = Array.apply({}, new Array(7)) useEffect(() => {
fetchCollectShopList()
}, [current])
/**
* 获取收藏的店铺列表
*/
const fetchCollectShopList = () => {
let param = {
current,
pageSize
}
//@ts-ignore
PublicApi.getTemplateShopCollectList(param).then(res => {
if (res.code === 1000) {
setList(res.data.data)
setTotalCount(res.data.totalCount)
}
})
}
const handleChange = (page) => {
setCurrent(page)
}
return ( return (
<> <>
<div className={styles.shops_list}> <div className={styles.shops_list}>
{ {
shopList.map((item, index) => ( list && list.map((item, index) => (
<div className={styles.shops_list_item} key={`shops_list_item_${index}`}> <div className={styles.shops_list_item} key={`shops_list_item_${index}`}>
<div className={cx(styles.shops_list_item_item, styles.morehalf)}> <div className={cx(styles.shops_list_item_item, styles.morehalf)}>
<div className={styles.shop_header_info}> <div className={styles.shop_header_info}>
...@@ -61,9 +89,13 @@ const Shops: React.FC = () => { ...@@ -61,9 +89,13 @@ const Shops: React.FC = () => {
} }
</div> </div>
<div className={styles.pagination_wrap}> {
<Pagination showSizeChanger={false} defaultCurrent={1} total={100} /> totalCount > 0 && (
</div> <div className={styles.pagination_wrap}>
<Pagination showSizeChanger={false} current={current} total={totalCount} pageSize={pageSize} onChange={handleChange} />
</div>
)
}
</> </>
) )
} }
......
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