Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
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
9724c77e
authored
Oct 21, 2022
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
【BUG】全局搜索修复
parent
ffc3374f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
59 deletions
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/module/SearchPage.js
app/containers/selfOrder/module/ChooseProductPage.js
View file @
9724c77e
...
@@ -874,6 +874,7 @@ class ChooseProductPage extends Component {
...
@@ -874,6 +874,7 @@ class ChooseProductPage extends Component {
// if (leftActiveIndex) {
// if (leftActiveIndex) {
return
(
return
(
<
TouchableOpacity
<
TouchableOpacity
activeOpacity
=
{
1
}
onPress
=
{()
=>
{
onPress
=
{()
=>
{
navigation
.
navigate
(
'SearchPage'
,
{
navigation
.
navigate
(
'SearchPage'
,
{
title
:
`选择产品`
,
title
:
`选择产品`
,
...
...
app/containers/selfOrder/module/SearchPage.js
View file @
9724c77e
...
@@ -18,9 +18,9 @@ import LocalVariable from '../../common/LocalVariable'
...
@@ -18,9 +18,9 @@ import LocalVariable from '../../common/LocalVariable'
import
{
reqGlobalSearch
,
reqSingleConsumSearch
,
reqProCategorySearch
}
from
'../../../action/SelfAction'
import
{
reqGlobalSearch
,
reqSingleConsumSearch
,
reqProCategorySearch
}
from
'../../../action/SelfAction'
import
ChooseCardList
from
'../../common/listDataComponent/ChooseCardList'
import
ChooseCardList
from
'../../common/listDataComponent/ChooseCardList'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
// import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import
StatusBarView
from
'../../common/StatusBarView'
import
LoadingModel
from
'../../common/listDataComponent/LoadingModel'
import
LoadingModel
from
'../../common/listDataComponent/LoadingModel'
import
{
Width
}
from
'../../../base/BaseStyle'
import
{
Width
,
home_background_color
,
promary_color
}
from
'../../../base/BaseStyle'
import
{
show
}
from
'../../../utils/Utils'
import
{
show
}
from
'../../../utils/Utils'
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
class
SearchPage
extends
Component
{
class
SearchPage
extends
Component
{
...
@@ -113,10 +113,13 @@ class SearchPage extends Component {
...
@@ -113,10 +113,13 @@ class SearchPage extends Component {
const
{
selfData
,
topProcOptionList
}
=
navigation
.
state
.
params
const
{
selfData
,
topProcOptionList
}
=
navigation
.
state
.
params
const
{
authorizations
}
=
selfData
const
{
authorizations
}
=
selfData
const
productLineCategory
=
authorizations
?.
product_line_category_list
const
productLineCategory
=
R
.
compose
(
?.
map
(
item
=>
item
.
product_line_category_code
)
R
.
join
(
','
),
?.
join
(
','
)
R
.
pluck
(
'product_line_category_code'
),
console
.
log
(
'topProcOptionList'
,
topProcOptionList
[
topActiveIndex
])
R
.
unnest
,
R
.
pluck
(
'product_line_category_list'
),
)(
authorizations
||
[])
const
params
=
{
const
params
=
{
accessToken
:
token
,
accessToken
:
token
,
orgCode
:
selfData
.
org_code
,
orgCode
:
selfData
.
org_code
,
...
@@ -403,66 +406,74 @@ class SearchPage extends Component {
...
@@ -403,66 +406,74 @@ class SearchPage extends Component {
console
.
log
(
'dataList'
,
data
.
item
)
console
.
log
(
'dataList'
,
data
.
item
)
return
(
return
(
<
SafeAreaView
style
=
{
safe_view
}
>
<
View
style
=
{
styles
.
container
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
StatusBarView
isReactStackNavigator
=
{
true
}
backgroundColor
=
{
promary_color
}
barStyle
=
"light-content"
/>
<
View
style
=
{
list_common_item
.
ser_cont
}
>
<
TextInput
placeholder
=
{
'请输入搜索关键词'
}
style
=
{
list_common_item
.
ser_text_input
}
onChangeText
=
{
text
=>
this
.
inputSearchValue
(
text
)}
/
>
<
View
style
=
{
list_common_item
.
ser_btn
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
initData
()
}}
>
<
Text
style
=
{
list_common_item
.
ser_text_btn
}
>
搜索
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
list_common_item
.
ser_img_box
}
>
<
Image
source
=
{
require
(
'../../../images/search_icon.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
/View
>
<
ChooseCardList
cardStyleBox
=
{
styles
.
chooseCardList_box
}
cardScrollEnabled
=
{
true
}
cardHorizontal
=
{
true
}
cardShowsHorizontalScrollIndicator
=
{
false
}
cardStyleListItem
=
{
styles
.
top_inner
}
cardListOptions
=
{
topProcOptionList
}
// cardItemTitle={cur_title}
cardItemIcon
=
{
cur_icon
}
curActIndex
=
{
topActiveIndex
}
cardCallBack
=
{(
item
,
index
)
=>
this
.
handleTopNav
(
item
,
index
)}
cardCountName
=
{
LocalVariable
.
SELECTED_QUQNTITY
}
cardStyleType
=
{
'GRAPHICS'
}
cardCouStyle
=
{
styles
.
top_cot_num
}
cardShowDefIcon
=
{
true
}
/
>
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
onScrollEndDrag
=
{
this
.
onMomentumScrollEnd
}
>
<
View
style
=
{
safe_view
}
>
{
data
.
item
.
length
>
0
&&
(
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
FlatList
<
View
style
=
{
list_common_item
.
ser_cont
}
>
keyExtractor
=
{
item
=>
item
.
id
}
<
TextInput
data
=
{
data
.
item
}
placeholder
=
{
'请输入搜索关键词'
}
extraData
=
{
this
.
state
}
style
=
{
list_common_item
.
ser_text_input
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderContColumnItem
(
item
,
index
)}
onChangeText
=
{
text
=>
this
.
inputSearchValue
(
text
)}
/
>
/
>
)}
<
View
style
=
{
list_common_item
.
ser_btn
}
>
{
data
.
item
.
length
===
data
.
total
&&
data
?.
item
?.
length
>
0
&&
(
<
TouchableOpacity
<
View
>
onPress
=
{()
=>
{
<
Text
style
=
{{
textAlign
:
'center'
,
lineHeight
:
40
}}
>
没有更多数据了
<
/Text
>
this
.
initData
()
}}
>
<
Text
style
=
{
list_common_item
.
ser_text_btn
}
>
搜索
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
)}
<
View
style
=
{
list_common_item
.
ser_img_box
}
>
{
!
data
?.
item
?.
length
&&
<
PicListNoData
/>
}
<
Image
source
=
{
require
(
'../../../images/search_icon.png'
)}
style
=
{
icon_style
}
/
>
<
/ScrollView
>
<
/View
>
<
LoadingModel
ref
=
"LoadingModel"
/>
<
/View
>
<
/SafeAreaView
>
<
ChooseCardList
cardStyleBox
=
{
styles
.
chooseCardList_box
}
cardScrollEnabled
=
{
true
}
cardHorizontal
=
{
true
}
cardShowsHorizontalScrollIndicator
=
{
false
}
cardStyleListItem
=
{
styles
.
top_inner
}
cardListOptions
=
{
topProcOptionList
}
// cardItemTitle={cur_title}
cardItemIcon
=
{
cur_icon
}
curActIndex
=
{
topActiveIndex
}
cardCallBack
=
{(
item
,
index
)
=>
this
.
handleTopNav
(
item
,
index
)}
cardCountName
=
{
LocalVariable
.
SELECTED_QUQNTITY
}
cardStyleType
=
{
'GRAPHICS'
}
cardCouStyle
=
{
styles
.
top_cot_num
}
cardShowDefIcon
=
{
true
}
/
>
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
onScrollEndDrag
=
{
this
.
onMomentumScrollEnd
}
>
{
data
.
item
.
length
>
0
&&
(
<
FlatList
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
data
.
item
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderContColumnItem
(
item
,
index
)}
/
>
)}
{
data
.
item
.
length
===
data
.
total
&&
data
?.
item
?.
length
>
0
&&
(
<
View
>
<
Text
style
=
{{
textAlign
:
'center'
,
lineHeight
:
40
}}
>
没有更多数据了
<
/Text
>
<
/View
>
)}
{
!
data
?.
item
?.
length
&&
<
PicListNoData
/>
}
<
/ScrollView
>
<
LoadingModel
ref
=
"LoadingModel"
/>
<
/View
>
<
/View
>
)
)
}
}
}
}
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
home_background_color
,
},
top_box
:
{
top_box
:
{
width
:
Width
(),
width
:
Width
(),
paddingHorizontal
:
20
,
paddingHorizontal
:
20
,
...
...
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