Commit 3a1a7b17 authored by 前端-许冠华's avatar 前端-许冠华

Merge branch 'fix-bug' into 'v2-220418'

fix: 修复代客进货单下单选择是自营商城时,商城id不对的问题 See merge request linkseeks-design/pro-platform!227
parents b732aff5 7fa1a4b1
...@@ -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,26 +137,30 @@ const AgentPurchaseOrder: React.FC = () => { ...@@ -129,26 +137,30 @@ const AgentPurchaseOrder: React.FC = () => {
setBtnLoading(false) setBtnLoading(false)
return return
} }
} else {
await waitMini()
}
const mallInfo = {
shopId: selectMall.id,
shopName: selectMall.name,
type: selectMall.type,
isChannel: selectMall.type === 3 || selectMall.type === 4,
environment: selectMall.environment,
property: selectMall.property,
self: selectMall.self,
memberOperate: selectMall.memberOperate,
logoUrl: selectMall.logoUrl,
memberId: selectMember.memberId,
memberName: selectMember.name,
roleId: selectMember.roleId,
memberLevel: selectMember.level,
storeId,
} }
dispatch({ dispatch({
type: 'update', type: 'update',
payload: { payload: mallInfo
shopId: selectMall.id,
shopName: selectMall.name,
type: selectMall.type,
isChannel: selectMall.type === 3 || selectMall.type === 4,
environment: selectMall.environment,
property: selectMall.property,
self: selectMall.self,
memberOperate: selectMall.memberOperate,
logoUrl: selectMall.logoUrl,
memberId: selectMember.memberId,
memberName: selectMember.name,
roleId: selectMember.roleId,
memberLevel: selectMember.level,
storeId,
}
}) })
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