Commit ed5f0b49 authored by GuanHua's avatar GuanHua

fix:下单接口添加传参参数

parent 597c1bae
......@@ -404,7 +404,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
labelAlign="left"
name="customerUrl"
label={<RequireItem label="客服链接" />}
rules={[{ pattern: /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/, message: '请输入正确的客服链接' }]}
rules={[{ pattern: /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?/, message: '请输入正确的客服链接' }]}
>
<Input allowClear className={styles.form_item} />
</Form.Item>
......
......@@ -371,7 +371,13 @@ const CommodityDetail = (props) => {
postFn = PublicApi.postSearchShopPurchaseSaveOrUpdatePurchase
break;
}
PublicApi.postOrderDirectPayment({ productId: selectCommodityId, memberId }).then(res => {
const directParam: any = {
productId: selectCommodityId,
memberId,
shopId
}
PublicApi.postOrderDirectPayment(directParam).then(res => {
if (res.code === 1000) {
message.destroy()
postFn && postFn(param).then(res => {
......@@ -483,8 +489,12 @@ const CommodityDetail = (props) => {
if (clickFlag) {
clickFlag = false
PublicApi.postOrderDirectPayment({ productId: selectCommodityId, memberId }).then(res => {
const param: any = {
productId: selectCommodityId,
memberId,
shopId
}
PublicApi.postOrderDirectPayment(param).then(res => {
if (res.code === 1000) {
message.destroy()
const buyCommodityInfo = {
......
......@@ -35,7 +35,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const [loading, setLoading] = useState<boolean>(true)
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
......@@ -61,7 +61,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
}, [query])
const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
......@@ -73,7 +73,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (shopInfo) {
body.className = shopInfo.channelShopTemplateFileName ? `theme-channel-${shopInfo.channelShopTemplateFileName}` : templateName;
} else {
......
......@@ -35,7 +35,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const [loading, setLoading] = useState<boolean>(true)
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
const { formatMessage } = useIntl();
......@@ -61,7 +61,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
}, [query])
const fetchShopInfo = (memberId) => {
//@ts-ignore
PublicApi.getTemplateChannelFindChannel({ memberId }).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
......@@ -73,7 +73,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (shopInfo) {
body.className = shopInfo.channelOwnShopTemplateFileName ? `theme-channel-${shopInfo.channelOwnShopTemplateFileName}` : templateName;
} else {
......
......@@ -32,7 +32,7 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const [mallInfo, setMallInfo] = useState<any>({})
const getMenuRouter = (routes: any, pathname: any) => {
let list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
const list = routes.filter((item: any) => pathname.indexOf(item.key) > -1)
return list[0] || {}
}
......@@ -50,12 +50,12 @@ const LXMallLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const getWebMallInfo = () => {
const shopInfo = GlobalConfig.web.shopInfo
let webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0]
const webMallInfo = shopInfo.filter(item => item.environment === 1 && item.type === 1)[0]
setMallInfo(webMallInfo)
}
useEffect(() => {
let body = document.getElementsByTagName('body')[0];
const body = document.getElementsByTagName('body')[0];
if (!isEmpty(mallTemplateInfo)) {
body.className = mallTemplateInfo.fileName ? `theme-mall-${mallTemplateInfo.fileName}` : templateName;
} else {
......
......@@ -25,12 +25,13 @@ interface OrderPropsType {
mallInfo: any;
layoutType: LAYOUT_TYPE;
shopUrlParam: string;
shopId: number;
}
const Order: React.FC<OrderPropsType> = (props) => {
let checkoutCount = 0
const userInfo = getAuth()
const { shopInfo, mallInfo, layoutType, shopUrlParam } = props
const { shopInfo, mallInfo, layoutType, shopUrlParam, shopId } = props
const { query: { type = COMMODITY_TYPE.prompt } } = props.location
const [signModalVisible, setSignModalVisible] = useState<boolean>(false)
const { spam_id } = props.location.query
......@@ -266,6 +267,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
const params: any = {
orderModel: getOrderMode(), // 下单模式
needTheInvoice: needTheInvoice ? 1 : 0,
shopId
}
if (orderInfo.logistics.deliveryType === 1 && !!selectAddressInfo) {
......
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