Commit a0af7fb6 authored by GuanHua's avatar GuanHua

feat:店铺页面id的获取;微信支付方式支付结果查询

parent f611fc4d
......@@ -112,7 +112,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
return React.cloneElement(child,
{
layoutType: LAYOUT_TYPE.shop,
shopId: query.shopId,
shopId: shopInfo.id,
memberId: query.memberId,
shopUrlParam: shopId,
shopInfo,
......
......@@ -15,8 +15,6 @@
&_imgbox {
padding: 20px;
width: 180px;
height: 180px;
border: 1px solid rgba(245, 245, 245, 1);
&>img {
......
......@@ -4,6 +4,7 @@ import { LAYOUT_TYPE } from '@/constants'
import wechatIcon from '@/assets/imgs/wechat_icon.png'
import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { linkToUrl } from '../../utils'
import { message, Spin } from 'antd'
import QRCode from 'qrcode'
import styles from './index.less'
......@@ -22,7 +23,8 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
const { payInfo, orderId, onChange, orderInfo, layoutType, shopUrlParam } = props
const [wechatPayUrl, setWechatPayUrl] = useState<any>('')
const [pageLoading, setPageLoading] = useState<boolean>(true)
let checkCount = 0
let checkTimer = null
useEffect(() => {
pay()
}, [])
......@@ -49,6 +51,9 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
if(res.code === 1000) {
message.destroy()
generateQrCode(res.data)
setTimeout(() => {
checkPayState()
}, 5000);
}
setPageLoading(false)
// setWechatPayUrl(res.data)
......@@ -58,6 +63,38 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
})
}
const checkPayState = () => {
if (checkCount < 12) {
let param = {
id: Number(orderId),
paymentInformationId: payInfo.paymentInformationId,
payTypeId: payInfo.paymentChannelsId,
}
//@ts-ignore
PublicApi.getOrderPayResultsl(param).then(res => {
const { data, code } = res
if (code === 1000) {
message.destroy()
if (data) {
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
checkCount++
checkTimer = setTimeout(() => {
checkPayState()
}, 5000)
}
} else {
message.error(res.message)
}
})
} else {
clearTimeout(checkTimer)
checkTimer = null
}
}
return (
<Spin spinning={pageLoading}>
<div className={styles.common_title}>
......
......@@ -77,8 +77,8 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
</div>
<div className={styles.shop_list_line}>
<label>以上信息已通过会员认证|</label>
<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>
<Link to={`/shop/about?shopId=${btoa(JSON.stringify({ memberId: item.memberId }))}`} className={styles.shop_list_line_link}>资质证书 &gt;</Link>
<Link to={`/shop/about?shopId=${btoa(JSON.stringify({ memberId: item.memberId }))}`} className={styles.shop_list_line_link}>公司信息 &gt;</Link>
</div>
</div>
<div className={styles.shop_list_goods}>
......
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