Commit 7fa1a4b1 authored by GuanHua's avatar GuanHua

fix: 修复代客进货单下单选择是自营商城时,商城id不对的问题

parent 6141615e
...@@ -12,7 +12,7 @@ import { getTemplateWebMemberShopWebFindCurrMemberShop } from "@/services/Templa ...@@ -12,7 +12,7 @@ import { getTemplateWebMemberShopWebFindCurrMemberShop } from "@/services/Templa
/* /*
* @Author: GHua * @Author: GHua
* @Date: 2022-03-30 17:27:01 * @Date: 2022-03-30 17:27:01
* @LastEditTime: 2022-04-08 17:18:28 * @LastEditTime: 2022-04-12 16:27:17
* @LastEditors: GHua * @LastEditors: GHua
* @Description: * @Description:
*/ */
...@@ -61,8 +61,10 @@ const useAgentInfo = (props?: UseAgentInfoProps): UseAgentInfoRes => { ...@@ -61,8 +61,10 @@ const useAgentInfo = (props?: UseAgentInfoProps): UseAgentInfoRes => {
switch (action.type) { switch (action.type) {
case 'update': case 'update':
sessionStorage.setItem(AGENT_ORDER_KEY, JSON.stringify(action.payload)) sessionStorage.setItem(AGENT_ORDER_KEY, JSON.stringify(action.payload))
state.agentOrderInfo = action.payload return {
return state ...state,
agentOrderInfo: action.payload
}
default: default:
throw new Error(); throw new Error();
} }
......
/* /*
* @Author: GHua * @Author: GHua
* @Date: 2022-03-29 17:42:11 * @Date: 2022-03-29 17:42:11
* @LastEditTime: 2022-04-08 17:19:39 * @LastEditTime: 2022-04-12 16:27:54
* @LastEditors: GHua * @LastEditors: GHua
* @Description: 代客下单(进货单下单) * @Description: 代客下单(进货单下单)
*/ */
...@@ -18,7 +18,7 @@ import { getAuth } from '@/utils/auth' ...@@ -18,7 +18,7 @@ import { getAuth } from '@/utils/auth'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import styles from './index.less' import styles from './index.less'
import { MallItemType, MemberItemType, OptionType } from './types' import { MallItemType, MemberItemType, OptionType } from './types'
import useAgentInfo from './hooks/useAgentInfo' import useAgentInfo, { AGENT_ORDER_KEY } from './hooks/useAgentInfo'
const { Link } = Anchor; const { Link } = Anchor;
...@@ -111,6 +111,14 @@ const AgentPurchaseOrder: React.FC = () => { ...@@ -111,6 +111,14 @@ const AgentPurchaseOrder: React.FC = () => {
setSelectMember(options) setSelectMember(options)
}; };
const waitMini = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true)
}, 200);
})
}
const handleNextStep = async () => { const handleNextStep = async () => {
if (!selectMall) { if (!selectMall) {
message.error(intl.formatMessage({ id: 'agentOrder.selectMall.required', defaultMessage: '请选择需要下单的商城'})) message.error(intl.formatMessage({ id: 'agentOrder.selectMall.required', defaultMessage: '请选择需要下单的商城'}))
...@@ -129,11 +137,11 @@ const AgentPurchaseOrder: React.FC = () => { ...@@ -129,11 +137,11 @@ const AgentPurchaseOrder: React.FC = () => {
setBtnLoading(false) setBtnLoading(false)
return return
} }
} else {
await waitMini()
} }
dispatch({ const mallInfo = {
type: 'update',
payload: {
shopId: selectMall.id, shopId: selectMall.id,
shopName: selectMall.name, shopName: selectMall.name,
type: selectMall.type, type: selectMall.type,
...@@ -149,6 +157,10 @@ const AgentPurchaseOrder: React.FC = () => { ...@@ -149,6 +157,10 @@ const AgentPurchaseOrder: React.FC = () => {
memberLevel: selectMember.level, memberLevel: selectMember.level,
storeId, storeId,
} }
dispatch({
type: 'update',
payload: mallInfo
}) })
history.push(`/memberCenter/order/saleOrder/agentPurchaseOrder/commodity`) history.push(`/memberCenter/order/saleOrder/agentPurchaseOrder/commodity`)
setBtnLoading(false) setBtnLoading(false)
......
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