Commit 470915ea authored by GuanHua's avatar GuanHua

feat:收藏管理的不同类型商品价格和按钮的显示

parent 14dd1dc2
......@@ -37,6 +37,10 @@ export enum LAYOUT_TYPE {
* 渠道商城-积分兑换
*/
channelScoreMall = 'channelScoreMall',
/**
* 店铺列表
*/
shopList = 'shopList'
}
// 本地环境跳过权限校验
......
......@@ -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
}
......
......@@ -66,6 +66,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:
......
......@@ -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} />
......
import React, { useState } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, 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 CommodityList from './list'
......@@ -89,7 +89,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
<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}>
......
......@@ -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}>
......@@ -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>
......
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