Authored by hongyong.zhao

update one

Too many changes to show.

To preserve performance only 31 of 31+ files are displayed.

import App from './js/App';
import RCTLog from 'RCTLog';
App('ios');
... ...
... ... @@ -3,7 +3,8 @@
'use strict';
import React, {Component} from 'react';
import {Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {Dimensions, Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
export default class ActivityOrderDetail extends Component {
... ...
... ... @@ -2,9 +2,10 @@
import React, {Component} from 'react';
import {
Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View, NativeModules,
Dimensions, Image, StyleSheet, Text, TouchableOpacity, View, NativeModules,
DeviceEventEmitter
} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
import ProductListCell from '../../common/components/ListCell/ProductListCell';
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, Text, TouchableOpacity, View, DeviceEventEmitter} from 'react-native';
import {Immutable} from "immutable";
import ReactNative from "react-native";
export default class BankList extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderRow(rowData, sectionID, rowID) {
return (
<View>
<TouchableOpacity style={styles.rowView} activeOpacity={1} onPress={() => {
DeviceEventEmitter.emit('BankSelectEvent', rowData);
ReactNative.NativeModules.YH_CommonHelper.goBack();
}}>
<Text style={styles.wordText}>{rowData.get('bankName')}</Text>
</TouchableOpacity>
<View style={styles.lineView}/>
</View>
);
}
render() {
let {bankListInfo} = this.props;
let bankList = bankListInfo.bankList ? bankListInfo.bankList.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(bankList)}
renderRow={this._renderRow}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
},
contentContainer: {
width: width,
},
rowView: {
width: width,
height: 39.5,
paddingLeft: 15,
paddingRight: 15,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
wordText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
letterSpacing: -0.19,
},
});
'use strict';
import React, {Component} from 'react';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View, DeviceEventEmitter} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from "immutable";
import ReactNative from "react-native";
export default class BankList extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderRow(rowData, sectionID, rowID) {
return (
<View>
<TouchableOpacity style={styles.rowView} activeOpacity={1} onPress={() => {
DeviceEventEmitter.emit('BankSelectEvent', rowData);
ReactNative.NativeModules.YH_CommonHelper.goBack();
}}>
<Text style={styles.wordText}>{rowData.get('bankName')}</Text>
</TouchableOpacity>
<View style={styles.lineView}/>
</View>
);
}
render() {
let {bankListInfo} = this.props;
let bankList = bankListInfo.bankList ? bankListInfo.bankList.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(bankList)}
renderRow={this._renderRow}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
},
contentContainer: {
width: width,
},
rowView: {
width: width,
height: 39.5,
paddingLeft: 15,
paddingRight: 15,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
wordText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
letterSpacing: -0.19,
},
});
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Swiper from '../../common/components/YH_Swiper';
import YH_Image from '../../common/components/YH_Image';
import {getSlicedUrl} from '../../classify/utils/Utils';
const {
View,
TouchableOpacity,
StyleSheet,
Dimensions,
Platform,
} = ReactNative;
import Immutable, {Map} from 'immutable';
export default class BannerSwiper extends React.Component {
constructor(props) {
super (props);
}
shouldComponentUpdate(nextProps){
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
render() {
let {resource ,row_ID} = this.props;
if (!resource) {
return null;
}
let template_name = resource?resource.get('template_name'):'';
let template_id = resource?resource.get('template_id'):0;
let data = resource.get('data').toJS();
if (data.length == 1) {
let newSrc = getSlicedUrl(data[0].src, width, swiperHeight);
return (
<View style={styles.container}>
<TouchableOpacity
activeOpacity={1}
style={{width: width, height: swiperHeight}}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(data[0].url)
}}
>
<YH_Image
url={newSrc}
style={{ width: width, height: swiperHeight}}
/>
</TouchableOpacity>
</View>
);
} else {
return (
<View style={styles.container}>
<YH_Swiper
style={styles.banner}
showsButtons={false}
loop={true}
autoplay={true}
autoplayTimeout={3}
paginationStyle={{bottom: 8}}
width={width}
height={swiperHeight}
>
{data.map((item, i) => {
let newSrc = getSlicedUrl(item.src, width, swiperHeight);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(item.url)
}}
>
<YH_Image
url={newSrc}
style={{width: width, height: swiperHeight}}
/>
</TouchableOpacity>
);
})}
</YH_Swiper>
</View>
);
}
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
let swiperHeight = Math.ceil(118 * DEVICE_WIDTH_RATIO);
let styles = StyleSheet.create({
container: {
width: width,
height: swiperHeight,
backgroundColor: 'white',
},
});
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Swiper from '../../common/components/YH_Swiper';
import YH_Image from '../../common/components/YH_Image';
import {getSlicedUrl} from '../../classify/utils/Utils';
const {
View,
TouchableOpacity,
StyleSheet,
Dimensions,
Platform,
} = ReactNative;
import Immutable, {Map} from 'immutable';
export default class BannerSwiper extends React.Component {
constructor(props) {
super (props);
}
shouldComponentUpdate(nextProps){
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
render() {
let {resource ,row_ID} = this.props;
if (!resource) {
return null;
}
let template_name = resource?resource.get('template_name'):'';
let template_id = resource?resource.get('template_id'):0;
let data = resource.get('data').toJS();
if (data.length == 1) {
let newSrc = getSlicedUrl(data[0].src, width, swiperHeight);
return (
<View style={styles.container}>
<TouchableOpacity
activeOpacity={1}
style={{width: width, height: swiperHeight}}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(data[0].url)
}}
>
<YH_Image
url={newSrc}
style={{ width: width, height: swiperHeight}}
/>
</TouchableOpacity>
</View>
);
} else {
return (
<View style={styles.container}>
<YH_Swiper
style={styles.banner}
showsButtons={false}
loop={true}
autoplay={true}
autoplayTimeout={3}
paginationStyle={{bottom: 8}}
width={width}
height={swiperHeight}
>
{data.map((item, i) => {
let newSrc = getSlicedUrl(item.src, width, swiperHeight);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(item.url)
}}
>
<YH_Image
url={newSrc}
style={{width: width, height: swiperHeight}}
/>
</TouchableOpacity>
);
})}
</YH_Swiper>
</View>
);
}
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
let swiperHeight = Math.ceil(118 * DEVICE_WIDTH_RATIO);
let styles = StyleSheet.create({
container: {
width: width,
height: swiperHeight,
backgroundColor: 'white',
},
});
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Image,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class GuideModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShowGuide}
animationType={'none'}
transparent={true}
onRequestClose={() => {
}}>
<TouchableOpacity activeOpacity={1} style={styles.modalContainer} onPress={() => {
this.props.hiddenGuideDialog && this.props.hiddenGuideDialog();
}}>
<Image style={styles.modalContainer} resizeMode={'stretch'} source={require('../images/alliance_guide.png')}/>
</TouchableOpacity>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'flex-end',
// backgroundColor: 'rgba(0, 0, 0, 0.6)',
},
helpImage: {
width: 127,
height: 120,
marginTop: 67,
marginRight: 50,
},
});
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Image,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class GuideModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShowGuide}
animationType={'none'}
transparent={true}
onRequestClose={() => {
}}>
<TouchableOpacity activeOpacity={1} style={styles.modalContainer} onPress={() => {
this.props.hiddenGuideDialog && this.props.hiddenGuideDialog();
}}>
<Image style={styles.modalContainer} resizeMode={'stretch'} source={require('../images/alliance_guide.png')}/>
</TouchableOpacity>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'flex-end',
// backgroundColor: 'rgba(0, 0, 0, 0.6)',
},
helpImage: {
width: 127,
height: 120,
marginTop: 67,
marginRight: 50,
},
});
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class HelpTipsModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShowHelp}
animationType={'none'}
transparent={true}
onRequestClose={() => {}}>
<View style={styles.modalContainer}>
<View style={styles.modalView}>
<View style={styles.confirmTitleContainer}>
<Text style={styles.confirmTitle}>{this.props.tips}</Text>
</View>
<View style={{width: '100%', height: 0.5, backgroundColor: '#e0e0e0'}}/>
<View style={styles.confirmBtnContainer}>
<TouchableOpacity style={styles.click} onPress={() => {
this.props.hiddenHelpDialog && this.props.hiddenHelpDialog();
}}>
<Text style={styles.sure}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.4)',
},
modalView: {
width: 270,
borderRadius: 5,
alignItems: 'center',
backgroundColor: '#ffffff',
},
confirmBtnContainer: {
width: '100%',
height: 44.5,
flexDirection: 'row',
justifyContent: 'space-between',
},
confirmTitleContainer: {
alignItems: 'center'
},
confirmTitle: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
},
click: {
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
cancel: {
fontSize: 17,
color: '#444444',
letterSpacing: -0.41,
fontFamily: 'PingFang-SC-Regular',
},
sure: {
fontSize: 17,
color: '#D0021B',
letterSpacing: -0.41,
fontWeight: 'bold'
},
});
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class HelpTipsModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShowHelp}
animationType={'none'}
transparent={true}
onRequestClose={() => {}}>
<View style={styles.modalContainer}>
<View style={styles.modalView}>
<View style={styles.confirmTitleContainer}>
<Text style={styles.confirmTitle}>{this.props.tips}</Text>
</View>
<View style={{width: '100%', height: 0.5, backgroundColor: '#e0e0e0'}}/>
<View style={styles.confirmBtnContainer}>
<TouchableOpacity style={styles.click} onPress={() => {
this.props.hiddenHelpDialog && this.props.hiddenHelpDialog();
}}>
<Text style={styles.sure}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.4)',
},
modalView: {
width: 270,
borderRadius: 5,
alignItems: 'center',
backgroundColor: '#ffffff',
},
confirmBtnContainer: {
width: '100%',
height: 44.5,
flexDirection: 'row',
justifyContent: 'space-between',
},
confirmTitleContainer: {
alignItems: 'center'
},
confirmTitle: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
},
click: {
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
cancel: {
fontSize: 17,
color: '#444444',
letterSpacing: -0.41,
fontFamily: 'PingFang-SC-Regular',
},
sure: {
fontSize: 17,
color: '#D0021B',
letterSpacing: -0.41,
fontWeight: 'bold'
},
});
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, Text, View, TouchableOpacity, Image, SectionList} from 'react-native';
import {Immutable, default as Immutables} from 'immutable';
import GuideModal from "./GuideModal";
import Focus from './floor/Focus';
import SingleImage from './floor/SingleImage';
import ImageFour from "./cell/ImageFour";
import ImageTwo from "./cell/ImageTwo";
import ProductCell from './recommend/ProductCell';
import CategorySelector from './recommend/CategorySelector';
import EditorTalk from './cell/EditorTalk';
let hotRecommend = Immutables.fromJS({
count: "8",
order_by: "100",
sort_name: "热门推荐",
sort_id: "0"
});
export default class Home extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderSectionHeader = this._renderSectionHeader.bind(this);
this._floorCellRender = this._floorCellRender.bind(this);
this._clickCategorySelector = this._clickCategorySelector.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
sectionHeaderHasChanged: (s1, s2) => !Immutable.is(s1, s2),
});
}
_renderSectionHeader({ section: { title } }) {
switch (title) {
case 'categoryList': {
let { productList } = this.props.data;
let selectedCategoryIndex = productList.selectedCategoryIndex;
let categoryList = productList.msort_list.unshift(hotRecommend);
return (
<CategorySelector
data={categoryList}
selectedCategoryIndex={selectedCategoryIndex}
changeCategorySelectorTitle={this._clickCategorySelector}
onPressCategory={(rowData, rowID) => {
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
}}
/>
);
}
default:
return null;
}
}
_clickCategorySelector(rowData) {
let params = {
animated: true,
sectionIndex: 1,
itemIndex: 0,
viewOffset: 44
}
this.sectionList.scrollToLocation(params);
}
_renderRow(item) {
let rowID = item.index;
let rowData = item.item;
let paddingLeft = rowID % 2 === 1 ? rowMarginHorizontal / 2 : rowMarginHorizontal;
let customStyle = rowID === 0 || rowID === 1 ? {paddingLeft} : {paddingLeft};
switch (item.section.title) {
case 'resourceList': {
return this._floorCellRender(rowData, rowID);
}
case 'productListTitle': {
return (
<View>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
<View style={styles.withdrawView}>
<Text style={[styles.hasWithDrawText, {fontWeight: 'bold'}]}>推荐商品</Text>
</View>
<View style={styles.titleBottomLine}/>
</View>
)
}
case 'categoryList': {
return (
<ProductCell
style={[styles.listContainer, customStyle]}
key={'row' + rowID}
rowID={rowID}
data={rowData}
onPressProduct={this.props.onPressProduct}
/>
);
}
default:
return null;
}
}
_floorCellRender(rowData, rowID) {
if (!rowData || !rowData.get('data')) {
return null;
}
let template_name = rowData.get('template_name');
switch (template_name) {
case 'focus': {
return (
<Focus
data={rowData.get('data')}
height={140}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'newSingleImage': {
let imageHeight = rowData.get('data').toJS().imageHeight;
return (
<SingleImage
style={imageHeight> 100 ? {marginLeft: 15, marginRight: 15, width: width-30}: {}}
data={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'image_list': {
return (
<ImageFour
resource={rowData.get('data')}
jumpWithUrl={this.props.jumpWithUrl}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'twoPicture': {
return (
<ImageTwo
resource={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'editorTalk': {
return (
<EditorTalk
htmlcontent={this.props.data.inviteCode}
resource={rowData}
image={require('../images/invitecode.png')}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
)
}
default:
return null;
}
}
render() {
let {
resourceInfo,
data,
} = this.props;
let dataSource = [
{title: 'resourceList', data: resourceInfo.resourceList ? resourceInfo.resourceList.toArray() : []},
{title: 'categoryList', data: data.productList.product_list ? data.productList.product_list.toArray() : []},
];
let productList = data.productList.product_list ? data.productList.product_list.toArray() : [];
return (
<View style={styles.container}>
<SectionList
stickySectionHeadersEnabled={true}
ref={(ref) => this.sectionList = ref}
sections={dataSource}
renderSectionHeader={this._renderSectionHeader}
yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
renderItem={this._renderRow}
onEndReached={() => {
if (productList && productList.size !== 0) {
this.props.onEndReached && this.props.onEndReached();
}
}}
keyExtractor={(item, index) => {
return index
}}
/>
</View>
);
}
}
let { width } = Dimensions.get('window');
let rowWidth = Math.ceil(137.5 * width / 320);
let rowMarginHorizontal = (width - rowWidth * 2) / 3;
let styles = StyleSheet.create({
container: {
flex: 1,
},
withdrawView: {
width: width,
height: 44,
backgroundColor: '#FFFFFF',
flexDirection: 'row',
paddingLeft: 15,
alignItems: 'center',
justifyContent: 'space-between'
},
hasWithDrawText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
},
titleBottomLine: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
contentContainer: {
flexDirection: 'column',
backgroundColor: 'white'
},
listContainer: {
width: width,
},
})
;
'use strict';
import React, {Component} from 'react';
import {Dimensions, StyleSheet, Text, View, TouchableOpacity, Image, SectionList} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable, default as Immutables} from 'immutable';
import GuideModal from "./GuideModal";
import Focus from './floor/Focus';
import SingleImage from './floor/SingleImage';
import ImageFour from "./cell/ImageFour";
import ImageTwo from "./cell/ImageTwo";
import ProductCell from './recommend/ProductCell';
import CategorySelector from './recommend/CategorySelector';
import EditorTalk from './cell/EditorTalk';
let hotRecommend = Immutables.fromJS({
count: "8",
order_by: "100",
sort_name: "热门推荐",
sort_id: "0"
});
export default class Home extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderSectionHeader = this._renderSectionHeader.bind(this);
this._floorCellRender = this._floorCellRender.bind(this);
this._clickCategorySelector = this._clickCategorySelector.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
sectionHeaderHasChanged: (s1, s2) => !Immutable.is(s1, s2),
});
}
_renderSectionHeader({ section: { title } }) {
switch (title) {
case 'categoryList': {
let { productList } = this.props.data;
let selectedCategoryIndex = productList.selectedCategoryIndex;
let categoryList = productList.msort_list.unshift(hotRecommend);
return (
<CategorySelector
data={categoryList}
selectedCategoryIndex={selectedCategoryIndex}
changeCategorySelectorTitle={this._clickCategorySelector}
onPressCategory={(rowData, rowID) => {
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
}}
/>
);
}
default:
return null;
}
}
_clickCategorySelector(rowData) {
let params = {
animated: true,
sectionIndex: 1,
itemIndex: 0,
viewOffset: 44
}
this.sectionList.scrollToLocation(params);
}
_renderRow(item) {
let rowID = item.index;
let rowData = item.item;
let paddingLeft = rowID % 2 === 1 ? rowMarginHorizontal / 2 : rowMarginHorizontal;
let customStyle = rowID === 0 || rowID === 1 ? {paddingLeft} : {paddingLeft};
switch (item.section.title) {
case 'resourceList': {
return this._floorCellRender(rowData, rowID);
}
case 'productListTitle': {
return (
<View>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
<View style={styles.withdrawView}>
<Text style={[styles.hasWithDrawText, {fontWeight: 'bold'}]}>推荐商品</Text>
</View>
<View style={styles.titleBottomLine}/>
</View>
)
}
case 'categoryList': {
return (
<ProductCell
style={[styles.listContainer, customStyle]}
key={'row' + rowID}
rowID={rowID}
data={rowData}
onPressProduct={this.props.onPressProduct}
/>
);
}
default:
return null;
}
}
_floorCellRender(rowData, rowID) {
if (!rowData || !rowData.get('data')) {
return null;
}
let template_name = rowData.get('template_name');
switch (template_name) {
case 'focus': {
return (
<Focus
data={rowData.get('data')}
height={140}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'newSingleImage': {
let imageHeight = rowData.get('data').toJS().imageHeight;
return (
<SingleImage
style={imageHeight> 100 ? {marginLeft: 15, marginRight: 15, width: width-30}: {}}
data={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'image_list': {
return (
<ImageFour
resource={rowData.get('data')}
jumpWithUrl={this.props.jumpWithUrl}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'twoPicture': {
return (
<ImageTwo
resource={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'editorTalk': {
return (
<EditorTalk
htmlcontent={this.props.data.inviteCode}
resource={rowData}
image={require('../images/invitecode.png')}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
)
}
default:
return null;
}
}
render() {
let {
resourceInfo,
data,
} = this.props;
let dataSource = [
{title: 'resourceList', data: resourceInfo.resourceList ? resourceInfo.resourceList.toArray() : []},
{title: 'categoryList', data: data.productList.product_list ? data.productList.product_list.toArray() : []},
];
let productList = data.productList.product_list ? data.productList.product_list.toArray() : [];
return (
<View style={styles.container}>
<SectionList
stickySectionHeadersEnabled={true}
ref={(ref) => this.sectionList = ref}
sections={dataSource}
renderSectionHeader={this._renderSectionHeader}
yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
renderItem={this._renderRow}
onEndReached={() => {
if (productList && productList.size !== 0) {
this.props.onEndReached && this.props.onEndReached();
}
}}
keyExtractor={(item, index) => {
return index
}}
/>
</View>
);
}
}
let { width } = Dimensions.get('window');
let rowWidth = Math.ceil(137.5 * width / 320);
let rowMarginHorizontal = (width - rowWidth * 2) / 3;
let styles = StyleSheet.create({
container: {
flex: 1,
},
withdrawView: {
width: width,
height: 44,
backgroundColor: '#FFFFFF',
flexDirection: 'row',
paddingLeft: 15,
alignItems: 'center',
justifyContent: 'space-between'
},
hasWithDrawText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
},
titleBottomLine: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
contentContainer: {
flexDirection: 'column',
backgroundColor: 'white'
},
listContainer: {
width: width,
},
})
;
... ...
'use strict';
import React, { Component } from 'react';
import { Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Dimensions, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import ListView from 'deprecated-react-native-listview'
import { Immutable } from 'immutable';
import YH_Image from '../../common/components/YH_Image';
... ...
'use strict';
import React, { Component } from 'react';
import { Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View, ScrollView } from 'react-native';
import { Dimensions, Image, StyleSheet, Text, TouchableOpacity, View, ScrollView } from 'react-native';
import ListView from 'deprecated-react-native-listview'
import { Immutable } from 'immutable';
import YH_Image from '../../common/components/YH_Image';
... ...
'use strict';
import React, { Component } from 'react';
import { Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Dimensions, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import ListView from 'deprecated-react-native-listview'
import { Immutable } from 'immutable';
const DEVICE_WIDTH_RATIO = Dimensions.get('window').width / 375;
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, View} from 'react-native';
import {Immutable} from "immutable";
import MessageCell from './cell/MessageCell';
export default class MessageList extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderRow(rowData, sectionID, rowID) {
return (
<MessageCell
data={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
shareAction={this.props.shareAction}
/>
);
}
render() {
let {messageList} = this.props;
let resourceList = messageList.list ? messageList.list.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(resourceList)}
renderRow={this._renderRow}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
},
contentContainer: {
width: width,
}
});
'use strict';
import React, {Component} from 'react';
import {Dimensions, StyleSheet, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from "immutable";
import MessageCell from './cell/MessageCell';
export default class MessageList extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderRow(rowData, sectionID, rowID) {
return (
<MessageCell
data={rowData}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
shareAction={this.props.shareAction}
/>
);
}
render() {
let {messageList} = this.props;
let resourceList = messageList.list ? messageList.list.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(resourceList)}
renderRow={this._renderRow}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
},
contentContainer: {
width: width,
}
});
... ...
'use strict';
import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {DeviceEventEmitter, Dimensions, Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from "immutable";
import SingleImage from './floor/SingleImage';
import MineCell from './cell/MineCell';
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {Immutable} from 'immutable';
export default class OrderDetail extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderHeader = this._renderHeader.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderHeader() {
let status = this.props.orderDetail.status === '10' ? '(待结算)' : '';
return (
<View>
<View style={styles.header}>
<Text style={[styles.headerText]}>{this.props.orderDetail.orderStatus}</Text>
</View>
<View style={styles.lineView}/>
<View style={styles.content}>
<Text style={styles.contentText}>订单编号:{this.props.orderDetail.orderCode}</Text>
<Text style={styles.contentText}>下单时间:{this.props.orderDetail.orderTimeStr.replace(/-/g,'.')}</Text>
<Text style={styles.contentText}>商品金额:{this.props.orderDetail.lastOrderAmountStr}</Text>
<View style={{flexDirection: 'row'}}>
<Text style={styles.contentText}>佣金金额:</Text>
<Text style={[styles.contentText, {fontWeight: 'bold', color: '#D0021B'}]}>{this.props.orderDetail.amountStr}</Text>
<Text style={styles.contentText}>{status}</Text>
</View>
</View>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
</View>
)
}
_renderRow(rowData, sectionID, rowID) {
let url = rowData.get('image');
return (
<TouchableOpacity activeOpacity={1} onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(rowData);
}}>
<View style={styles.rowView}>
<Image style={styles.picImage} source={{uri: url}} resizeMode={'contain'}/>
<Text style={styles.titleText}>{rowData.get('productName')}</Text>
<View style={styles.rightView}>
<Text style={styles.priceText}>{rowData.get('priceStr')}</Text>
<Text style={styles.numText}>x {rowData.get('num')}</Text>
</View>
</View>
<View style={[styles.lineView, {marginLeft: 15}]}/>
</TouchableOpacity>
);
}
render() {
let {orderDetail} = this.props;
let productList = orderDetail.productList ? orderDetail.productList.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
// yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(productList)}
renderRow={this._renderRow}
renderHeader={this._renderHeader}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
alignItems: 'center'
},
contentContainer: {
width: width,
backgroundColor: 'white'
},
header: {
width: width,
height: 50,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#FFFFFF',
},
content: {
width: width,
height: 140,
padding: 15,
backgroundColor: '#FFFFFF',
},
headerText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 17,
paddingLeft: 15,
color: '#444444',
letterSpacing: -0,
fontWeight: 'bold',
},
contentText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
paddingBottom: 10,
color: '#444444',
letterSpacing: -0,
},
rowView: {
width: width,
height: 86,
flexDirection: 'row',
padding: 10,
},
picImage: {
width: 50,
height: 66,
marginLeft: 5,
},
titleText: {
flex:1,
marginLeft: 10,
fontSize: 14,
color: '#444444',
letterSpacing: -0,
lineHeight: 18,
fontFamily: 'PingFang-SC-Regular',
},
priceText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#D0021B',
textAlign: 'right',
letterSpacing: -0.4,
},
numText: {
marginTop: 5,
fontSize: 12,
color: '#B0B0B0',
letterSpacing: -0.34,
textAlign: 'right',
fontFamily: 'PingFang-SC-Medium',
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
rightView: {
width: 95,
}
});
'use strict';
import React, {Component} from 'react';
import {Dimensions, Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
export default class OrderDetail extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderHeader = this._renderHeader.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
_renderHeader() {
let status = this.props.orderDetail.status === '10' ? '(待结算)' : '';
return (
<View>
<View style={styles.header}>
<Text style={[styles.headerText]}>{this.props.orderDetail.orderStatus}</Text>
</View>
<View style={styles.lineView}/>
<View style={styles.content}>
<Text style={styles.contentText}>订单编号:{this.props.orderDetail.orderCode}</Text>
<Text style={styles.contentText}>下单时间:{this.props.orderDetail.orderTimeStr.replace(/-/g,'.')}</Text>
<Text style={styles.contentText}>商品金额:{this.props.orderDetail.lastOrderAmountStr}</Text>
<View style={{flexDirection: 'row'}}>
<Text style={styles.contentText}>佣金金额:</Text>
<Text style={[styles.contentText, {fontWeight: 'bold', color: '#D0021B'}]}>{this.props.orderDetail.amountStr}</Text>
<Text style={styles.contentText}>{status}</Text>
</View>
</View>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
</View>
)
}
_renderRow(rowData, sectionID, rowID) {
let url = rowData.get('image');
return (
<TouchableOpacity activeOpacity={1} onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(rowData);
}}>
<View style={styles.rowView}>
<Image style={styles.picImage} source={{uri: url}} resizeMode={'contain'}/>
<Text style={styles.titleText}>{rowData.get('productName')}</Text>
<View style={styles.rightView}>
<Text style={styles.priceText}>{rowData.get('priceStr')}</Text>
<Text style={styles.numText}>x {rowData.get('num')}</Text>
</View>
</View>
<View style={[styles.lineView, {marginLeft: 15}]}/>
</TouchableOpacity>
);
}
render() {
let {orderDetail} = this.props;
let productList = orderDetail.productList ? orderDetail.productList.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
// yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(productList)}
renderRow={this._renderRow}
renderHeader={this._renderHeader}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
alignItems: 'center'
},
contentContainer: {
width: width,
backgroundColor: 'white'
},
header: {
width: width,
height: 50,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#FFFFFF',
},
content: {
width: width,
height: 140,
padding: 15,
backgroundColor: '#FFFFFF',
},
headerText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 17,
paddingLeft: 15,
color: '#444444',
letterSpacing: -0,
fontWeight: 'bold',
},
contentText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
paddingBottom: 10,
color: '#444444',
letterSpacing: -0,
},
rowView: {
width: width,
height: 86,
flexDirection: 'row',
padding: 10,
},
picImage: {
width: 50,
height: 66,
marginLeft: 5,
},
titleText: {
flex:1,
marginLeft: 10,
fontSize: 14,
color: '#444444',
letterSpacing: -0,
lineHeight: 18,
fontFamily: 'PingFang-SC-Regular',
},
priceText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#D0021B',
textAlign: 'right',
letterSpacing: -0.4,
},
numText: {
marginTop: 5,
fontSize: 12,
color: '#B0B0B0',
letterSpacing: -0.34,
textAlign: 'right',
fontFamily: 'PingFang-SC-Medium',
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
rightView: {
width: 95,
}
});
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class SureModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShow}
animationType={'none'}
transparent={true}
onRequestClose={() => {
}}>
<View style={styles.modalContainer}>
<View style={styles.modalView}>
<View style={styles.confirmTitleContainer}>
<Text style={styles.confirmTitle}>
每月15号统一打款,节假日顺延。
申请后不能取消,确定要提现吗?
</Text>
</View>
<View style={{width: '100%', height: 0.5, backgroundColor: '#e0e0e0'}}/>
<View style={styles.confirmBtnContainer}>
<TouchableOpacity
style={{width: '49%', alignItems: 'center', justifyContent: 'center', height: 45.5}}
onPress={() => {
this.props.hiddenSureDialog && this.props.hiddenSureDialog();
}}>
<Text style={{fontSize: 17, color: '#444444', letterSpacing: -0.41}}>取消</Text>
</TouchableOpacity>
<View style={{width: 0.5, height: 45, backgroundColor: '#e0e0e0'}}/>
<TouchableOpacity
style={{width: '49%', alignItems: 'center', justifyContent: 'center', height: 45.5}}
onPress={() => {
this.props.hiddenSureDialog && this.props.hiddenSureDialog();
this.props.showWithdrawalDialog && this.props.showWithdrawalDialog();
}}>
<Text style={{
fontSize: 17,
color: '#d0021b',
letterSpacing: -0.41,
fontWeight: '500'
}}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.4)',
},
modalView: {
width: 270,
borderRadius: 5,
alignItems: 'center',
backgroundColor: '#ffffff',
},
confirmBtnContainer: {
width: '100%',
height: 44.5,
flexDirection: 'row',
},
confirmTitleContainer: {
alignItems: 'center'
},
confirmTitle: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
},
confirmContent: {
marginLeft: 30,
marginRight: 30,
marginBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
includeFontPadding: false,
},
click: {
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
sure: {
fontSize: 17,
color: '#D0021B',
letterSpacing: -0.41,
fontWeight: 'bold'
},
});
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
TouchableOpacity,
Modal,
} = ReactNative;
export default class SureModal extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Modal
visible={this.props.isShow}
animationType={'none'}
transparent={true}
onRequestClose={() => {
}}>
<View style={styles.modalContainer}>
<View style={styles.modalView}>
<View style={styles.confirmTitleContainer}>
<Text style={styles.confirmTitle}>
每月15号统一打款,节假日顺延。
申请后不能取消,确定要提现吗?
</Text>
</View>
<View style={{width: '100%', height: 0.5, backgroundColor: '#e0e0e0'}}/>
<View style={styles.confirmBtnContainer}>
<TouchableOpacity
style={{width: '49%', alignItems: 'center', justifyContent: 'center', height: 45.5}}
onPress={() => {
this.props.hiddenSureDialog && this.props.hiddenSureDialog();
}}>
<Text style={{fontSize: 17, color: '#444444', letterSpacing: -0.41}}>取消</Text>
</TouchableOpacity>
<View style={{width: 0.5, height: 45, backgroundColor: '#e0e0e0'}}/>
<TouchableOpacity
style={{width: '49%', alignItems: 'center', justifyContent: 'center', height: 45.5}}
onPress={() => {
this.props.hiddenSureDialog && this.props.hiddenSureDialog();
this.props.showWithdrawalDialog && this.props.showWithdrawalDialog();
}}>
<Text style={{
fontSize: 17,
color: '#d0021b',
letterSpacing: -0.41,
fontWeight: '500'
}}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
modalContainer: {
flex: 1,
width: width,
height: height,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.4)',
},
modalView: {
width: 270,
borderRadius: 5,
alignItems: 'center',
backgroundColor: '#ffffff',
},
confirmBtnContainer: {
width: '100%',
height: 44.5,
flexDirection: 'row',
},
confirmTitleContainer: {
alignItems: 'center'
},
confirmTitle: {
paddingTop: 20,
paddingLeft: 30,
paddingRight: 30,
paddingBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
},
confirmContent: {
marginLeft: 30,
marginRight: 30,
marginBottom: 20,
color: '#444444',
fontSize: 14,
lineHeight: 24,
textAlign: 'center',
letterSpacing: -0.09,
fontFamily: 'PingFang-SC-Regular',
includeFontPadding: false,
},
click: {
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
sure: {
fontSize: 17,
color: '#D0021B',
letterSpacing: -0.41,
fontWeight: 'bold'
},
});
... ...
'use strict';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default class TabBottom extends Component {
static propType = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
tabNames: PropTypes.array,
tabIconNames: PropTypes.array,
selectedTabIconNames: PropTypes.array
};
componentDidMount() {
this.props.scrollValue.addListener(this.setAnimationValue);
}
setAnimationValue({value}) {
console.log(value);
}
render() {
return (
<View style={styles.tabs}>
{this.props.tabs.map((tab, i) => {
let color = this.props.activeTab === i ? 'green' : 'gray';
let icon = this.props.activeTab === i ? this.props.selectedTabIconNames[i] : this.props.tabIconNames[i];
return (
<TouchableOpacity key={i} activeOpacity={0.8} style={styles.tab} onPress={() => this.props.goToPage(i)}>
<View style={styles.tabItem}>
<Image
style={styles.icon}
source={icon}/>
{/*<Text style={{color: color, fontSize: 12}}>*/}
{/*{this.props.tabNames[i]}*/}
{/*</Text>*/}
</View>
</TouchableOpacity>
)
})}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
marginTop: 20
},
tabs: {
flexDirection: 'row',
height: 51,
borderTopColor: '#E0E0E0',
borderTopWidth: 1
},
tab: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
tabItem: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'space-around'
},
icon: {
width: 24,
height: 38,
}
});
'use strict';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default class TabBottom extends Component {
static propType = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
tabNames: PropTypes.array,
tabIconNames: PropTypes.array,
selectedTabIconNames: PropTypes.array
};
componentDidMount() {
this.props.scrollValue.addListener(this.setAnimationValue);
}
setAnimationValue({value}) {
console.log(value);
}
render() {
return (
<View style={styles.tabs}>
{this.props.tabs.map((tab, i) => {
let color = this.props.activeTab === i ? 'green' : 'gray';
let icon = this.props.activeTab === i ? this.props.selectedTabIconNames[i] : this.props.tabIconNames[i];
return (
<TouchableOpacity key={i} activeOpacity={0.8} style={styles.tab} onPress={() => this.props.goToPage(i)}>
<View style={styles.tabItem}>
<Image
style={styles.icon}
source={icon}/>
{/*<Text style={{color: color, fontSize: 12}}>*/}
{/*{this.props.tabNames[i]}*/}
{/*</Text>*/}
</View>
</TouchableOpacity>
)
})}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
marginTop: 20
},
tabs: {
flexDirection: 'row',
height: 51,
borderTopColor: '#E0E0E0',
borderTopWidth: 1
},
tab: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
tabItem: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'space-around'
},
icon: {
width: 24,
height: 38,
}
});
... ...
'use strict';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default class TabBottom extends Component {
static propType = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
tabNames: PropTypes.array,
tabIconNames: PropTypes.array,
selectedTabIconNames: PropTypes.array
};
componentDidMount() {
this.props.scrollValue.addListener(this.setAnimationValue);
}
setAnimationValue({value}) {
console.log(value);
}
render() {
return (
<View>
<View style={styles.tabs}>
{this.props.tabs.map((tab, i) => {
let color = this.props.activeTab === i ? '#444444' : '#B0B0B0';
let fontWeight = this.props.activeTab === i ? 'bold' : 'normal';
return (
<TouchableOpacity key={i} activeOpacity={0.8} style={styles.tab} onPress={() => this.props.goToPage(i)}>
<View style={styles.tabItem}>
<Text style={[styles.nameText, {
color: color,
fontWeight: fontWeight,
}]}>{this.props.tabNames[i]}</Text>
</View>
{this.props.activeTab !== i ? null :
<View style={{alignItems: 'center'}}>
<View style={styles.underLine}/>
</View>
}
</TouchableOpacity>
)
})}
</View>
<View style={styles.lineView}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
marginTop: 20
},
tabs: {
flexDirection: 'row',
height: 50,
borderTopColor: '#FFFFFF',
borderTopWidth: 1
},
tab: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
tabItem: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
nameText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
textAlign: 'center',
},
underLine: {
width: 28,
height: 2,
backgroundColor: '#444444',
},
lineView: {
width: width,
height: 1,
backgroundColor: '#e0e0e0'
},
});
'use strict';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default class TabBottom extends Component {
static propType = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
tabNames: PropTypes.array,
tabIconNames: PropTypes.array,
selectedTabIconNames: PropTypes.array
};
componentDidMount() {
this.props.scrollValue.addListener(this.setAnimationValue);
}
setAnimationValue({value}) {
console.log(value);
}
render() {
return (
<View>
<View style={styles.tabs}>
{this.props.tabs.map((tab, i) => {
let color = this.props.activeTab === i ? '#444444' : '#B0B0B0';
let fontWeight = this.props.activeTab === i ? 'bold' : 'normal';
return (
<TouchableOpacity key={i} activeOpacity={0.8} style={styles.tab} onPress={() => this.props.goToPage(i)}>
<View style={styles.tabItem}>
<Text style={[styles.nameText, {
color: color,
fontWeight: fontWeight,
}]}>{this.props.tabNames[i]}</Text>
</View>
{this.props.activeTab !== i ? null :
<View style={{alignItems: 'center'}}>
<View style={styles.underLine}/>
</View>
}
</TouchableOpacity>
)
})}
</View>
<View style={styles.lineView}/>
</View>
);
}
}
let {width} = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
marginTop: 20
},
tabs: {
flexDirection: 'row',
height: 50,
borderTopColor: '#FFFFFF',
borderTopWidth: 1
},
tab: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
tabItem: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
nameText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
textAlign: 'center',
},
underLine: {
width: 28,
height: 2,
backgroundColor: '#444444',
},
lineView: {
width: width,
height: 1,
backgroundColor: '#e0e0e0'
},
});
... ...
'use strict';
import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, ListView, StyleSheet, Text, View, Image, TouchableOpacity} from 'react-native';
import {Immutable} from 'immutable';
export default class WithdrawalRecord extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderHeader = this._renderHeader.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
componentDidMount() {
this.subscription = DeviceEventEmitter.addListener('IdentityCardBindSuccessEvent', () => {
this.props.refreshIdentityCardInfo && this.props.refreshIdentityCardInfo();
});
}
componentWillUnmount() {
this.subscription.remove();
}
_renderHeader() {
let uploadStatus = this.props.identityCardInfo.data;
return (<View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}/>
{ uploadStatus ?
null
:
<View style={styles.uploadContainer}>
<Text style={styles.loadStyle}>{'结算收益时需按照国家规定预扣个税,因此需先上传身份证信息 。若未提供正确有效的身份信息将导致扣税失败而影响提现。'}</Text>
<TouchableOpacity style={styles.uploadButton} onPress={()=> {
this.props.jumpWithUrl && this.props.jumpWithUrl('我的身份证', 'nameAuthen');
}}>
<Text style={styles.buttonText}>{'去上传'}</Text>
</TouchableOpacity>
</View>
}
{ uploadStatus ?
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {lineHeight: 40}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center'}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
:
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {marginTop: 15, height: 17}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center', height: 17, marginTop: 15}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image style={{width: 11, height: 11}} source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
}
</View>
)
}
_renderRow(rowData, sectionID, rowID) {
let showSpace = rowID === rowData.length ? false : true;
return (
<View>
<View style={styles.rowView}>
<Text style={styles.numberText}>处理编号:{rowData.get("settlementCode")}</Text>
<Text style={styles.statusText}>{rowData.get("settlementStatus")}</Text>
</View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}></View>
<View style={styles.detailView}>
<Text>
<Text style={styles.priceText}>税后总收益:</Text>
<Text style={styles.allPriceText}>{rowData.get("afterTaxAmountStr")}</Text>
</Text>
<Text style={styles.priceText}>提现总金额:{rowData.get("settlementAmountStr")}</Text>
<Text style={styles.priceText}>扣税总金额:{rowData.get("taxAmountStr")}</Text>
<Text style={styles.timeText}>{rowData.get("settlementTimeStr")}</Text>
</View>
{showSpace? <View style={{width: width, height: 10, backgroundColor: '#f0f0f0'}}></View> : null}
</View>
);
}
render() {
let {
settlementRecordList,
} = this.props;
let recordList = settlementRecordList.list ? settlementRecordList.list.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
// yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(recordList)}
renderHeader={this._renderHeader}
renderRow={this._renderRow}
onEndReached={() => {
if (recordList.size !== 0) {
this.props.onEndReached && this.props.onEndReached();
}
}}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
alignItems: 'center'
},
contentContainer: {
width: width,
backgroundColor: 'white'
},
rowView: {
width: width,
height: 50,
flexDirection: 'row',
paddingLeft: 15,
paddingRight: 15,
alignItems: 'center',
justifyContent: 'space-between'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
detailView: {
width: width,
paddingTop: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'flex-start',
},
allPriceText:{
fontFamily: 'PingFang-SC-Medium',
fontSize: 14,
color: '#D0021B',
},
numberText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
},
priceText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
marginTop: 6,
},
timeText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#B0B0B0',
marginTop: 15,
},
statusText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#D0021B',
},
uploadContainer: {
width: width,
backgroundColor: 'transparent',
flexDirection: 'column',
alignItems: 'center',
paddingTop: 20,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
},
loadStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
backgroundColor: 'transparent',
textAlign: 'left',
lineHeight: 23,
},
uploadButton: {
width: 80,
height: 30,
marginTop: 10,
borderRadius: 4,
backgroundColor: '#D0021B',
alignItems: 'center',
justifyContent: 'center',
},
buttonText: {
color: 'white',
fontSize: 14,
fontWeight: 'bold',
},
withdrawContainer: {
width: width,
height: 40,
paddingLeft: 15,
paddingRight: 15,
backgroundColor: '#f0f0f0',
flexDirection: 'row',
justifyContent: 'space-between',
},
tipStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 12,
color: '#B0B0B0',
backgroundColor: 'transparent',
textAlign: 'center',
},
});
'use strict';
import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, StyleSheet, Text, View, Image, TouchableOpacity} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import {Immutable} from 'immutable';
export default class WithdrawalRecord extends Component {
constructor(props) {
super(props);
this._renderRow = this._renderRow.bind(this);
this._renderHeader = this._renderHeader.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
}
componentDidMount() {
this.subscription = DeviceEventEmitter.addListener('IdentityCardBindSuccessEvent', () => {
this.props.refreshIdentityCardInfo && this.props.refreshIdentityCardInfo();
});
}
componentWillUnmount() {
this.subscription.remove();
}
_renderHeader() {
let uploadStatus = this.props.identityCardInfo.data;
return (<View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}/>
{ uploadStatus ?
null
:
<View style={styles.uploadContainer}>
<Text style={styles.loadStyle}>{'结算收益时需按照国家规定预扣个税,因此需先上传身份证信息 。若未提供正确有效的身份信息将导致扣税失败而影响提现。'}</Text>
<TouchableOpacity style={styles.uploadButton} onPress={()=> {
this.props.jumpWithUrl && this.props.jumpWithUrl('我的身份证', 'nameAuthen');
}}>
<Text style={styles.buttonText}>{'去上传'}</Text>
</TouchableOpacity>
</View>
}
{ uploadStatus ?
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {lineHeight: 40}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center'}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
:
<View style={styles.withdrawContainer}>
<Text style={[styles.tipStyle, {marginTop: 15, height: 17}]}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
<TouchableOpacity activeOpacity={1} style={{flexDirection: 'row', alignItems: 'center', height: 17, marginTop: 15}} onPress={()=> {
this.props.jumpWithActivityUrl && this.props.jumpWithActivityUrl();
}}>
<Text style={styles.tipStyle}>{'结算说明 '}</Text>
<Image style={{width: 11, height: 11}} source={require('../images/more.png')}/>
</TouchableOpacity>
</View>
}
</View>
)
}
_renderRow(rowData, sectionID, rowID) {
let showSpace = rowID === rowData.length ? false : true;
return (
<View>
<View style={styles.rowView}>
<Text style={styles.numberText}>处理编号:{rowData.get("settlementCode")}</Text>
<Text style={styles.statusText}>{rowData.get("settlementStatus")}</Text>
</View>
<View style={{width: width, height: 0.5, backgroundColor: '#e0e0e0'}}></View>
<View style={styles.detailView}>
<Text>
<Text style={styles.priceText}>税后总收益:</Text>
<Text style={styles.allPriceText}>{rowData.get("afterTaxAmountStr")}</Text>
</Text>
<Text style={styles.priceText}>提现总金额:{rowData.get("settlementAmountStr")}</Text>
<Text style={styles.priceText}>扣税总金额:{rowData.get("taxAmountStr")}</Text>
<Text style={styles.timeText}>{rowData.get("settlementTimeStr")}</Text>
</View>
{showSpace? <View style={{width: width, height: 10, backgroundColor: '#f0f0f0'}}></View> : null}
</View>
);
}
render() {
let {
settlementRecordList,
} = this.props;
let recordList = settlementRecordList.list ? settlementRecordList.list.toArray() : [];
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
// yh_viewVisible={true}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
dataSource={this.dataSource.cloneWithRows(recordList)}
renderHeader={this._renderHeader}
renderRow={this._renderRow}
onEndReached={() => {
if (recordList.size !== 0) {
this.props.onEndReached && this.props.onEndReached();
}
}}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
alignItems: 'center'
},
contentContainer: {
width: width,
backgroundColor: 'white'
},
rowView: {
width: width,
height: 50,
flexDirection: 'row',
paddingLeft: 15,
paddingRight: 15,
alignItems: 'center',
justifyContent: 'space-between'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
detailView: {
width: width,
paddingTop: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'flex-start',
},
allPriceText:{
fontFamily: 'PingFang-SC-Medium',
fontSize: 14,
color: '#D0021B',
},
numberText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
},
priceText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
marginTop: 6,
},
timeText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#B0B0B0',
marginTop: 15,
},
statusText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#D0021B',
},
uploadContainer: {
width: width,
backgroundColor: 'transparent',
flexDirection: 'column',
alignItems: 'center',
paddingTop: 20,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 20,
},
loadStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 14,
color: '#444444',
backgroundColor: 'transparent',
textAlign: 'left',
lineHeight: 23,
},
uploadButton: {
width: 80,
height: 30,
marginTop: 10,
borderRadius: 4,
backgroundColor: '#D0021B',
alignItems: 'center',
justifyContent: 'center',
},
buttonText: {
color: 'white',
fontSize: 14,
fontWeight: 'bold',
},
withdrawContainer: {
width: width,
height: 40,
paddingLeft: 15,
paddingRight: 15,
backgroundColor: '#f0f0f0',
flexDirection: 'row',
justifyContent: 'space-between',
},
tipStyle: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 12,
color: '#B0B0B0',
backgroundColor: 'transparent',
textAlign: 'center',
},
});
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
TouchableOpacity,
Dimensions,
} = ReactNative;
export default class ImageSingle extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(id, name, url) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
F_ID: id,
F_NAME: name,
F_URL: url
};
if (this.props.messageResourceInfo) {
params = {
ID: id,
};
}
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'one', params);
}
render() {
let {resource} = this.props;
if (!resource || resource.size === 0) {
return null;
}
let data = resource.get('data').toJS();
let list = data && data.list;
if (!list || list.length === 0) {
return null;
}
let sliderWidth = this.props.style && this.props.style.width ? this.props.style.width : width;
let ratio = data.imageWidth / width;
let sliderHeight = data.imageHeight / ratio;
let imageUrl = YH_Image.getSlicedUrl(list[0].src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
activeOpacity={1}
yh_exposureData={list[0].yh_exposureData}
style={[{width: sliderWidth, height: sliderHeight},this.props.style]}
onPress={() => {
this._handleParamsJumpWithUrl(resource.get('template_id'), resource.get('template_name'), list[0].url);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
}
}
let {width} = Dimensions.get('window');
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
TouchableOpacity,
Dimensions,
} = ReactNative;
export default class ImageSingle extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(id, name, url) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
F_ID: id,
F_NAME: name,
F_URL: url
};
if (this.props.messageResourceInfo) {
params = {
ID: id,
};
}
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'one', params);
}
render() {
let {resource} = this.props;
if (!resource || resource.size === 0) {
return null;
}
let data = resource.get('data').toJS();
let list = data && data.list;
if (!list || list.length === 0) {
return null;
}
let sliderWidth = this.props.style && this.props.style.width ? this.props.style.width : width;
let ratio = data.imageWidth / width;
let sliderHeight = data.imageHeight / ratio;
let imageUrl = YH_Image.getSlicedUrl(list[0].src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
activeOpacity={1}
yh_exposureData={list[0].yh_exposureData}
style={[{width: sliderWidth, height: sliderHeight},this.props.style]}
onPress={() => {
this._handleParamsJumpWithUrl(resource.get('template_id'), resource.get('template_name'), list[0].url);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
}
}
let {width} = Dimensions.get('window');
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Swiper from '../../../common/components/YH_Swiper';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
View,
Image,
TouchableOpacity,
StyleSheet,
Dimensions,
Platform,
} = ReactNative;
export default class ImageSlider extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)
&& nextProps.sliderWidth == this.props.sliderWidth
&& nextProps.sliderHeight == this.props.sliderHeight) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(index, url) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
I_INDEX: index,
F_URL: url
};
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'banner', params);
}
render() {
let {resource, sliderWidth, sliderHeight} = this.props;
if (!resource || resource.size == 0) {
return null;
}
let data = this.props.resource.toJS();
if (data.length == 1) {
let imageUrl = YH_Image.getSlicedUrl(data[0].src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
activeOpacity={1}
yh_exposureData={data[0].yh_exposureData}
style={{width: sliderWidth, height: sliderHeight}}
onPress={() => {
this._handleParamsJumpWithUrl(1, data[0].url)
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
} else {
return (
<YH_Swiper
showsButtons={false}
loop={true}
autoplay={true}
autoplayTimeout={8}
width={sliderWidth}
height={sliderHeight}
paginationStyle={{
backgroundColor: 'rgba(68, 68, 68, 0.2)',
bottom: 10,
height: 10,
width: data.length * 12,
borderRadius: 5,
marginLeft: (sliderWidth - data.length * 12) / 2,
paddingBottom: 0,
}}
>
{data.map((item, i) => {
let imageUrl = YH_Image.getSlicedUrl(item.src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
yh_exposureData={item.yh_exposureData}
onPress={() => {
this._handleParamsJumpWithUrl(i + 1, item.url);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
})}
</YH_Swiper>
);
}
}
}
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Swiper from '../../../common/components/YH_Swiper';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
View,
Image,
TouchableOpacity,
StyleSheet,
Dimensions,
Platform,
} = ReactNative;
export default class ImageSlider extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)
&& nextProps.sliderWidth == this.props.sliderWidth
&& nextProps.sliderHeight == this.props.sliderHeight) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(index, url) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
I_INDEX: index,
F_URL: url
};
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'banner', params);
}
render() {
let {resource, sliderWidth, sliderHeight} = this.props;
if (!resource || resource.size == 0) {
return null;
}
let data = this.props.resource.toJS();
if (data.length == 1) {
let imageUrl = YH_Image.getSlicedUrl(data[0].src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
activeOpacity={1}
yh_exposureData={data[0].yh_exposureData}
style={{width: sliderWidth, height: sliderHeight}}
onPress={() => {
this._handleParamsJumpWithUrl(1, data[0].url)
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
} else {
return (
<YH_Swiper
showsButtons={false}
loop={true}
autoplay={true}
autoplayTimeout={8}
width={sliderWidth}
height={sliderHeight}
paginationStyle={{
backgroundColor: 'rgba(68, 68, 68, 0.2)',
bottom: 10,
height: 10,
width: data.length * 12,
borderRadius: 5,
marginLeft: (sliderWidth - data.length * 12) / 2,
paddingBottom: 0,
}}
>
{data.map((item, i) => {
let imageUrl = YH_Image.getSlicedUrl(item.src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
yh_exposureData={item.yh_exposureData}
onPress={() => {
this._handleParamsJumpWithUrl(i + 1, item.url);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
})}
</YH_Swiper>
);
}
}
}
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
View,
TouchableOpacity,
Dimensions,
} = ReactNative;
export default class ImageTwo extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(id, name, url, i_index) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
F_ID: id,
F_NAME: name,
F_URL: url,
I_INDEX: i_index
};
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'two', params);
}
render() {
let {resource} = this.props;
if (!resource || resource.size === 0) {
return null;
}
let data = resource.get('data').toJS();
let list = data && data.list;
console.log('four');
console.log(list);
if (!list || list.length === 0) {
return null;
}
let sliderWidth = (width - 40) / 2;
let sliderHeight = 120 * DEVICE_WIDTH_RATIO;
return (
<View style={{marginLeft: 15, marginRight: 15, marginBottom: 18, flexDirection: 'row',}}>
{list.map((item, i) => {
let imageUrl = YH_Image.getSlicedUrl(item.src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
yh_exposureData={item.yh_exposureData}
style={{width: sliderWidth, height: sliderHeight, marginRight:10}}
onPress={() => {
this._handleParamsJumpWithUrl(resource.get('template_id'), resource.get('template_name'), item.url, i + 1);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
})}
</View>
);
}
}
let {width} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import YH_Image from '../../../common/components/YH_Image';
import Immutable from 'immutable';
const {
View,
TouchableOpacity,
Dimensions,
} = ReactNative;
export default class ImageTwo extends React.Component {
constructor(props) {
super(props);
this._handleParamsJumpWithUrl = this._handleParamsJumpWithUrl.bind(this);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.resource, this.props.resource)) {
return false;
} else {
return true;
}
}
_handleParamsJumpWithUrl(id, name, url, i_index) {
// 为埋点提供参数组装
// 后期请将所有的点击事件由 resourceJumpWithUrl 修改为自己独有的事件
// 由于多数组件都使用的 resourceJumpWithUrl ,埋点传参无法正常进行
let params = {
F_ID: id,
F_NAME: name,
F_URL: url,
I_INDEX: i_index
};
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url, 'two', params);
}
render() {
let {resource} = this.props;
if (!resource || resource.size === 0) {
return null;
}
let data = resource.get('data').toJS();
let list = data && data.list;
console.log('four');
console.log(list);
if (!list || list.length === 0) {
return null;
}
let sliderWidth = (width - 40) / 2;
let sliderHeight = 120 * DEVICE_WIDTH_RATIO;
return (
<View style={{marginLeft: 15, marginRight: 15, marginBottom: 18, flexDirection: 'row',}}>
{list.map((item, i) => {
let imageUrl = YH_Image.getSlicedUrl(item.src, sliderWidth, sliderHeight, 2);
return (
<TouchableOpacity
key={i}
activeOpacity={1}
yh_exposureData={item.yh_exposureData}
style={{width: sliderWidth, height: sliderHeight, marginRight:10}}
onPress={() => {
this._handleParamsJumpWithUrl(resource.get('template_id'), resource.get('template_name'), item.url, i + 1);
}}
>
<YH_Image
url={imageUrl}
style={{width: sliderWidth, height: sliderHeight}}
/>
</TouchableOpacity>
);
})}
</View>
);
}
}
let {width} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import ImageSlider from '../cell/ImageSlider';
import Immutable from 'immutable';
const {
StyleSheet,
Dimensions,
View,
} = ReactNative;
export default class Focus extends React.Component {
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.data, this.props.data)) {
return false;
} else {
return true;
}
}
render() {
let {data} = this.props;
let sliderHeight = Math.ceil(this.props.height * DEVICE_WIDTH_RATIO);
return (
<View style={{height:sliderHeight, width:width}}>
<ImageSlider
resource={data}
sliderWidth={width}
sliderHeight={sliderHeight}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
let styles = StyleSheet.create({
banner: {},
});
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import ImageSlider from '../cell/ImageSlider';
import Immutable from 'immutable';
const {
StyleSheet,
Dimensions,
View,
} = ReactNative;
export default class Focus extends React.Component {
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.data, this.props.data)) {
return false;
} else {
return true;
}
}
render() {
let {data} = this.props;
let sliderHeight = Math.ceil(this.props.height * DEVICE_WIDTH_RATIO);
return (
<View style={{height:sliderHeight, width:width}}>
<ImageSlider
resource={data}
sliderWidth={width}
sliderHeight={sliderHeight}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 375;
let styles = StyleSheet.create({
banner: {},
});
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import Immutable from 'immutable';
import ImageSingle from "../cell/ImageSingle";
const {Dimensions} = ReactNative;
export default class SingleImage extends React.Component {
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.data, this.props.data)) {
return false;
} else {
return true;
}
}
render() {
return (
<ImageSingle
style={this.props.style}
resource={this.props.data}
messageResourceInfo={this.props.messageResourceInfo}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let sliderHeight = Math.ceil(100 * DEVICE_WIDTH_RATIO);
'use strict';
import React from 'react';
import ReactNative from 'react-native';
import Immutable from 'immutable';
import ImageSingle from "../cell/ImageSingle";
const {Dimensions} = ReactNative;
export default class SingleImage extends React.Component {
constructor(props) {
super(props);
}
shouldComponentUpdate(nextProps) {
if (Immutable.is(nextProps.data, this.props.data)) {
return false;
} else {
return true;
}
}
render() {
return (
<ImageSingle
style={this.props.style}
resource={this.props.data}
messageResourceInfo={this.props.messageResourceInfo}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
}
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let sliderHeight = Math.ceil(100 * DEVICE_WIDTH_RATIO);
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, Text, TouchableOpacity, View,} from 'react-native';
import {Dimensions, StyleSheet, Text, TouchableOpacity, View,} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import Immutable from 'immutable';
export default class CategorySelector extends Component {
... ...
'use strict';
import React, {Component} from 'react';
import {Dimensions, ListView, StyleSheet, TouchableOpacity, View} from 'react-native';
import {Dimensions, StyleSheet, TouchableOpacity, View} from 'react-native';
import ListView from 'deprecated-react-native-listview'
import LoadingIndicator from '../../../common/components/LoadingIndicator';
import ProductCell from './ProductCell';
... ...
import keyMirror from 'key-mirror';
export default keyMirror({
SET_PLATFORM: null,
SET_CHANNEL: null,
SET_HOST: null,
SET_SERVICE_HOST: null,
SHOW_TIPS_ALERT_DIALOG: null,
DISMISS_TIPS_ALERT_DIALOG: null,
SHOW_HELP_DIALOG: null,
DISMISS_HELP_DIALOG: null,
SHOW_SURE_DIALOG: null,
DISMISS_SURE_DIALOG: null,
SHOW_BANK_TIPS_ALERT: null,
DISMISS_BANK_TIPS_ALERT: null,
SET_ORDER_CODE: null,
SET_ACTIVITY_ID: null,
SET_SRC: null,
SET_JUMP_URL: null,
SET_PRODUCT_POOL:null,
SET_SKNS: null,
SHOW_WITHDRAW_DIALOG: null,
DISMISS_WITHDRAW_DIALOG: null,
SHOW_BANK_INFO_DIALOG: null,
DISMISS_BANK_INFO_DIALOG: null,
SETTLEMENT_INFO_REQUEST: null,
SETTLEMENT_INFO_SUCCESS: null,
SETTLEMENT_INFO_FAILURE: null,
ADD_SETTLEMENT_REQUEST: null,
ADD_SETTLEMENT_SUCCESS: null,
ADD_SETTLEMENT_FAILURE: null,
RESOURCE_INFO_REQUEST: null,
RESOURCE_INFO_SUCCESS: null,
RESOURCE_INFO_FAILURE: null,
MESSAGE_LIST_REQUEST: null,
MESSAGE_LIST_SUCCESS: null,
MESSAGE_LIST_FAILURE: null,
MINE_RESOURCE_INFO_REQUEST: null,
MINE_RESOURCE_INFO_SUCCESS: null,
MINE_RESOURCE_INFO_FAILURE: null,
RECENTLY_ORDER_REQUEST: null,
RECENTLY_ORDER_SUCCESS: null,
RECENTLY_ORDER_FAILURE: null,
ORDER_DETAIL_REQUEST: null,
ORDER_DETAIL_SUCCESS: null,
ORDER_DETAIL_FAILURE: null,
ACTIVITY_DETAIL_REQUEST: null,
ACTIVITY_DETAIL_SUCCESS: null,
ACTIVITY_DETAIL_FAILURE: null,
SETTLEMENT_RECORD_REQUEST: null,
SETTLEMENT_RECORD_SUCCESS: null,
SETTLEMENT_RECORD_FAILURE: null,
ORDER_LIST_REQUEST: null,
ORDER_LIST_SUCCESS: null,
ORDER_LIST_FAILURE: null,
ESTIMATE_LIST_REQUEST: null,
ESTIMATE_LIST_SUCCESS: null,
ESTIMATE_LIST_FAILURE: null,
TOP_LIST_REQUEST: null,
TOP_LIST_SUCCESS: null,
TOP_LIST_FAILURE: null,
PRODUCT_LIST_REQUEST: null,
PRODUCT_LIST_SUCCESS: null,
PRODUCT_LIST_FAILURE: null,
GET_BANK_CARD_REQUEST: null,
GET_BANK_CARD_SUCCESS: null,
GET_BANK_CARD_FAILURE: null,
GET_BANK_LIST_REQUEST: null,
GET_BANK_LIST_SUCCESS: null,
GET_BANK_LIST_FAILURE: null,
CHECK_BANK_CARD_REQUEST: null,
CHECK_BANK_CARD_SUCCESS: null,
CHECK_BANK_CARD_FAILURE: null,
BIND_BANK_CARD_REQUEST: null,
BIND_BANK_CARD_SUCCESS: null,
BIND_BANK_CARD_FAILURE: null,
//recommend
HISTORY_LIST_REQUEST: null,
HISTORY_LIST_SUCCESS: null,
HISTORY_LIST_FAILURE: null,
HISTORY_SORT_LIST_REQUEST: null,
HISTORY_SORT_LIST_SUCCESS: null,
HISTORY_SORT_LIST_FAILURE: null,
STATISTICS_REQUEST: null,
STATISTICS_SUCCESS: null,
STATISTICS_FAILURE: null,
GET_MINEUSERINFO_REQUEST: null,
GET_MINEUSERINFO_SUCCESS: null,
GET_MINEUSERINFO_FAILURE: null,
SET_SELECTED_CATEGORY: null,
HISTORY_DELETE_REQUEST: null,
HISTORY_DELETE_SUCCESS: null,
HISTORY_DELETE_FAILURE: null,
HISTORY_CLEAR_REQUEST: null,
HISTORY_CLEAR_SUCCESS: null,
HISTORY_CLEAR_FAILURE: null,
APP_SET_SELECTED_CATEGORY: null,
GET_UID: null,
TALENT_RANK_REQUEST: null,
MONTH_RANK_SUCCESS: null,
TOTAL_RANK_SUCCESS: null,
TALENT_RANK_FAILURE: null,
BANNER_INVITECODE_REQUEST: null,
BANNER_INVITECODE_SUCCESS: null,
BANNER_INVITECODE_FAILURE: null,
SHARE_DETAIL_REQUEST: null,
SHARE_DETAIL_SUCCESS: null,
SHARE_DETAIL_FAILURE: null,
ADD_FAVORITE_REQUEST: null,
ADD_FAVORITE_SUCCESS: null,
ADD_FAVORITE_FAILURE: null,
FAVORITE_INFO_REQUEST: null,
FAVORITE_INFO_FAILURE: null,
SHARE_CODE_INFO_REQUEST: null,
SHARE_CODE_INFO_SUCCESS: null,
SHARE_CODE_INFO_FAILURE: null,
INVITED_FRIENDS_REQUEST: null,
INVITED_FRIENDS_SUCCESS: null,
INVITED_FRIENDS_FAILURE: null,
SHARETOTAL_REQUEST: null,
SHARETOTAL_SUCCESS: null,
SHARETOTAL_FAILURE: null,
SHOW_TIP_MESSAGE: null,
HIDDEN_TIP_MESSAGE: null,
IDENTITY_CARD_INFO_REQUEST: null,
IDENTITY_CARD_INFO_SUCCESS: null,
IDENTITY_CARD_INFO_FAILURE: null,
BIND_IDENTITY_CARD_REQUEST: null,
BIND_IDENTITY_CARD_SUCCESS: null,
BIND_IDENTITY_CARD_FAILURE: null,
SHOW_TOAST: null,
HIDE_TOAST: null,
SHOW_LOADING: null,
CHECK_SETTLEMENT_REQUEST: null,
CHECK_SETTLEMENT_SUCCESS: null,
CHECK_SETTLEMENT_FAILURE: null,
SHOW_BIND_ALERT_DIALOG: null,
DISMISS_BIND_ALERT_DIALOG: null,
SHOW_CHECKSETTLE_DIALOG: null,
DISMISS_CHECKSETTLE_DIALOG: null,
QUERY_INVITE_YOHOLIST_REQUEST: null,
QUERY_INVITE_YOHOLIST_SUCCESS: null,
QUERY_INVITE_YOHOLIST_FAILURE: null,
INVITE_YOHO_RESOURCEINFO_REQUEST: null,
INVITE_YOHO_RESOURCEINFO_SUCCESS: null,
INVITE_YOHO_RESOURCEINFO_FAILURE: null,
GET_LOCATION_REQUEST: null,
GET_LOCATION_SUCCESS: null,
GET_LOCATION_FAILURE: null,
});
import keyMirror from 'key-mirror';
export default keyMirror({
SET_PLATFORM: null,
SET_CHANNEL: null,
SET_HOST: null,
SET_SERVICE_HOST: null,
SHOW_TIPS_ALERT_DIALOG: null,
DISMISS_TIPS_ALERT_DIALOG: null,
SHOW_HELP_DIALOG: null,
DISMISS_HELP_DIALOG: null,
SHOW_SURE_DIALOG: null,
DISMISS_SURE_DIALOG: null,
SHOW_BANK_TIPS_ALERT: null,
DISMISS_BANK_TIPS_ALERT: null,
SET_ORDER_CODE: null,
SET_ACTIVITY_ID: null,
SET_SRC: null,
SET_JUMP_URL: null,
SET_PRODUCT_POOL:null,
SET_SKNS: null,
SHOW_WITHDRAW_DIALOG: null,
DISMISS_WITHDRAW_DIALOG: null,
SHOW_BANK_INFO_DIALOG: null,
DISMISS_BANK_INFO_DIALOG: null,
SETTLEMENT_INFO_REQUEST: null,
SETTLEMENT_INFO_SUCCESS: null,
SETTLEMENT_INFO_FAILURE: null,
ADD_SETTLEMENT_REQUEST: null,
ADD_SETTLEMENT_SUCCESS: null,
ADD_SETTLEMENT_FAILURE: null,
RESOURCE_INFO_REQUEST: null,
RESOURCE_INFO_SUCCESS: null,
RESOURCE_INFO_FAILURE: null,
MESSAGE_LIST_REQUEST: null,
MESSAGE_LIST_SUCCESS: null,
MESSAGE_LIST_FAILURE: null,
MINE_RESOURCE_INFO_REQUEST: null,
MINE_RESOURCE_INFO_SUCCESS: null,
MINE_RESOURCE_INFO_FAILURE: null,
RECENTLY_ORDER_REQUEST: null,
RECENTLY_ORDER_SUCCESS: null,
RECENTLY_ORDER_FAILURE: null,
ORDER_DETAIL_REQUEST: null,
ORDER_DETAIL_SUCCESS: null,
ORDER_DETAIL_FAILURE: null,
ACTIVITY_DETAIL_REQUEST: null,
ACTIVITY_DETAIL_SUCCESS: null,
ACTIVITY_DETAIL_FAILURE: null,
SETTLEMENT_RECORD_REQUEST: null,
SETTLEMENT_RECORD_SUCCESS: null,
SETTLEMENT_RECORD_FAILURE: null,
ORDER_LIST_REQUEST: null,
ORDER_LIST_SUCCESS: null,
ORDER_LIST_FAILURE: null,
ESTIMATE_LIST_REQUEST: null,
ESTIMATE_LIST_SUCCESS: null,
ESTIMATE_LIST_FAILURE: null,
TOP_LIST_REQUEST: null,
TOP_LIST_SUCCESS: null,
TOP_LIST_FAILURE: null,
PRODUCT_LIST_REQUEST: null,
PRODUCT_LIST_SUCCESS: null,
PRODUCT_LIST_FAILURE: null,
GET_BANK_CARD_REQUEST: null,
GET_BANK_CARD_SUCCESS: null,
GET_BANK_CARD_FAILURE: null,
GET_BANK_LIST_REQUEST: null,
GET_BANK_LIST_SUCCESS: null,
GET_BANK_LIST_FAILURE: null,
CHECK_BANK_CARD_REQUEST: null,
CHECK_BANK_CARD_SUCCESS: null,
CHECK_BANK_CARD_FAILURE: null,
BIND_BANK_CARD_REQUEST: null,
BIND_BANK_CARD_SUCCESS: null,
BIND_BANK_CARD_FAILURE: null,
//recommend
HISTORY_LIST_REQUEST: null,
HISTORY_LIST_SUCCESS: null,
HISTORY_LIST_FAILURE: null,
HISTORY_SORT_LIST_REQUEST: null,
HISTORY_SORT_LIST_SUCCESS: null,
HISTORY_SORT_LIST_FAILURE: null,
STATISTICS_REQUEST: null,
STATISTICS_SUCCESS: null,
STATISTICS_FAILURE: null,
GET_MINEUSERINFO_REQUEST: null,
GET_MINEUSERINFO_SUCCESS: null,
GET_MINEUSERINFO_FAILURE: null,
SET_SELECTED_CATEGORY: null,
HISTORY_DELETE_REQUEST: null,
HISTORY_DELETE_SUCCESS: null,
HISTORY_DELETE_FAILURE: null,
HISTORY_CLEAR_REQUEST: null,
HISTORY_CLEAR_SUCCESS: null,
HISTORY_CLEAR_FAILURE: null,
APP_SET_SELECTED_CATEGORY: null,
GET_UID: null,
TALENT_RANK_REQUEST: null,
MONTH_RANK_SUCCESS: null,
TOTAL_RANK_SUCCESS: null,
TALENT_RANK_FAILURE: null,
BANNER_INVITECODE_REQUEST: null,
BANNER_INVITECODE_SUCCESS: null,
BANNER_INVITECODE_FAILURE: null,
SHARE_DETAIL_REQUEST: null,
SHARE_DETAIL_SUCCESS: null,
SHARE_DETAIL_FAILURE: null,
ADD_FAVORITE_REQUEST: null,
ADD_FAVORITE_SUCCESS: null,
ADD_FAVORITE_FAILURE: null,
FAVORITE_INFO_REQUEST: null,
FAVORITE_INFO_FAILURE: null,
SHARE_CODE_INFO_REQUEST: null,
SHARE_CODE_INFO_SUCCESS: null,
SHARE_CODE_INFO_FAILURE: null,
INVITED_FRIENDS_REQUEST: null,
INVITED_FRIENDS_SUCCESS: null,
INVITED_FRIENDS_FAILURE: null,
SHARETOTAL_REQUEST: null,
SHARETOTAL_SUCCESS: null,
SHARETOTAL_FAILURE: null,
SHOW_TIP_MESSAGE: null,
HIDDEN_TIP_MESSAGE: null,
IDENTITY_CARD_INFO_REQUEST: null,
IDENTITY_CARD_INFO_SUCCESS: null,
IDENTITY_CARD_INFO_FAILURE: null,
BIND_IDENTITY_CARD_REQUEST: null,
BIND_IDENTITY_CARD_SUCCESS: null,
BIND_IDENTITY_CARD_FAILURE: null,
SHOW_TOAST: null,
HIDE_TOAST: null,
SHOW_LOADING: null,
CHECK_SETTLEMENT_REQUEST: null,
CHECK_SETTLEMENT_SUCCESS: null,
CHECK_SETTLEMENT_FAILURE: null,
SHOW_BIND_ALERT_DIALOG: null,
DISMISS_BIND_ALERT_DIALOG: null,
SHOW_CHECKSETTLE_DIALOG: null,
DISMISS_CHECKSETTLE_DIALOG: null,
QUERY_INVITE_YOHOLIST_REQUEST: null,
QUERY_INVITE_YOHOLIST_SUCCESS: null,
QUERY_INVITE_YOHOLIST_FAILURE: null,
INVITE_YOHO_RESOURCEINFO_REQUEST: null,
INVITE_YOHO_RESOURCEINFO_SUCCESS: null,
INVITE_YOHO_RESOURCEINFO_FAILURE: null,
GET_LOCATION_REQUEST: null,
GET_LOCATION_SUCCESS: null,
GET_LOCATION_FAILURE: null,
});
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {AsyncStorage, Platform, StyleSheet, View} from 'react-native'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import Alliance from '../components/Alliance'
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
const AsyncStorageKey = "RN_FIRST_FLAG";
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class AllianceContainer extends Component {
constructor(props) {
super(props);
this.state = {
tips: '',
firstFlag: '0'
};
this._showTipsAlertDialog = this._showTipsAlertDialog.bind(this);
this._hiddenTipsAlertDialog = this._hiddenTipsAlertDialog.bind(this);
this._hiddenGuideDialog = this._hiddenGuideDialog.bind(this);
this._showHelpDialog = this._showHelpDialog.bind(this);
this._hiddenHelpDialog = this._hiddenHelpDialog.bind(this);
this._showSureDialog = this._showSureDialog.bind(this);
this._hiddenSureDialog = this._hiddenSureDialog.bind(this);
this._showWithDrawDialog = this._showWithDrawDialog.bind(this);
this._hiddenWithDrawDialog = this._hiddenWithDrawDialog.bind(this);
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._onPressProduct = this._onPressProduct.bind(this);
this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
this._onEndReached = this._onEndReached.bind(this);
this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this);
AsyncStorage.getItem(AsyncStorageKey, (error, value) => {
if (error) {
return
}
if (value === null) {
AsyncStorage.setItem(AsyncStorageKey, '1', (error) => {
if(error){
return
}
this.setState({
firstFlag: '1',
});
});
} else {
this.setState({
firstFlag: value,
});
}
});
}
componentDidMount() {
this.props.actions.getSettlementInfo();
this.props.actions.getResourceInfo();
this.props.actions.getRecentlyOrderLimitTen();
this.props.actions.getTop100List();
}
componentWillUnmount() {
}
_hiddenGuideDialog() {
AsyncStorage.setItem(AsyncStorageKey, '0', () => {
this.setState({
firstFlag: '0',
});
});
}
_showTipsAlertDialog(tips) {
this.setState({
tips,
});
this.props.actions.showTipsAlertDialog();
}
_hiddenTipsAlertDialog() {
this.props.actions.hiddenTipsAlertDialog();
}
_showHelpDialog(tips) {
this.setState({
tips,
});
this.props.actions.showHelpDialog();
}
_hiddenHelpDialog() {
this.props.actions.hiddenHelpDialog();
}
_showSureDialog() {
this.props.actions.showSureDialog();
}
_hiddenSureDialog() {
this.props.actions.hiddenSureDialog();
}
_showWithDrawDialog() {
this.props.actions.getAddSettlement();
}
_hiddenWithDrawDialog() {
this.props.actions.hiddenWithDrawDialog();
//重新刷新页面
this.props.actions.getSettlementInfo();
this.props.actions.getRecentlyOrderLimitTen();
}
_jumpWithUrl(title = '', type = '', orderCode = '') {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}","order_code":"${orderCode}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
//重新请求信息,更新银行卡绑定状态
_refreshSettlementInfo() {
this.props.actions.getSettlementInfo();
}
_resourceJumpWithUrl(url) {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_onPressProduct(product) {
let productSkn = product && product.get('product_skn', 0);
let is_global = product && product.get('is_global', 'N');
if (!productSkn) {
return;
}
let pageName = 'iFP_Alliance';
if (Platform.OS === 'android') {
pageName = 'aFP_Alliance';
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}", "from_page_name":"${pageName}"}}`;
if (is_global === 'Y') {
url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.globalpurchase","params":{"skn":"${productSkn}"}}`;
}
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_onEndReached() {
this.props.actions.getTop100List();
}
render() {
let {
showTipsAlert,
showHelpDialog,
showSureDialog,
showWithdrawalDialog,
settlementInfo,
addSettlement,
resourceInfo,
recentlyOrder,
topList
} = this.props.alliance;
let tip = this.state.tips;
let isShowGuide = this.state.firstFlag === '1';
let isFetching = settlementInfo.isFetching || recentlyOrder.isFetching;
return (
<View style={styles.container}>
<Alliance
isShowTipsAlert={showTipsAlert}
isShowGuide={isShowGuide}
isShowHelp={showHelpDialog}
isShowSure={showSureDialog}
isShowWithdrawal={showWithdrawalDialog}
settlementInfo={settlementInfo}
addSettlement={addSettlement}
resourceInfo={resourceInfo}
recentlyOrder={recentlyOrder}
topList={topList}
tips={tip}
showTipsAlertDialog={this._showTipsAlertDialog}
hiddenTipsAlertDialog={this._hiddenTipsAlertDialog}
hiddenGuideDialog={this._hiddenGuideDialog}
showHelpDialog={this._showHelpDialog}
hiddenHelpDialog={this._hiddenHelpDialog}
showSureDialog={this._showSureDialog}
hiddenSureDialog={this._hiddenSureDialog}
showWithdrawalDialog={this._showWithDrawDialog}
hiddenWithDrawDialog={this._hiddenWithDrawDialog}
jumpWithUrl={this._jumpWithUrl}
refreshSettlementInfo={this._refreshSettlementInfo}
resourceJumpWithUrl={this._resourceJumpWithUrl}
onPressProduct={this._onPressProduct}
onEndReached={this._onEndReached}
/>
<LoadingIndicator isVisible={isFetching}/>
</View>
);
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(AllianceContainer);
'use strict';
import React, {Component} from 'react';
import ReactNative, {AsyncStorage, Platform, StyleSheet, View} from 'react-native'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import Alliance from '../components/Alliance'
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
const AsyncStorageKey = "RN_FIRST_FLAG";
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class AllianceContainer extends Component {
constructor(props) {
super(props);
this.state = {
tips: '',
firstFlag: '0'
};
this._showTipsAlertDialog = this._showTipsAlertDialog.bind(this);
this._hiddenTipsAlertDialog = this._hiddenTipsAlertDialog.bind(this);
this._hiddenGuideDialog = this._hiddenGuideDialog.bind(this);
this._showHelpDialog = this._showHelpDialog.bind(this);
this._hiddenHelpDialog = this._hiddenHelpDialog.bind(this);
this._showSureDialog = this._showSureDialog.bind(this);
this._hiddenSureDialog = this._hiddenSureDialog.bind(this);
this._showWithDrawDialog = this._showWithDrawDialog.bind(this);
this._hiddenWithDrawDialog = this._hiddenWithDrawDialog.bind(this);
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._onPressProduct = this._onPressProduct.bind(this);
this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
this._onEndReached = this._onEndReached.bind(this);
this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this);
AsyncStorage.getItem(AsyncStorageKey, (error, value) => {
if (error) {
return
}
if (value === null) {
AsyncStorage.setItem(AsyncStorageKey, '1', (error) => {
if(error){
return
}
this.setState({
firstFlag: '1',
});
});
} else {
this.setState({
firstFlag: value,
});
}
});
}
componentDidMount() {
this.props.actions.getSettlementInfo();
this.props.actions.getResourceInfo();
this.props.actions.getRecentlyOrderLimitTen();
this.props.actions.getTop100List();
}
componentWillUnmount() {
}
_hiddenGuideDialog() {
AsyncStorage.setItem(AsyncStorageKey, '0', () => {
this.setState({
firstFlag: '0',
});
});
}
_showTipsAlertDialog(tips) {
this.setState({
tips,
});
this.props.actions.showTipsAlertDialog();
}
_hiddenTipsAlertDialog() {
this.props.actions.hiddenTipsAlertDialog();
}
_showHelpDialog(tips) {
this.setState({
tips,
});
this.props.actions.showHelpDialog();
}
_hiddenHelpDialog() {
this.props.actions.hiddenHelpDialog();
}
_showSureDialog() {
this.props.actions.showSureDialog();
}
_hiddenSureDialog() {
this.props.actions.hiddenSureDialog();
}
_showWithDrawDialog() {
this.props.actions.getAddSettlement();
}
_hiddenWithDrawDialog() {
this.props.actions.hiddenWithDrawDialog();
//重新刷新页面
this.props.actions.getSettlementInfo();
this.props.actions.getRecentlyOrderLimitTen();
}
_jumpWithUrl(title = '', type = '', orderCode = '') {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}","order_code":"${orderCode}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
//重新请求信息,更新银行卡绑定状态
_refreshSettlementInfo() {
this.props.actions.getSettlementInfo();
}
_resourceJumpWithUrl(url) {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_onPressProduct(product) {
let productSkn = product && product.get('product_skn', 0);
let is_global = product && product.get('is_global', 'N');
if (!productSkn) {
return;
}
let pageName = 'iFP_Alliance';
if (Platform.OS === 'android') {
pageName = 'aFP_Alliance';
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}", "from_page_name":"${pageName}"}}`;
if (is_global === 'Y') {
url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.globalpurchase","params":{"skn":"${productSkn}"}}`;
}
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_onEndReached() {
this.props.actions.getTop100List();
}
render() {
let {
showTipsAlert,
showHelpDialog,
showSureDialog,
showWithdrawalDialog,
settlementInfo,
addSettlement,
resourceInfo,
recentlyOrder,
topList
} = this.props.alliance;
let tip = this.state.tips;
let isShowGuide = this.state.firstFlag === '1';
let isFetching = settlementInfo.isFetching || recentlyOrder.isFetching;
return (
<View style={styles.container}>
<Alliance
isShowTipsAlert={showTipsAlert}
isShowGuide={isShowGuide}
isShowHelp={showHelpDialog}
isShowSure={showSureDialog}
isShowWithdrawal={showWithdrawalDialog}
settlementInfo={settlementInfo}
addSettlement={addSettlement}
resourceInfo={resourceInfo}
recentlyOrder={recentlyOrder}
topList={topList}
tips={tip}
showTipsAlertDialog={this._showTipsAlertDialog}
hiddenTipsAlertDialog={this._hiddenTipsAlertDialog}
hiddenGuideDialog={this._hiddenGuideDialog}
showHelpDialog={this._showHelpDialog}
hiddenHelpDialog={this._hiddenHelpDialog}
showSureDialog={this._showSureDialog}
hiddenSureDialog={this._hiddenSureDialog}
showWithdrawalDialog={this._showWithDrawDialog}
hiddenWithDrawDialog={this._hiddenWithDrawDialog}
jumpWithUrl={this._jumpWithUrl}
refreshSettlementInfo={this._refreshSettlementInfo}
resourceJumpWithUrl={this._resourceJumpWithUrl}
onPressProduct={this._onPressProduct}
onEndReached={this._onEndReached}
/>
<LoadingIndicator isVisible={isFetching}/>
</View>
);
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(AllianceContainer);
... ...
'use strict';
import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import ReactNative, {StyleSheet, View} from "react-native";
import BankCard from "../components/BankCard";
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class BankCardContainer extends Component {
constructor(props) {
super(props);
this.state = {
isBand: '',
};
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._hiddenSureDialog = this._hiddenSureDialog.bind(this);
this._checkBankCard = this._checkBankCard.bind(this);
this._bindBankCard = this._bindBankCard.bind(this);
this._showBankTipsAlert = this._showBankTipsAlert.bind(this);
this._hiddenBankTipsAlert = this._hiddenBankTipsAlert.bind(this);
}
componentDidMount() {
if (this.props.alliance.orderCode === '2') {
this.props.actions.getBankInfo();
}
}
componentWillUnmount() {
}
_jumpWithUrl(title = '', type = '') {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_checkBankCard(name, idCardNo, bankCode, bankCardNo,bankBranch,bankCityId) {
this.props.actions.checkBankCard(name, idCardNo, bankCode, bankCardNo,bankBranch, bankCityId);
}
_bindBankCard(bankInfo) {
this.props.actions.bindBankCard(bankInfo.name, bankInfo.idCardNo, bankInfo.bankCode, bankInfo.bankCardNo,bankInfo.bankBranch, bankInfo.bankCityId);
}
_hiddenSureDialog() {
this.props.actions.hiddenBankInfoDialog();
}
_showBankTipsAlert() {
this.props.actions.showBankTipsAlert();
}
_hiddenBankTipsAlert() {
this.props.actions.hiddenBankTipsAlert();
}
render() {
let {orderCode, getBankCardInfo, checkBankCardResult, showBankInfoDialog, showBankAlert} = this.props.alliance;
let isFetching = getBankCardInfo.isFetching;
return (
<View style={styles.container}>
<BankCard
status = {orderCode}
isShowDialog={showBankInfoDialog}
bankCardInfo={getBankCardInfo}
checkBankCardResult = {checkBankCardResult}
jumpWithUrl={this._jumpWithUrl}
hiddenSureDialog={this._hiddenSureDialog}
checkBankCard={this._checkBankCard}
bindBankCard={this._bindBankCard}
isShowBankAlert={showBankAlert}
showBankTipsAlert={this._showBankTipsAlert}
hiddenBankTipsAlert={this._hiddenBankTipsAlert}/>
<LoadingIndicator isVisible={isFetching}/>
</View>
)
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(BankCardContainer);
'use strict';
import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import ReactNative, {StyleSheet, View} from "react-native";
import BankCard from "../components/BankCard";
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class BankCardContainer extends Component {
constructor(props) {
super(props);
this.state = {
isBand: '',
};
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._hiddenSureDialog = this._hiddenSureDialog.bind(this);
this._checkBankCard = this._checkBankCard.bind(this);
this._bindBankCard = this._bindBankCard.bind(this);
this._showBankTipsAlert = this._showBankTipsAlert.bind(this);
this._hiddenBankTipsAlert = this._hiddenBankTipsAlert.bind(this);
}
componentDidMount() {
if (this.props.alliance.orderCode === '2') {
this.props.actions.getBankInfo();
}
}
componentWillUnmount() {
}
_jumpWithUrl(title = '', type = '') {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_checkBankCard(name, idCardNo, bankCode, bankCardNo,bankBranch,bankCityId) {
this.props.actions.checkBankCard(name, idCardNo, bankCode, bankCardNo,bankBranch, bankCityId);
}
_bindBankCard(bankInfo) {
this.props.actions.bindBankCard(bankInfo.name, bankInfo.idCardNo, bankInfo.bankCode, bankInfo.bankCardNo,bankInfo.bankBranch, bankInfo.bankCityId);
}
_hiddenSureDialog() {
this.props.actions.hiddenBankInfoDialog();
}
_showBankTipsAlert() {
this.props.actions.showBankTipsAlert();
}
_hiddenBankTipsAlert() {
this.props.actions.hiddenBankTipsAlert();
}
render() {
let {orderCode, getBankCardInfo, checkBankCardResult, showBankInfoDialog, showBankAlert} = this.props.alliance;
let isFetching = getBankCardInfo.isFetching;
return (
<View style={styles.container}>
<BankCard
status = {orderCode}
isShowDialog={showBankInfoDialog}
bankCardInfo={getBankCardInfo}
checkBankCardResult = {checkBankCardResult}
jumpWithUrl={this._jumpWithUrl}
hiddenSureDialog={this._hiddenSureDialog}
checkBankCard={this._checkBankCard}
bindBankCard={this._bindBankCard}
isShowBankAlert={showBankAlert}
showBankTipsAlert={this._showBankTipsAlert}
hiddenBankTipsAlert={this._hiddenBankTipsAlert}/>
<LoadingIndicator isVisible={isFetching}/>
</View>
)
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(BankCardContainer);
... ...
'use strict';
import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import {StyleSheet, View,} from "react-native";
import BankList from "../components/BankList";
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class BankListContainer extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.actions.getBankList();
}
componentWillUnmount() {
}
render() {
let {bankListInfo} = this.props.alliance;
let isFetching = bankListInfo.isFetching;
return (
<View style={styles.container}>
<BankList bankListInfo={bankListInfo}/>
<LoadingIndicator isVisible={isFetching}/>
</View>
)
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(BankListContainer);
'use strict';
import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import {StyleSheet, View,} from "react-native";
import BankList from "../components/BankList";
import LoadingIndicator from '../../common/components/LoadingIndicator';
const actions = [
allianceActions,
];
function mapStateToProps(state) {
return {
...state
};
}
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class BankListContainer extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.actions.getBankList();
}
componentWillUnmount() {
}
render() {
let {bankListInfo} = this.props.alliance;
let isFetching = bankListInfo.isFetching;
return (
<View style={styles.container}>
<BankList bankListInfo={bankListInfo}/>
<LoadingIndicator isVisible={isFetching}/>
</View>
)
}
}
let styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(BankListContainer);
... ...