Authored by 张丽霞

秒杀toast替换、删除线、已抢光跳转详情、日历关闭时提醒、提示未登录同时设置提醒,review by 孙凯

... ... @@ -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>
... ...
... ... @@ -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>
);
}
... ...
... ... @@ -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('请到设置中开启日历授权'));
});
};
... ...