Commit 29cb0d30 authored by XieZhiXiong's avatar XieZhiXiong
parents 45967a9f 5e72f8b3
......@@ -37,6 +37,10 @@ export enum LAYOUT_TYPE {
* 渠道商城-积分兑换
*/
channelScoreMall = 'channelScoreMall',
/**
* 店铺列表
*/
shopList = 'shopList'
}
// 本地环境跳过权限校验
......@@ -166,7 +170,11 @@ export enum FILTER_TYPE {
/**
* 属性筛选
*/
attribute = 'attribute'
attribute = 'attribute',
/**
* 店铺地区筛选
*/
shopArea = 'shopArea'
}
// 商城类型
......
......@@ -86,6 +86,7 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
}, [props.location.query])
useEffect(() => {
setCurrent(1)
fetchCommodityList(1)
}, [filterParam])
......
......@@ -61,9 +61,9 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
// const filterConfig = [FILTER_TYPE.commonlyUsed, FILTER_TYPE.category, FILTER_TYPE.brand, FILTER_TYPE.price, FILTER_TYPE.useArea, FILTER_TYPE.commodityType]
useEffect(() => {
fetchCommodityList()
}, [filterParam, current, search])
setCurrent(1)
fetchCommodityList(1)
}, [filterParam, search])
useEffect(() => {
if (!isEmpty(filterList) || filterUpdate) {
......@@ -82,9 +82,9 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
})
}, [layoutType])
const fetchCommodityList = () => {
const fetchCommodityList = (currentParam?: number) => {
let param: filterQuery = {
current,
current: currentParam ? currentParam : current,
pageSize
}
if (!!search) {
......@@ -146,6 +146,7 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
const handlePageChange = (page) => {
setCurrent(page)
fetchCommodityList(page)
}
/**
......
......@@ -518,9 +518,9 @@ const CommodityDetail = (props) => {
}
const handleSelectAttrVal = (attrId: number, attrValId: number) => {
if (!judgeHasAttr(attrId, attrValId)) {
return
}
// if (!judgeHasAttr(attrId, attrValId)) {
// return
// }
if (judgeSelectAttrInList(selectAttrVal, attrId, 'attrId')) {
let result = []
for (let item of selectAttrVal) {
......@@ -696,7 +696,8 @@ const CommodityDetail = (props) => {
key={`product_info_line_list_item_${childItem.id}_${index}`}
className={cx(styles.product_info_line_list_item,
judgeSelectAttrInList(selectAttrVal, childItem.id, 'attrValId') ? styles.active : '',
judgeHasAttr(item.customerAttribute.id, childItem.id) ? '' : styles.disabled)}
// judgeHasAttr(item.customerAttribute.id, childItem.id) ? '' : styles.disabled
)}
onClick={() => handleSelectAttrVal(item.customerAttribute.id, childItem.id)} >
{
childItem.commodityPic && (
......
......@@ -47,6 +47,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
useEffect(() => {
let getCategoryListFn
let param: any = {}
/**
* 根据不通过的页面类型,请求不同的品类接口
*/
switch (layoutType) {
case LAYOUT_TYPE.mall:
getCategoryListFn = PublicApi.getSearchShopEnterpriseGetCategoryTree
......@@ -66,6 +69,8 @@ const Category: React.FC<CategoryPropsType> = (props) => {
param.storeId = shopId
getCategoryListFn = PublicApi.getSearchShopScoreGetCategoryTree
break
case LAYOUT_TYPE.shopList:
getCategoryListFn = PublicApi.getProductPlatformGetCategoryTree
default:
break
}
......
......@@ -3,10 +3,11 @@
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-08-20 16:49:11
* @Last Modified time: 2020-09-23 19:49:12
*/
import React from 'react'
import React, { useState, useEffect } from 'react'
import { PublicApi } from '@/services/api'
import styles from './index.less'
interface NewJoinPropsType {
......@@ -15,44 +16,40 @@ interface NewJoinPropsType {
const NewJoin: React.FC<NewJoinPropsType> = (props) => {
const [newJoinShopList, setNewJoinShopList] = useState([])
useEffect(() => {
fetchNewJoinShopList()
}, [])
const fetchNewJoinShopList = () => {
PublicApi.getTemplateShopFindNewAddShop().then(res => {
if (res.code === 1000) {
setNewJoinShopList(res.data)
}
})
}
return (
<div className={styles.new_join}>
<div className={styles.new_join_title}>
<label>最新加入</label>
</div>
<div className={styles.new_join_list}>
<div className={styles.new_join_list_item}>
<div className={styles.new_join_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.new_join_name}> <a href="/">无锡市群明钢业有限公司</a></div>
</div>
<div className={styles.new_join_list_item}>
{
newJoinShopList && newJoinShopList.map(item => (
<div className={styles.new_join_list_item} key={`new_join_list_item_${item.id}`}>
<div className={styles.new_join_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
<img src={item.logo} />
</div>
<div className={styles.new_join_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.new_join_list_item}>
<div className={styles.new_join_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.new_join_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.new_join_list_item}>
<div className={styles.new_join_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
</div>
<div className={styles.new_join_name}>无锡市群明钢业有限公司</div>
</div>
<div className={styles.new_join_list_item}>
<div className={styles.new_join_logo}>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3381279230,433852972&fm=26&gp=0.jpg" />
<div className={styles.new_join_name}>
<a href={`/shop?shopId=${btoa(JSON.stringify({ shopId: item.id, memberId: item.memberId }))}`}>
{item.memberName}
</a>
</div>
<div className={styles.new_join_name}>无锡市群明钢业有限公司</div>
</div>
))
}
</div>
</div>
)
......
......@@ -50,6 +50,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
setSelectCity([])
} else {
let initKeys = []
if (layoutType !== LAYOUT_TYPE.shopList) {
for (let item of filterList) {
if (item.type === FILTER_TYPE.province) {
initKeys.push(item.key)
......@@ -59,6 +60,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
}
setSelectCity(initKeys)
}
}
}, [filterList])
useEffect(() => {
......@@ -66,6 +68,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
let param: any = {}
switch (layoutType) {
case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.shopList:
getAreaFn = PublicApi.getSearchShopEnterpriseGetArea
break
case LAYOUT_TYPE.shop:
......@@ -109,6 +112,13 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
const handleSelect = (item: any, type: FILTER_TYPE) => {
if (type === FILTER_TYPE.province) {
setSelectCity([item.value])
if (layoutType === LAYOUT_TYPE.shopList) {
onFilter({
type: FILTER_TYPE.shopArea,
title: item.label,
key: item.value
})
} else {
onFilter({
type: FILTER_TYPE.province,
title: item.label,
......@@ -121,8 +131,16 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
key: null
})
}
}
} else {
setSelectCity([selectCity[0], item.value])
if (layoutType === LAYOUT_TYPE.shopList) {
onFilter({
type: FILTER_TYPE.shopArea,
title: item.label,
key: item.value
})
} else {
onFilter({
type: FILTER_TYPE.province,
title: getProvinceText(selectCity[0]),
......@@ -135,6 +153,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
})
}
}
}
const getProvinceText = (code: string) => {
let result = ""
......
......@@ -2,11 +2,12 @@ import React from 'react'
import styles from './index.less'
interface NoResultPropsType {
search?: string
search?: string,
type?: number, // 1:商品, 2:店铺
}
const SearchNoResult: React.FC<NoResultPropsType> = (props) => {
const { search } = props
const { search, type = 1 } = props
return (
<div className={styles.no_result}>
<div className={styles.no_result_tip}>
......@@ -17,11 +18,11 @@ const SearchNoResult: React.FC<NoResultPropsType> = (props) => {
<>
抱歉,没有找到与“
<span className={styles.no_result_tip_search}>{search}</span>
”相关的商品
”相关的{type === 1 ? '商品' : '店铺'}
</>
) : (
<>
抱歉,没有找到相关的商品
抱歉,没有找到相关的{type === 1 ? '商品' : '店铺'}
</>
)
}
......
......@@ -53,6 +53,7 @@ const PointsMall: React.FC<CommodityPropsType> = (props) => {
const filterConfig = [FILTER_TYPE.category, FILTER_TYPE.points]
useEffect(() => {
setCurrent(1)
fetchCommodityList(1)
}, [filterParam])
......
......@@ -120,7 +120,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
<div className={styles.purchaseOnline}>
<div className={styles.mall_container}>
<div className={styles.commodity_container}>
<Filter filterConfig={filterConfig} />
<Filter filterConfig={filterConfig} {...props} />
<div className={styles.commodity_main}>
{/* <div className="banner">
<img src={bannerImg} />
......
......@@ -35,7 +35,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let countState = true
useEffect(() => {
fetchPurchaseList(true)
fetchPurchaseList()
}, [])
const fetchPurchaseList = (initState = false) => {
......@@ -109,7 +109,6 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
defaultCheckedList: item.orderList.map(item => item.id)
})
})
console.log(result)
setOrderList(result)
// !initChecked && setCheckedList(result.map(item => item.id))
}
......@@ -136,7 +135,6 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let temp = [...checkedList, id]
setCheckedList(temp)
if (temp.length === getAllKeys().length) {
console.log(`temp.length === getAllKeys().length`)
setIndeterminate(false)
setCheckAll(true)
}
......@@ -249,7 +247,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
return new Promise((resolve, reject) => {
PublicApi.postProductPurchaseDeletePurchase({ idList: [id] }).then(res => {
if (res.code === 1000) {
fetchPurchaseList()
// fetchPurchaseList()
deleteListItems([id])
resolve()
} else {
reject()
......@@ -282,7 +281,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
return new Promise((resolve, reject) => {
PublicApi.postProductPurchaseDeletePurchase({ idList: idList }).then(res => {
if (res.code === 1000) {
fetchPurchaseList()
// fetchPurchaseList()
deleteListItems(idList)
resolve()
} else {
reject()
......@@ -296,6 +296,23 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
}
/**
* 删除指定id的商品
* @param ids
*/
const deleteListItems = (ids: number[]) => {
let newOrderList = JSON.parse(JSON.stringify(orderList))
let result = []
for (let item of newOrderList) {
let newItem = item
newItem.orderList = newItem.orderList.filter(orderItem => !ids.includes(orderItem.id))
if (newItem.orderList.length > 0) {
result.push(newItem)
}
}
setOrderList(result)
}
/**
* 计算已选商品数量
*/
const handleComputeSelectCount = () => {
......@@ -311,7 +328,6 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
return count
}
/**
* 计算已选商品价格
*/
......@@ -401,12 +417,11 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
return result
}
/**
* 结算
*/
const handleSettlement = async () => {
if (orderList.every(item => item.checkedList.length > 1)) {
if (orderList.length > 1 && orderList.every(item => item.checkedList.length > 0)) {
message.info("暂不支持多个供应商商品生成订单,请选择相同供应商的商品")
return
} else if (orderList.every(item => item.checkedList.length === 0)) {
......@@ -420,7 +435,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let buyOrderlist = []
const selectOrderList = selectItem.orderList.filter(item => selectItem.checkedList.includes(item.id))
let commonLogistics = {}
setConfirmLoading(true)
for (let item of selectOrderList) {
productIds.push(item.commodityUnitPrice.id)
commonLogistics = item.commodityUnitPrice.commodity.logistics
......
import React, { useState } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons'
import React, { useState, useEffect } from 'react'
import { CaretUpOutlined, CaretDownOutlined, CloseOutlined } from '@ant-design/icons'
import Filter from '../components/Filter'
import { FILTER_TYPE } from '@/constants'
import { FILTER_TYPE, LAYOUT_TYPE } from '@/constants'
import cx from 'classnames'
import { Pagination } from 'antd'
import { history } from 'umi'
import { Pagination, Spin } from 'antd'
import CommodityList from './list'
import NoResult from './noResult'
import SearchNoResult from '../components/SearchNoResult'
import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import isEmpty from 'lodash/isEmpty'
import styles from './index.less'
interface filterValueType {
key: string;
title: string;
type: FILTER_TYPE;
}
import { PublicApi } from '@/services/api'
import { GetTemplateShopFindShopListResponseDetail } from '@/services/TemplateApi'
interface ShopListPropsType {
location: any
......@@ -25,16 +23,65 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
const { filterList, filterUpdate, filterParam, onDeleteFilterItem, onResetFilter, onFilter, onFilterParamChange } = FilterStore
const { query: { search = "" } } = props.location
const [showType, setShowType] = useState<number>(1) // 展示方式:1:矩阵排列; 2:列表排列
const [current, setCurrent] = useState<number>(1)
const [pageSize] = useState<number>(10)
const [loading, setLoading] = useState<boolean>(true)
const [shopList, setShopList] = useState<GetTemplateShopFindShopListResponseDetail[]>([])
const [totalCount, setTotalCount] = useState<number>(0)
const filterConfig = [FILTER_TYPE.category, FILTER_TYPE.useArea, FILTER_TYPE.activeStores, FILTER_TYPE.newJoin]
useEffect(() => {
setCurrent(1)
fetchShopList(1)
}, [filterParam, search])
useEffect(() => {
if (!isEmpty(filterList) || filterUpdate) {
handleFilterChange(filterList)
}
}, [filterList])
const fetchShopList = (currentParam?: number) => {
let param: any = {
current: currentParam ? currentParam : current,
pageSize
}
if (!!search) {
param.memberName = search
}
if (!isEmpty(filterParam)) {
param = Object.assign(param, filterParam)
}
setLoading(true)
PublicApi.getTemplateShopFindShopList(param).then(res => {
setLoading(false)
if (res.code === 1000) {
setShopList(res.data.data)
setTotalCount(res.data.totalCount)
}
})
}
const handleFilterChange = (newFilterList: any) => {
onFilterParamChange(newFilterList)
}
/**
* 重置筛选
*/
const handleResetFilter = () => {
if (search) {
onResetFilter()
handleClearSearch()
} else {
onResetFilter()
}
}
const handleDeleteFilterItem = (item: any) => {
onDeleteFilterItem(item.key, item.type)
......@@ -84,12 +131,24 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
}
}
const handlePageChange = (page) => {
setCurrent(page)
fetchShopList(page)
}
/**
* 清除搜索
*/
const handleClearSearch = () => {
history.push('/shops')
}
return (
<div className={styles.commodity}>
<div className={styles.mall_container}>
<div className={styles.commodity_container}>
<Filter filterConfig={filterConfig} />
<Filter filterConfig={filterConfig} {...props} layoutType={LAYOUT_TYPE.shopList} />
<div className={styles.commodity_main}>
<div className={styles.tool_bar}>
<div className={styles.tool_bar_left}>
......@@ -104,19 +163,28 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
<div className={styles.tool_bar_right}>
<div className={styles.count}>
<span></span>
<label>43</label>
<label>{totalCount}</label>
<span>个店铺</span>
</div>
</div>
</div>
{
filterList && filterList.length > 0 && (
(filterList && filterList.length > 0 || search) && (
<div className={styles.filter_bar}>
<div className={styles.filter_bar_left}>
<div className={styles.filter_bar_left_text} onClick={handleResetFilter}>重置</div>
</div>
<div className={styles.filter_bar_list}>
{
search && (
<div className={styles.filter_bar_list_item}>
<span className={styles.filter_bar_list_item_text}>{search}</span>
<CloseOutlined className={styles.filter_bar_list_item_icon} onClick={() => handleClearSearch()} />
</div>
)
}
{
filterList.map(item => (
<div className={styles.filter_bar_list_item} key={item.key}>
<span className={styles.filter_bar_list_item_text}>{item.title}</span>
......@@ -129,11 +197,13 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
)
}
{
!!search ? <NoResult search={search} /> : (
(shopList.length === 0 || !shopList) ? !loading && <SearchNoResult search="" type={2} /> : (
<>
<CommodityList showType={showType} />
<Spin spinning={loading}>
<CommodityList showType={showType} shopList={shopList} />
</Spin>
<div className={styles.pagination_wrap}>
<Pagination showQuickJumper showSizeChanger={false} defaultCurrent={1} total={100} />
<Pagination showQuickJumper showSizeChanger={false} onChange={handlePageChange} current={current} pageSize={pageSize} total={totalCount} />
</div>
</>
)
......
......@@ -35,6 +35,10 @@
&_name {
display: flex;
&>a {
color: #333333;
}
}
&_city {
......
......@@ -4,90 +4,99 @@ import { Link } from 'umi'
import { Rate } from 'antd'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import shop_logo from '@/assets/imgs/shop_logo.png'
import './list.less'
import { priceFormat } from '@/utils/numberFomat'
import styles from './list.less'
interface CommodityListPropsType {
showType: number
showType: number,
shopList: any
}
const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const { showType } = props
const { shopList } = props
let dataList = []
for (let i = 0; i < 10; i++) {
dataList.push(i)
const renderCommodityPrice = (unitPrice) => {
let price = 0
if (unitPrice) {
let priceArr = []
Object.keys(unitPrice).forEach(key => {
priceArr.push(unitPrice[key])
})
price = priceArr[0] || 0
}
return <div className={styles.shop_list_goods_item_price}>
<span className={styles.unit}></span>
<span>{priceFormat(price)}</span>
</div>
}
const renderArea = (shopAreaList) => {
if (shopAreaList) {
return shopAreaList.map(item => `${item.province}/${item.city}`).join(" ")
} else {
return '所有地区'
}
}
return (
<div className={cx("shop_list")}>
<div className={cx(styles.shop_list)}>
{
dataList.map((item, index) => (
<div key={item} className="shop_list_item row">
<div className="shop_list_left">
<div className="shop_list_info">
<div className="shop_list_info_imgbox">
<div className="shop_list_info_imgbox_img" style={{ backgroundImage: `url(${shop_logo})` }}></div>
</div>
<div className="shop_list_info_box">
<div className="shop_list_info_name">
<span>温州市龙昌皮业有限公司</span>
<span className="shop_list_info_city">广东/广州</span>
</div>
<div className="shop_list_info_about">
<div className="shop_list_info_about_item">
<i className="icon"><img src={credit_icon} /></i>
<span>1288</span>
</div>
<div className="shop_list_info_about_item">
<i className="icon"><img src={shop_icon} /></i>
<span className="red">2</span>
shopList.map((item, index) => (
<div key={`${item.id}_${index}`} className={cx(styles.shop_list_item, styles.row)}>
<div className={styles.shop_list_left}>
<div className={styles.shop_list_info}>
<div className={styles.shop_list_info_imgbox}>
<div className={styles.shop_list_info_imgbox_img} style={{ backgroundImage: `url(${item.logo})` }}></div>
</div>
<div className={styles.shop_list_info_box}>
<div className={styles.shop_list_info_name}>
<Link to={`/shop?shopId=${btoa(JSON.stringify({ shopId: item.id, memberId: item.memberId }))}`}>{item.memberName}</Link>
<span className={styles.shop_list_info_city}>{item.memberShopAreas}</span>
</div>
<div className={styles.shop_list_info_about}>
<div className={styles.shop_list_info_about_item}>
<i className={styles.icon}><img src={credit_icon} /></i>
<span>{item.integral}</span>
</div>
<div className={styles.shop_list_info_about_item}>
<i className={styles.icon}><img src={shop_icon} /></i>
<span className={styles.red}>{item.registerYears}</span>
<span></span>
</div>
</div>
</div>
</div>
<div className="shop_satisfaction">
<div className={styles.shop_satisfaction}>
<label>满意度:</label>
<Rate className="shop_satisfaction_rate" disabled defaultValue={2} />
<Rate className={styles.shop_satisfaction_rate} disabled defaultValue={item.satisfied || 0} />
</div>
<div className="shop_list_line">
<div className={styles.shop_list_line}>
<label>主营</label>
<span className="shop_list_line_brief">全粒面牛皮|修面皮|漆色皮|打腊皮|水腊皮|疯马皮|珠光变色|水腊皮|疯马皮|珠光变色|珠光变色</span>
<span className={styles.shop_list_line_brief}>{item.customerCategoryName}</span>
</div>
<div className="shop_list_line">
<div className={styles.shop_list_line}>
<label>以上信息已通过会员认证|</label>
<Link to="/shop?id=12" className="shop_list_line_link">资质证书 &gt;</Link>
<Link to="/shop?id=12" className="shop_list_line_link">公司信息 &gt;</Link>
</div>
</div>
<div className="shop_list_goods">
<Link to={`/shop/commodity/detail?id=asdjflewjfe&type=prompt`}>
<div className="shop_list_goods_item">
<div className="shop_list_goods_item_imgbox">
<div className="shop_list_goods_item_imgbox_img" style={{ backgroundImage: `url(https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1.jpg)` }}></div>
<Link to={`/shop/about?shopId=${btoa(JSON.stringify({ shopId: item.id, memberId: item.memberId }))}`} className={styles.shop_list_line_link}>资质证书 &gt;</Link>
<Link to={`/shop/about?shopId=${btoa(JSON.stringify({ shopId: item.id, memberId: item.memberId }))}`} className={styles.shop_list_line_link}>公司信息 &gt;</Link>
</div>
<div className="shop_list_goods_item_price">
<span className="unit"></span>
<span>79.00</span>
</div>
<div className={styles.shop_list_goods}>
{
item.commodityList && item.commodityList.map((commodityItem, commodityIndex) => commodityIndex < 2 && (
<Link to={`/shop/commodity/detail?id=${commodityItem.id}&shopId=${btoa(JSON.stringify({ shopId: item.id, memberId: item.memberId }))}`} key={commodityItem.id} target="_blank">
<div className={styles.shop_list_goods_item}>
<div className={styles.shop_list_goods_item_imgbox}>
<div className={styles.shop_list_goods_item_imgbox_img} style={{ backgroundImage: `url(${commodityItem.mainPic})` }}></div>
</div>
</Link>
<Link to={`/shop/commodity/detail?id=asdjflewjfe&type=prompt`}>
<div className="shop_list_goods_item">
<div className="shop_list_goods_item_imgbox">
<div className="shop_list_goods_item_imgbox_img" style={{ backgroundImage: `url(https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1.jpg)` }}></div>
</div>
<div className="shop_list_goods_item_price">
<span className="unit"></span>
<span>79.00</span>
</div>
{
renderCommodityPrice(commodityItem.unitPrice)
}
</div>
</Link>
))
}
</div>
</div>
))
}
</div>
......
......@@ -12,7 +12,7 @@ const NoResult: React.FC<NoResultPropsType> = (props) => {
<div className={styles.no_result_tip}>
<div className={styles.no_result_tip_img}></div>
<div className={styles.no_result_tip_text}>
暂无求购信息
暂无店铺信息
</div>
</div>
</div>
......
......@@ -5,11 +5,43 @@ import { StarFilled } from '@ant-design/icons'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import styles from './index.less'
import { COMMODITY_TYPE } from '@/constants'
const Commodity: React.FC = () => {
let CommodityList = Array.apply({}, new Array(7))
const renderBtn = (priceType) => {
switch (priceType) {
case COMMODITY_TYPE.prompt:
return <Button className={styles.collection_state_wrap_btn} type="primary">再次购买</Button>
case COMMODITY_TYPE.integral:
return <Button className={styles.collection_state_wrap_btn} type="primary">立即兑换</Button>
case COMMODITY_TYPE.inquiry:
return <Button className={styles.collection_state_wrap_btn} type="primary">立即询价</Button>
}
}
const renderPrice = (priceType) => {
switch (priceType) {
case COMMODITY_TYPE.prompt:
return (
<div className={styles.commodity_price}>
<span></span>
<label>79.00</label>
</div>
)
case COMMODITY_TYPE.integral:
return (
<div className={styles.commodity_point}>
2,000~3,000积分
</div>
)
case COMMODITY_TYPE.inquiry:
return <div className={styles.commodity_tag}>在线询价</div>
}
}
return (
<>
<div className={styles.commodity_list}>
......@@ -24,9 +56,9 @@ const Commodity: React.FC = () => {
<div className={styles.shop_header_info_content}>
<p className={styles.commodity_name}>0.8-1.0mm黑色手折纹胎水牛皮</p>
<ul className={styles.tags_list}>
<li className={styles.tags_list_item} key={`tags_list_item`}>黄牛头皮层自然摔纹</li>
<li className={styles.tags_list_item} key={`tags_list_item`}>硬度适中偏软</li>
<li className={styles.tags_list_item} key={`tags_list_item`}>手感舒适</li>
<li className={styles.tags_list_item} key={`tags_list_item_1`}>黄牛头皮层自然摔纹</li>
<li className={styles.tags_list_item} key={`tags_list_item_2`}>硬度适中偏软</li>
<li className={styles.tags_list_item} key={`tags_list_item_3`}>手感舒适</li>
</ul>
</div>
</div>
......@@ -39,14 +71,7 @@ const Commodity: React.FC = () => {
<div className={styles.commodity_shopname}>温州市龙昌皮业有限公司</div>
</div>
<div className={cx(styles.commodity_list_item_item)}>
{/* <div className={styles.commodity_price}>
<span>¥</span>
<label>79.00</label>
</div> */}
{/* <div className={styles.commodity_tag}>在线询价</div> */}
<div className={styles.commodity_point}>
2,000~3,000积分
</div>
{renderPrice(1)}
</div>
<div className={cx(styles.commodity_list_item_item)}>
<span className={styles.date}>2020-10-25 10:58</span>
......@@ -57,7 +82,7 @@ const Commodity: React.FC = () => {
<StarFilled />
<label>收藏</label>
</div>
<Button className={styles.collection_state_wrap_btn} type="primary">再次购买</Button>
{renderBtn(1)}
</div>
</div>
</div>
......
......@@ -160,6 +160,9 @@ class FilterStore {
case FILTER_TYPE.attribute:
tempFilterParam.customerAttributeList = filterItem.key
break
case FILTER_TYPE.shopArea:
tempFilterParam.areaCode = filterItem.key
break
default:
break
}
......
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