index.js
3.5 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
import React,{Component} from 'react';
import { connect } from 'dva';
import { SwipeAction, List } from 'antd-mobile';
import styles from "./swipeActive.css"
class SwipeActionExample extends Component{
constructor(props){
super(props);
this.state={
}
}
componentDidMount(){
}
editor=(item)=>{
if(item.seriNo){
// this.props.goPlan(item)
/*this.props.dispatch(routerRedux.push({
pathname: '/planEditor',
query: {
seriNo:item.seriNo,
riskName:item.riskName,
},
}));*/
this.props.go1(item)
}
//通讯录修改
if(this.props.client){
this.props.dispatch(item)
}
}
delete=(item)=>{
// 通讯录删除
if(this.props.client) {
console.log(this.props.item.id);
this.props.delete(this.props.item.id)
}else{
this.props.go(item)
}
}
history=(item)=>{
}
render(){
return (
<List style={{width:'4.14rem',}} >
<SwipeAction
style={{ backgroundColor: 'red',width:'4.14rem', }}
autoClose
disabled = {this.props.disabled}
right={[
{
text: '修改',
onPress: ()=>{
this.editor(this.props.item)
},
style: { backgroundColor: '#ddd', color: 'white',width:'.8rem' },
},
{
text: '删除',
onPress: () => {
this.delete(this.props.item)
},
style: { backgroundColor: '#F4333C', color: 'white' ,width:'.8rem'},
},
]}
onOpen={() => console.log('global open')}
onClose={() => console.log('global close')}
>
<List.Item
// arrow="horizontal"
onClick={e => console.log(e)}
style={{width:'4.14rem'}}
>
{/* 我的客户----通讯录 */}
{this.props.client ? <div >
{this.props.item.name}
{this.props.label && <span className={styles.label}>{this.props.item.label}</span>}
<span className={styles.time}>{this.props.item.time}</span>
</div>
:
/* 计划书 --- 我的 */
<div className={styles.myItem} onClick={(e)=>{
// e.preventDefault();
this.props.goPlanResult(this.props.item)
}} >
<div className={styles.myleft}>
<img src={this.props.item.thumbnail} alt=""/>
</div>
<div className={styles.myright}>
<div className={styles.top} style={{marginBottom:'.05rem'}}>
<div className={styles.mytitle}>{this.props.item.riskName}</div>
</div>
<div className={styles.detail}>{this.props.item.insSex== 'M'?'男':'女'} {this.props.item.insAge} 期缴保费:{this.props.item.prem}元 </div>
<div className={styles.detail2}>制作时间:{this.props.item.createTime}</div>
</div>
</div>}
</List.Item>
</SwipeAction>
</List>
)
}
}
// export default withRouter(SwipeActionExample)
export default connect(({home})=>({home}))(SwipeActionExample)
// (Form.create()(History))