Commit 52275304 authored by GuanHua's avatar GuanHua

feat:企业商城首页快速导航链接

parent c9b8cf43
......@@ -52,7 +52,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
const [commonlyUsedName, setCommonlyUsedName] = useState<string>("")
const { filterList, filterUpdate, filterParam, onDeleteFilterItem, onResetFilter, onFilter, onFilterParamChange, saveCommonlyUsedFilter } = FilterStore
const { layoutType, shopId, memberId } = props
const { query: { categoryId, categoryName, brandId, brandName } } = props.location
const { query: { categoryId, categoryName, brandId, brandName, priceType } } = props.location
const [loading, setLoading] = useState<boolean>(true)
const [showType, setShowType] = useState<number>(1) // 展示方式:1:矩阵排列; 2:列表排列
const [commodityList, setCommodityList] = useState<GetSearchShopEnterpriseGetCommodityListResponseDetail[]>([])
......@@ -62,10 +62,6 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
const [filterConfig, setFilterConfig] = useState([FILTER_TYPE.categoryAndAttr, FILTER_TYPE.brand, FILTER_TYPE.price, FILTER_TYPE.useArea, FILTER_TYPE.commodityType])
useEffect(() => {
fetchCommodityList(1)
}, [filterParam])
useEffect(() => {
if (categoryId && categoryName) {
onFilter({
key: [categoryId],
......@@ -80,9 +76,20 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
type: FILTER_TYPE.brand,
})
}
if (priceType) {
onFilter({
key: priceType,
title: Number(priceType) === 1 ? '只看现价商品' : '只看询价商品',
type: FILTER_TYPE.commodityType,
})
}
}, [props.location.query])
useEffect(() => {
fetchCommodityList(1)
}, [filterParam])
useEffect(() => {
if (!isEmpty(filterList) || filterUpdate) {
handleFilterChange(filterList)
}
......
import React, { useState, useEffect } from 'react'
import { Checkbox } from 'antd'
import FilterBox from '../FilterBox'
import { observer } from 'mobx-react'
import { LAYOUT_TYPE, FILTER_TYPE } from '@/constants'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
......@@ -13,7 +14,7 @@ interface CommodityTypePropsType {
const CheckboxGroup = Checkbox.Group
const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
const { layoutType = LAYOUT_TYPE.mall } = props
// const { layoutType = LAYOUT_TYPE.mall } = props
const { onFilter, filterList } = props.FilterStore
const [selectKeys, setSelectKeys] = useState<number[]>([])
......@@ -29,7 +30,7 @@ const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
let initKeys = []
for (let item of filterList) {
if (item.type === FILTER_TYPE.commodityType) {
initKeys.push(item.key)
initKeys.push(Number(item.key))
}
}
setSelectKeys(initKeys)
......@@ -74,4 +75,4 @@ const CommodityType: React.FC<CommodityTypePropsType> = (props) => {
)
}
export default CommodityType
export default observer(CommodityType)
......@@ -31,7 +31,7 @@ const FloorAnchor: React.FC<FloorAnchorPropsType> = (props) => {
<ToTopOutlined />
<span className="text">顶部</span>
</BackTop>
{
{/* {
type === 'mall' && (
<div className="qrcode">
<div className="qrcode_img">
......@@ -40,7 +40,7 @@ const FloorAnchor: React.FC<FloorAnchorPropsType> = (props) => {
<div>扫码下载APP</div>
</div>
)
}
} */}
</Anchor>
</div>
)
......
......@@ -28,11 +28,11 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
title: '上传商品',
},
{
path: '/memberCenter/tranactionAbility/enquirySubmit/addEnquiry',
path: '/memberCenter/tranactionAbility/enquiryOffer/addEnquiry',
title: '报价',
},
{
path: '/memberCenter/home',
path: '/memberCenter/tranactionAbility/saleOrder',
title: '接单',
},
]
......@@ -40,11 +40,11 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
// 买家服务快捷导航
const buy_quick_nav_list = [
{
path: '/purchaseOnline',
path: '/memberCenter/tranactionAbility/enquirySubmit/addEnquiry',
title: '我要求购',
},
{
path: '/memberCenter/home',
path: '/memberCenter/tranactionAbility/enquiryOffer/toSubmit',
title: '报价信息',
},
{
......@@ -55,15 +55,15 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
// 公用快捷导航
const quick_nav_list = [
{
path: '/memberCenter/home',
path: '/commodity?priceType=1',
title: '找现货',
},
{
path: '/memberCenter/home',
path: '/commodity?priceType=2',
title: '找供应',
},
{
path: '/memberCenter/home',
path: '/purchaseOnline',
title: '去求购',
},
{
......
......@@ -156,14 +156,6 @@ const Order: React.FC<OrderPropsType> = (props) => {
* 提交订单
*/
const submitOrder = () => {
// if (isEmpty(selectPayWay)) {
// message.info('请选择支付方式')
// return
// }
// if (!needTheContract) {
// message.info('请先同意签订电子合同')
// return
// }
let params: any = {
orderModel: getOrderMode(), // 下单模式
deliveryAddresId: selectAddressInfo.id,
......@@ -220,11 +212,19 @@ const Order: React.FC<OrderPropsType> = (props) => {
message.info('请选择支付方式')
return
}
if (needTheInvoice) {
if (!selectInvoiceInfo) {
message.info('请选择发票')
return
}
}
if (!needTheContract) {
message.info('请先同意签订电子合同')
return
}
setSignModalVisible(true)
// setSignModalVisible(true)
submitOrder()
}
const handleSignModalConfirm = () => {
......
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