index.js
2.64 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
import React, { Component } from 'react'
import { connect } from 'dva'
import styles from './InsuranceList.css'
import SwipeActionExample from "../../components/SwipeAction"
class InsuranceList extends Component{
constructor(props){
super(props);
this.state={
planList:[],
}
}
componentDidMount(){
console.log(this.props.planList);
this.setState({
planList:this.props.planList
})
}
go1=(item)=>{
this.props.go1(item)
}
go=(item)=>{
console.log(5555);
let that = this;
this.props.dispatch({
type: 'planEditor/deletePlan',
payload: {
"seriNo": item.seriNo,
"deleteType": 0,
"riskCode": item.riskCode
},
callback(data){
console.log(data);
// that.props.go()
that.props.getMyPlan()
}
})
}
render(){
return (
<div>
{
this.props.planList.map((item,index)=>{
return(
<div key={index}>
{
this.props.my?
<div>
<SwipeActionExample item={item} go={this.go} go1={this.go1} goPlanResult={()=>{
this.props.goPlanResult(item)
}
}/>
</div>
:
<div className={styles.item} style={{paddingTop:'.2rem'}} onClick={()=>{
this.props.goAddInsurance(item)
}} >
<div className={styles.left} >
<img src={item.thumbnail} alt=""/>
</div>
<div className={styles.right}>
<div className={styles.top}>
<div className={styles.title}>{item.riskName}</div>
{item.riskLabels && item.riskLabels.map((ite,ind)=>{
return(
<span key={ind} className={ite === '新品'?styles.orangeSpan:styles.redSpan}>
{ ite =='热门' ?<img src={require("../../assets/image/label-hot.png")} alt=""/>:ite =='新品' ?<img src={require("../../assets/image/label-newProduct.png")} alt=""/> :null}
</span>
)
})}
</div>
<div className={styles.buttom}>
{item.riskIntroduce}
</div>
</div>
</div>
}
</div>
)
})
}
</div>
)
}
}
InsuranceList.propsTypes = {}
export default connect()(InsuranceList)