Commit 044fa59a authored by 张子雨's avatar 张子雨

feat: 接口联调

parent 04f973cc
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'xyqb'; const environment = 'sc';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
...@@ -19,52 +19,17 @@ const StoreManagement = () => { ...@@ -19,52 +19,17 @@ const StoreManagement = () => {
page: 1, page: 1,
size: 10, size: 10,
}); });
const optionData = [
{
value: 'jack',
label: '1',
},
{
value: 'lucy',
label: '2',
},
{
value: 'tom',
label: '3',
},
];
const [searchForm, setSearchForm] = useState({}); const [searchForm, setSearchForm] = useState({});
const formRef = useRef(null); const formRef = useRef(null);
const [editVisible, setEditVisible] = useState(false); const [editVisible, setEditVisible] = useState(false);
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);
const [repastType, setRepastType] = useState([]); const [repastType, setRepastType] = useState([]);
const [repastId, setRepastId] = useState(null); const [repastId, setRepastId] = useState(null);
const [enterpriseList, setEnterpriseList] = useState(optionData); const [enterpriseList, setEnterpriseList] = useState();
const [firstEnterprise, setFirstEnterprise] = useState(''); const [firstEnterprise, setFirstEnterprise] = useState('');
const [enterprise, setEnterprise] = useState({}); const [enterprise, setEnterprise] = useState({});
const [dataList, setDataList] = useState([]); const [dataList, setDataList] = useState([]);
const [name, setName] = useState(''); const [name, setName] = useState('');
const data = [
{
enterpriseId: '企业id',
id: '1',
shopId: 'shopId',
shopName: '店铺名称',
mealType: [1, 2],
pickselfName: ['1', '1111'],
updatedBy: '修改人名称',
amount: '2023/03/21 14:06:11',
},
{
enterpriseId: '企业id',
id: '2',
shopId: 'shopId',
shopName: '店铺名称',
mealType: [1, 2],
updatedBy: '修改人名称',
pickselfName: ['xxx', '1111'],
},
];
const shopList = async () => { const shopList = async () => {
const params = { const params = {
...@@ -79,21 +44,19 @@ const StoreManagement = () => { ...@@ -79,21 +44,19 @@ const StoreManagement = () => {
// 企业查询 // 企业查询
const getEnterpriseList = async () => { const getEnterpriseList = async () => {
// const res = await apiEnterpriseList(); const res = await apiEnterpriseList();
// if (res.businessCode === '0000' && res.data?.records?.length) { if (res.businessCode === '0000' && res.data?.records?.length) {
// const list = res.data.records; const list = res.data.records;
// const firstOption = list[0].id; const firstOption = list[0].id;
// const optionData = list.map(item => ({ const optionData = list.map(item => ({
// value: item.id, value: item.id,
// label: item.name, label: item.name,
// })); }));
// setFirstEnterprise(firstOption); setFirstEnterprise(firstOption);
// setEnterpriseList(optionData); setEnterpriseList(optionData);
// setSearchForm({ enterpriseId: firstOption }); setSearchForm({ enterpriseId: firstOption });
// shopList(); shopList();
// } }
setSearchForm({ enterpriseId: 'jack' });
setFirstEnterprise('jack');
}; };
useEffect(() => { useEffect(() => {
getEnterpriseList(); getEnterpriseList();
...@@ -242,7 +205,7 @@ const StoreManagement = () => { ...@@ -242,7 +205,7 @@ const StoreManagement = () => {
</Card> </Card>
<Table <Table
columns={columns(res)} columns={columns(res)}
dataSource={data} dataSource={dataList}
rowKey={r => r.appealNo} rowKey={r => r.appealNo}
bordered bordered
onChange={handleTableChange} onChange={handleTableChange}
......
...@@ -50,7 +50,7 @@ export const shopAdd = async params => { ...@@ -50,7 +50,7 @@ export const shopAdd = async params => {
// 企业店铺]-修改餐品类型 // 企业店铺]-修改餐品类型
// http://yapi.quantgroups.com/project/389/interface/api/65309 // http://yapi.quantgroups.com/project/389/interface/api/65309
export const apiShopUpdate = async params => { export const apiShopUpdate = async params => {
const data = await request.post('/v1/channels/enterprise/shop/update', { const data = await request.post('/api/consoles/enterprise/shop/update', {
prefix: goodsApi, prefix: goodsApi,
data: params, data: params,
}); });
......
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