Commit 06131bf4 authored by XieZhiXiong's avatar XieZhiXiong
parents ed3d37d9 fc5903cf
......@@ -41,7 +41,7 @@
"copy-to-clipboard": "^3.3.1",
"god": "0.1.28",
"lingxi-design": "^1.0.7",
"lingxi-design-ui": "^1.1.3",
"lingxi-design-ui": "^1.1.4",
"lingxi-editor-core": "^1.0.6",
"lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7",
......@@ -78,4 +78,4 @@
"json2ts": "^0.0.7",
"ora": "^4.0.4"
}
}
}
\ No newline at end of file
......@@ -54,7 +54,15 @@ const mallLists = [
'/channelmall/infomation/detail',
'/channelmall/infomation/search',
'/channelmall/about',
'/channel/purchaseOrder'
'/ichannelmall',
'/ichannelmall/commodity',
'/ichannelmall/commodity/search',
'/ichannelmall/commodity/detail',
'/ichannelmall/pointsMall',
'/ichannelmall/infomation',
'/ichannelmall/infomation/detail',
'/ichannelmall/infomation/search',
'/ichannelmall/about',
]
// let routeAuthUrls: any[] = []
......
......@@ -18,7 +18,7 @@ const InputNumber: React.FC<InputNumberPropsType> = (props) => {
const [maxCount, setMaxCount] = useState<number>()
useEffect(() => {
if (min) {
if (min || min === 0) {
setMinCount(min)
if (value < min) {
onChange(min)
......
......@@ -400,6 +400,22 @@ export enum OrderModalType {
CHANNEL_SPOT_MANUAL_ORDER,
}
export enum COMMODITY_TYPE {
/**
* 现货商品
*/
prompt = 1,
/**
*询价商品
*/
inquiry = 2,
/**
* 积分商品
*/
integral = 3
}
// 采购订单外部工作流状态
export enum PurchaseOrderOutWorkState {
......@@ -417,7 +433,7 @@ export enum PurchaseOrderOutWorkState {
* 确认订单
*/
CONFIRM_ORDER,
/**
* 确认电子合同
*/
......@@ -437,7 +453,7 @@ export enum PurchaseOrderOutWorkState {
* 新增销售发货单
*/
ADD_SALE_INVOICE_ORDER,
/**
* 新增物流单
*/
......@@ -446,7 +462,7 @@ export enum PurchaseOrderOutWorkState {
/**
* 订单发货确认
*/
CONFIRM_DELIVERY_ORDER,
CONFIRM_DELIVERY_ORDER,
/**
* 新增采购入库单
......@@ -457,10 +473,10 @@ export enum PurchaseOrderOutWorkState {
* 订单收货确认
*/
CONFIRM_RECEIPT_ORDER,
/**
* 确认回单
*/
/**
* 确认回单
*/
CONFIRM_RECEIPT,
/**
......@@ -496,7 +512,7 @@ export enum PurchaseOrderOutWorkState {
// 采购订单内部工作流状态
export enum PurchaseOrderInsideWorkState {
/**
* 取消订单
*/
......@@ -605,4 +621,4 @@ export const PurchaseOrderInsideWorkStateTexts = {
12: '确认收货',
14: '订单入库',
15: '订单归档'
}
\ No newline at end of file
}
......@@ -341,7 +341,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
imgUrl={""}
large={true}
fileMaxSize={100}
size="xxx"
size="600x400"
onChange={(url) => handleAddworkshopPics(url)}
/>
</div>
......@@ -368,7 +368,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
imgUrl={""}
large={true}
fileMaxSize={100}
size="xxx"
size="106x107"
onChange={(url) => handleAddhonorPics(url)}
/>
</div>
......
......@@ -35,8 +35,11 @@
padding: 0 !important;
}
:global {
.ant-drawer-title {
font-weight: bold;
}
:global {
.card-container {
.ant-form-item {
......
......@@ -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)
}
......
......@@ -236,7 +236,7 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
</div>
</div>
{
(commodityList.length === 0 || !commodityList) ? <SearchNoResult search={search} /> : (
(commodityList.length === 0 || !commodityList) ? !loading && <SearchNoResult search={search} /> : (
<>
<Spin spinning={loading}>
<CommodityList showType={showType} commodityList={commodityList} layoutType={layoutType} />
......
......@@ -48,6 +48,10 @@
color: #333333;
text-align: center;
margin-top: 5px;
&.integral {
color: #EA8000;
}
}
}
}
......
......@@ -2,14 +2,15 @@ import React, { useRef } from 'react'
import { Carousel } from 'antd'
import { LeftOutlined, RightOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { COMMODITY_TYPE } from '@/constants'
import styles from './index.less'
interface BrowseRecordsPropsType {
priceType: COMMODITY_TYPE
}
const BrowseRecords: React.FC<BrowseRecordsPropsType> = () => {
const BrowseRecords: React.FC<BrowseRecordsPropsType> = (props) => {
const { priceType } = props
const actionRef = useRef<any>()
const product_list = [
......@@ -46,7 +47,7 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = () => {
const new_product_list = arrGroup(product_list, 3)
return (
return priceType ? (
<div className={styles.browse_records}>
<div className={styles.browse_records_title}>
<span className={styles.browse_records_title_line}></span>
......@@ -64,7 +65,11 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = () => {
<div className={styles.product_img_box}>
<img src={childItem.imgUrl} />
</div>
<div className={styles.product_price}>{childItem.price}</div>
{
priceType === COMMODITY_TYPE.integral ? <div className={cx(styles.product_price, styles.integral)}>2,000~3,000积分</div> :
<div className={styles.product_price}>{childItem.price}</div>
}
</div>
))
}
......@@ -76,7 +81,7 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = () => {
<RightOutlined className={cx(styles.common_arrow_btn, styles.next)} onClick={() => actionRef.current.next()} />
</div>
</div>
)
) : null
}
export default BrowseRecords
......@@ -38,6 +38,10 @@
margin-top: 6px;
font-size: 14px;
&.integral {
color: #EA8000;
}
&>span {
font-size: 12px;
}
......
import React from 'react'
import { COMMODITY_TYPE } from '@/constants'
import cx from 'classnames'
import styles from './index.less'
const Interested: React.FC = () => {
interface InterestedPropsType {
priceType: COMMODITY_TYPE
}
const Interested: React.FC<InterestedPropsType> = (props) => {
const { priceType } = props
return (
<div className={styles.interested}>
......@@ -13,8 +20,10 @@ const Interested: React.FC = () => {
<img src="https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg" />
</div>
<div className={styles.interested_product_list_item_name}>0.8-1.0mm黑色手折纹胎…</div>
<div className={styles.interested_product_list_item_price}><span></span> 79.00</div>
{
priceType === COMMODITY_TYPE.integral ? <div className={cx(styles.interested_product_list_item_price, styles.integral)}>2,000~3,000 积分</div> :
<div className={styles.interested_product_list_item_price}><span></span> 79.00</div>
}
</div>
</a>
<a href="/shop/commodity/detail?id=asdjflewjfe&type=prompt">
......@@ -23,7 +32,10 @@ const Interested: React.FC = () => {
<img src="https://woodmartcdn-cec2.kxcdn.com/wp-content/uploads/2016/09/product-furniture-1-6.jpg" />
</div>
<div className={styles.interested_product_list_item_name}>0.8-1.0mm黑色手折纹胎…</div>
<div className={styles.interested_product_list_item_price}><span></span> 79.00</div>
{
priceType === COMMODITY_TYPE.integral ? <div className={cx(styles.interested_product_list_item_price, styles.integral)}>2,000~3,000 积分</div> :
<div className={styles.interested_product_list_item_price}><span></span> 79.00</div>
}
</div>
</a>
</div>
......
......@@ -4,6 +4,7 @@ import Comment from './components/Comment'
import Introduction from './components/Introduction'
import TradeRecord from './components/TradeRecord'
import Recommand from './components/Recommand'
import { COMMODITY_TYPE } from '@/constants'
import { GetSearchShopStoreGetCommodityDetailResponse } from '@/services/SearchApi'
import cx from 'classnames'
import styles from './index.less'
......@@ -23,6 +24,7 @@ const ProductDescription: React.FC<ProductDescriptionPropsType> = (props) => {
setCurrentAnchor(currentActiveLink)
}
}
return (
<div className={styles.product_description} id="product_description">
<Anchor
......@@ -31,7 +33,7 @@ const ProductDescription: React.FC<ProductDescriptionPropsType> = (props) => {
onChange={handleAnchorChange}
>
<Link className={cx(currentAnchor === "#introduction" ? 'active' : '')} href="#introduction" title="产品简介" />
<Link href="#trade_record" title="交易记录(2)" />
<Link href="#trade_record" title={commodityDetail?.priceType === COMMODITY_TYPE.integral ? `兑换记录(2)` : `交易记录(2)`} />
<Link href="#comment" title="交易评价(96)" />
<BackTop className={styles.buy_now_btn} visibilityHeight={800} >立即订购</BackTop>
</Anchor>
......
......@@ -120,6 +120,11 @@
text-align: center;
cursor: pointer;
&>a {
display: block;
color: #333333;
}
&:hover {
background-color: #f5f5f5;
}
......
import React from 'react'
import { Rate } from 'antd'
import { Link } from 'umi'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import styles from './index.less'
const ShopInfo: React.FC = () => {
interface ShopInfoPropsType {
shopInfo: any;
shopUrlParam: string;
}
const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const { shopInfo, shopUrlParam } = props
return (
<div className={styles.shop_info}>
......@@ -13,7 +20,7 @@ const ShopInfo: React.FC = () => {
<div className={styles.shop_info_title_text}>会员认证</div>
<div className={styles.shop_info_title_split}></div>
</div>
<div className={styles.shop_name}>温州市龙昌皮具有限公司</div>
<div className={styles.shop_name}>{shopInfo?.company}</div>
<div className={styles.shop_about}>
<div className={styles.shop_about_item}>
<i className={styles.icon}><img src={shop_icon} /></i>
......@@ -45,7 +52,7 @@ const ShopInfo: React.FC = () => {
</div>
<div className={styles.dashed_split}></div>
<div className={styles.shop_info_btn_group}>
<div className={styles.shop_info_btn}>进入店铺</div>
<div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div>
<div className={styles.shop_info_btn}>收藏本店</div>
</div>
<div className={styles.apply_member_btn}>申请成为本店会员</div>
......
This diff is collapsed.
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>
)
......
......@@ -4,6 +4,8 @@ import { Input } from 'antd'
import { history } from 'umi'
import { FileTextOutlined } from '@ant-design/icons'
import isEmpty from 'lodash/isEmpty'
import { PublicApi } from '@/services/api'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
interface HeaderPropsType {
......@@ -14,7 +16,9 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const { logo } = props
const [searchType, setSearchType] = useState<number>(1) // 1:商品; 2:店铺
const [searchValue, setSearchValue] = useState<string>("")
const [count, setCount] = useState<number>(0)
const { search } = history.location.query
useEffect(() => {
if (!!search) {
setSearchValue(search)
......@@ -23,6 +27,18 @@ const Header: React.FC<HeaderPropsType> = (props) => {
}
}, [search])
useEffect(() => {
if (getAuth()) {
getPurchaseCount()
}
}, [])
const getPurchaseCount = () => {
PublicApi.getProductPurchaseGetPurchaseCount().then(res => {
setCount(res.data)
})
}
const handleChangeSearchType = (type: number) => {
if (searchType !== type) {
setSearchType(type)
......@@ -63,7 +79,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
</div>
</div>
<div className={cx(styles.shopping_cart, styles.mall)} onClick={() => history.push('/purchaseOrder')}>
<div className={styles.badge}>0</div>
<div className={styles.badge}>{count}</div>
<FileTextOutlined className={styles.card_icon} />
<span>进货单</span>
</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: '去求购',
},
{
......
......@@ -236,6 +236,11 @@
background-color: #f5f5f5;
}
&>a {
display: block;
color: #333333;
}
&:last-child {
margin-left: 6px;
}
......
import React, { useState, useEffect } from 'react'
import { CaretDownOutlined } from '@ant-design/icons'
import { Rate, Input } from 'antd'
import { history } from 'umi'
import { history, Link } from 'umi'
import isEmpty from 'lodash/isEmpty'
import logo from '@/theme/imgs/logo_w.png'
// import logo from '@/theme/imgs/logo_w.png'
import shop_icon from '@/assets/imgs/shop_icon.png'
import credit_icon from '@/assets/imgs/credit_icon.png'
import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
......@@ -12,11 +12,12 @@ import styles from './index.less'
interface ShopHeaderPropsType {
shopId: number;
shopUrlParam: string;
shopInfo: GetTemplateShopFindShopResponse
shopInfo: GetTemplateShopFindShopResponse;
logo: string;
}
const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { shopId, shopUrlParam, shopInfo } = props
const { shopId, shopUrlParam, shopInfo, logo } = props
const [searchValue, setSearchValue] = useState<string>("")
const { search } = history.location.query
......@@ -91,7 +92,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
</div>
<div className={styles.dashed_split}></div>
<div className={styles.shop_info_btn_group}>
<div className={styles.shop_info_btn}>进入店铺</div>
<div className={styles.shop_info_btn}><Link to={`/shop?shopId=${shopUrlParam}`}>进入店铺</Link></div>
<div className={styles.shop_info_btn}>收藏本店</div>
</div>
<div className={styles.apply_member_btn}>申请成为本店会员</div>
......
......@@ -83,7 +83,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
<div className={styles.lxmall_page}>
<TopBar name={mallInfo.name} />
<div className={styles.content}>
<ShopHeader shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} />
<ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.shop} shopId={query.shopId} shopUrlParam={shopId} />
{
children && React.Children.map(children, (child: any) => {
......
......@@ -16,7 +16,7 @@ import { PublicApi } from '@/services/api'
import { GetLogisticsReceiverAddressGetResponse } from '@/services/LogisticsApi'
import SignModal from '@/components/SignModal'
import { isEmpty } from 'lodash'
import { LAYOUT_TYPE, OrderModalType } from '@/constants'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE } from '@/constants'
interface OrderPropsType {
location: any;
......@@ -26,7 +26,8 @@ interface OrderPropsType {
}
const Order: React.FC<OrderPropsType> = (props) => {
const { shopInfo, mallInfo, layoutType } = props
const { shopInfo, mallInfo, layoutType, } = props
const { query: { type = COMMODITY_TYPE.prompt } } = props.location
const [signModalVisible, setSignModalVisible] = useState<boolean>(false)
const { spam_id } = props.location.query
const OrderStore = useLocalStore(() => store.OrderStore)
......@@ -40,6 +41,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
const [needTheContract, setneedTheContract] = useState<boolean>(false)
const [selectAddressInfo, setSelectAddressInfo] = useState<GetLogisticsReceiverAddressGetResponse>()
const [selectInvoiceInfo, setSelectInvoiceInfo] = useState<any>()
const [logisticsFee, setLogisticsFee] = useState<number>(0)
useEffect(() => {
if (!spam_id) {
......@@ -124,13 +126,48 @@ const Order: React.FC<OrderPropsType> = (props) => {
return amount
}
useEffect(() => {
getLogisticsFeeAnync()
}, [selectAddressInfo])
const getLogisticsFeeAnync = async () => {
if (selectAddressInfo) {
let orderProductList = []
for (let item of orderInfo.orderList) {
for (let orderItem of item.orderList) {
let templateId = orderItem.logistics?.templateId
// 判断是否物流的方式和由买家承担费用并使用了运费模板
if (orderItem.logistics?.deliveryType === 1 && orderItem.logistics?.carriageType === 1 && orderItem.logistics?.useTemplate && templateId) {
orderProductList.push({
templateId,
weight: orderItem.logistics?.weight,
})
}
}
}
if (orderProductList.length > 0) {
let params: any = {
orderProductList,
receiverAddressId: selectAddressInfo.id
}
try {
const res: any = await PublicApi.postLogisticsFreightTemplateCalFreightPrice(params)
message.destroy()
setLogisticsFee(Number(res.data))
} catch (error) { }
}
}
}
/**
* 获取物流费用
*/
const getLogisticsFee = () => {
let fee = 0
return fee
return logisticsFee
}
const getAmount = () => {
return priceFormat(getCommodityAmount() + getLogisticsFee())
const getAmount = (state = true) => {
return state ? priceFormat(getCommodityAmount() + getLogisticsFee()) : numFormat(getCommodityAmount() + getLogisticsFee())
}
/**
......@@ -156,14 +193,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 +249,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 = () => {
......@@ -256,9 +293,9 @@ const Order: React.FC<OrderPropsType> = (props) => {
</div>
<div className={styles.order_tb_title}>
<div className={cx(styles.order_tb_title_item, styles.goods_info)}>商品</div>
<div className={styles.order_tb_title_item}>单价(元)</div>
<div className={cx(styles.order_tb_title_item, styles.count)}>数量</div>
<div className={styles.order_tb_title_item}>小计(元)</div>
<div className={styles.order_tb_title_item}>{Number(type) === COMMODITY_TYPE.integral ? '所需积分' : '单价(元)'}</div>
<div className={cx(styles.order_tb_title_item, styles.count)}>{Number(type) === COMMODITY_TYPE.integral ? '兑换数量' : '数量'}</div>
<div className={styles.order_tb_title_item}>小计{Number(type) === COMMODITY_TYPE.integral ? '' : '(元)'}</div>
</div>
{
orderList && orderList.map((orderItem, orderItemIndex) => (
......@@ -287,14 +324,14 @@ const Order: React.FC<OrderPropsType> = (props) => {
</div>
<div className={styles.order_list_item_item}>
<span className={styles.order_list_item_item_unitprice}>
<div className={styles.order_list_item_item_unitprice}>¥ {priceFormat(item.unitPrice)}</div>
<div className={styles.order_list_item_item_unitprice}>{Number(type) === COMMODITY_TYPE.integral ? `${numFormat(item.unitPrice)}` : `¥ ${priceFormat(item.unitPrice)}`}</div>
</span>
</div>
<div className={cx(styles.order_list_item_item, styles.count)}>
<span>{numFormat(item.count)} {item.unitName}</span>
</div>
<div className={styles.order_list_item_item}>
<span className={styles.order_list_item_item_price}>{priceFormat(item.unitPrice * item.count)}</span>
<span className={styles.order_list_item_item_price}>{Number(type) === COMMODITY_TYPE.integral ? `${numFormat(item.unitPrice * item.count)}` : priceFormat(item.unitPrice * item.count)}</span>
</div>
</div>
{
......@@ -309,21 +346,28 @@ const Order: React.FC<OrderPropsType> = (props) => {
<div className={styles.settlement_box}>
<div className={styles.settlement_box_item}>
<div className={styles.settlement_box_item_price}>
<span>商品金额总计:</span>
<b>{priceFormat(getCommodityAmount())}</b>
<span>RMB</span>
</div>
<div className={styles.settlement_box_item_price}>
<span>运费:</span>
<b>{priceFormat(getLogisticsFee())}</b>
<span>RMB</span>
<span>{Number(type) === COMMODITY_TYPE.integral ? '商品积分总计:' : '商品金额总计:'}</span>
<b>{Number(type) === COMMODITY_TYPE.integral ? numFormat(getCommodityAmount()) : priceFormat(getCommodityAmount())}</b>
{
Number(type) !== COMMODITY_TYPE.integral && <span>RMB</span>
}
</div>
{
Number(type) !== COMMODITY_TYPE.integral && (
<div className={styles.settlement_box_item_price}>
<span>运费:</span>
<b>{priceFormat(getLogisticsFee())}</b>
<span>RMB</span>
</div>)
}
<div className={styles.settlement_box_item_price}>
<span>共需支付:</span>
<b className={styles.settlement_box_item_price_total}>{getAmount()}</b>
<span>RMB</span>
<span>{Number(type) === COMMODITY_TYPE.integral ? '共需支付积分:' : '共需支付:'}</span>
<b className={styles.settlement_box_item_price_total}>{Number(type) === COMMODITY_TYPE.integral ? getAmount(false) : getAmount()}</b>
{
Number(type) !== COMMODITY_TYPE.integral && <span>RMB</span>
}
</div>
<Button loading={confirmLoading} className={styles.settlement_box_item_btn} onClick={() => checkOrder()}>提交订单</Button>
<Button loading={confirmLoading} className={styles.settlement_box_item_btn} onClick={() => checkOrder()}>{Number(type) === COMMODITY_TYPE.integral ? '提交积分订单' : '提交订单'}</Button>
</div>
</div>
</div>
......
import React, { useState } from 'react'
import React, { useState, useEffect } from 'react'
import cx from 'classnames'
import { DownOutlined } from '@ant-design/icons'
import alipayIcon from '@/assets/imgs/alipay_icon.png'
......@@ -16,57 +16,16 @@ const PayWay: React.FC<PayWayProps> = (props) => {
const { payWayList = [], onChange, selectItem = {} } = props
const [expand, setExpand] = useState<boolean>(false)
const PayWay = [
{
name: '线上支付',
payway: [
{
type: 'alipay',
name: '支付宝',
},
{
type: 'wechat',
name: '微信支付'
},
{
type: 'bank',
name: '银联'
},
]
},
{
name: '线下支付',
payway: [
{
type: 'pay',
name: '线下支付'
}
]
},
{
name: '授信额度',
payway: [
{
type: 'pay',
name: '授信额度支付'
}
]
},
{
name: '货到付款',
payway: [
{
type: 'pay',
name: '货到付款支付'
}
]
},
]
const handleSelectWay = (item) => {
onChange(item)
}
useEffect(() => {
if (payWayList && payWayList.length === 1) {
onChange(payWayList[0].payList[0])
}
}, [payWayList])
return (
<div className={styles.payway}>
<div className={styles.common_title}>
......@@ -92,7 +51,7 @@ const PayWay: React.FC<PayWayProps> = (props) => {
))
}
{
payWayList && payWayList.length > 0 && (
payWayList && payWayList.length > 1 && (
<div className={cx(styles.more_btn, styles.pad_l_100)} onClick={() => setExpand(!expand)}>
<span>{expand ? '收起' : '展开'}</span>
<div className={styles.more_btn_icon}>
......
......@@ -44,7 +44,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
{item.min}~{item.max}积分
</div>
<div className={styles.goods_name}>{item.name}</div>
<div className={styles.count}>已售:{item.sold}</div>
<div className={styles.count}>库存:{item.sold || 0}</div>
</div>
</a>
</div>
......
......@@ -20,7 +20,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
{
dataList.map((item, index) => (
<div key={item} className="purchase_list_item row">
<a href={`/shop/commodity/detail?id=asdjflewjfe&type=prompt`}>
<a href={`/memberCenter/tranactionAbility/enquiryOffer/addEnquiry`}>
<div className="purchase_list_item_title">头层自然摔牛皮,箱包鞋面料</div>
<div className="purchase_list_item_info_box">
<div className="purchase_list_item_info_line">
......
......@@ -200,6 +200,16 @@
outline: none;
cursor: pointer;
&[disabled] {
cursor: not-allowed;
color: rgba(0, 0, 0, 0.25);
background: #f5f5f5;
border-color: #d9d9d9;
text-shadow: none;
box-shadow: none;
}
&:hover {
opacity: .9;
}
......
......@@ -68,7 +68,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
})
})
// TODO 暂时给个库存数量
item.stockCount = item.stockCount || 2000
item.stockCount = item.stockCount
item.commodityUnitPrice['priceRange'] = tempPriceRange
tempItem.orderList = [...tempItem.orderList, item]
}
......@@ -92,8 +92,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
price: unitPrice[key]
})
})
// TODO 暂时给个库存数量
item.stockCount = item.stockCount || 2000
item.stockCount = item.stockCount
item.commodityUnitPrice['priceRange'] = tempPriceRange
temp.orderList = [item]
result.push(temp)
......@@ -577,7 +577,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
}
</div>
<div className={cx(styles.order_list_item_item, styles.count)}>
<InputNumber disabled={true} max={childItem.stockCount || 0} min={1} value={childItem.count} onChange={(value) => handleCountChange(value, childItem.id)} />
<InputNumber disabled={true} max={childItem.stockCount || 0} min={0} value={childItem.count} onChange={(value) => handleCountChange(value, childItem.id)} />
<div className={styles.stock}>(库存{numFormat(childItem.stockCount)}{childItem.commodityUnitPrice.commodity.unitName})</div>
</div>
<div className={cx(styles.order_list_item_item, styles.amount)}>
......@@ -623,7 +623,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
<b className={styles.settlement_box_item_price_total}>{handleComputeSelectPrice()}</b>
<span>RMB</span>
</div>
<Button loading={confirmLoading} className={styles.settlement_box_item_btn} onClick={() => handleSettlement()}>结算</Button>
<Button disabled={handleComputeSelectCount() <= 0} loading={confirmLoading} className={styles.settlement_box_item_btn} onClick={() => handleSettlement()}>结算</Button>
</div>
</div>
</Affix>
......
......@@ -230,10 +230,10 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
if (mallItem.environment === 1) {
switch (mallItem.type) {
case 1:
result = `${siteUrl}/shop?shopId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
result = `${siteUrl}/shop?shopId=${btoa(JSON.stringify({ shopId: shopInfo.id, memberId: shopInfo.memberId }))}`
break
case 2:
result = `${siteUrl}/shop/pointsMall?shopId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
result = `${siteUrl}/shop/pointsMall?shopId=${btoa(JSON.stringify({ shopId: shopInfo.id, memberId: shopInfo.memberId }))}`
break
default:
result = ""
......@@ -337,7 +337,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
imgUrl={""}
large={true}
fileMaxSize={100}
size="xxx"
size="600x400"
onChange={(url) => handleAddworkshopPics(url)}
/>
</div>
......@@ -363,7 +363,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
imgUrl={""}
large={true}
fileMaxSize={100}
size="xxx"
size="106x107"
onChange={(url) => handleAddhonorPics(url)}
/>
</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