...
|
...
|
@@ -18,7 +18,7 @@ import Immutable, {Map} from 'immutable'; |
|
|
import ProductListView from './ProductListView';
|
|
|
import TimeListView from './TimeListView';
|
|
|
import LoadingIndicator from '../../../common/components/LoadingIndicator';
|
|
|
import Toast from 'react-native-smart-toast'
|
|
|
import Toast from 'react-native-root-toast'
|
|
|
|
|
|
export default class Seckill extends Component {
|
|
|
constructor(props) {
|
...
|
...
|
@@ -31,6 +31,7 @@ export default class Seckill extends Component { |
|
|
sectionHeaderHasChanged: (s1, s2) => !Immutable.is(s1, s2),
|
|
|
});
|
|
|
this.isFetching = false;
|
|
|
this.tipMessage = '';
|
|
|
this.queryActivityInfo = Immutable.fromJS({});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -52,29 +53,29 @@ export default class Seckill extends Component { |
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if (nextProps.tipMessage && nextProps.tipMessage !== '') {
|
|
|
this._showToast && this._showToast(nextProps.tipMessage);
|
|
|
console.log(nextProps.tipMessage);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_showToast(message){
|
|
|
this._toast && this._toast.show({
|
|
|
position: Toast.constants.gravity.center,
|
|
|
duration: 255,
|
|
|
children: message,
|
|
|
animationEnd : () => {
|
|
|
this._toast._toastAnimationToggle = setTimeout(
|
|
|
() => {
|
|
|
this._toast.hide({
|
|
|
duration: 0,
|
|
|
animationEnd: () => {
|
|
|
this.props.onClearTipMessage && this.props.onClearTipMessage();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
1000
|
|
|
);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
_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) {
|
...
|
...
|
@@ -112,6 +113,7 @@ export default class Seckill extends Component { |
|
|
resource={rowData}
|
|
|
onPressProductItem={this.props.onPressProductItem}
|
|
|
onPressRemindBtn={this.props.onPressRemindBtn}
|
|
|
tipMessage={this.tipMessage}
|
|
|
/>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -133,6 +135,7 @@ export default class Seckill extends Component { |
|
|
} = this.props;
|
|
|
this.isFetching = isFetching;
|
|
|
this.queryActivityInfo = queryActivityInfo;
|
|
|
this.tipMessage = tipMessage;
|
|
|
diff = localServerTimeDiff;
|
|
|
let dataSource = {
|
|
|
ActivityProductList: [queryProductList ? queryProductList : []],
|
...
|
...
|
@@ -207,11 +210,6 @@ export default class Seckill extends Component { |
|
|
isVisible={isFetching && !ptr}
|
|
|
/>
|
|
|
|
|
|
<Toast
|
|
|
ref={ component => this._toast = component }
|
|
|
marginTop={64}>
|
|
|
</Toast>
|
|
|
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
|