Commit 8519262e authored by GuanHua's avatar GuanHua

fix:1.修复分类跳转时导致渠道id丢失问题;2,商品库存小于最小订购量还可以下单的问题;3.渠道商城支付页面logo不对的问题;4.模板状态样式问题

parent 446ffdba
......@@ -100,6 +100,24 @@ const ChannelRoute = {
component: '@/pages/lxMall/order',
},
{
// 渠道订单支付页面
path: `${rootRoute}/pay`,
name: 'pay',
key: 'pay',
hide: true,
hideHeader: true,
component: '@/pages/lxMall/pay',
},
{
// 支付结果页面
path: `${rootRoute}/pay/result`,
name: 'payResult',
key: 'payResult',
hide: true,
hideHeader: true,
component: '@/pages/lxMall/payResult',
},
{
path: '/noAuth',
component: '@/pages/403',
},
......
......@@ -100,6 +100,24 @@ const selfChannelRoute = {
component: '@/pages/lxMall/order',
},
{
// 渠道订单支付页面
path: `${rootRoute}/pay`,
name: 'pay',
key: 'pay',
hide: true,
hideHeader: true,
component: '@/pages/lxMall/pay',
},
{
// 支付结果页面
path: `${rootRoute}/pay/result`,
name: 'payResult',
key: 'payResult',
hide: true,
hideHeader: true,
component: '@/pages/lxMall/payResult',
},
{
path: '/noAuth',
component: '@/pages/403',
},
......
......@@ -65,6 +65,8 @@ const mallLists = [
`${channelRootRoute}/about`,
`${channelRootRoute}/purchaseOrder`,
`${channelRootRoute}/order`,
`${channelRootRoute}/pay`,
`${channelRootRoute}/pay/result`,
`${ichannelRootRoute}`,
`${ichannelRootRoute}/commodity`,
`${ichannelRootRoute}/commodity/search`,
......@@ -76,6 +78,8 @@ const mallLists = [
`${ichannelRootRoute}/about`,
`${ichannelRootRoute}/purchaseOrder`,
`${ichannelRootRoute}/order`,
`${ichannelRootRoute}/pay`,
`${ichannelRootRoute}/pay/result`,
]
// let routeAuthUrls: any[] = []
......
......@@ -67,7 +67,7 @@ const InputNumber: React.FC<InputNumberPropsType> = (props) => {
return (
<div className={styles.input_number}>
<div className={cx(styles.input_number_item, styles.reduce, value <= minCount ? styles.disable : '')} onClick={handleReduce}><MinusOutlined /></div>
<input disabled={disabled} className={styles.input_number_input} value={value} onChange={handleChange} onBlur={handleBlur} />
<input disabled={disabled} maxLength={8} className={styles.input_number_input} value={value} onChange={handleChange} onBlur={handleBlur} />
<div className={cx(styles.input_number_item, styles.add, value >= maxCount ? styles.disable : '')} onClick={handleAdd}><PlusOutlined /></div>
</div>
)
......
......@@ -225,6 +225,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
"props": {
categoryAdvertPicUrl: categoryDetail.categoryAdvertPicUrl,
categoryid: item.id,
linkdisable: true,
categoryList: categoryDetail.categoryBOList
},
},
......
......@@ -5,7 +5,8 @@
&_item {
position: relative;
width: 380px;
// width: 380px;
flex: 0 0 48.6%;
height: 136px;
border: 1px solid #ffffff;
margin: 8px 4px;
......
......@@ -15,7 +15,7 @@
}
&_info {
flex: 1;
flex-grow: 1;
width: 0;
margin-left: 12px;
......
......@@ -151,7 +151,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
useMemo(() => <Advert visible={firstAdvertList.length > 0} type="banner" advertList={firstAdvertList} hasQuickNav={false} />, [firstAdvertList])
}
</div>
<FloorAnchor anchorList={categoryList} type="shop" />
<FloorAnchor anchorList={categoryList} type={LAYOUT_TYPE.channel} />
<CommonTitle title="热销商品" type="primary" />
{
categoryComponents ? categoryComponents : loading ? <FloorSkeleton type={LAYOUT_TYPE.shop} /> : null
......
......@@ -451,6 +451,13 @@ const CommodityDetail = (props) => {
message.info("请选择商品属性")
return
}
if (stockCount < commodityDetail.minOrder) {
message.destroy()
message.info("库存不足")
return
}
if (clickFlag) {
clickFlag = false
......
......@@ -73,9 +73,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
case LAYOUT_TYPE.shop:
return `/shop/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&shopId=${shopUrlParam}`
case LAYOUT_TYPE.channel:
return `${GlobalConfig.channelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&id=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `${GlobalConfig.ichannelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&id=${shopUrlParam}`
return `${GlobalConfig.ichannelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&channelId=${shopUrlParam}`
default:
return `/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}`
}
......@@ -86,9 +86,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
case LAYOUT_TYPE.shop:
return `/shop/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&shopId=${shopUrlParam}`
case LAYOUT_TYPE.channel:
return `${GlobalConfig.channelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&id=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `${GlobalConfig.ichannelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&id=${shopUrlParam}`
return `${GlobalConfig.ichannelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&channelId=${shopUrlParam}`
default:
return `/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}`
}
......
import React from 'react'
import { ToTopOutlined } from '@ant-design/icons'
import { Anchor, BackTop } from 'antd'
import qrcodeImg from '@/assets/imgs/erweima.png'
import { LAYOUT_TYPE } from '@/constants'
import './index.less'
interface FloorAnchorPropsType {
......@@ -17,7 +17,7 @@ const FloorAnchor: React.FC<FloorAnchorPropsType> = (props) => {
<div className="anchor_wrap">
<Anchor className="anchor" offsetTop={120} >
{
type === 'shop' && <Anchor.Link href={`#about_us`} title="关于我们" />
type === LAYOUT_TYPE.shop && <Anchor.Link href={`#about_us`} title="关于我们" />
}
{
anchorList.map(item => (
......@@ -27,6 +27,9 @@ const FloorAnchor: React.FC<FloorAnchorPropsType> = (props) => {
{
type === 'mall' && <Anchor.Link href={`#find_more`} title="发现更多" />
}
{
(type === LAYOUT_TYPE.channel || type === LAYOUT_TYPE.ichannel) && <Anchor.Link href={`#about_us`} title="关于我们" />
}
<BackTop>
<ToTopOutlined />
<span className="text">顶部</span>
......
......@@ -13,11 +13,12 @@ import styles from './index.less'
interface MallIndexPropsType {
SiteStore?: any;
mallInfo: any
mallInfo: any;
layoutType: LAYOUT_TYPE
}
const MallIndex: React.FC<MallIndexPropsType> = (props) => {
const { mallInfo } = props
const { mallInfo, layoutType } = props
const [categoryList, setCategoryList] = useState<GetTemplatePlatformFindAllFirstCategoryResponse>([])
const { mallTemplateId } = props.SiteStore
const [firstAdvertList, setFirstAdvertList] = useState([])
......@@ -145,7 +146,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
{
useMemo(() => <Advert type="banner" advertList={firstAdvertList} hasQuickNav={true} ><QuickNav name={mallInfo.name} /></Advert>, [firstAdvertList])
}
<FloorAnchor anchorList={categoryList} type="mall" />
<FloorAnchor anchorList={categoryList} type={LAYOUT_TYPE.mall} />
{
secondAdvertList ? useMemo(() => {
if (secondAdvertList.length > 0) {
......
......@@ -15,6 +15,7 @@ import styles from './index.less'
import { PublicApi } from '@/services/api'
import SignModal from '@/components/SignModal'
import { isEmpty } from 'lodash'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE } from '@/constants'
......@@ -23,12 +24,13 @@ interface OrderPropsType {
shopInfo: any;
mallInfo: any;
layoutType: LAYOUT_TYPE;
shopUrlParam: string;
}
const Order: React.FC<OrderPropsType> = (props) => {
let checkoutCount = 0
const userInfo = getAuth()
const { shopInfo, mallInfo, layoutType, } = props
const { shopInfo, mallInfo, layoutType, shopUrlParam } = props
const { query: { type = COMMODITY_TYPE.prompt } } = props.location
const [signModalVisible, setSignModalVisible] = useState<boolean>(false)
const { spam_id } = props.location.query
......@@ -310,9 +312,9 @@ const Order: React.FC<OrderPropsType> = (props) => {
if (res.code === 1000) {
const data = res.data
if (selectPayWay.payType === 4) {
history.replace(`/pay/result?orderId=${data.orderId}`)
linkToUrl(`/pay/result?orderId=${data.orderId}`)
} else {
history.replace(`/pay?orderId=${data.orderId}&spam_id=${spam_id}`)
linkToUrl(`/pay?orderId=${data.orderId}&spam_id=${spam_id}`)
}
}
setConfirmLoading(false)
......@@ -321,6 +323,21 @@ const Order: React.FC<OrderPropsType> = (props) => {
})
}
const linkToUrl = (path: string) => {
switch(layoutType) {
case LAYOUT_TYPE.channel:
history.replace(`${GlobalConfig.channelRootRoute}${path}?channelId=${shopUrlParam}`)
break
case LAYOUT_TYPE.ichannel:
history.replace(`${GlobalConfig.ichannelRootRoute}${path}?channelId=${shopUrlParam}`)
break
default:
history.replace(`${path}?channelId=${shopUrlParam}`)
break
}
}
const checkOrder = () => {
message.destroy()
if (orderInfo.logistics.deliveryType === 1 && !selectAddressInfo) {
......
......@@ -48,6 +48,7 @@
.pay_btn {
display: block;
width: 160px;
text-align: center;
color: #FFF;
......
......@@ -7,6 +7,8 @@ import { GetMemberSecurityGetResponse } from '@/services/MemberApi'
import { history } from 'umi'
import PasswordInput from '../passwordInput'
import { numFormat } from '@/utils/numberFomat'
import { linkToUrl } from '../../utils'
import { LAYOUT_TYPE } from '@/constants'
import styles from './index.less'
import { message, Button, Spin } from 'antd'
......@@ -14,11 +16,13 @@ interface CreditPayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
}
const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
const { payInfo, orderId, orderInfo } = props
const { payInfo, orderId, orderInfo, layoutType, shopUrlParam } = props
const [payPassword, setPayPassword] = useState<string>('')
const [type, setType] = useState<string>('normal') // normal: 普通;member:会员
const [creditInfo, setCreditInfo] = useState<GetPayCreditGetCreditResponse>()
......@@ -84,6 +88,7 @@ const CreditPayWay: React.FC<CreditPayWayPropsType> = (props) => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam )
history.replace(`/pay/result?orderId=${orderId}`)
} else {
setConfirmLoading(false)
......
......@@ -6,7 +6,8 @@ import { history } from 'umi'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface'
import { priceFormat } from '@/utils/numberFomat'
import { UPLOAD_TYPE } from '@/constants'
import { UPLOAD_TYPE, LAYOUT_TYPE } from '@/constants'
import { linkToUrl } from '../../utils'
import styles from './index.less'
const { Dragger } = Upload
......@@ -14,11 +15,13 @@ const { Dragger } = Upload
interface TransferPayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse
orderId: number,
onChange: Function
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
}
const TransferPayWay: React.FC<TransferPayWayPropsType> = (props) => {
const { payInfo, orderId, onChange } = props
const { payInfo, orderId, onChange, layoutType, shopUrlParam } = props
const [loading, setLoading] = useState<boolean>(false)
const [payOrderUrl, setPayOrderUrls] = useState<string>()
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
......@@ -77,7 +80,7 @@ const TransferPayWay: React.FC<TransferPayWayPropsType> = (props) => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
history.push(`/pay/result?orderId=${orderId}`)
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
setConfirmLoading(false)
onChange(false)
......
......@@ -49,7 +49,7 @@ const getPayTypeTitle = (type) => {
}
const PayPage: React.FC<PayPagePropsType> = (props) => {
const { shopInfo, mallInfo, layoutType, } = props
const { shopInfo, mallInfo, layoutType } = props
const [payState, setPayState] = useState<boolean>(false)
const { orderId, spam_id } = props.location.query
const [pageTitle, setPageTitle] = useState<string>()
......@@ -105,17 +105,18 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
case PayWayType.balance:
return <BablancePayWay />
case PayWayType.credit:
return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} />
return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.wechat:
return <WechatPayWay />
case PayWayType.bank:
return <BankPayWay />
case PayWayType.transfer:
return <TransferPayWay payInfo={payInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} />
return <TransferPayWay payInfo={payInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
default:
return null
}
}
const backHome = () => {
window.location.href = '/'
}
......
import { GlobalConfig } from '@/global/config'
import { history } from 'umi'
import { LAYOUT_TYPE } from '@/constants'
export const linkToUrl = (path: string, layoutType, shopUrlParam) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
history.replace(`${GlobalConfig.channelRootRoute}${path}?channelId=${shopUrlParam}`)
break
case LAYOUT_TYPE.ichannel:
history.replace(`${GlobalConfig.ichannelRootRoute}${path}?channelId=${shopUrlParam}`)
break
default:
history.replace(`${path}?channelId=${shopUrlParam}`)
break
}
}
\ No newline at end of file
......@@ -138,7 +138,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
useMemo(() => <Advert type="banner" visible={firstAdvertList.length > 0} advertList={firstAdvertList} hasQuickNav={false} />, [firstAdvertList])
}
</div>
<FloorAnchor anchorList={categoryList} type="shop" />
<FloorAnchor anchorList={categoryList} type={LAYOUT_TYPE.shop} />
<CommonTitle title="关于我们" type="primary" />
<AboutUs shopInfo={shopInfo} shopUrlParam={shopUrlParam} type={LAYOUT_TYPE.shop} />
<CommonTitle title="热销商品" type="primary" />
......@@ -146,7 +146,6 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
categoryComponents ? categoryComponents : loading ? <FloorSkeleton type={LAYOUT_TYPE.shop} /> : null
}
<Advert visible={secondAdvertList.length > 0} type="service" advertList={secondAdvertList} />
{/* <Information /> */}
</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