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
yoho-js001
8 years ago
Commit
0f539f97147c94e37d0bd7fe3c425f8b09af0b1c
1 parent
5b98dacd
master
...
6.7.0_0.49
6.7.1_0.49
6.7.4_0.49
6.7.5_0.49
6.8.7_message
6.9.5_msg
6.9.9_invite
V0125_Date
V1115_Date
V1130_Date
V1217_Date
V1230_Date
V6.10.1
V6.10.2
V6.7.9_dev
V6.8.6
V6.8.7
V6.8.7_upgrades
V6.8.9
V6.9.1
V6.9.2
V6.9.3
V6.9.5
V6.9.6
V6.9.6_Alliance
V6.9.7
V6.9.8
V6.9.8_shoudan
V6.9.9
V9.30_Date
exception
feature/rn_update61
gerry/v6.9.14_panicBuying
gerry/v6.9.16_bugfixed
v6.10.0
v6.9.10
v6.9.11
v6.9.12
v6.9.13
v6.9.14
v6.9.16
v6.9.17
v6.9.19
v6.9.20
v6.9.21
v6.9.22
v6.9.24
6.9.8
6.9.7
6.9.6
6.9.4
6.9.2
6.9.1
6.8.9
6.8.8
6.8.4
6.8.3
6.8.2
6.7.9
6.7.8
6.7.7
6.6.4
5.5.1
v6.7.5
v6.7.1
v6.2.0
v6.1.0
v5.6.2
v5.6.0
v5.5.2
v5.5.0
V6.8.6
V6.8.5
V6.8.1
根据修改意见修改部分好货推荐详情。reviewed by redding.
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
60 deletions
js/goodGoodsRecommend/GoodGoodsRecommend.js
js/goodGoodsRecommend/components/detail/Detail.js
js/goodGoodsRecommend/components/detail/Footer.js
js/goodGoodsRecommend/constants/actionTypes.js
js/goodGoodsRecommend/reducers/app/appActions.js
js/goodGoodsRecommend/reducers/app/appInitialState.js
js/goodGoodsRecommend/reducers/app/appReducer.js
js/goodGoodsRecommend/reducers/detail/detailActions.js
js/goodGoodsRecommend/GoodGoodsRecommend.js
View file @
0f539f9
...
...
@@ -25,6 +25,7 @@ import {
setPlatform
,
setHost
,
setServiceHost
,
setSingleHost
,
}
from
'./reducers/app/appActions'
;
import
{
...
...
@@ -49,7 +50,8 @@ export default function native(platform) {
store
.
dispatch
(
setPlatform
(
platform
));
store
.
dispatch
(
setHost
(
this
.
props
.
host
));
store
.
dispatch
(
setServiceHost
(
this
.
props
.
serviceHost
));
store
.
dispatch
(
setSingleHost
(
this
.
props
.
singleHost
));
let
type
=
this
.
props
.
type
;
if
(
type
==
'list'
)
{
return
(
...
...
js/goodGoodsRecommend/components/detail/Detail.js
View file @
0f539f9
...
...
@@ -6,6 +6,7 @@ import LoadingIndicator from '../../../common/components/LoadingIndicator';
import
GoodGoodsImagesView
from
'./GoodGoodsImagesView'
import
ContentCell
from
'./ContentCell'
import
BrandProductListCell
from
'../../../common/components/ListCell/ProductListCell'
;
import
Footer
from
'./Footer'
import
ReactNative
,
{
View
,
...
...
@@ -109,8 +110,7 @@ export default class Detail extends Component {
// //Test
// product_skn = '51148345';
// //
let
fav_image
=
favorite
?
require
(
'../../image/love_tab_ic_h.png'
):
require
(
'../../image/love_tab_ic.png'
);
let
fav_title
=
favorite
?
'已收藏'
:
'收藏'
;
return
(
<
View
style
=
{
styles
.
container
}
>
{
!
isFetching
?
...
...
@@ -122,20 +122,12 @@ export default class Detail extends Component {
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataSource
)}
renderRow
=
{
this
.
renderRow
}
/
>
<
View
style
=
{
styles
.
footer
}
>
<
TouchableOpacity
style
=
{
styles
.
favoriteButton
}
onPress
=
{()
=>
{
this
.
props
.
onPressFavorite
&&
this
.
props
.
onPressFavorite
(
favorite
)}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Image
style
=
{
styles
.
favIcon
}
source
=
{
fav_image
}
/
>
<
Text
style
=
{
styles
.
favText
}
>
{
fav_title
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
detailButton
}
>
<
Text
style
=
{
styles
.
detailButtonText
}
onPress
=
{()
=>
{
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
Immutable
.
fromJS
({
product_skn
}))}}
>
查看详情
<
/Text
>
<
/View
>
<
/View
>
<
Footer
favorite
=
{
favorite
}
onPressFavorite
=
{
this
.
props
.
onPressFavorite
}
onPressProduct
=
{
this
.
props
.
onPressProduct
}
product_skn
=
{
product_skn
}
/
>
<
/View
>
:
<
LoadingIndicator
isVisible
=
{
isFetching
}
...
...
@@ -166,45 +158,4 @@ let styles = StyleSheet.create({
listContainer
:
{
width
:
width
/
2
,
},
footer
:
{
width
:
width
,
height
:
59
,
borderColor
:
'#ededed'
,
borderTopWidth
:
1
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
},
detailButton
:
{
position
:
'absolute'
,
width
:
100
,
height
:
44
,
top
:
7
,
left
:
width
-
15
-
100
,
backgroundColor
:
'#d0021b'
,
borderRadius
:
4
,
alignItems
:
'center'
,
},
detailButtonText
:
{
marginTop
:
4
,
height
:
36
,
color
:
'white'
,
paddingTop
:
10
,
textAlign
:
'center'
,
fontSize
:
15
,
},
favoriteButton
:
{
width
:
100
,
height
:
40
,
},
favIcon
:
{
width
:
17
,
height
:
16
,
marginLeft
:
20
,
marginRight
:
0
,
},
favText
:
{
fontSize
:
13
,
color
:
'#b0b0b0'
,
marginLeft
:
5
,
},
});
...
...
js/goodGoodsRecommend/components/detail/Footer.js
0 → 100644
View file @
0f539f9
'use strict'
;
import
React
,
{
Component
}
from
'react'
;
import
Immutable
,
{
Map
}
from
'immutable'
;
import
ReactNative
,
{
View
,
Text
,
Image
,
ListView
,
StyleSheet
,
Dimensions
,
TouchableOpacity
,
InteractionManager
,
Platform
,
}
from
'react-native'
;
export
default
class
Detail
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
let
fav_image
=
this
.
props
.
favorite
?
require
(
'../../image/love_tab_ic_h.png'
):
require
(
'../../image/love_tab_ic.png'
);
let
fav_title
=
this
.
props
.
favorite
?
'已收藏'
:
'收藏'
;
return
(
<
View
style
=
{
styles
.
footer
}
>
<
TouchableOpacity
style
=
{
styles
.
favoriteButton
}
onPress
=
{()
=>
{
this
.
props
.
onPressFavorite
&&
this
.
props
.
onPressFavorite
(
this
.
props
.
favorite
)}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Image
style
=
{
styles
.
favIcon
}
source
=
{
fav_image
}
/
>
<
Text
style
=
{
styles
.
favText
}
>
{
fav_title
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
detailButton
}
>
<
Text
style
=
{
styles
.
detailButtonText
}
onPress
=
{()
=>
{
this
.
props
.
onPressProduct
&&
this
.
props
.
onPressProduct
(
Immutable
.
fromJS
({
this
.
props
.
product_skn
}))}}
>
查看详情
<
/Text
>
<
/View
>
<
/View
>
);
}
}
let
{
width
,
height
}
=
Dimensions
.
get
(
'window'
);
let
styles
=
StyleSheet
.
create
({
footer
:
{
width
:
width
,
height
:
59
,
borderColor
:
'#ededed'
,
borderTopWidth
:
1
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
},
detailButton
:
{
position
:
'absolute'
,
width
:
100
,
height
:
44
,
top
:
7
,
left
:
width
-
15
-
100
,
backgroundColor
:
'#d0021b'
,
borderRadius
:
4
,
alignItems
:
'center'
,
},
detailButtonText
:
{
marginTop
:
4
,
height
:
36
,
color
:
'white'
,
paddingTop
:
10
,
textAlign
:
'center'
,
fontSize
:
15
,
},
favoriteButton
:
{
width
:
100
,
height
:
40
,
},
favIcon
:
{
width
:
17
,
height
:
16
,
marginLeft
:
20
,
marginRight
:
0
,
},
favText
:
{
fontSize
:
13
,
color
:
'#b0b0b0'
,
marginLeft
:
5
,
},
});
...
...
js/goodGoodsRecommend/constants/actionTypes.js
View file @
0f539f9
...
...
@@ -6,6 +6,7 @@ export default keyMirror({
SET_HOST
:
null
,
SET_SERVICE_HOST
:
null
,
SET_CHANNEL
:
null
,
SET_SINGLE_HOST
:
null
,
SET_PRODUCT_SKN
:
null
,
GET_DETAIL_REQUEST
:
null
,
...
...
js/goodGoodsRecommend/reducers/app/appActions.js
View file @
0f539f9
...
...
@@ -7,6 +7,7 @@ const {
SET_CHANNEL
,
SET_HOST
,
SET_SERVICE_HOST
,
SET_SINGLE_HOST
,
}
=
require
(
'../../constants/actionTypes'
).
default
;
export
function
setPlatform
(
platform
)
{
...
...
@@ -30,9 +31,16 @@ export function setHost(host) {
};
}
export
function
setSingleHost
(
host
)
{
return
{
type
:
SET_SINGLE_HOST
,
payload
:
host
};
}
export
function
setServiceHost
(
host
)
{
return
{
type
:
SET_SERVICE_HOST
,
payload
:
host
};
}
\ No newline at end of file
}
...
...
js/goodGoodsRecommend/reducers/app/appInitialState.js
View file @
0f539f9
...
...
@@ -7,6 +7,7 @@ let InitialState = Record({
channel
:
1
,
// 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host
:
'http://api.yoho.cn'
,
serviceHost
:
'http://service.yoho.cn'
,
singleHost
:
'http://single.yoho.cn/favorite'
,
});
export
default
InitialState
;
...
...
js/goodGoodsRecommend/reducers/app/appReducer.js
View file @
0f539f9
...
...
@@ -7,6 +7,7 @@ const {
SET_CHANNEL
,
SET_HOST
,
SET_SERVICE_HOST
,
SET_SINGLE_HOST
,
}
=
require
(
'../../constants/actionTypes'
).
default
;
const
initialState
=
new
InitialState
;
...
...
@@ -23,6 +24,8 @@ export default function appReducer(state = initialState, action) {
return
state
.
set
(
'host'
,
action
.
payload
);
case
SET_SERVICE_HOST
:
return
state
.
set
(
'serviceHost'
,
action
.
payload
);
case
SET_SINGLE_HOST
:
return
state
.
set
(
'singleHost'
,
action
.
payload
);
}
return
state
;
...
...
js/goodGoodsRecommend/reducers/detail/detailActions.js
View file @
0f539f9
...
...
@@ -36,7 +36,7 @@ export function getDetail() {
// console.log(product_skn);
// console.log(json);
dispatch
(
getDetailSuccess
(
json
));
return
new
DetailService
(
'http://single.yoho.cn/favorite'
).
getFavoriteStatusWithProductID
(
json
.
product_id
)
return
new
DetailService
(
app
.
singleHost
).
getFavoriteStatusWithProductID
(
json
.
product_id
)
.
then
(
json
=>
{
dispatch
(
setFavoriteStatus
(
json
));
})
...
...
Please
register
or
login
to post a comment