Commit 7fa1a4b1 authored by GuanHua's avatar GuanHua

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

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