Commit 470915ea authored by GuanHua's avatar GuanHua

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

parent 14dd1dc2
...@@ -37,6 +37,10 @@ export enum LAYOUT_TYPE { ...@@ -37,6 +37,10 @@ export enum LAYOUT_TYPE {
* 渠道商城-积分兑换 * 渠道商城-积分兑换
*/ */
channelScoreMall = 'channelScoreMall', channelScoreMall = 'channelScoreMall',
/**
* 店铺列表
*/
shopList = 'shopList'
} }
// 本地环境跳过权限校验 // 本地环境跳过权限校验
...@@ -645,7 +649,7 @@ export enum SaleOrderInsideWorkState { ...@@ -645,7 +649,7 @@ export enum SaleOrderInsideWorkState {
* 提交二级审核订单不通过 * 提交二级审核订单不通过
*/ */
TWO_LEVEL_AUDIT_ORDER_NOT_ALLOWED, TWO_LEVEL_AUDIT_ORDER_NOT_ALLOWED,
/** /**
* 不接受订单 * 不接受订单
*/ */
...@@ -665,7 +669,7 @@ export enum SaleOrderInsideWorkState { ...@@ -665,7 +669,7 @@ export enum SaleOrderInsideWorkState {
* 订单销售,发货单创建 * 订单销售,发货单创建
*/ */
SALE_CREATE_DELIVED_ORDER, SALE_CREATE_DELIVED_ORDER,
/** /**
* 新增物流单 * 新增物流单
*/ */
......
...@@ -518,9 +518,9 @@ const CommodityDetail = (props) => { ...@@ -518,9 +518,9 @@ const CommodityDetail = (props) => {
} }
const handleSelectAttrVal = (attrId: number, attrValId: number) => { const handleSelectAttrVal = (attrId: number, attrValId: number) => {
if (!judgeHasAttr(attrId, attrValId)) { // if (!judgeHasAttr(attrId, attrValId)) {
return // return
} // }
if (judgeSelectAttrInList(selectAttrVal, attrId, 'attrId')) { if (judgeSelectAttrInList(selectAttrVal, attrId, 'attrId')) {
let result = [] let result = []
for (let item of selectAttrVal) { for (let item of selectAttrVal) {
...@@ -696,7 +696,8 @@ const CommodityDetail = (props) => { ...@@ -696,7 +696,8 @@ const CommodityDetail = (props) => {
key={`product_info_line_list_item_${childItem.id}_${index}`} key={`product_info_line_list_item_${childItem.id}_${index}`}
className={cx(styles.product_info_line_list_item, className={cx(styles.product_info_line_list_item,
judgeSelectAttrInList(selectAttrVal, childItem.id, 'attrValId') ? styles.active : '', 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)} > onClick={() => handleSelectAttrVal(item.customerAttribute.id, childItem.id)} >
{ {
childItem.commodityPic && ( childItem.commodityPic && (
......
...@@ -47,6 +47,9 @@ const Category: React.FC<CategoryPropsType> = (props) => { ...@@ -47,6 +47,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
useEffect(() => { useEffect(() => {
let getCategoryListFn let getCategoryListFn
let param: any = {} let param: any = {}
/**
* 根据不通过的页面类型,请求不同的品类接口
*/
switch (layoutType) { switch (layoutType) {
case LAYOUT_TYPE.mall: case LAYOUT_TYPE.mall:
getCategoryListFn = PublicApi.getSearchShopEnterpriseGetCategoryTree getCategoryListFn = PublicApi.getSearchShopEnterpriseGetCategoryTree
...@@ -66,6 +69,8 @@ const Category: React.FC<CategoryPropsType> = (props) => { ...@@ -66,6 +69,8 @@ const Category: React.FC<CategoryPropsType> = (props) => {
param.storeId = shopId param.storeId = shopId
getCategoryListFn = PublicApi.getSearchShopScoreGetCategoryTree getCategoryListFn = PublicApi.getSearchShopScoreGetCategoryTree
break break
case LAYOUT_TYPE.shopList:
getCategoryListFn = PublicApi.getProductPlatformGetCategoryTree
default: default:
break break
} }
......
...@@ -66,6 +66,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => { ...@@ -66,6 +66,7 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
let param: any = {} let param: any = {}
switch (layoutType) { switch (layoutType) {
case LAYOUT_TYPE.mall: case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.shopList:
getAreaFn = PublicApi.getSearchShopEnterpriseGetArea getAreaFn = PublicApi.getSearchShopEnterpriseGetArea
break break
case LAYOUT_TYPE.shop: case LAYOUT_TYPE.shop:
......
...@@ -120,7 +120,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => { ...@@ -120,7 +120,7 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
<div className={styles.purchaseOnline}> <div className={styles.purchaseOnline}>
<div className={styles.mall_container}> <div className={styles.mall_container}>
<div className={styles.commodity_container}> <div className={styles.commodity_container}>
<Filter filterConfig={filterConfig} /> <Filter filterConfig={filterConfig} {...props} />
<div className={styles.commodity_main}> <div className={styles.commodity_main}>
{/* <div className="banner"> {/* <div className="banner">
<img src={bannerImg} /> <img src={bannerImg} />
......
import React, { useState } from 'react' import React, { useState } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons' import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons'
import Filter from '../components/Filter' import Filter from '../components/Filter'
import { FILTER_TYPE } from '@/constants' import { FILTER_TYPE, LAYOUT_TYPE } from '@/constants'
import cx from 'classnames' import cx from 'classnames'
import { Pagination } from 'antd' import { Pagination } from 'antd'
import CommodityList from './list' import CommodityList from './list'
...@@ -89,7 +89,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => { ...@@ -89,7 +89,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
<div className={styles.commodity}> <div className={styles.commodity}>
<div className={styles.mall_container}> <div className={styles.mall_container}>
<div className={styles.commodity_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.commodity_main}>
<div className={styles.tool_bar}> <div className={styles.tool_bar}>
<div className={styles.tool_bar_left}> <div className={styles.tool_bar_left}>
......
...@@ -5,11 +5,43 @@ import { StarFilled } from '@ant-design/icons' ...@@ -5,11 +5,43 @@ 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 styles from './index.less' import styles from './index.less'
import { COMMODITY_TYPE } from '@/constants'
const Commodity: React.FC = () => { const Commodity: React.FC = () => {
let CommodityList = Array.apply({}, new Array(7)) 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 ( return (
<> <>
<div className={styles.commodity_list}> <div className={styles.commodity_list}>
...@@ -39,14 +71,7 @@ const Commodity: React.FC = () => { ...@@ -39,14 +71,7 @@ const Commodity: React.FC = () => {
<div className={styles.commodity_shopname}>温州市龙昌皮业有限公司</div> <div className={styles.commodity_shopname}>温州市龙昌皮业有限公司</div>
</div> </div>
<div className={cx(styles.commodity_list_item_item)}> <div className={cx(styles.commodity_list_item_item)}>
{/* <div className={styles.commodity_price}> {renderPrice(1)}
<span>¥</span>
<label>79.00</label>
</div> */}
{/* <div className={styles.commodity_tag}>在线询价</div> */}
<div className={styles.commodity_point}>
2,000~3,000积分
</div>
</div> </div>
<div className={cx(styles.commodity_list_item_item)}> <div className={cx(styles.commodity_list_item_item)}>
<span className={styles.date}>2020-10-25 10:58</span> <span className={styles.date}>2020-10-25 10:58</span>
...@@ -57,7 +82,7 @@ const Commodity: React.FC = () => { ...@@ -57,7 +82,7 @@ const Commodity: React.FC = () => {
<StarFilled /> <StarFilled />
<label>收藏</label> <label>收藏</label>
</div> </div>
<Button className={styles.collection_state_wrap_btn} type="primary">再次购买</Button> {renderBtn(1)}
</div> </div>
</div> </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