Commit df583036 authored by GuanHua's avatar GuanHua

fix: 更换代客下单选择商品和商品详情的接口

parent 0347cbe3
/* /*
* @Author: GHua * @Author: GHua
* @Date: 2022-03-29 17:42:11 * @Date: 2022-03-29 17:42:11
* @LastEditTime: 2022-04-11 10:56:04 * @LastEditTime: 2022-04-13 17:35:11
* @LastEditors: GHua * @LastEditors: Please set LastEditors
* @Description: 代客下单(进货单下单)- 商品列表 * @Description: 代客下单(进货单下单)- 商品列表
*/ */
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
...@@ -24,10 +24,10 @@ import { ...@@ -24,10 +24,10 @@ import {
} from '@linkseeks/lingxi-mall-components' } from '@linkseeks/lingxi-mall-components'
import FilterBar from '../components/FilterBar' import FilterBar from '../components/FilterBar'
import { import {
postSearchShopSelfGetCommodityList, postSearchShopSelfGetCustomerCommodityList,
getSearchShopSelfGetCustomerAttributeByCategoryId, getSearchShopSelfGetCustomerAttributeByCategoryId,
getSearchShopStoreGetCustomerAttributeByCategoryId, getSearchShopStoreGetCustomerAttributeByCategoryId,
postSearchShopStoreGetCommodityList, postSearchShopStoreGetCustomerCommodityList,
} from '@/services/SearchV2Api' } from '@/services/SearchV2Api'
import '@linkseeks/lingxi-mall-components/dist/index.esm.css' import '@linkseeks/lingxi-mall-components/dist/index.esm.css'
import useAgentInfo from '../hooks/useAgentInfo' import useAgentInfo from '../hooks/useAgentInfo'
...@@ -92,7 +92,9 @@ const AgentCommodity: React.FC = () => { ...@@ -92,7 +92,9 @@ const AgentCommodity: React.FC = () => {
pageSize: size ? size : pageSize, pageSize: size ? size : pageSize,
priceTypeList: [1], priceTypeList: [1],
provinceCode: DEFAULT_CITY.provinceCode, provinceCode: DEFAULT_CITY.provinceCode,
cityCode: DEFAULT_CITY.cityCode cityCode: DEFAULT_CITY.cityCode,
customerMemberId: agentPurchaseOrderInfo?.memberId,
customerMemberRoleId: agentPurchaseOrderInfo?.roleId,
} }
if (location.query?.carriageType) { if (location.query?.carriageType) {
...@@ -112,11 +114,11 @@ const AgentCommodity: React.FC = () => { ...@@ -112,11 +114,11 @@ const AgentCommodity: React.FC = () => {
switch (layoutType) { switch (layoutType) {
case LAYOUT_TYPE.mall: case LAYOUT_TYPE.mall:
param.storeId = agentPurchaseOrderInfo?.storeId param.storeId = agentPurchaseOrderInfo?.storeId
postFn = postSearchShopStoreGetCommodityList postFn = postSearchShopStoreGetCustomerCommodityList
break; break;
case LAYOUT_TYPE.own: case LAYOUT_TYPE.own:
param.memberId = userInfo?.memberId param.memberId = userInfo?.memberId
postFn = postSearchShopSelfGetCommodityList postFn = postSearchShopSelfGetCustomerCommodityList
break; break;
default: default:
break; break;
......
...@@ -24,7 +24,7 @@ import isEmpty from 'lodash/isEmpty' ...@@ -24,7 +24,7 @@ import isEmpty from 'lodash/isEmpty'
import IconFont from '@/utils/iconfont' import IconFont from '@/utils/iconfont'
import cx from 'classnames' import cx from 'classnames'
import { import {
getSearchShopStoreGetCommodityDetail, getSearchShopStoreGetCustomerCommodityDetail,
GetSearchShopStoreGetCommodityDetailResponse, GetSearchShopStoreGetCommodityDetailResponse,
PostSearchShopStoreGetCommodityListResponseDetail, PostSearchShopStoreGetCommodityListResponseDetail,
} from "@/services/SearchV2Api"; } from "@/services/SearchV2Api";
...@@ -291,13 +291,15 @@ const CommodityDetail: React.FC = (props: any) => { ...@@ -291,13 +291,15 @@ const CommodityDetail: React.FC = (props: any) => {
const fetchDetail = () => { const fetchDetail = () => {
const params: any = { const params: any = {
commodityId: id, commodityId: id,
customerMemberId: agentPurchaseOrderInfo?.memberId,
customerMemberRoleId: agentPurchaseOrderInfo?.roleId,
} }
let headers: any = { let headers: any = {
type, type,
shopId: mallId, shopId: mallId,
} }
getSearchShopStoreGetCommodityDetail(params, { headers }).then(async (res) => { getSearchShopStoreGetCustomerCommodityDetail(params, { headers }).then(async (res) => {
if (res.code === 1000) { if (res.code === 1000) {
const data = res.data const data = res.data
setErrorInfo(null) setErrorInfo(null)
......
...@@ -10,8 +10,8 @@ import { getMessage } from "../utils" ...@@ -10,8 +10,8 @@ import { getMessage } from "../utils"
/* /*
* @Author: GHua * @Author: GHua
* @Date: 2022-04-02 10:05:25 * @Date: 2022-04-02 10:05:25
* @LastEditTime: 2022-04-07 16:29:29 * @LastEditTime: 2022-04-13 17:26:16
* @LastEditors: GHua * @LastEditors: Please set LastEditors
* @Description: * @Description:
*/ */
interface UsePurchaseOrderProps { interface UsePurchaseOrderProps {
...@@ -42,7 +42,7 @@ interface UsePurchaseOrderReturn { ...@@ -42,7 +42,7 @@ interface UsePurchaseOrderReturn {
} }
const usePurchaseOrder = (props: UsePurchaseOrderProps): UsePurchaseOrderReturn => { const usePurchaseOrder = (props: UsePurchaseOrderProps): UsePurchaseOrderReturn => {
const { customerMemberId, customerMemberRoleId, customerMemberLevel, mallId, orderId } = props const { customerMemberId, customerMemberRoleId, mallId, orderId } = props
const [purchaseCount, setPurchaseCount] = useState<number>(0) const [purchaseCount, setPurchaseCount] = useState<number>(0)
const [purchaseList, setPurchaseList] = useState<any[]>([]) const [purchaseList, setPurchaseList] = useState<any[]>([])
...@@ -111,7 +111,6 @@ const usePurchaseOrder = (props: UsePurchaseOrderProps): UsePurchaseOrderReturn ...@@ -111,7 +111,6 @@ const usePurchaseOrder = (props: UsePurchaseOrderProps): UsePurchaseOrderReturn
const params: any = { const params: any = {
customerMemberId, customerMemberId,
customerMemberRoleId, customerMemberRoleId,
customerMemberLevel,
} }
if (orderId) { if (orderId) {
......
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