Commit df583036 authored by GuanHua's avatar GuanHua

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

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