Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
Europa-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dfcc7742
authored
Jan 08, 2025
by
肖康
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
supplier
parent
7165f187
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
22 deletions
configReact.tsx
pages/search/[keyword].tsx
configReact.tsx
View file @
dfcc7742
const
os
=
require
(
'os'
);
export
const
QQURL
=
'https://wpa.qq.com/msgrd?v=3&uin=1908059998&site=qq&menu=yes'
export
const
API_URL
=
((
os
.
hostname
()
==
"MS-NDPSTQVAWPAX"
||
os
.
hostname
()
==
"dev235"
||
os
.
hostname
()
==
"localhost"
||
os
.
hostname
()
==
"erpweb.liexindev.com"
)?
'http://erpweb.liexindev.net'
:
'http://api.chiplinks.net'
)
console
.
log
(
os
.
hostname
(),
API_URL
)
pages/search/[keyword].tsx
View file @
dfcc7742
...
...
@@ -63,26 +63,7 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
};
},
[]);
const
getSlideSupplierInit
=
(
datasg
:
any
[])
=>
{
let
newSlideSupplier
:
any
=
[]
datasg
.
forEach
((
item
)
=>
{
const
id_
=
String
(
item
.
supplier_id
)
const
name_
=
String
(
item
.
supplier_name
)
newSlideSupplier
=
[...
newSlideSupplier
,
{
id
:
id_
,
value
:
name_
,
checked
:
false
}]
})
let
uniqueBrand
=
newSlideSupplier
.
reduce
((
acc
:
any
,
current
:
any
)
=>
{
if
(
!
acc
.
some
((
item
:
any
)
=>
item
.
id
===
current
.
id
))
{
if
(
current
.
value
)
{
acc
.
push
(
current
);
}
}
return
acc
;
},
[]);
if
(
uniqueBrand
.
length
>
0
)
{
uniqueBrand
[
0
].
checked
=
true
}
return
uniqueBrand
}
useEffect
(()
=>
{
initSupplierList
.
current
=
[]
...
...
@@ -91,6 +72,13 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
getListRequest
({
url
:
'/api/search/goodsSearch'
,
method
:
'post'
,
data
:
{
keyword
:
keyword
,
num
:
num
,
supplier_id
:
supplier_id
,
page
:
1
,
page_size
:
10
}
}).
then
((
res
)
=>
{
requestCount
.
current
=
requestCount
.
current
+
1
if
(
res
?.
code
===
0
)
{
let
arr_
=
res
.
data
||
[]
arr_
.
forEach
(
item
=>
{
(
item
.
data
||
[]).
forEach
(
item1
=>
{
item1
!
.
supplier_name
=
String
(
item
.
supplier_name
||
""
)
item1
.
supplier_id
=
item
.
supplier_id
})
})
initSupplierList
.
current
=
[...
initSupplierList
.
current
,
...(
res
.
data
||
[])]
}
getInitData
()
...
...
@@ -183,7 +171,6 @@ const Page = (props: { cateList: ResponseTypeCateList }) => {
if
(
element
)
{
const
elementTop
=
element
.
offsetTop
;
const
scrollPosition
=
elementTop
-
100
;
console
.
log
(
scrollPosition
)
window
.
scrollTo
({
top
:
scrollPosition
,
behavior
:
'smooth'
...
...
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