Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
孙凯
7 years ago
Commit
e0c0211c6b05059d0229a29c7138efd20f587d4f
1 parent
48ef7aa9
更新 bug review by hongmo
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
20 deletions
js/recorder/components/browse/Browse.ios.js
js/recorder/components/browse/Browse.js
js/recorder/reducers/browse/browseActions.js
js/recorder/reducers/browse/browseReducer.js
js/recorder/components/browse/Browse.ios.js
View file @
e0c0211
...
...
@@ -107,7 +107,7 @@ export default class Browse extends Component {
let
{
isFetching
,
productList
,
categoryList
,
selectedCategoryIndex
,
isDeleting
,
showEmpty
,
currentPage
,
page_total
}
=
this
.
props
.
data
;
let
isLoading
=
(
productList
.
size
==
0
&&
isFetching
)
||
isDeleting
;
let
isLoading
=
(
productList
.
size
==
0
&&
isFetching
);
let
showList
=
!
isFetching
&&
productList
.
size
>
0
;
let
isLoadingMore
=
isFetching
&&
currentPage
>
0
;
return
(
...
...
js/recorder/components/browse/Browse.js
View file @
e0c0211
...
...
@@ -133,7 +133,7 @@ export default class Browse extends Component {
let
{
isFetching
,
productList
,
categoryList
,
selectedCategoryIndex
,
isDeleting
,
showEmpty
,
currentPage
,
page_total
}
=
this
.
props
.
data
;
let
isLoading
=
(
productList
.
size
==
0
&&
isFetching
)
||
isDeleting
;
let
isLoading
=
(
productList
.
size
==
0
&&
isFetching
);
let
isLoadingMore
=
isFetching
&&
currentPage
>
0
;
let
showList
=
!
isFetching
&&
productList
.
size
>
0
;
return
(
...
...
js/recorder/reducers/browse/browseActions.js
View file @
e0c0211
...
...
@@ -144,7 +144,7 @@ export function historyList(category_id) {
}
else
if
(
newproductList
.
length
){
productList
=
newproductList
;
}
dispatch
(
historyListSuccess
({
currentPage
,
page_total
,
productList
}));
let
show
=
productList
.
length
>
0
;
ReactNative
.
NativeModules
.
YH_RecorderHelper
.
setRightClearButtonVisiblity
(
show
);
...
...
@@ -217,11 +217,11 @@ export function deleteOneHistory(skn, index) {
if
(
indexInAll
!=
-
1
)
{
productList
=
productList
.
delete
(
indexInAll
);
}
if
(
productList
.
size
==
0
||
productList
.
length
==
0
)
{
dispatch
(
historySortList
());
}
else
{
// if (productList.size == 0 || productList.length == 0) {
// dispatch(historySortList());
// }else {
dispatch
(
historyDeleteSuccess
({
productList
}));
}
//
}
let
show
=
productList
.
size
>
0
;
ReactNative
.
NativeModules
.
YH_RecorderHelper
.
setRightClearButtonVisiblity
(
show
);
...
...
@@ -256,10 +256,9 @@ export function historyClearRequest() {
};
}
export
function
historyClearSuccess
(
json
)
{
export
function
historyClearSuccess
()
{
return
{
type
:
HISTORY_CLEAR_SUCCESS
,
payload
:
json
};
}
...
...
@@ -287,9 +286,9 @@ export function clearHistory(selectedProducts) {
dispatch
(
historyClearRequest
());
return
new
BrowseService
(
app
.
host
).
deleteHistory
(
skns
,
uid
,
sourcePage
)
.
then
(
json
=>
{
dispatch
(
historySortList
());
dispatch
(
historyList
(
0
));
dispatch
({
type
:
HISTORY_CLEAR_SUCCESS
});
// dispatch(historySortList());
// dispatch(historyList(0));
dispatch
(
historyClearSuccess
());
})
.
catch
(
error
=>
{
dispatch
(
historyClearFailure
(
error
));
...
...
@@ -314,4 +313,3 @@ export function clearHistory(selectedProducts) {
});
};
}
...
...
js/recorder/reducers/browse/browseReducer.js
View file @
e0c0211
...
...
@@ -54,7 +54,7 @@ export default function browseReducer(state=initialState, action) {
return
newState
;
}
case
HISTORY_LIST_FAILURE
:
case
HISTORY_LIST_FAILURE
:
case
HISTORY_SORT_LIST_FAILURE
:
{
return
state
.
set
(
'isFetching'
,
false
)
.
set
(
'error'
,
action
.
payload
);
...
...
@@ -78,9 +78,14 @@ export default function browseReducer(state=initialState, action) {
}
case
HISTORY_DELETE_SUCCESS
:
{
let
{
productList
,
selectedProductList
}
=
action
.
payload
;
let
{
productList
}
=
action
.
payload
;
let
showEmpty
=
productList
.
size
==
0
;
return
state
.
set
(
'isDeleting'
,
false
);
console
.
log
(
showEmpty
);
return
state
.
set
(
'isDeleting'
,
false
)
.
set
(
'productList'
,
productList
)
.
set
(
'showEmpty'
,
showEmpty
);
}
case
HISTORY_DELETE_FAILURE
:
...
...
@@ -90,12 +95,12 @@ export default function browseReducer(state=initialState, action) {
case
HISTORY_CLEAR_SUCCESS
:
{
let
{
productList
,
categoryList
,
index
}
=
action
.
payload
;
let
show
=
productList
.
length
==
0
;
return
state
.
set
(
'isDeleting'
,
false
);
return
state
.
set
(
'isDeleting'
,
false
)
.
set
(
'productList'
,
Immutable
.
fromJS
([]))
.
set
(
'categoryList'
,
Immutable
.
fromJS
([]))
.
set
(
'showEmpty'
,
true
);
}
}
return
state
;
}
...
...
Please
register
or
login
to post a comment