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

feat: 接口联调

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