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
张丽霞
8 years ago
Commit
2df4dad69ad9d22b5e1a22801c89d2eeab3fc835
1 parent
542fa491
秒杀toast替换、删除线、已抢光跳转详情、日历关闭时提醒、提示未登录同时设置提醒,review by 孙凯
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
45 deletions
js/seckill/components/seckill/ProductListView.js
js/seckill/components/seckill/Seckill.js
js/seckill/reducers/seckill/seckillActions.js
js/seckill/components/seckill/ProductListView.js
View file @
2df4dad
...
...
@@ -76,32 +76,38 @@ export default class ProductListView extends Component {
<
/View
>
:
<
View
style
=
{[
styles
.
secKillMarketPriceContainer
,
{
marginTop
:
2
}]}
>
<
Text
style
=
{[
styles
.
secKillPrice
,{
color
:
'#d0021b'
}]}
>
¥
{
rowData
.
secKillPrice
}
<
/Text
>
<
DeleteLineText
style
=
{{
top
:
3
,
left
:
8
}}
text
=
{
'¥'
+
rowData
.
marketPrice
+
' '
}
/
>
<
DeleteLineText
style
=
{{
top
:
3
,
left
:
8
}}
lineStyle
=
{{
marginRight
:
8
}}
text
=
{
'¥'
+
rowData
.
marketPrice
+
' '
}
/
>
<
/View
>
}
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
{
if
(
this
.
tipMessage
==
''
)
{
if
(
rowData
.
wait
)
{
this
.
props
.
onPressRemindBtn
&&
this
.
props
.
onPressRemindBtn
(
rowData
);
}
else
{
this
.
props
.
onPressProductItem
&&
this
.
props
.
onPressProductItem
(
rowData
);
}
}
}}
>
{
(
tipState
==
'取消提醒'
)?
<
View
style
=
{[
styles
.
priceClickTipViewRight
,{
backgroundColor
:
btnBgColor
,
borderWidth
:
1.0
}]}
>
<
Text
style
=
{{
color
:
btnTextcolor
}}
>
{
tipState
}
<
/Text
>
<
/View
>
:
<
View
style
=
{[
styles
.
priceClickTipViewRight
,{
backgroundColor
:
btnBgColor
}]}
>
<
Text
style
=
{{
color
:
btnTextcolor
}}
>
{
tipState
}
<
/Text
>
<
/View
>
}
{
tipState
==
'已抢光'
?
<
View
style
=
{[
styles
.
priceClickTipViewRight
,{
backgroundColor
:
btnBgColor
}]}
>
<
Text
style
=
{{
color
:
btnTextcolor
}}
>
{
tipState
}
<
/Text
>
<
/View
>
:
<
TouchableOpacity
onPress
=
{()
=>
{
if
(
this
.
tipMessage
==
''
)
{
if
(
rowData
.
wait
)
{
this
.
props
.
onPressRemindBtn
&&
this
.
props
.
onPressRemindBtn
(
rowData
);
}
else
{
this
.
props
.
onPressProductItem
&&
this
.
props
.
onPressProductItem
(
rowData
);
}
}
<
/TouchableOpacity
>
}}
>
{
(
tipState
==
'取消提醒'
)?
<
View
style
=
{[
styles
.
priceClickTipViewRight
,{
backgroundColor
:
btnBgColor
,
borderWidth
:
1.0
}]}
>
<
Text
style
=
{{
color
:
btnTextcolor
}}
>
{
tipState
}
<
/Text
>
<
/View
>
:
<
View
style
=
{[
styles
.
priceClickTipViewRight
,{
backgroundColor
:
btnBgColor
}]}
>
<
Text
style
=
{{
color
:
btnTextcolor
}}
>
{
tipState
}
<
/Text
>
<
/View
>
}
<
/TouchableOpacity
>
}
<
/View
>
<
/View
>
<
/View
>
...
...
js/seckill/components/seckill/Seckill.js
View file @
2df4dad
...
...
@@ -19,7 +19,7 @@ import TimerMixin from 'react-timer-mixin';
import
Immutable
,
{
Map
}
from
'immutable'
;
import
ProductListView
from
'./ProductListView'
;
import
TimeListView
from
'./TimeListView'
;
import
Toast
from
'react-native-root-toast'
import
Prompt
from
'../../../coupon/components/coupon/Prompt'
;
export
default
class
Seckill
extends
Component
{
constructor
(
props
)
{
...
...
@@ -57,9 +57,6 @@ export default class Seckill extends Component {
componentWillReceiveProps
(
nextProps
)
{
this
.
firstLaunch
=
false
;
if
(
nextProps
.
tipMessage
&&
nextProps
.
tipMessage
!==
''
)
{
this
.
_showToast
&&
this
.
_showToast
(
nextProps
.
tipMessage
);
}
}
_onPressTimeItem
(
activity
)
{
...
...
@@ -69,26 +66,6 @@ export default class Seckill extends Component {
}
}
_showToast
=
(
message
)
=>
{
if
(
this
.
toast
)
{
return
;
}
this
.
toast
=
Toast
.
show
(
message
,
{
duration
:
3000
,
position
:
height
/
2
-
60
,
shadow
:
false
,
animation
:
true
,
hideOnPress
:
true
,
onHidden
:
()
=>
{
if
(
this
.
toast
)
{
this
.
toast
.
destroy
();
this
.
toast
=
null
;
}
this
.
props
.
onClearTipMessage
&&
this
.
props
.
onClearTipMessage
();
}
});
};
renderSectionHeader
(
sectionData
,
sectionID
)
{
if
(
this
.
queryActivityInfo
&&
this
.
queryActivityInfo
.
secKillProductVoList
&&
this
.
queryActivityInfo
.
secKillProductVoList
.
size
>
0
)
{
return
(
...
...
@@ -221,6 +198,15 @@ export default class Seckill extends Component {
}}
/
>
}
{
tipMessage
!=
''
?
<
Prompt
text
=
{
tipMessage
}
duration
=
{
800
}
onPromptHidden
=
{
this
.
props
.
onClearTipMessage
}
/
>
:
null
}
<
/View
>
);
}
...
...
js/seckill/reducers/seckill/seckillActions.js
View file @
2df4dad
...
...
@@ -313,6 +313,7 @@ export function clickRemindBtn(product) {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
login
()
.
then
(
uid
=>
{
dispatch
(
clickActivityTimeItem
(
product
));
queryRemindList
(
uid
);
})
.
catch
(
error
=>
{
...
...
@@ -363,7 +364,9 @@ export function clickRemindBtn(product) {
dispatch
(
addCancelUserReminder
(
method
,
product
.
activityId
,
skn
,
uid
,
product
.
id
,
okTip
,
failTip
));
})
.
catch
(
error
=>
{
dispatch
(
showTipMessage
(
error
));
console
.
log
(
'error'
);
console
.
log
(
error
);
dispatch
(
showTipMessage
(
'请到设置中开启日历授权'
));
});
};
...
...
Please
register
or
login
to post a comment