Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
826f0972
Commit
826f0972
authored
Jun 12, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加接口前缀
parent
ad5992ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
12 deletions
+36
-12
env.config.js
config/env.config.js
+6
-1
index.js
src/pages/businessGoods/service/index.js
+11
-3
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+6
-6
takeawayGoodsInfo.jsx
src/pages/businessGoods/takeawayGoodsInfo.jsx
+13
-2
No files found.
config/env.config.js
View file @
826f0972
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
'
;
// 从tob进入的判断接口前缀
const
apiPrefix
=
sessionStorage
.
get
(
'
role
'
)
===
'
platform
'
?
'
/api/consoles
'
:
'
/api/merchants
'
;
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`
,
...
@@ -12,6 +14,7 @@ const envAPi = {
...
@@ -12,6 +14,7 @@ const envAPi = {
opapiHost
:
`https://gw.yxmie.com`
,
opapiHost
:
`https://gw.yxmie.com`
,
wsApi
:
`wss://push-
${
environment
}
.liangkebang.net`
,
wsApi
:
`wss://push-
${
environment
}
.liangkebang.net`
,
msgApi
:
`https://msgapi-
${
environment
}
.liangkebang.net`
,
msgApi
:
`https://msgapi-
${
environment
}
.liangkebang.net`
,
apiPrefix
,
};
};
const
prodApi
=
{
const
prodApi
=
{
...
@@ -29,6 +32,7 @@ const prodApi = {
...
@@ -29,6 +32,7 @@ const prodApi = {
querysApi
:
'
https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement
'
,
querysApi
:
'
https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
apiPrefix
,
};
};
const
preProdApi
=
{
const
preProdApi
=
{
...
@@ -42,6 +46,7 @@ const preProdApi = {
...
@@ -42,6 +46,7 @@ const preProdApi = {
querysApi
:
'
https://sc-settlement-api.q-gp.com
'
,
querysApi
:
'
https://sc-settlement-api.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
apiPrefix
,
};
};
let
exportApi
=
envAPi
;
let
exportApi
=
envAPi
;
...
...
src/pages/businessGoods/service/index.js
View file @
826f0972
import
request
from
'
@/utils/request
'
;
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
import
config
from
'
@/../config/env.config
'
;
const
{
kdspApi
,
goodsApi
}
=
config
;
const
{
kdspApi
,
goodsApi
,
apiPrefix
}
=
config
;
/**
/**
* 获取企业外卖商品列表
* 获取企业外卖商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
*/
export
async
function
apiTakeawayList
(
param
)
{
export
async
function
apiTakeawayList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/pageList
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/main/pageList`
,
{
data
:
param
,
data
:
param
,
prefix
:
goodsApi
,
prefix
:
goodsApi
,
});
});
...
@@ -73,6 +72,15 @@ export async function apiMealInfoDel(param) {
...
@@ -73,6 +72,15 @@ export async function apiMealInfoDel(param) {
prefix
:
goodsApi
,
prefix
:
goodsApi
,
});
});
}
}
/**
* 企业团餐->查询自提点列表
* http://yapi.quantgroups.com/project/389/interface/api/65494
*/
export
async
function
apiPickSelfList
()
{
return
request
.
get
(
'
/api/consoles/selfPickUpLocation/list
'
,
{
prefix
:
goodsApi
,
});
}
/**
/**
* 企业团餐->根据企业ID查询已选择自提点
* 企业团餐->根据企业ID查询已选择自提点
* http://yapi.quantgroups.com/project/389/interface/api/65449
* http://yapi.quantgroups.com/project/389/interface/api/65449
...
...
src/pages/businessGoods/takeawayGoods.jsx
View file @
826f0972
...
@@ -33,12 +33,12 @@ const TakeawayGoods = () => {
...
@@ -33,12 +33,12 @@ const TakeawayGoods = () => {
if
(
params
.
enterpriseId
&&
params
.
enterpriseId
!==
enterpriseId
)
{
if
(
params
.
enterpriseId
&&
params
.
enterpriseId
!==
enterpriseId
)
{
setEnterpriseId
(
params
.
enterpriseId
);
setEnterpriseId
(
params
.
enterpriseId
);
}
}
//
const data = {
const
data
=
{
//
page: params.current,
page
:
params
.
current
,
//
size: params.pageSize,
size
:
params
.
pageSize
,
//
data: params,
data
:
params
,
//
};
};
//
return apiTakeawayList(data);
return
apiTakeawayList
(
data
);
};
};
const
onDel
=
async
id
=>
{
const
onDel
=
async
id
=>
{
await
apiMealInfoDel
({
await
apiMealInfoDel
({
...
...
src/pages/businessGoods/takeawayGoodsInfo.jsx
View file @
826f0972
...
@@ -6,7 +6,7 @@ import { GoodsInfoColumn } from './staticData/goods';
...
@@ -6,7 +6,7 @@ import { GoodsInfoColumn } from './staticData/goods';
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
SelectGoodsModal
from
'
./components/SelectGoodsModal
'
;
import
SelectGoodsModal
from
'
./components/SelectGoodsModal
'
;
import
{
apiSelPickSelfList
,
apiSaveGoodsList
}
from
'
./service
'
;
import
{
apiSelPickSelfList
,
api
PickSelfList
,
api
SaveGoodsList
}
from
'
./service
'
;
import
style
from
'
./style/index.less
'
;
import
style
from
'
./style/index.less
'
;
...
@@ -57,10 +57,20 @@ const TakeawayGoodsInfo = props => {
...
@@ -57,10 +57,20 @@ const TakeawayGoodsInfo = props => {
// 根据企业ID获取取餐点
// 根据企业ID获取取餐点
const
getPickSelf
=
async
()
=>
{
const
getPickSelf
=
async
()
=>
{
const
res
=
await
apiPickSelfList
();
setPickSelfList
(
res
.
map
(
item
=>
({
key
:
item
.
pickSelfId
,
label
:
<
span
>
{
item
.
pickSelfName
}
</
span
>,
})),
);
};
// 根据企业ID获取已选取餐点
const
getSelPickSelf
=
async
()
=>
{
const
res
=
await
apiSelPickSelfList
({
const
res
=
await
apiSelPickSelfList
({
enterpriseId
:
id
,
enterpriseId
:
id
,
});
});
set
PickSelfList
(
set
SelPickSelf
(
res
.
map
(
item
=>
({
res
.
map
(
item
=>
({
key
:
item
.
pickSelfId
,
key
:
item
.
pickSelfId
,
label
:
<
span
>
{
item
.
pickSelfName
}
</
span
>,
label
:
<
span
>
{
item
.
pickSelfName
}
</
span
>,
...
@@ -88,6 +98,7 @@ const TakeawayGoodsInfo = props => {
...
@@ -88,6 +98,7 @@ const TakeawayGoodsInfo = props => {
// };
// };
useEffect
(()
=>
{
useEffect
(()
=>
{
getPickSelf
();
getPickSelf
();
getSelPickSelf
();
},
[]);
},
[]);
const
options
=
{
const
options
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment