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
huangyCode
6 years ago
Commit
8a9aff283b834e86d764ca91ca9d7fd8c7403d9b
1 parent
54f69dcb
砍价列表埋点
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
30 deletions
js/haggle/reducers/haggleListReducer/haggleActions.js
js/haggle/reducers/haggleListReducer/haggleActions.js
View file @
8a9aff2
...
...
@@ -23,8 +23,8 @@ const {
export
function
setSelectedCategoryType
(
index
)
{
return
{
type
:
SET_SELECTED_CATEGORY
,
payload
:
index
type
:
SET_SELECTED_CATEGORY
,
payload
:
index
};
}
...
...
@@ -38,9 +38,9 @@ export function setSelectedCategory(index) {
let
myList
=
myproductList
.
list
?
myproductList
.
list
.
toArray
()
:
[];
if
(
index
==
0
&&
list
.
length
==
0
)
{
dispatch
(
getHaggleProductList
());
}
else
if
(
index
==
1
&&
myList
.
length
==
0
){
dispatch
(
getMyHaggleProductList
());
dispatch
(
getHaggleProductList
());
}
else
if
(
index
==
1
&&
myList
.
length
==
0
)
{
dispatch
(
getMyHaggleProductList
());
}
};
}
...
...
@@ -54,9 +54,9 @@ export function refreshProductList(index) {
});
if
(
index
==
0
)
{
dispatch
(
getHaggleProductList
());
}
else
if
(
index
==
1
){
dispatch
(
getMyHaggleProductList
());
dispatch
(
getHaggleProductList
());
}
else
if
(
index
==
1
)
{
dispatch
(
getMyHaggleProductList
());
}
};
...
...
@@ -114,6 +114,7 @@ export function myHaggleProductListFailure(error) {
payload
:
error
};
}
export
function
getResourceRequest
()
{
return
{
type
:
RESOURCE_INFO_REQUEST
,
...
...
@@ -210,25 +211,25 @@ export function getMyHaggleProductList() {
};
ReactNative
.
NativeModules
.
YH_CommonHelper
.
uid
()
.
then
(
uid
=>
{
fetchMyHaggleProductList
(
uid
);
})
.
catch
(
error
=>
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
login
()
.
then
(
uid
=>
{
.
then
(
uid
=>
{
fetchMyHaggleProductList
(
uid
);
})
.
catch
(
error
=>
{
})
.
catch
(
error
=>
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
login
()
.
then
(
uid
=>
{
fetchMyHaggleProductList
(
uid
);
})
.
catch
(
error
=>
{
});
});
});
});
};
}
function
exposeProductListData
(
json
)
{
let
res
=
json
;
try
{
try
{
let
list
=
json
?
json
.
list
:
[];
if
(
!
list
)
{
return
json
;
...
...
@@ -242,14 +243,16 @@ function exposeProductListData(json) {
let
inFloorIndex
=
parseInt
(
i
)
+
1
+
json
.
page_size
*
(
json
.
page
-
1
)
+
''
;
item
.
yh_exposureData
=
{
P_NAME
:
pageName
,
P_PARAM
:
item
.
activityId
,
P_PARAM
:
item
.
activityId
,
I_INDEX
:
inFloorIndex
,
PRD_SKN
:
item
.
productSkn
,
PRD_CHANNEL
:
item
.
productType
?
"UFO"
:
""
,
exposureEnd
:
1
};
}
res
.
list
=
list
;
}
catch
(
error
){}
}
catch
(
error
)
{
}
return
res
;
}
...
...
@@ -260,9 +263,9 @@ export function getHaggleStatus(productSkn, activityId, callBack) {
let
fetchHaggleStatus
=
(
uid
)
=>
{
return
new
haggleService
(
app
.
host
).
fetcheProductHaggleStatus
(
uid
,
activityId
,
productSkn
)
.
then
(
json
=>
{
let
payload
=
json
;
dispatch
(
haggleStatusSuccess
(
payload
));
callBack
&&
typeof
callBack
===
'function'
&&
callBack
(
payload
)
let
payload
=
json
;
dispatch
(
haggleStatusSuccess
(
payload
));
callBack
&&
typeof
callBack
===
'function'
&&
callBack
(
payload
)
})
.
catch
(
error
=>
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
showToast
(
error
.
message
||
'网络请求失败'
)
...
...
@@ -271,15 +274,15 @@ export function getHaggleStatus(productSkn, activityId, callBack) {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
uid
()
.
then
(
uid
=>
{
fetchHaggleStatus
(
uid
)
fetchHaggleStatus
(
uid
)
})
.
catch
(
error
=>
{
ReactNative
.
NativeModules
.
YH_CommonHelper
.
login
()
.
then
(
uid
=>
{
fetchHaggleStatus
(
uid
)
})
.
catch
(
error
=>
{
});
.
then
(
uid
=>
{
fetchHaggleStatus
(
uid
)
})
.
catch
(
error
=>
{
});
});
};
...
...
Please
register
or
login
to post a comment