Statistics.js
5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
'use strict';
import React, {Component} from 'react';
import {DeviceEventEmitter, Dimensions, Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default class Statistics extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.subscription = DeviceEventEmitter.addListener('BankCardBindSuccessEvent', () => {
this.props.refreshSettlementInfo && this.props.refreshSettlementInfo();
});
}
componentWillUnmount() {
this.subscription.remove();
}
render() {
let {statisticsInfo} = this.props;
let currentTab = this.props.currentTab;
return (
<View style={styles.container}>
<View style={styles.statisticsView}>
<TouchableOpacity activeOpacity={1} style={styles.container} onPress={() => {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"预估佣金","type":"estimateDetails","time_type":${currentTab}, "tab_type":"1"}}`;
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url);
}} >
<View style={{width: width / 2, paddingLeft: 30, marginTop: -8}}>
<Text style={styles.numberText}>¥{statisticsInfo.orderAmountSum}</Text>
<Text style={styles.tipsText}>预估订单佣金</Text>
</View>
</TouchableOpacity>
<View style={styles.spaceView}/>
<TouchableOpacity activeOpacity={1} style={styles.container} onPress={() => {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"预估佣金","type":"estimateDetails","time_type":${currentTab}, "tab_type":"2"}}`;
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url);
}} >
<View style={{width: width / 2, paddingLeft: 30, marginTop: -8}}>
<Text style={styles.numberText}>¥{statisticsInfo.extraAmountSum}</Text>
<Text style={styles.tipsText}>预估其他佣金</Text>
</View>
</TouchableOpacity>
</View>
<View style={styles.lineView}/>
<View style={styles.statisticsView}>
<TouchableOpacity activeOpacity={1} style={styles.container} onPress={() => {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"预估佣金","type":"estimateDetails","time_type":${currentTab}, "tab_type":"1"}}`;
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url);
}} >
<View style={{width: width / 2, paddingLeft: 30, marginTop: -10}}>
<Text style={styles.numberText}>{statisticsInfo.orderNum}</Text>
<Text style={styles.tipsText}>订单数</Text>
</View>
</TouchableOpacity>
<View style={styles.spaceView}/>
<TouchableOpacity activeOpacity={1} style={styles.container} onPress={() => {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"全部佣金","type":"orderIncome"}}`;
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(url);
}} >
<View style={{width: width / 2, paddingLeft: 30, marginTop: -10}}>
<Text style={styles.numberText}>{statisticsInfo.clickNum}</Text>
<Text style={styles.tipsText}>点击数</Text>
</View>
</TouchableOpacity>
</View>
<View style={styles.lineView}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
},
statisticsView: {
width: width,
height: 90,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
},
numberText: {
fontFamily: 'PingFang-SC-Regular',
fontSize: 25,
color: '#444444',
},
tipsText: {
fontFamily: 'PingFang-SC-Regular',
marginTop: 5,
fontSize: 12,
color: '#B0B0B0',
},
arrowImage: {
width: 16,
height: 16,
marginLeft: 2,
},
spaceView: {
width: 0.5,
height: 90,
backgroundColor: '#e0e0e0'
},
lineView: {
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
}
})
;