Commit 36b40e1c by gaoju

first

0 parents
Showing 282 changed files with 23469 additions and 0 deletions
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
{
"extends": "umi",
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
}
}
\ No newline at end of file \ No newline at end of file
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
# production
/dist
# misc
.DS_Store
npm-debug.log*
export default {
};
{
"extraBabelPlugins": [
["import", { "libraryName": "antd", "style": "css" }],
["import", { "libraryName": "antd-mobile", "style": true },"mobile"]
],
"proxy": {
"/o2o":{
"target": "https://iwpuat.ihxlife.com/",
"changeOrigin": true
}
},
"hash": true,
"html": {
"template": "./src/index.ejs"
},
"publicPath": "/"
}
# react-dva
#### 介绍
#### 软件架构
react + react-dva
#### 项目流程
- npm install 下载相关的包
- npm start 启动项目
- npm run build 把项目进行打包
#### 项目结构
project
- public 项目index.html入口
- src
- assete 静态的资源文件
- components 组件
- models 存储数据的容器redux
- services 数据容器异步请求操作
- utils 公共类封装
- index.js 入口文件
- router.js 路由配置
- node_modules 下载的所需的包
- package.json 项目所需的包
This diff could not be displayed because it is too large.
{
"private": true,
"scripts": {
"start": "roadhog server",
"build": "roadhog build",
"lint": "eslint --ext .js src test",
"precommit": "npm run lint"
},
"dependencies": {
"animate.css": "^3.7.0",
"antd": "^3.12.3",
"antd-mobile": "^2.2.9",
"babel-helpers": "^6.24.1",
"babel-plugin-import": "^1.11.0",
"chinese-to-pinyin": "^0.1.8",
"dva": "^2.1.0",
"echarts": "^4.2.1",
"html2canvas": "^1.0.0-alpha.12",
"iscroll": "^5.2.0",
"jquery": "^3.3.1",
"moment": "^2.24.0",
"react": "^16.2.0",
"react-addons-css-transition-group": "^15.6.2",
"react-bmap": "^1.0.98",
"react-dom": "^16.2.0",
"react-qmap": "^0.1.5",
"react-sticky": "^6.0.3",
"swiper": "^4.4.6"
},
"devDependencies": {
"babel-plugin-dva-hmr": "^0.3.2",
"eslint": "^4.14.0",
"eslint-config-umi": "^1.4.0",
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.1.0",
"redbox-react": "^1.4.3",
"roadhog": "^2.0.0"
}
}
No preview for this file type
/*底部导航*/
.bottomButton{
width: 100%;
max-width: 680px;
position: fixed;
bottom: 0;
display: flex;
font-size: .18rem;
background-color:#FF9D5C;
height: .8rem;
background: url("../../assets/image/home-frame.png") no-repeat center center;
background-size: 100% 100%;
z-index: 10;
}
bottomButton > .module{
position: relative;
}
.bottomButton > .module>img{
width: .2rem;
height: .2rem;
margin-top: .3rem;
}
.bottomButton > .module:nth-child(2)>img{
width: .33rem;
height: .3rem;
margin-top: .2rem;
}
.line{
width: 15%;
text-align: center;
border-bottom: 2px solid #000;
position: absolute;
bottom: .1rem;
margin-left:.4rem;
}
.module{
text-align: center;
flex: 1;
}
.module>p{
margin: 0;
color: #666666;
font-size:.1rem;
}
import React,{Component} from 'react';
import styles from "./BottomNav.css"
export default class BottomNav extends Component{
constructor(){
super();
this.state={
select:0,
moduleList:[
{
img:require('../../assets/image/home.png'),
text:'首页'
},
{
img:require('../../assets/image/onLine.png'),
text:'在线专家'
},
{
img:require('../../assets/image/userCenter.png'),
text:'个人中心'
},
],
moduleList1:[
{
img:require('../../assets/image/home.png'),
text:'首页'
},
{
img:require('../../assets/image/personnel.png'),
text:'人员管理'
},
{
img:require('../../assets/image/userCenter.png'),
text:'个人中心'
},
],
}
}
renderBottom() {
let list = [];
if (this.props.roleId == 3) {
list = this.state.moduleList1;
}
if (this.props.roleId == 2) {
if (this.props.hasRoom) list = this.state.moduleList;
else list = [{
img: require('../../assets/image/home.png'),
text: '首页'
},
{
img: require('../../assets/image/offLine.png'),
text: '在线专家'
},
{
img: require('../../assets/image/userCenter.png'),
text: '个人中心'
},
];
}
if(this.props.roleId != 3 && this.props.roleId != 2){
list = this.state.moduleList1;
}
return list.map((item,index)=>{
return (
<div className={styles.module} key={index} onClick={()=>{
this.setState({
select:index,
})
if (this.props.roleId == 2 && index === 1) {
if (this.props.hasRoom) this.props.handleShowExpert()
}else if(this.props.roleId == 3 && index === 1){
this.props.goGtclientlist()
}else if(this.props.roleId != 3 && this.props.roleId != 2 && index === 1){
this.props.goGtclientlist()
}else if(index === 2){
localStorage.setItem('keyIndex',2)
this.props.goPerformance()
}
}}>
<img src={item.img} alt=""/>
<p>{item.text}</p>
{/*<div className={this.state.select=== index?styles.line:''}></div>*/}
</div>
)
})
}
render() {
return (
<div className={styles.bottomButton}>
{
this.renderBottom()
}
</div>
)
}
}
import React, { Component } from 'react'
import { Menu, Icon } from 'antd'
import { connect } from 'dva'
import { Calendar } from 'antd';
import moment from 'moment';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
class Calendar extends Component {
constructor(props) {
super(props);
this.state = {
value: moment('2017-01-25'),
selectedValue: moment('2017-01-25'),
};
}
onSelect = (value) => {
console.log(value.format('YYYY-MM-DD'));
}
onPanelChange = (value, mode)=> {
console.log(value, mode);
}
render() {
return (
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
<Calendar fullscreen={false} onSelect={this.onSelect} onPanelChange={this.onPanelChange} />
</div>
);
}
}
export default connect()(Calendar)
import React, { Component } from 'react'
import { connect } from 'dva'
import { DatePicker, List } from 'antd-mobile';
import enUs from 'antd-mobile/lib/date-picker/locale/en_US';
const nowTimeStamp = new Date('1963-01-01');
const today = new Date();
const now = new Date();
// GMT is not currently observed in the UK. So use UTC now.
const utcNow = new Date(now.getTime() + (now.getTimezoneOffset() * 60000));
// Make sure that in `time` mode, the maxDate and minDate are within one day.
let minDate = new Date('1963-01-01');
const maxDate = new Date(nowTimeStamp );
console.log(minDate, maxDate);
if (minDate.getDate() !== maxDate.getDate()) {
// set the minDate to the 0 of maxDate
minDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
}
function formatDate(date) {
/* eslint no-confusing-arrow: 0 */
const pad = n => n < 10 ? `0${n}` : n;
const dateStr = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
const timeStr = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
return `${dateStr} ${timeStr}`;
}
// If not using `List.Item` as children
// The `onClick / extra` props need to be processed within the component
const CustomChildren = ({ extra, onClick, children }) => (
<div
onClick={onClick}
style={{ backgroundColor: '#fff', height: '45px', lineHeight: '45px', padding: '0 15px' }}
>
{children}
<span style={{ float: 'right', color: '#888' }}>{extra}</span>
</div>
);
class datePicker extends Component {
state = {
date: now,
time: now,
utcDate: utcNow,
dpValue: null,
customChildValue: null,
visible: false,
}
componentDidMount() {
this.props.onRef(this)
this.setState({
date: this.props.birthday ? new Date(this.props.birthday) : now
})
console.log('componentDidMount---',this.props.birthday)
}
componentWillReceiveProps(nextProps) { // 父组件重传props时就会调用这个方法
if(nextProps.birthday && nextProps.birthday != this.state.date){
this.setState({
date:new Date(nextProps.birthday)
})
}
}
showDate=()=>{
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
this.setState({
visible: true,
});
}
showDate1=()=> {
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
this.setState({
visible: true,
});
}
render() {
let defaultdate = today.getFullYear()-101;//默认范围值为100岁
console.log('render---',this.props.birthday)
let minDate = this.props.minYear ? new Date(this.props.minYear, today.getMonth(), today.getDate() + 1) : new Date(defaultdate, 0, 1, 0, 0, 0);
return (
<List className="date-picker-list" style={{ backgroundColor: 'white',opacity:0 ,width:0,display:'none'}}>
{/*<DatePicker
value={this.state.date}
onChange={date => this.setState({ date })}
>
<List.Item arrow="horizontal">Datetime</List.Item>
</DatePicker>*/}
<DatePicker
visible={this.state.visible}
mode="date"
title="出生日期"
extra="Optional"
value={this.state.date}
minDate={minDate}
maxDate={new Date()}
onChange={date => {
console.log('--DatePicker--onChange--->',date)
//this.setState({ date })
}}
onValueChange={(date,index) => {
let data1 = new Date(date[0],date[1],date[2]);
console.log('--DatePicker--onValueChange--->',data1)
this.setState({ date:data1 })
}}
onOk = {
(date)=>{
console.log('--DatePicker--ok--->',date)
this.setState({ visible:false })
this.props.getDate(date)
}
}
onDismiss={
()=>{
this.setState({ visible:false,date:this.props.birthday ? new Date(this.props.birthday) : now })
console.log('--DatePicker--onDismiss--->',this.state.date)
}
}
>
<List.Item arrow="horizontal">Date</List.Item>
</DatePicker>
{/* <DatePicker
mode="time"
minuteStep={2}
use12Hours
value={this.state.time}
onChange={time => this.setState({ time })}
>
<List.Item arrow="horizontal">Time (am/pm)</List.Item>
</DatePicker>
<DatePicker
mode="time"
minDate={minDate}
maxDate={maxDate}
value={this.state.time}
onChange={time => this.setState({ time })}
>
<List.Item arrow="horizontal">Limited time</List.Item>
</DatePicker>
<DatePicker
mode="time"
locale={enUs}
format={val => `UTC Time: ${formatDate(val).split(' ')[1]}`}
value={this.state.utcDate}
onChange={date => this.setState({ utcDate: date })}
>
<List.Item arrow="horizontal">UTC time</List.Item>
</DatePicker>
<List.Item
extra={this.state.dpValue && formatDate(this.state.dpValue)}
onClick={() => this.setState({ visible: true })}
>
External control visible state
</List.Item>
<DatePicker
visible={this.state.visible}
value={this.state.dpValue}
onOk={date => this.setState({ dpValue: date, visible: false })}
onDismiss={() => this.setState({ visible: false })}
/>
<DatePicker
mode="time"
format="HH:mm"
title="Select Time"
value={this.state.customChildValue}
onChange={v => this.setState({ customChildValue: v })}
extra="click to choose"
>
<CustomChildren>With customized children</CustomChildren>
</DatePicker>*/}
</List>
);
}
}
export default connect()(datePicker)
/*ReactDOM.render(<Demo />, mountNode);
.date-picker-list .am-list-item .am-list-line .am-list-extra {
flex-basis: initial;
}*/
import React, { Component } from 'react'
import { Menu, Icon } from 'antd'
import { connect } from 'dva'
import { Link, } from 'dva/router'
import './header.css'
class Header extends Component {
render() {
return (
<Menu style={{position:'fixed',bottom:0,width:'100%'}}
mode="horizontal"
theme="dark"
>
<Menu.Item key="/users" style={{width:'33%'}}>
<Link to="/users">
<Icon type="bars" />Users
</Link>
</Menu.Item>
<Menu.Item key="/" style={{width:'33%'}}>
<Link to="/">
<Icon type="home" />Home
</Link>
</Menu.Item>
<Menu.Item key="/discover" style={{width:'33%'}}>
<Link to="/discover">
<Icon type="user" />Discover
</Link>
</Menu.Item>
</Menu>
)
}
}
export default connect()(Header)
.size{
font-size: .5rem;
color: yellow;
}
import React, { Component } from 'react'
import { NavBar, Icon } from 'antd-mobile';
import styles from "./HeaderNav.css"
export default class HeaderNav extends Component{
constructor(props){
super(props);
this.state={
select:0
}
}
componentDidMount(){
}
goBack=()=>{
this.props.history.goBack();
}
render(){
return (
<div className={styles.size}>
<NavBar
mode="light"
icon={<Icon type="left" onClick={this.goBack} style={{color:'#954547'}}/>}
onLeftClick={() => console.log('onLeftClick')}
rightContent={[
<Icon key="1" type="ellipsis" />,
]}
style={{fontSize:'.18rem',height:'.45rem',color:'red'}}
>{this.props.title}</NavBar>
</div>
)
}
}
import { List, InputItem } from 'antd-mobile';
import { createForm } from 'rc-form';
import ReactDOM from 'react-dom';
import React, { Component } from 'react';
// 通过自定义 moneyKeyboardWrapProps 修复虚拟键盘滚动穿透问题
// https://github.com/ant-design/ant-design-mobile/issues/307
// https://github.com/ant-design/ant-design-mobile/issues/163
const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps;
if (isIPhone) {
moneyKeyboardWrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
export default class H5NumberInputExample extends React.Component {
state = {
type: 'money',
}
render() {
const { getFieldProps } = this.props.form;
const { type } = this.state;
return (
<div>
<List>
<InputItem
{...getFieldProps('money3')}
type={type}
defaultValue={100}
placeholder="start from left"
clear
moneyKeyboardAlign="left"
moneyKeyboardWrapProps={moneyKeyboardWrapProps}
>光标在左</InputItem>
<InputItem
type={type}
placeholder="start from right"
clear
onChange={(v) => { console.log('onChange', v); }}
onBlur={(v) => { console.log('onBlur', v); }}
moneyKeyboardWrapProps={moneyKeyboardWrapProps}
>光标在右</InputItem>
<InputItem
{...getFieldProps('money2', {
normalize: (v, prev) => {
if (v && !/^(([1-9]\d*)|0)(\.\d{0,2}?)?$/.test(v)) {
if (v === '.') {
return '0.';
}
return prev;
}
return v;
},
})}
type={type}
placeholder="money format"
ref={el => this.inputRef = el}
onVirtualKeyboardConfirm={v => console.log('onVirtualKeyboardConfirm:', v)}
clear
moneyKeyboardWrapProps={moneyKeyboardWrapProps}
>数字键盘</InputItem>
<List.Item>
<div
style={{ width: '100%', color: '#108ee9', textAlign: 'center' }}
onClick={() => this.inputRef.focus()}
>
click to focus
</div>
</List.Item>
</List>
</div>
);
}
}
const H5NumberInputExampleWrapper = createForm()(H5NumberInputExample);
ReactDOM.render(<H5NumberInputExampleWrapper />,root);
.inputcss{
width: 1.5rem;
border: 1px solid rgb(221, 221, 221);
padding-left: 0.1rem;
height: 0.3rem;
font-size: 0.15rem;
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react'
import { Picker} from 'antd-mobile';
import styles from './InputModal.css';
class InputModal extends Component {
constructor(props) {
super(props);
this.state = {
value: props.value || '',
id:props.id || 'input',
placeholder:props.placeholder || '请输入',
}
}
componentWillReceiveProps(nextProps){
console.log('---------WILLreceiveprops------->',nextProps.value,this.state.value)
if(nextProps.placeholder != this.state.placeholder || nextProps.value != this.state.value){
this.setState({
value:nextProps.value,
placeholder:nextProps.placeholder,
})
}
}
onChange = (e)=>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
value :value
})
}
blur =()=>{
setTimeout(function(){
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
},10)
}
render() {
const { placeholder,value,id} = this.state;
return (
<input className={styles.inputcss}
id={id}
placeholder={placeholder}
value={value}
type="number"
pattern="[0-9]*"
onBlur={::this.blur}
onChange={this.onChange}/>
)
}
}
export default InputModal
.planList{
width: 3.92rem;
background-color: white;
border-radius: 16px;
margin: 0 auto .64rem ;
}
.planList > div >p {
font-size:.16rem;
color: #999999;
padding: .15rem 0 0 .1rem;
}
.item{
height: 1rem;
}
.item:nth-child(last){
height: .8rem;
}
.left{
margin: 0 .1rem 0 0;
width: .8rem;
height: .8rem;
float: left;
}
.left>img{
width: 100%;
height: 100%;
}
.right{
width: 2.9rem;
height: .8rem;
float: right;
position: relative;
}
.top{
position: relative;
}
.title{
display: inline-block;
float: left;
font-size: .17rem;
color: #333333;
}
.label{
display: inline-block;
float: right;
height: 0;
position: absolute;
top: 0;
right: 0;
}
span{
margin-right: .1rem;
float: right;
}
.labelImg{
width: .34rem;
}
.buttom{
position: absolute;
bottom: 0px;
color: #888888;
font-size: .14rem;
height: .3rem;
line-height: 0px;
width: 100%;
border-bottom: 1px solid #F8F8F8;
}
.last:nth-child(last){
height: .2rem;
}
.mytitle{
font-size: .17rem;
color: #333333;
}
.detail{
font-size: .14rem;
color: #888888;
}
.myright{
width: 4.8rem;
height: .8rem;
float: right;
position: relative;
background-color: #FF9D5C;
overflow: hidden;
}
.myItem{
font-size: .17rem;
color: #333333;
margin-bottom: .2rem;
width: 5.54rem;
max-width: 900px;
}
.myleft{
margin: 0 .1rem 0;
width: .8rem;
height: .8rem;
position: relative;
left: .8rem;
display: inline-block;
}
.myleft>img{
width: 100%;
height: 100%;
}
.myright{
width: 4.4rem;
height: .8rem;
position: relative;
left: .2rem;
}
.mytitle{
color: #333333;
font-size: .17rem;
}
/*
label标签
*/
.orangeSpan{
float: right;
margin-right: .1rem;
}
.orangeSpan>img{
width: .34rem;
height: .18rem;
}
.redSpan{
float: right;
}
.redSpan>img{
width: .34rem;
height: .18rem;
}
.noMore>div{
margin-top: .1rem;
}
.noMore>div>img{
width: .25rem;
height: .18rem;
}
.noMore>div>span{
font-size: .18rem;
color: #ABABAB;
float: none;
margin-left: .1rem;
}
.noMore>div{
text-align: center;
}
.noMore >.line{
text-align: center;
width: 1.5rem;
height: .02rem;
border-radius: 2px;
background-color: black;
margin-top: .2rem;
}
.blueSpan{
float: right;
margin-right: .1rem;
}
.blueSpan>div{
background-color: #8ec5f3;
font-size: .15rem;
width: .4rem;
height: .2rem;
line-height: .2rem;
margin-top: .03rem;
text-align: center;
color: white;
border-radius: 5px;
transform: scale(0.9);
}
\ No newline at end of file \ No newline at end of file
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>
)
})**/}
{item.riskLabels && item.riskLabels.map((ite,ind)=>{
return(
<span key={ind} className={ite == '新品' || ite == '热门' ? (ite == '新品' ? styles.orangeSpan:styles.redSpan) : styles.blueSpan}>
{ ite =='新品' && <img src={require("../../assets/image/label-newProduct.png")} alt=""/>}
{ ite =='热门' && <img src={require("../../assets/image/label-hot.png")} alt=""/>}
{ (ite !='新品' && ite !='热门') && <div><b style={{fontWeight:'lighter'}}>{ite}</b></div> }
</span>
)
})}
</div>
<div className={styles.buttom}>
{item.riskIntroduce}
</div>
</div>
</div>
}
</div>
)
})
}
</div>
)
}
}
InsuranceList.propsTypes = {}
export default connect()(InsuranceList)
.wrapper_scroller {
position: absolute;
z-index: 1;
top: 0;
bottom: 0;
left: 0;
overflow: hidden;
width: 100%;
height: 100%;
min-height: 100px;
font-size: 14px;
}
.wrapper_scroller .scroller {
position: absolute;
z-index: 1;
-webkit-tap-highlight-color: rgba(0,0,0,0);
width: 100%;
min-height: 100%;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}
.wrapper_scroller .scroller .scroller_pullUp {min-height: 1.5em;line-height: 1.5em;font-size: 1em;text-align:center;position:absolute;left:0px;width:100%;overflow: hidden;}
.wrapper_scroller .scroller .scroller_pullDown {min-height: 1.5em;line-height: 1.5em;font-size: 1em;text-align:center;position:absolute;left:0px;width:100%;overflow: hidden;}
.wrapper_scroller .scroller .scroller_pullDown{top:-1.5em;-webkit-user-select: none;user-select: none;font-size: 1em;}
.wrapper_scroller .scroller .loadingSection{
display: flex;
justify-content: center;
}
.wrapper_scroller .scroller .loadingSection img{height: 1.5em;margin: 0 .5em 0 0;}
.wrapper_scroller .backTopSection{
position: absolute;
bottom: 5em;
z-index: 10;
right: 5px;
width: 40px;
height: 40px;
}
.wrapper_scroller .backTopSection img{width: 100%;height: 100%;}
\ No newline at end of file \ No newline at end of file
/**
* Created by gaoju on 2019/7/2.
* 滚动组件
* 注意:::此组件需要包裹在有高度的元素中,否则占满全屏
*/
import React, { Component } from 'react';
import IScroll from 'iscroll/build/iscroll-probe'
import styles from './index.css'
class Home extends Component {
constructor(props) {
super(props);
this.state = {
data: [],
yesDown: false, // 是否已到了下拉刷新的高度
yesUp: false, // 是否已到了上拉加载的高度
loadingDownShow: false, // 是否处于刷新中状态
loadingUpShow: false, // 是否属于加载中状态
loadingDirection:'',//true 为下拉,false为上拉
loadingEnd:false,//
options: {
backgroundColor: '#f5f5f5', // 背景颜色
fontColor: '#888888', // 文字颜色
beyondHeight: 50, // 超过此长度后触发下拉或上拉,单位px
pulldownInfo: '下拉刷新',
pulldownReadyInfo: '松开刷新',
pulldowningInfo: '刷新中…',
pulldownEnd:"刷新完成",
pullupInfo: '上拉加载',
pullupReadyInfo: '松开加载',
pullupingInfo: '加载中…',
pullupEnd:"没有新的数据了…",
},
boxHeight: 0,
dataEnd:false,
backTopFlag:false,
};
this.myScroll = null;
this.timerRefresh = null; // 刷新iscroll的延时timer
this.iscrollTimer = null; // 检测高度变化的timer
this.elementToTarget = this.elementToTarget.bind(this);
}
componentDidMount() {
console.log('------componentDidMount-------------')
let options = {
mouseWheel: true, //鼠标事件
click: true,//点击事件
probeType: 3,
fadeScrollbars:false,
scrollbars: false,
//shrinkScrollbars: 'clip',//根据滚动缩放大小
//fadeScrollbars: true,//滚动条淡入淡出
//interactiveScrollbars:true,//滚动条能拖动
//bounce:true,//滚动边缘反弹
}
// this.myScroll = new IScroll('#wrapper',options);
let id = this.props.id + "_wrapper_scroller";
this.myScroll = new IScroll("#"+id, Object.assign({}, options, this.props.iscrollOptions));
this.myScroll.on('scroll', () => {
const myScroll = this.myScroll;
if (myScroll.y >0 && myScroll.y < this.state.options.beyondHeight) {
this.setState({
loadingDownShow: false,
loadingUpShow: false,
});
}else if (myScroll.y > this.state.options.beyondHeight) {
this.setState({
loadingDirection:'down',
loadingDownShow: true,
loadingUpShow: false,
});
}else if (myScroll.y < -(this.state.options.beyondHeight)) {
this.setState({
loadingDirection:'down',
});
}else if (myScroll.y < myScroll.maxScrollY - this.state.options.beyondHeight) {
this.setState({
loadingDirection:'up',
loadingDownShow: false,
loadingUpShow: true,
});
}
});
this.myScroll.on('scrollStart', () => {
window.top.addEventListener('mouseup', this.onMouseUpListener, false);
window.top.addEventListener('touchend', this.onMouseUpListener, false);
});
this.myScroll.on('scrollEnd', () => {
const myScroll = this.myScroll;
if (myScroll.y > -100) {
this.setState({
backTopFlag:false
});
}else if (myScroll.y < -100) {
this.setState({
backTopFlag:true
});
}
});
this.setState({
data: this.props.children,
options: Object.assign({}, this.state.options, this.props.options),
});
let scrollDom = document.getElementById(id);
scrollDom.addEventListener('touchmove', function (e) { e.preventDefault(); }, { passive: false });
//绑定父组件得方法
if(this.props.onRef){
this.props.onRef(this)
}
}
/** children内容改变时触发,表示已完成了刷新或加载 **/
static getDerivedStateFromProps(nextP, prevState) {
if (nextP.children != prevState.data) {
console.log('------getDerivedStateFromProps--------更新-----')
return {
data: nextP.children,
loadingDownShow: false,
loadingUpShow: false,
dataEnd: nextP.dataEnd ? true : false,
};
}
return null;
}
componentDidUpdate(prevP, prevS){
if(prevS.data !== this.state.data || prevP.hasDown !== this.props.hasDown || prevP.hasUp !== this.props.hasUp) {
console.log('------componentDidUpdate--------onRefresh-----')
// if(this.state.loadingDirection == 'down'){
// this.myScroll.scrollTo(0, this.myScroll.y);
// }
this.onRefresh();
}
}
/** 组件即将销毁时触发,销毁当前iscroll实例 **/
componentWillUnmount() {
console.log('------componentWillUnmount--------destroy-----')
//window.clearTimeout(this.iscrollTimer);
this.myScroll.destroy();
}
/** 刷新ISCROLL **/
onRefresh() {
const myScroll = this.myScroll;
window.clearTimeout(this.timerRefresh);
this.timerRefresh = window.setTimeout(() => {
myScroll.refresh();
}, 200);
}
//锚点跳转
elementToTarget(target){
this.myScroll.scrollToElement(document.querySelector("#"+target))
}
onMouseUpListener = () => {
const t = this;
let maxScrollY = t.myScroll.maxScrollY;
window.top.removeEventListener('mouseup', t.onMouseUpListener, false);
window.top.removeEventListener('touchend', t.onMouseUpListener, false);
// 如果滑动距离超过了设定界限并且当前没在下拉中,就触发下拉
if(t.myScroll.y >= t.state.options.beyondHeight) {
if(t.props.hasDown && t.props.onPullDownLoadMore) {
//t.myScroll.scrollTo(0, t.myScroll.y);
if (t.props.onPullDownLoadMore) {
this.props.onPullDownLoadMore();//加载新的数据
}
}
} else if (t.myScroll.y < t.myScroll.maxScrollY - t.state.options.beyondHeight) {
console.log('---onMouseUpListener------->>>>',t.myScroll.y,t.myScroll.maxScrollY,t.props.dataEnd,t.state.dataEnd)
if(t.props.hasUp && t.props.onPullUpLoadMore) {
if (t.props.onPullUpLoadMore) {
this.props.onPullUpLoadMore();//加载新的数据
}
}
}
};
render() {
let {data,backTopFlag} = this.state;
let id = this.props.id + "_wrapper_scroller";
return (
<div id={id} className={styles.wrapper_scroller} >
<div className={styles.scroller}>
<div className={styles.scroller_pullDown} style={{ display: !this.props.hasDown ? 'none' : 'inline-block' }}>
{
this.state.loadingDownShow ? (
<div className={styles.loadingSection}>
<img src={require('./assets/loading.gif')} />
<span className = {styles.msg} style={{ color: this.state.options.fontColor, display: 'inline-block' }}>
{this.state.options.pulldowningInfo}
</span>
</div>
) : (
<div>
<span className = {styles.msg} style={{ color: this.state.options.fontColor, display: 'inline-block' }}>
{this.state.options.pulldownInfo}
</span>
</div>
)
}
</div>
<div>
{this.props.children}
</div>
<div className={styles.scroller_pullUp} style={{ display: !this.props.hasUp ? 'none' : 'inline-block' }}>
{this.state.backTopFlag &&(
!this.state.dataEnd ? (
<div className={styles.loadingSection}>
<img src={require('./assets/loading.gif')} />
<span className = {styles.msg} style={{ color: this.state.options.fontColor, display: 'inline-block' }}>
{this.state.options.pullupingInfo}
</span>
</div>
) : (
<div className={styles.loadingSection}>
<span className = {styles.msg} style={{ color: this.state.options.fontColor, display: !this.props.hasUp ? 'none' : 'inline-block' }}>
{this.props.finishStr || this.state.options.pullupEnd}
</span>
</div>
)
)
}
</div>
</div>
{this.props.haveBackTop && (
<div style={{ display: backTopFlag ? 'block' : 'none'}} className={styles.backTopSection} onClick={()=>{this.myScroll.scrollTo(0,0,600)}}>
<img src={require("../../assets/image/backTop.png")} />
</div>
)}
</div>
);
}
}
export default Home;
/**
*
id: PropTypes.string, // id
children: PropTypes.object, // 数据
options: PropTypes.object, // 自定义参数
iscrollOptions: PropTypes.object, // iscroll原生参数
detectionHeight: PropTypes.bool, // 是否不停的检测高度变化
className: PropTypes.string, // 额外的class
onPullDownLoadMore: PropTypes.func, // 下拉刷新
onPullUpLoadMore: PropTypes.func, // 上拉加载更多
hasDown:PropTypes.bool,// 是否有下拉加载
hasUp:PropTypes.bool,// 是否有上拉加载更多
noDownStr:PropTypes.string,// 加载完提示
noUpStr:PropTypes.string,// 刷新完提示
finishStr:PropTypes.string,// 加载完成提示语
haveBackTop:PropTypes.bool,// 是否又返回顶部按钮
*
**/
\ No newline at end of file \ No newline at end of file
import React from 'react';
import { SwipeAction } from 'antd-mobile';
import $ from 'jquery';
import { sortArr } from '../../utils/dataFilter';
import Iscroll from "../../components/Iscroll";
import css from './css.less';
class MemberList extends React.Component{
constructor(props) {
super(props);
this.state = {
list: [],
searchVal:'',
isShowTips: true,
letters: ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','#']
}
}
swipeBack(el, i) {
$(el).find('.am-swipe-cover, .am-swipe-content').css('left', 0);
}
//绑定子组件scroll得方法
maoPointRef = (ref) => {
this.child = ref;
}
render() {
const { dataList, pTitle, showActionSheet, chooseClient, handleAction, renderItem, renderType, filterData, handleEdit,isCheckClientStateForSwipe } = this.props;
const list = sortArr(dataList, renderType);
const isf = typeof handleAction === 'function';
return <div className={css.listWrap}>
<div className={css.splitline}></div>
<div className={css.search}>
<input
onChange={(e) => {
this.setState({ searchVal: e.target.value });
filterData(e.target.value.trim());
}}
value={this.state.searchVal}
placeholder={"请输入" + pTitle + "姓名"} />
</div>
<div className={css.subTip}>所有{pTitle}<i>({dataList.length}人)</i></div>
<div className={css.scrollListWrap} style={{height:this.props.height ? this.props.height : '66vh'}} ref={el=>this.nameList=el}>
<Iscroll id={"memberList_"+this.props.id}
iscrollOptions={{
probeType:2
}}
onRef={this.maoPointRef}
>
<div className={css.list}>
{
list.length>0 && list.map((itm, index) => {
return <dl key={index} id={'list'+itm.letter} ref={el=>this['list'+itm.letter]=el} >
<dt>{itm.letter}</dt>
{
itm.list.map((item, i) => {
let disabled = false;
if (isCheckClientStateForSwipe) {
disabled = item.currentState && item.currentState !== '2';
}
return <dd key={index + '_' + i} onClick={() => {
if (chooseClient) {
chooseClient(item);
}
}}>
<SwipeAction
disabled={disabled||!isf}
right={[
{
text: '编辑',
onPress: () => {
this.swipeBack(this['list' + itm.letter]);
handleEdit(item);
},
style: { backgroundColor: '#ddd', color: 'white' },
},
{
text: '删除',
onPress: () => {
this.swipeBack(this['list' + itm.letter]);
this.setState({
isShowTips: true
})
isf && handleAction(item);
},
style: { backgroundColor: '#F4333C', color: 'white' },
},
]}
>
{
renderItem(item, index + '_' + i)
}
</SwipeAction>
</dd>
})
}
</dl>
})
}
</div>
</Iscroll>
</div>
{
// 是否有选择操作
showActionSheet && <div className={css.btnAdd} onClick={ showActionSheet }></div>
}
<ul className={css.indexList} style={{height:this.props.height ? this.props.height : '69vh'}}>
{
// 右侧字母索引
this.state.letters.map((item,i) => {
return <li key={i} onClick={() => {
for (let j = 0; j < list.length; j++){
if (list[j].letter === item) {
console.log('elementToTarget-->list',item)
this.child.elementToTarget('list' + item);
}
}
}}>{item}</li>
})
}
</ul>
</div>
}
}
export default MemberList;
\ No newline at end of file \ No newline at end of file
.listWrap {
position: relative;
background: white;
.indexList {
position: absolute;
right: 0;
top: .7rem;
overflow-y: auto;
height: 69vh;
z-index:5;
li {
color: #666;
font-size: .1rem;
line-height: .2rem;
// width: .2rem;
height: .2rem;
}
}
.btn_confirm {
overflow: hidden;
span {
float: right;
width: .75rem;
height: .4rem;
background: #FF9D5C;
text-align: center;
line-height: .3rem;
border-radius: .04rem;
color: #fff;
margin-top: .09rem;
margin-right: .11rem;
}
}
.btnAdd {
position: fixed;
right: .3rem;
bottom: .08rem;
width: .6rem;
height: .6rem;
background: url(../../assets/image/add-user.png) no-repeat;
background-size: 100%;
}
.search {
position: relative;
padding: .1rem .17rem;
padding-bottom: 0;
&:before {
position: absolute;
width: .15rem;
height: .15rem;
content: '';
background: url(../../assets/image/search.png) no-repeat;
background-size: 100%;
left: .35rem;
top: .19rem;
z-index: 10;
}
input {
box-sizing: border-box;
width: 100%;
border: none;
border-radius: .16rem;
background: #F4F4F4;
height: .32rem;
line-height: .32rem;
padding: 0;
padding-left: .42rem;
font-size: .14rem;
}
}
.subTip {
color: #101010;
font-size: .15rem;
line-height: .48rem;
text-align: left;
margin-left: .11rem;
i {
color: #B6B6B6;
font-style: normal;
}
}
.scrollListWrap {
position:relative;
background: #f8f8f8;
height: 66vh;
//height: calc(100vh - 190px);
overflow-y: scroll;
}
// @media only screen and (device-width: 414px) and (device-height: 896px) {
// .scrollListWrap {
// height: 6.8rem;
// }
// }
// @media only screen and (device-width: 375px) and (device-height: 812px) {
// .scrollListWrap {
// height: 6.6rem;
// }
// }
.list {
position: relative;
text-align: left;
dt {
background: #F8F8F8;
line-height: .3rem;
padding-left: .11rem;
box-sizing: border-box;
color: #ABABAB;
font-size: .13rem;
}
dd {
line-height: .5rem;
font-size: .15rem;
background: #fff;
color: #101010;
padding-right: .15rem;
span {
float: none;
}
&:before {
display: block;
border-top: 1px solid #F8F8F8;
content: '';
overflow: hidden;
}
}
dd:first-of-type {
&:before {
display: none;
}
}
}
}
import React from "react";
import { Modal, } from 'antd';
import css from './css.less';
const ConfirmPop = (props) => {
const { show,title, handleOK, handleCancel } = props;
return (
<Modal
title={title}
centered
footer={false}
closable={false}
visible={show}
>
{
props.children
}
<div className={css.footer}>
<div className={css.cancel} onClick={handleCancel}>取消</div>
<div className={css.ok} onClick={handleOK}>确认</div>
</div>
</Modal>
);
}
export default ConfirmPop;
:global(.ant-modal) {
width:3rem !important;
}
:global(.ant-modal-header){
position: relative; padding:0; border-radius: .05rem; border: none;
&:before{
display:block;
width: 100%;
height: .04rem;
background:linear-gradient(133deg, rgba(255, 197, 159, 1) 0%, rgba(255, 157, 91, 1) 100%);
border-radius:5px 5px 0px 0px; content:'';
}
}
:global(.ant-modal-title){
text-align: center; color:#333; font-size: .18rem; line-height: .25rem; margin-top: .2rem;
}
:global(.ant-modal-body){
padding:0; text-align: center; margin-top:.1rem;
}
.footer{
display:flex; border-top: 1px solid #F8F8F8;
.ok{
flex:1; text-align: center; font-size:.18rem; color:#333; height: .44rem; line-height: .44rem;
}
.cancel{
flex:1; text-align: center; font-size:.18rem; border-right: 1px solid #F8F8F8;color:#333; height: .44rem; line-height: .44rem;
}
}
\ No newline at end of file \ No newline at end of file
import React from "react";
import { Modal, } from 'antd';
export default class LocalizedModal extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false
};
}
hideModal = (v) => {
if(this.props.message === '确定'){
this.props.hideModal(v)
}else{
this.props.hideModalSubmit(v)
}
}
componentDidMount() {
}
render() {
return (
<div>
<Modal
title={this.props.onClick.title}
visible={this.props.visible}
onOk={()=>{this.hideModal('ok')}}
onCancel={()=>{this.hideModal('cancel')}}
okText="确认"
cancelText="取消"
>
<p>{this.props.onClick.content}</p>
</Modal>
</div>
);
}
}
import React from "react";
export default class NoData extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
const haveNoData={
position: 'absolute',
top: '50%',
left: '50%',
textAlign: 'center',
transform: 'translate(-50%, -50%)'
}
const img={
width:'1.51rem',
}
const text={
textAlign: 'center',
fontSize: '.15rem',
color: '#666666',
marginTop:'20px'
}
return (
<div style={haveNoData}>
<img style={img} src={require('../../assets/image/clientless.png')} alt="" />
<div style={text}>{this.state.infoText || "当前暂无数据"}</div>
</div>
);
}
}
.choose{
width: 1.5rem; height: .3rem;
border: 1px solid #F0F0F1;
font-size: .15rem;
border-radius: .04rem;
text-align: left; padding-left:.1rem;
color:#999; box-sizing: border-box;
}
.choose:after{
float:right;
width: .12rem; height: .1rem;
margin-top: .11rem; margin-right: .1rem;
background: url('../../assets/image/icon_arrowDown.png') no-repeat;
content:''; background-size: 100%;
}
.choose>span{
float: none;
color:#000;
font-size: .15rem;
line-height: .3rem;
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react'
import { Picker} from 'antd-mobile';
import styles from './SelectPicker.css';
import {getPlanInListWithCode} from '../../utils/dataFilter'
class SelectPicker extends Component {
constructor(props) {
console.log('---------constructor------->',props)
super(props);
this.state = {
List: props.List,
value: props.value || 0,
selectIndex:0
}
}
componentWillReceiveProps(nextProps){
console.log('---------SelectPicker--------componentWillReceiveProps------------nextProps------->',nextProps)
if(nextProps.List != this.state.List){
this.setState({
List:nextProps.List,
})
}
}
render() {
const { List,value,selectIndex} = this.state;
let len = List.length;
let value2 = value;
console.log('---------SelectPicker--------value2------->',value2,List,getPlanInListWithCode('value',value2,List).label)
let labelText = '';
if(value2 == 0 || value2){
labelText = getPlanInListWithCode('value',value2,List).label;
}else{
value2 = len-1;
labelText = List[len-1].label;
}
if(!getPlanInListWithCode('value',value2,List).label){
value2 = len-1;
labelText = List[len-1].label;
}
console.log('---------SelectPicker--------2222222----->',value2,labelText)
return (
<Picker
data={List}
cols={1}
value={[value2]}
onChange={
v => {
this.setState({
value: List[v[0]].value,
label:List[v[0]].label,
selectIndex:v[0],
});
console.log('-------Picker----onchange------>',v)
this.props.selectChange(List[Number(v[0])])
}
}
>
<div className={styles.choose} ><span>{labelText}</span></div>
</Picker>
)
}
}
export default SelectPicker
import React,{Component} from 'react';
import { connect } from 'dva';
import { SwipeAction, List ,Modal} from 'antd-mobile';
import styles from "./swipeActive.css"
const alert = Modal.alert;
let alert2=null;
class SwipeActionExample extends Component{
constructor(props){
super(props);
this.state={
}
}
componentDidMount(){
}
componentWillUnmount(){
//如果弹框没有关闭则关闭
if(alert2){
alert2.close();
}
}
editor=(item)=>{
if(item.seriNo){
this.props.go1(item)
}
//通讯录修改
if(this.props.client){
this.props.dispatch(item)
}
}
delete=(item)=>{
alert2 = alert('', '确定删除吗?', [
{ text: '取消', onPress: () => {
return;
} },
{ text: '确定', onPress: () => {
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'?'男':'女'} &nbsp;&nbsp; {this.props.item.insAge} &nbsp;&nbsp;&nbsp; 期缴保费:{this.props.item.prem}元 </div>
<div className={styles.detail2}>制作时间:{this.props.item.createTime}</div>
</div>
</div>}
</List.Item>
</SwipeAction>
</List>
)
}
}
export default connect(({home})=>({home}))(SwipeActionExample)
/* 计划书---我的 */
.myItem{
width: 100%;
height: .8rem;
}
.myleft{
width: .8rem;
height: .888rem;
display: inline-block;
}
.myleft>img{
width: 100%;
height: .8rem;
position: relative;
top: .07rem;
}
.myright{
display: inline-block;
width: 2.8rem;
position: relative;
left: .2rem;
top:-.2rem;
}
.mytitle{
/*position: absolute;*/
color: #333333;
font-size: .17rem;
}
.detail{
position: absolute;
top:.3rem;
color: #666666;
font-size: .14rem;
}
.detail2{
position: absolute;
top:.55rem;
color: #666666;
font-size: .14rem;
}
/* 我的客户 --- 通讯录 */
.label{
margin-right: .1rem;
float: right;
margin-left: .5rem;
padding: .0rem .1rem;
background-color: #ddd;
border-radius: .1rem;
color: white;
/* line-height: .2rem; */
font-size: .13rem;
margin-top: .02rem;
}
.time{
margin-right: .1rem;
float: right;
/*margin-left: .5rem;*/
}
:global(.am-list-body::before){
background: none !important;
}
:global(.am-modal-transparent .am-modal-content){
padding-top: 15px;
}
import React,{Component} from 'react';
import { connect } from 'dva'
import { Carousel,} from 'antd';
import styles from "./Swiper.css"
class SWiper extends Component{
constructor(){
super();
this.state={
slide: [],
moveend: 0,
movestart:0
}
}
componentDidMount(){
let that = this;
/* 轮播图接口 */
this.props.dispatch({
type:'home/getBanner',
payload: {
"bannerName":"",
"bannerStatus":1,
"proId":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
callback(data){
that.setState({
slide:data
})
},
});
}
goPlan =(item)=>{
let storage = window.localStorage;
storage.setItem("riskName",item.bannerName)
storage.setItem("riskCode",item.bannerCode)
storage.setItem("calculationMethod",item.bannerLabel)
storage.setItem("selectd",1)
storage.setItem("seriNo",'')
//storage.setItem("recipients",false)
storage.setItem("riskIntroduce",'')
// storage.setItem("thumbnail",item.bannerPath)
storage.setItem("thumbnail",item.bannerUrl)
//storage.setItem("recipientsName",'')
let roleId =localStorage.getItem("roleId");
window.location.href= window.location.href.split('#')[0]+ '#/addplaneditor?riskName='+item.bannerName+'&riskCode='+item.bannerCode +'&calculationMethod='+ item.bannerLabel + '&riskIntroduce=&thumbnail='+item.bannerUrl+'&selectd=1&roleId='+ roleId +'&Id='+ localStorage.getItem('id') + '&seriNo='
}
render(){
return (
<Carousel
autoplay
>
{ this.state.slide !=='' && this.state.slide.map((item,index)=>{
const that = this;
return (<div className="swiper-slide" key={index} onTouchMove={(e) => {
this.setState({
moveend: e.touches[0].pageX
})
}}
onTouchEnd={() => {
if (this.state.moveend == 0) {
that.goPlan(item);
}
this.setState({
moveend: 0
})
}}
onTouchStart={(e) => {
this.setState({
moveend: 0
})
}} ><img src={item.bannerPath} alt="" style={{ width: '3.92rem',height:'1.8rem', borderRadius: '.12rem', }}
/> </div>)
})}
</Carousel>
)
}
}
export default connect()(SWiper)
import React from 'react'
import {
Table, Input, Button, Popconfirm, Form,
} from 'antd';
import ReactDOM from 'react-dom'
import styles from './table.css';
const FormItem = Form.Item;
const EditableContext = React.createContext();
const EditableRow = ({ form, index, ...props }) => (
<EditableContext.Provider value={form}>
<tr {...props} />
</EditableContext.Provider>
);
export default class EditableTable extends React.Component {
constructor(props) {
super(props);
this.state = {
dataSource: [{
key: '0',
0: '险种',
1: '保额',
2: '保费',
3:'缴费期限'
}
],
columns : [{
title: '险种',
dataIndex: '0',
width: '25%',
editable: true,
}, {
title: '保额',
dataIndex: '1',
}, {
title: '保费',
dataIndex: '2',
}, {
title: '期间',
dataIndex: '3',
}],
count: 2,
};
}
componentWillReceiveProps(nextProps){
this.setState({
dataSource:nextProps.listTable,
columns:nextProps.listTitle,
})
}
componentDidMount(){
this.setState({
dataSource:this.props.listTable,
columns:this.props.listTitle,
})
}
render() {
const { dataSource } = this.state;
const { scroll } = this.props;
const columns = this.state.columns.map((col) => {
if (!col.editable) {
return col;
}
return {
...col,
};
});
return (
<div>
<Table
bordered
dataSource={dataSource}
columns={columns}
pagination={false}
scroll={scroll}
/>
</div>
);
}
}
:global(td){
background-color: white !important;
}
:global(.ant-table-thead )>tr> th{
padding: .08rem 0;
}
:global(.ant-table-tbody )>tr> td{
padding: .08rem 0;
}
:global(.ant-table){
font-size: .14rem;
}
:global(.ant-table )>td { white-space: nowrap; }
.last{
height: .8rem;
}
.noMore{
/*position: fixed;*/
/*bottom: 0rem;*/
width: 100%;
height: .5rem;
background-color: white;
}
.noMore>div{
margin-top: .1rem;
}
.noMore>div>img{
width: .21rem;
height: .17rem;
}
.noMore>div>span{
font-size: .15rem;
color: #ABABAB;
float: none;
margin-left: .1rem;
}
.noMore>div{
text-align: center;
}
.noMore >.line{
text-align: center;
width: 1.5rem;
height: .02rem;
border-radius: 2px;
background-color: black;
margin-top: .2rem;
}
.am-tabs-default-bar-tab{
font-size: .15rem;
}
/* 我的客户 --- 无*/
.clientless{
/*margin: auto;*/
position: absolute;
height: 100%;
}
.clientless> .client{
width: 1.51rem;
margin: 0 1.32rem;
margin-top: 1.75rem;
}
.clientless>p{
text-align: center;
font-size: .15rem;
color: #666666;
margin-bottom: .02rem;
}
.add{
position: absolute;
bottom: .32rem;
width: 3.5rem;
height: 1.22rem;
margin: 0 .32rem 0;
}
/*我的客户---有*/
.search{
width: 3.8rem;
height: .32rem;
background-color: #F4F4F4;
border-radius: 25.6px;
margin: 0px auto 9.6px;
position: relative;
}
.search img{
position: absolute;
margin:.09rem .15rem;
width: .15rem;
height: .15rem;
}
.search input{
position: absolute;
border: none;
outline:none;
left: .4rem;
top: 0.08rem;
background-color: #F4F4F4;
font-size: .14rem;
color: #999;
width:3.25rem ;
}
.client{
margin-left: .11rem;
padding-bottom: .11rem;
}
.client>span{
float: none;
}
.initial{
margin: 0;
padding-left: .15rem;
font-size: .13rem;
height: .38rem;
padding-top: .1rem;
background-color: #f8f8f8;
}
SwipeActionExample{
font-size: .15rem;
}
.address{
position: fixed;
top: .9rem;
right: .05rem;
}
.scrollListWrap{
height:5.2rem;
overflow-y: auto;
}
.list {
position: relative;
text-align: left;
}
.list>dl{
margin-top: -.1rem;
margin-bottom: .00rem;
}
.list>dl>dt{
background: #F8F8F8;
line-height: .5rem;
padding-left: .11rem;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #ABABAB;
font-size: .13rem;
height: .4rem;
}
.list>dl>.dd {
margin-bottom: 0;
}
.dd{
line-height: .5rem;
padding-left: .11rem;
font-size: .15rem;
background: #fff;
color: #101010;
}
.dd>p{
display: flex;
margin: 0;
-ms-flex-pack: justify;
justify-content: space-between;
border-bottom: 1px solid #f8f8f8;
}
.list>dd>p{
display:flex;
margin:0;
justify-content: space-between;
}
.list>dd>p>span{
margin-right: 0;
float:none;
}
.list>dd>p>.name{
position: relative;
padding-left: .3rem;
}
.list>dd{
display:block;
border-top:1px solid #F8F8F8;
content:''; overflow: hidden;
}
.list>dd>p>.time{
margin-right: .3rem;
}
.indexList{
position: absolute;
right: .09rem;
top: .7rem;
margin: 0px;
padding: 0;
list-style: none;
}
.btn_confirm{
position: relative;
height: .7rem;
top: .05rem;
}
.btn_confirm>img{
width: .6rem;
height: .6rem;
position: relative;
right: .2rem;
float: right;
}
.indexList1{
position: absolute;
top: .7rem;
margin: 0px;
padding: 0;
list-style: none;
right: -4.1rem;
}
:global(.am-tabs-default-bar-underline){
border: 1px #FF9D5C solid;
}
:global(.am-tabs-default-bar-tab-active){
color:#000 ;
}
.tabs{
display: flex;
justify-content: center;
background-color: #fff;
overflow-x: hidden;
}
.tabs1{
display: flex;
justify-content: center;
background-color: #fff;
overflow: hidden;
min-height: 100%;
}
/*:global(.am-list-line){*/
/*padding-left: 15px;*/
/*}*/
import React, { Component } from 'react'
import { connect } from 'dva'
import { Tabs, WhiteSpace, Badge,Toast } from 'antd-mobile';
import { Form } from 'antd';
import InsuranceList from "../InsuranceList"
import styles from "./Tabs.css"
import css from "../../routes/GovernorTraining/css.less"
import MemberList from '../../components/MemberList/MemberList';
import Iscroll from "../../components/Iscroll";
class Tab extends Component{
constructor(props){
super(props);
this.state={
tabs:[{ title: <Badge >{this.props.title[0]}</Badge> },
{ title: <Badge >{this.props.title[1]}</Badge> }
],
chosenClientId:0,
chosenItm: '',
inputValue:'',
name:'',
currentStatus:'',
firstName:[],
nameList:props.nameList,
nameList1:props.nameList1,
checkTab:0,
}
}
onSearch = (val) => {
this.setState({
inputValue:val
})
}
componentWillMount(){
let that = this;
// that.props.dispatch({
// type:'myUser/getAllUser',
// payload:{
// "id":localStorage.getItem("id"),
// "currentState":0,
// },
// callback(data){
// that.setState({
// list:data,
// nameList:data,
// })
// }
// })
// this.props.dispatch({
// type:'myUser/getAllUser',
// payload:{
// "id":localStorage.getItem("id"),
// },
// callback(data){
// that.setState({
// list:data,
// nameList1:data,
// })
// }
// })
}
/* 删除客户 */
delete = (id)=>{
let that = this;
this.props.dispatch({
type:'myUser/deleteCustomer',
payload:{
"id":id,
},
callback(){
// this.getUaer()
}
})
}
history=()=>{
this.props.history()
}
go1=(item)=>{
console.log(item);
let storage = window.localStorage;
storage.setItem("riskName",item.riskName)
storage.setItem("riskCode",item.riskCode)
storage.setItem("calculationMethod",item.calculationMethod)
storage.setItem("selectd",1)
storage.setItem("seriNo",item.seriNo)
//storage.setItem("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
//storage.setItem("recipientsName",'')
//storage.setItem("recipientsSex",true)
//storage.setItem("recipients",false)
let roleId =localStorage.getItem("roleId");
window.location.href= window.location.href.split('#')[0]+ '#/addplaneditor?riskName='+item.riskName+'&riskCode='+item.riskCode +'&calculationMethod='+ item.calculationMethod + '&thumbnail='+item.thumbnail+'&selectd=1&roleId='+ roleId +'&Id='+ localStorage.getItem('id') + '&seriNo='+item.seriNo+'&recipientsName='+ item.receiveName +'&recipientsSex='+item.receiveSex;
}
goPlanResult=(item)=>{
let storage = window.localStorage;
storage.setItem("seriNo",item.seriNo)
storage.setItem("calculationMethod",item.calculationMethod)
storage.setItem("riskCode",item.riskCode)
storage.setItem("riskName",item.riskName)
storage.setItem("thumbnail",item.thumbnail)
window.location.href= window.location.href.split('#')[0]+ '#/planResult?seriNo='+item.seriNo+'&riskName='+item.riskName +'&riskCode='+ item.riskCode +'&thumbnail='+item.thumbnail+'&recipientsName='+ item.receiveName +'&recipientsSex='+item.receiveSex;
}
go=(item)=>{
this.props.dispatch({
type:'planEditor/getMyPlanMessage',
payload:{
"seriNo":item.seriNo,
"interestRate":"0.03"
},
callback(data){
}
})
}
dispatch=(item)=>{
let that = this;
if(item.seriNo){
}else{
this.props.dispatch({
type: 'myUser/getAllUser',
payload: {
"id":localStorage.getItem("id"),
"currentState":this.state.currentStatus,
},
callback(){
that.props.amentClient();
}
})
}
}
goAddInsurance = (item)=>{
let storage = window.localStorage;
storage.setItem("riskName",item.riskName)
storage.setItem("riskCode",item.riskCode)
storage.setItem("calculationMethod",item.calculationMethod)
storage.setItem("selectd",1)
storage.setItem("seriNo",'')
//storage.setItem("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
//storage.setItem("recipientsName",'')
//storage.setItem("recipientsSex",true)
//storage.setItem("recipients",false)
let roleId =localStorage.getItem("roleId");
window.location.href= window.location.href.split('#')[0]+ '#/addPlanEditor?riskName='+item.riskName+'&riskCode='+item.riskCode +'&calculationMethod='+ item.calculationMethod + '&riskIntroduce=&thumbnail='+item.thumbnail+'&selectd=1&roleId='+ roleId +'&Id='+ localStorage.getItem('id') + '&seriNo='
}
render() {
let checkTab = this.state.checkTab
if(sessionStorage.getItem("key") == '已提交'){
checkTab = 1
}
if(sessionStorage.getItem("key") == '我的'){
checkTab = 1
}
let showClient = this.props.storeNameList?this.props.storeNameList.length==0:false &&this.props.user;
let showClient1 = this.props.storeNameList1?this.props.storeNameList1.length==0:false &&this.props.user;
const { dataFilterToProp } = this.props;
return (
<div style={{height:'100%',backgroundColor:'white'}}>
<Tabs tabs={this.state.tabs}
initialPage={checkTab}
swipeable={false}
onChange={(tab, index) => {
let checkTab = tab.title.props.children;
sessionStorage.setItem( "key", checkTab);
}}
tabBarTextStyle={{fontSize:'.15rem',height:'.435rem'}}
>
<div className={!showClient||!showClient1?styles.tabs1:styles.tabs}>
{/*计划书列表---所有*/}
{this.props.allPlanList &&
<div>
<InsuranceList planList = {this.props.allPlanList} goAddInsurance={this.goAddInsurance} style={{paddingTop:'0.2rem',}}></InsuranceList>
<div className={styles.noMore}>
<div><img src={require('../../assets/image/no-more.png')} alt=""/>
<span>没有更多啦</span>
</div>
</div>
</div>
}
{/* 我的客户---无客户跟进中*/}
{ !this.props.myPlanList&& showClient && <div className={styles.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={styles.client}/>
<p>
您当前并未提交客户
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers.png')} onClick={()=>{
this.props.addUser();
}} alt="" className={styles.add}/>
</div>}
{/*我的客户 --- 未提交*/}
{ !this.props.myPlanList&& !showClient &&
<div className={styles.less} style={{ width: '100%',height:'100%'}}>
{!this.props.hasClient[0] && <div className={styles.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={styles.client} />
<p>
您当前并无已提交客户
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers.png')} onClick={() => {
this.props.addUser();
}} alt="" className={styles.add} />
</div>
}
{this.props.hasClient[0] &&
<div>
<MemberList
id="user1"
dataList={this.props.nameList}
renderType={['name']}
content={this.props.content}
handleEdit={(item) => {
// item 客户信息, false 未提交状态
this.props.goAddUser(item, false)
}}
filterData={keywords => {
dataFilterToProp(keywords, 0);
}}
renderItem={item => {
return <div className={css.managerItem} onClick={()=>{
let clientNeededInfo = {...item ,disabled1:true}
localStorage.setItem('clientNeededInfo', JSON.stringify(clientNeededInfo))
window.location.href = window.location.href.split('#')[0] + '#/addUser'
}}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.createTime.substr(0, 16)}</span>
</div>
}}
handleAction={item => {
this.props.delete(item.id)
}}
pTitle='客户' />
<div className={styles.btn_confirm} >
<img src={require('../../assets/image/add-user.png')} alt="" onClick={() => {
this.props.addUser();
}} />
</div>
</div>
}
</div>
}
</div>
{/*----tabs 右侧--*/}
<div style={{ position: 'relative',display: 'flex', minHeight:'100%', justifyContent: 'center',backgroundColor: '#fff',overflow: 'hidden'}}>
{/*计划书---我的*/}
{this.props.myPlanList && <div style={{marginBottom:'.3rem'}}>
<Iscroll id="myPlan2"
iscrollOptions={{
probeType:2
}}
>
<InsuranceList planList = {this.props.myPlanList} className={styles.last} history={this.history} my={true} go={this.go} go1={this.go1} goPlanResult={this.goPlanResult} getMyPlan = {this.props.getMyPlan}></InsuranceList>
<div className={styles.noMore}>
<div><img src={require('../../assets/image/no-more.png')} alt=""/>
<span>没有更多啦</span>
</div>
</div>
</Iscroll>
</div>}
{/* 我的客户 --- 无客户已提交*/}
{!this.props.myPlanList&& showClient1 && <div className={styles.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={styles.client}/>
<p>
您当前并无跟进客户
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers.png')} onClick={() => {
this.props.addUser();
}} alt="" className={styles.add} />
</div>
}
{/*我的客户---有客户已提交 */}
{!this.props.myPlanList&& !showClient1 && <div className={styles.less} style={{width:'100%'}}>
{!this.props.hasClient[1] && <div className={styles.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={styles.client} />
<p>
您当前并无跟进客户
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers.png')} onClick={() => {
this.props.addUser();
}} alt="" className={styles.add} />
</div>
}
{ this.props.hasClient[1] && <div style={{height:'100%'}}>
<MemberList
id="user2"
dataList={this.props.nameList1}
renderType={['name']}
isCheckClientStateForSwipe={true}
handleEdit={(item) => {
// item 客户信息, true 已提交状态
this.props.goAddUser(item, true)
}}
filterData={keywords => {
dataFilterToProp(keywords, 1);
}}
renderItem={item => {
let status = '未提交';
switch (item.currentState) {
// case '1':
// status = '待审核';
// break;
// case '2':
// status = '审核退回';
// break;
case '3':
status = '已提交';
break;
case '4':
status = '已成单';
break;
case '5':
status = '已上传';
break;
case '6':
status = '跟进中';
break;
case '7':
status = '停止跟进';
break;
default:
}
return <div className={css.clientItem}
style={{display:'flex'}}
onClick={()=>{
let clientNeededInfo = {...item ,disabled1:true}
localStorage.setItem('clientNeededInfo', JSON.stringify(clientNeededInfo))
//审核驳回的,可以修改,不能预览
if(item.currentState !=2){
window.location.href = window.location.href.split('#')[0] + '#/addUser'
}
}}>
<span className={css.name}>{item.name}</span>
<span className={css.time}>{item.createTime.substr(0, 16)}</span>
<span className={css.status}>{status}</span>
</div>
}}
handleAction={item => {
console.log(44);
this.props.delete(item.id)
}}
pTitle='客户' />
<div className={styles.btn_confirm} >
<img src={require('../../assets/image/add-user.png')} alt="" onClick={() => {
this.props.addUser();
}} />
</div>
</div>
}
</div>
}
</div>
</Tabs>
<WhiteSpace />
</div>
)
}
}
Tab.propsTypes = {}
export default connect(({myUser})=>({myUser}))(Form.create()(Tab))
\ No newline at end of file \ No newline at end of file
body,:global(#root){
position: fixed;
left:0;
top:0;
width: 100%;
height: 100%;
max-width: 680px;
}
:global(#root.loginRelease) {
position: relative;
height: auto;
}
:global(body.loginRelease) {
position: relative;
height: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<title>&nbsp;</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
</head>
<body>
<script type="text/javascript">
document.title='\u200E';//设置title为空
</script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=kbGgAESiajyhOwzTsjcACyXlDtvoMBp8"></script>
<div id="root"></div>
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="https://zmt.ihxlife.com/pdf.js"></script>
<script src="https://zmt.ihxlife.com/pdf.worker.js"></script>
</body>
</html>
import dva from 'dva';
import './index.css';
import './utils/index.js'
// 1. Initialize
const app = dva();
// 2. Plugins
// app.use({});
// 3. Model
// app.model(require('./models/example').default);
app.model(require('./models/login').default);
app.model(require('./models/planEditor').default);
app.model(require('./models/home').default);
app.model(require('./models/myUser').default);
app.model(require('./models/addUser').default);
app.model(require('./models/poster').default);
app.model(require('./models/databank').default);
app.model(require('./models/GovernorTraining').default);
app.model(require('./models/getCode').default);
app.model(require('./models/Performance').default);
app.model(require('./models/Invitation').default);
app.model(require('./models/infoCenter').default);
app.model(require('./models/BusinessCard').default);
app.model(require('./models/industrynews').default);
app.model(require('./models/exchangeCommunity').default);
app.model(require('./models/myCenter').default);
// 4. Router
app.router(require('./router').default);
// 5. Start
app.start('#root');
import {GetBusinessCardInfo,UpdateBusinessCardInfo,GetCardBackgroundTmpsList,AddOrUpdateCardBackground,DeleteCardBackgroud} from '../services/businessCard';
export default {
namespace: 'BusinessCard',
state: {
CardBackgroundList: {},
cardAllInfo:{},//名片所有信息
},
effects: {
*GetBusinessCardInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetBusinessCardInfo, payload);
if (data.userInfo) {
if (callback) callback(data.userInfo);
yield put({ type: 'updateCardAllInfo' ,payload:{item:data}});
} else {
error && error("没有查出下相应数据")
}
},
*UpdateBusinessCardInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(UpdateBusinessCardInfo, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*GetCardBackgroundTmpsList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetCardBackgroundTmpsList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*AddOrUpdateCardBackground({ payload, callback, error }, { call, put }) {
const { data } = yield call(AddOrUpdateCardBackground, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*DeleteCardBackgroud({ payload, callback, error }, { call, put }) {
const { data } = yield call(DeleteCardBackgroud, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
}
},
reducers: {
updateCardAllInfo(state, { payload }) {
return { ...state, cardAllInfo: payload.item };
},
},
subscriptions: {
},
};
import { GetManagerList,UpdateManager, GetOrzList, GetRegionList, GetClientList,UpdateClientInfo } from '../services/GovernorTraining';
export default {
namespace: 'governortraining',
state: {
},
effects: {
/**
* 获取客户经理列表
* @param {Json} payload
* @param {Function} callback
*/
*getManagerList({ payload, callback }, { call, put }) {
const { data } = yield call(GetManagerList, payload);
// console.log(data)
callback && callback(data)
// if (data.status == true) {
// console.log(data.data);
// if(data.data.length==1){
// yield put({
// type: 'saveUser',
// payload: data.data,
// });
// }
},
/**
* 修改客户经理所属督训
* @param {Json} payload
* @param {Function} callback
*/
*updateManager({ payload, callback }, { call, put }) {
const { data } = yield call(UpdateManager, payload);
callback && callback(data)
},
/**
* 获取机构级联
* @param {Json} payload
* @param {Function} callback
*/
*getOrzList({ payload, callback }, { call, put }) {
const { data } = yield call(GetOrzList, payload);
callback && callback(data)
},
/**
* 获取省市级联信息
* @param {Json} payload
* @param {Function} callback
*/
*getRegionList({ payload, callback }, { call, put }) {
const { data } = yield call(GetRegionList, payload);
callback && callback(data)
},
/**
* 获取客户列表
* @param {Json} payload
* @param {Function} callback
*/
*getClientList({ payload, callback }, { call, put }) {
const { data } = yield call(GetClientList, payload);
callback && callback(data)
},
/**
* 修改客户信息
* @param {Json} payload
* @param {Function} callback
*/
*updateClientInfo({ payload, callback }, { call, put }) {
const { data } = yield call(UpdateClientInfo, payload);
callback && callback(data)
},
},
reducers: {
// saveUser(state, { payload }) {
// console.log(payload);
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import { addEdit, GetInvitationTmpsList, GetMyInvitList, del, GetInvitListById } from '../services/Invitation';
export default {
namespace: 'Invitation',
state: {
item: {},
},
effects: {
*GetInvitationTmpsList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetInvitationTmpsList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*GetMyInvitList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetMyInvitList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*GetInvitListById({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetInvitListById, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*addEdit({ payload, callback ,error}, { call, put }) {
const { data } = yield call(addEdit, payload);
if (data.status === true) {
if (callback) callback(data);
} else {
error && error(data)
}
},
*del({ payload, callback, error }, { call, put }) {
const { data } = yield call(del, payload);
if (data.status === true) {
if (callback) callback(data);
} else {
error && error(data)
}
}
},
reducers: {
// saveUser(state, { payload }) {
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import {policyList,performList,achievementRank} from '../services/performance';
import {Toast} from "antd-mobile"
export default {
namespace: 'Performance',
state: {
item: {},
},
effects: {
*policyList({ payload, callback ,error}, { call, put }) {
const { data } = yield call(policyList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*performList({ payload, callback, error}, { call, put }) {
const { data } = yield call(performList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error&& error(data)
}
},
*achievementRank({ payload, callback, error}, { call, put }) {
const { data } = yield call(achievementRank, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error&& error(data)
}
}
},
reducers: {
saveUser(state, { payload }) {
return { ...state, item: payload };
},
},
subscriptions: {
},
};
import { notifyError } from '../services/app.js';
import { addUser,Dictionaries,sendMaster,isFollow,followCustomer} from '../services/addUser';
export default {
namespace: 'addUser',
state: {
},
effects: {
*addUser({ payload,callback,error}, { call, put }) {
const { data } = yield call(addUser, payload);
if (data.status) {
if (callback) callback(data);
} else {
// if (error) callback(error);
if (error) error(data);
}
},
*Dictionaries({ payload, callback }, { call, put }) {
const { data } = yield call(Dictionaries, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
*sendMaster({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(sendMaster, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
}
},
*isFollow({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(isFollow, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
}
},
*followCustomer({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(followCustomer, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
}
}
},
reducers: {
},
subscriptions: {
},
};
import { GetDataBankList, GetDataInfoList } from '../services/databank';
export default {
namespace: 'databank',
state: {
// item: {},
},
effects: {
*getDataBankList({ payload, callback }, { call, put }) {
const { data } = yield call(GetDataBankList, payload);
// console.log(data)
callback && callback(data)
// if (data.status == true) {
// console.log(data.data);
// if(data.data.length==1){
// yield put({
// type: 'saveUser',
// payload: data.data,
// });
// }
// console.log(666666);
// if (callback) callback(data.data);
// } else {
// notifyError('!');
// }
},
*getDataInfoList({ payload, callback }, { call, put }) {
const { data } = yield call(GetDataInfoList, payload);
callback && callback(data);
},
},
reducers: {
// saveUser(state, { payload }) {
// console.log(payload);
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import {getAllQuestionList,getQuestionInfo,AddQuestion,addAnswer,DeleteQuestion,DeleteAnswer,getLoginUserInfo,getAnswerOfAnswerInfo,updateClickNum} from '../services/exchangeCommunity';
export default {
namespace: 'exchangeCommunity',
state: {
allQuestionList: [],//所有的问题
},
effects: {
*getLoginUserInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(getLoginUserInfo, payload);
if (data.data) {
if (callback) callback(data.data);
} else {
error && error("没有查出下相应数据")
}
},
*getAllQuestionList({ payload, callback, error }, { call, put }) {
const { data } = yield call(getAllQuestionList, payload);
if(data.status){
if (callback) callback(data);
// yield put({ type: 'updateallQuestionList' ,payload:{item:data.data}});
}else{
error && error(data.message)
}
},
*getQuestionInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(getQuestionInfo, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*getAnswerOfAnswerInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(getAnswerOfAnswerInfo, payload);
if (data.data) {
if (callback) callback(data.data);
} else {
error && error("没有查出下相应数据")
}
},
*AddQuestion({ payload, callback, error }, { call, put }) {
const { data } = yield call(AddQuestion, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*addAnswer({ payload, callback, error }, { call, put }) {
const { data } = yield call(addAnswer, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*DeleteQuestion({ payload, callback, error }, { call, put }) {
const { data } = yield call(DeleteQuestion, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*DeleteAnswer({ payload, callback, error }, { call, put }) {
const { data } = yield call(DeleteAnswer, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*updateClickNum({ payload, callback, error }, { call, put }) {
const { data } = yield call(updateClickNum, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
}
},
reducers: {
updateCardAllInfo(state, { payload }) {
return { ...state, updateallQuestionList: payload.item };
},
},
subscriptions: {
},
};
import { GetAccessToken,GetWXACodeUnlimit,GetCodeUnlimit } from '../services/getcode';
export default {
namespace: 'getcode',
state: {
// item: {},
},
effects: {
// *getDataBankList({ payload, callback }, { call, put }) {
// const { data } = yield call(GetDataBankList, payload);
// // console.log(data)
// callback && callback(data)
// // if (data.status == true) {
// // console.log(data.data);
// // if(data.data.length==1){
// // yield put({
// // type: 'saveUser',
// // payload: data.data,
// // });
// // }
// // console.log(666666);
// // if (callback) callback(data.data);
// // } else {
// // notifyError('!');
// // }
// },
*getAccessToken({ payload, callback }, { call, put }) {
const { data } = yield call(GetAccessToken, payload);
callback && callback(data);
},
*getWXACodeUnlimit({ payload, token, callback }, { call, put }) {
const data = yield call(GetWXACodeUnlimit, payload, token);
callback && callback(data);
},
*getCodeUnlimit({ payload, token, callback }, { call, put }) {
const data = yield call(GetCodeUnlimit, payload, token);
callback && callback(data);
},
},
reducers: {
// saveUser(state, { payload }) {
// console.log(payload);
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import { notifyError } from '../services/app.js';
import { getBanner,getPlanList,getMyPlan,getCustomerInfo,GetRoomList,getSearchList,setClickRecord} from '../services/home';
export default {
namespace: 'home',
state: {
PersonalDetail:{},
AllPlanList:[],
MyPlanList:[],
searchList:[]
},
effects: {
*getBanner({ payload, callback }, { call, put }) {
const { data } = yield call(getBanner, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
// notifyError(data.message);
}
},
*getPlanList({ payload, callback }, { call, put }) {
const { data } = yield call(getPlanList, payload);
if (data.status === true) {
if (callback) callback(data.data);
yield put({ type: 'updatePlanList' ,payload:{planList:data.data}});
} else {
notifyError('退出失败!');
}
},
*getMyPlan({ payload, callback }, { call, put }) {
const { data } = yield call(getMyPlan, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
// notifyError(data.message);
}
},
*getCustomerInfo({ payload, callback }, { call, put }) {
const { data } = yield call(getCustomerInfo, payload);
if (callback) callback(data);
},
*getRoomList({ payload, callback }, { call, put }) {
const { data } = yield call(GetRoomList, payload);
if (data.code === 0) {
if (callback) callback(data);
} else {
notifyError(data.message);
}
},
*getSearchList({ payload, callback }, { call, put }) {
const { data } = yield call(getSearchList, payload);
if (data.status) {
if (callback) callback(data.data);
yield put({ type: 'updateSearchList' ,payload:{searchList:data.data}});
} else {
notifyError(data.message);
}
},
*setClickRecord({ payload, callback }, { call, put }) {
const { data } = yield call(setClickRecord, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
}
},
reducers: {
savePersonalDetail(state, { payload }) {
return { ...state, PersonalDetail: payload.microPlanInfo };
},
updatePlanList(state, { payload }){
return {
...state,
AllPlanList: payload.planList };
},
updateSearchList(state, { payload }){
return {
...state,
...payload };
}
},
subscriptions: {
},
};
import { getNewsList, getNews } from '../services/industrynews';
export default {
namespace: 'industrynews',
state: {
item: {},
},
effects: {
*getNewsList({ payload, callback, error }, { call, put }) {
const { data } = yield call(getNewsList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*getNews({ payload, callback, error }, { call, put }) {
const { data } = yield call(getNews, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
}
},
reducers: {
// saveUser(state, { payload }) {
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import {GetInfoList, GetInformationsList, GetSubInfoList} from '../services/infoCenter';
export default {
namespace: 'infoCenter',
state: {
item: {},
},
effects: {
*GetInfoList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetInfoList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*GetSubInfoList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetSubInfoList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
},
*GetInformationsList({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetInformationsList, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
error && error(data)
}
}
},
reducers: {
// saveUser(state, { payload }) {
// return { ...state, item: payload };
// },
},
subscriptions: {
},
};
import { notifyError } from '../services/app.js';
import { Sms,Approve,checkUser } from '../services/login';
export default {
namespace: 'login',
state: {
phone:''
},
effects: {
/* 获取手机验证码 */
*Sms({ payload, callback }, { call, put }) {
const { data } = yield call(Sms, payload);
console.log(payload);
yield put({
type: 'savePhone',
payload: payload,
});
if (data.status === true) {
if (callback) callback(data);
} else {
notifyError(data.message);
}
},
*Approve({ payload, callback }, { call, put }) {
const { data } = yield call(Approve, payload);
if (data.status === true) {
if (callback) callback(data);
} else {
// notifyError(data.message);
}
},
*checkUser({ payload, callback,error }, { call, put }) {
const { data } = yield call(checkUser, payload);
if (data.status ) {
if (callback) callback(data);
} else {
if (error) error(data);
}
},
},
reducers: {
savePhone(state, { payload }) {
return { ...state, phone: payload.mobile };
},
},
subscriptions: {
},
};
import { notifyError } from '../services/app.js';
import { getPerformanceRank } from '../services/myCenter';
export default {
namespace: 'myCenter',
state: {
rerformanceRank:''
},
effects: {
/* 获取手机验证码 */
*getPerformanceRank({ payload, callback }, { call, put }) {
const { data } = yield call(getPerformanceRank, payload);
console.log(payload);
yield put({
type: 'savePhone',
payload: payload,
});
if (data.status === true) {
if (callback) callback(data);
} else {
notifyError(data.message);
}
}
},
reducers: {
},
subscriptions: {
},
};
import { notifyError } from '../services/app.js';
import { getAllUser,deleteCustomer } from '../services/myUser';
export default {
namespace: 'myUser',
state: {
item: {},
},
effects: {
*getAllUser({ payload, callback }, { call, put }) {
const { data } = yield call(getAllUser, payload);
if (data.status === true) {
if(data.data && data.data.length===1){
yield put({
type: 'saveUser',
payload: data.data,
});
}
let dataList = data.data || [];
if (callback) callback(dataList);
} else {
notifyError(data.message);
}
},
*deleteCustomer({ payload, callback }, { call, put }) {
const { data } = yield call(deleteCustomer, payload);
if (data.status === true) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
},
reducers: {
saveUser(state, { payload }) {
return { ...state, item: payload };
},
},
subscriptions: {
},
};
import { getMyPlanMessage,PlanClause,payInsurance,getProspectusaAditional,deletePlan,PremiumPaymentPeriod,addReceiveInfo} from '../services/planEditor';
import { notifyError } from '../services/app.js';
export default {
namespace: 'planEditor',
state: {
userName: '',
password: '',
termList:'',//产品条款
},
effects: {
// 计划书 获取险种信息
*getMyPlanMessage({ payload, callback }, { call, put }) {
const { data } = yield call(getMyPlanMessage, payload);
if (data.status === true) {
yield put({
type: 'savePersonalDetail',
payload: data.data,
});
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
// 计划书查看条款
*PlanClause({ payload, callback ,error}, { call, put }) {
const { data } = yield call(PlanClause, payload);
if (data.status) {
if (callback) callback(data);
} else {
if (error) error(data);
}
},
/* 编辑计划书--买入保险 */
*payInsurance({ payload, callback,error }, { call, put }) {
console.log('8888888888888888888888888888 ----购买险种的参数---payInsurance------>',JSON.stringify(payload));
const { data } = yield call(payInsurance, payload);
if (data && data.status) {
if (callback) callback(data);
} else {
if (error) error(data);
}
},
/* 获取附加险 */
*getProspectusaAditional({ payload, callback,error }, { call, put }) {
const { data } = yield call(getProspectusaAditional, payload);
if (data.status) {
if (callback) callback(data);
yield put({ type: 'updateTermList' ,payload:{termList:data.data}});
} else {
if (error) error(data);
}
},
/* 删除主险,附加险*/
*deletePlan({ payload, callback,error }, { call, put }) {
const { data } = yield call(deletePlan, payload);
if (data.status === true) {
if (callback) callback(data);
} else {
// notifyError(data.message);
if (error) error(data);
}
},
/* 获取险种的缴费期间 */
*PremiumPaymentPeriod({ payload, callback }, { call, put }) {
console.log(payload);
const { data } = yield call(PremiumPaymentPeriod, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
/* 更新收件人的信息 */
*addReceiveInfo({ payload, callback }, { call, put }) {
console.log(payload);
const { data } = yield call(addReceiveInfo, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
},
reducers: {
updateTermList(state,action){
return {
...state,
termList : action.payload.termList
}
}
},
subscriptions: {
},
};
import { GetPosterList, GetPosterInfo } from "../services/poster";
export default {
namespace: "poster",
state: {
// item: {},
},
effects: {
*getPosterList({ payload, callback }, { call, put }) {
const { data } = yield call(GetPosterList, payload);
callback && callback(data);
},
*getPosterInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetPosterInfo, payload);
if (data.status) {
callback && callback(data.data);
} else {
error && error(data);
}
}
},
reducers: {
// saveUser(state, { payload }) {
// console.log(payload);
// return { ...state, item: payload };
// },
},
subscriptions: {}
};
import React from 'react'
import { Route, Switch, Redirect, routerRedux } from 'dva/router'
import dynamic from 'dva/dynamic' // 路由按需加载
const { ConnectedRouter } = routerRedux
function RouterConfig({ history, app }) {
const Login = dynamic({
app,
component: () => import('./routes/Login')
})
const Home = dynamic({
app,
component: () => import('./routes/Home')
})
const Search = dynamic({
app,
component: () => import('./routes/Home/search')
})
const Welcome = dynamic({
app,
component: () => import('./routes/Welcome')
})
const Users = dynamic({
app,
component: () => import('./routes/Users')
})
const Poster = dynamic({
app,
component: () => import('./routes/Poster')
})
const PosterInfo = dynamic({
app,
component: () => import('./routes/Poster/info')
})
const ProspectusList = dynamic({
app,
component: () => import('./routes/ProspectusList')
})
const AddPlanEditor = dynamic({
app,
component: () => import('./routes/AddPlanEditor')
})
const Cover = dynamic({
app,
component: () => import('./routes/Cover')
})
const PlanResult = dynamic({
app,
component: () => import('./routes/PlanResult')
})
const MyUser = dynamic({
app,
component: () => import('./routes/MyUser/index')
})
const AddUser = dynamic({
app,
component: () => import('./routes/AddUser')
})
const AmendClient = dynamic({
app,
component: () => import('./routes/AmendClient')
})
const DataBank = dynamic({
app,
component: () => import('./routes/DataBank')
})
const InfoList = dynamic({
app,
component: () => import('./routes/DataBank/infoList')
})
const Preview = dynamic({
app,
component: () => import('./routes/DataBank/preview')
})
const GTClientList = dynamic({
app,
component: () => import('./routes/GovernorTraining/clientList')
})
const GTAddClient = dynamic({
app,
component: () => import('./routes/GovernorTraining/addClient')
})
const GTChooseClient = dynamic({
app,
component: () => import('./routes/GovernorTraining/chooseClient')
})
const Audit = dynamic({
app,
component: () => import('./routes/GovernorTraining/Audit')
})
const AuditInfo = dynamic({
app,
component: () => import('./routes/GovernorTraining/clientInfo')
})
const VideoChooseClient = dynamic({
app,
component: () => import('./routes/expertVideo/chooseClient')
})
const Performance = dynamic({
app,
component: () => import('./routes/Performance')
})
const MyRank = dynamic({
app,
component: () => import('./routes/MyRank')
})
const MyCenter = dynamic({
app,
component: () => import('./routes/MyCenter')
})
const Website = dynamic({
app,
component: () => import('./routes/MyCenter/websiteDetail')
})
const Invitation = dynamic({
app,
component: () => import('./routes/Invitation')
})
const InvtAddEdit = dynamic({
app,
component: () => import('./routes/Invitation/addEdit')
})
const InvtPreview = dynamic({
app,
component: () => import('./routes/Invitation/preview')
})
const InfoCenter = dynamic({
app,
component: () => import('./routes/InfoCenter')
})
const InfoCenterList = dynamic({
app,
component: () => import('./routes/InfoCenter/infoList')
})
const BusinessCard = dynamic({
app,
component: () => import('./routes/BusinessCard')
})
const BusinessCardAddEdit = dynamic({
app,
component: () => import('./routes/BusinessCard/addEdit')
})
const BusinessCardBackground = dynamic({
app,
component: () => import('./routes/BusinessCard/Background')
})
const IndustryNews = dynamic({
app,
component: () => import('./routes/industrynews')
})
const IndustryNewsDetail = dynamic({
app,
component: () => import('./routes/industrynews/detail')
})
const ExchangeCommunity = dynamic({
app,
component: () => import('./routes/ExchangeCommunity')
})
const QuestionDetail = dynamic({
app,
component: () => import('./routes/ExchangeCommunity/questionDetail')
})
return (
<ConnectedRouter history={history}>
<Switch>
<Route path="/" exact component={Login} />
<Route path="/welcome" exact component={Welcome} />
<Route path="/home" exact component={Home} />
<Route path="/search" exact component={Search} />
<Route path="/users" exact component={Users} />
<Route path="/poster" exact component={Poster} />
<Route path="/poster/info" exact component={PosterInfo} />
<Route path="/prospectusList" exact component={ProspectusList} />
<Route path="/addPlanEditor" exact component={AddPlanEditor} />
<Route path="/cover" exact component={Cover} />
<Route path="/planResult" exact component={PlanResult} />
<Route path="/myUser" exact component={MyUser} />
<Route path="/addUser" exact component={AddUser} />
<Route path="/amendClient" exact component={AmendClient} />
<Route path="/databank" exact component={DataBank} />
<Route path="/databank/infolist" exact component={InfoList} />
<Route path="/databank/preview" exact component={Preview} />
<Route path="/governortraining/gtclientlist" exact component={GTClientList} />
<Route path="/governortraining/audit" exact component={Audit} />
<Route path="/governortraining/auditinfo" exact component={AuditInfo} />
<Route path="/governortraining/addclient" exact component={GTAddClient} />
<Route path="/governortraining/chooseclient" exact component={GTChooseClient} />
<Route path="/video/chooseclient" exact component={VideoChooseClient} />
<Route path="/home/myCenter" exact component={MyCenter} />
<Route path="/home/myUser/website" exact component={Website} />
<Route path="/performance" exact component={Performance} />
<Route path="/myRank" exact component={MyRank} />
<Route path="/invitation" exact component={Invitation} />
<Route path="/invitation/addedit" exact component={InvtAddEdit} />
<Route path="/invitation/preview" exact component={InvtPreview} />
<Route path="/infocenter" exact component={InfoCenter} />
<Route path="/infocenter/list" exact component={InfoCenterList} />
<Route path="/businessCard" exact component={BusinessCard} />
<Route path="/businessCard/addedit" exact component={BusinessCardAddEdit} />
<Route path="/businessCard/cardBackground" exact component={BusinessCardBackground} />
<Route path="/industrynews" exact component={IndustryNews} />
<Route path="/industrynews/detail" exact component={IndustryNewsDetail} />
<Route path="/exchangeCommunity" exact component={ExchangeCommunity} />
<Route path="/exchangeCommunity/questionDetail" exact component={QuestionDetail} />
<Route path="*" render={() => <Redirect to="/" />} />
</Switch>
</ConnectedRouter>
)
}
export default RouterConfig
body{
width:100%;
max-width: 680px;
margin: auto;
background-color: #FF9D5C;
}
.box{
width: 100%;
height: 100%;
background-color: #FF9D5C;
padding-top:.01rem;
padding-bottom: .6rem;
overflow-x: hidden;
}
/*被保人信息*/
.recognizee{
width: 3.92rem;
border-radius: 10px;
margin: .1rem auto;
border: 1px solid #FF9D5C;
overflow: hidden;
}
.message{
padding-left: .15rem;
height: .4rem;
font-size: .16rem;
background-color: #FFF1E8;
line-height: .4rem;
color: #101010;
}
.detail{
width: 3.92rem;
background-color: white;
}
.sex{
height: .5rem;
line-height: .5rem;
padding: 0 .15rem;
}
.sex>.left{
font-size: .15rem;
color: #101010;
display: inline-block;
float: left;
}
.sex>.right{
/*background-color: #666666;*/
display: inline-block;
float: right;
height: .5rem;
position: relative;
}
.sex>.right>.date{
/*display: block;*/
margin-right: .4rem;
width: 1.2rem;
margin-top: .08rem;
border: none;
}
.sex>.right>span{
display: inline-block;
width: .6rem;
height: .3rem;
border: 1px solid #666666;
font-size: .15rem;
text-align: center;
line-height: .3rem;
margin-left: .15rem;
margin-right: 0;
border-radius: 4px;
}
.boy{
position: absolute;
top: .1rem;
right: .75rem;
}
.girl{
position: absolute;
right: 0rem;
top:.1rem;
}
.selectBoy{
position: absolute;
color:#FF5167;
border: 1px solid #FF5167 !important;
top: .1rem;
right: .75rem;
border-radius: 4px;
}
.selectGirl{
position: absolute;
color:#FF5167;
border: 1px solid #FF5167 !important;
right: 0rem;
top:.1rem;
border-radius: 4px;
}
.right>img{
width: .22rem;
height: .2rem;
position: absolute;
top: .14rem;
right: 0;
}
/*投保人非本人*/
.self{
display: inline-block;
}
.select{
width: .2rem;
height: 0.4rem;
float: right;
margin-right: .2rem;
position: relative;
}
.selectd1{
right: 1rem;
}
.selectd2{
right:.3rem;
}
.yes{
position: absolute;
right:.7rem;
}
.no{
position: absolute;
right:.01rem;
}
.select>div>img{
margin-left: .1rem;
width: .2rem;
height: .2rem;
position: absolute;
top: .1rem;
}
.left{
position: relative;
}
.left>input{
position: absolute;
border: none;
outline: none;
left: .8rem;
top: 0.15rem;
font-size: .14rem;
color: #999;
width: 2.25rem;
}
/*险种选择*/
.editor{
width: .16rem !important;
height: .16rem !important;
top:.2rem !important;
}
.recipients{
right: 0rem;
}
:global(.am-button)>span{
float: none;
}
/*底部首年保费*/
.bottom{
width: 100%;
max-width:680px;
margin: 0 auto;
height: .74rem;
background-color: white;
position: fixed;
bottom: 0;
padding-left: .11rem;
z-index: 100;
}
.bottom>.left{
height: .74rem;
float: left;
margin-top: .11rem;
}
.bottom>.left>p{
height: .35rem;
position: relative;
font-size: .15rem;
color: #FF9D5C;
}
.bottom>.left>.num{
color: #FB5150;
font-size: .2rem;
position: relative;
top:-.35rem;
}
.bottom>.left>.num>span{
font-size: .15rem;
float: none;
}
.bottom>.right{
float: right;
font-size: .15rem;
padding-top: .2rem;
}
.bottom>.right> span{
padding: .1rem .13rem;
border: 1px solid #FF9D5C;
border-radius: 4px;
color: #FF9D5C;
float: none;
}
.bottom>.right>.color{
background-color: #FF9D5C;
color:white;
border: 1px dashed #FF9D5C;
}
.choose{
width: 1.5rem; height: .3rem;
border: 1px solid #F0F0F1;
font-size: .15rem;
border-radius: .04rem;
text-align: left; padding-left:.1rem;
color:#999; box-sizing: border-box;
}
.choose:after{
float:right;
width: .12rem; height: .1rem;
margin-top: .11rem; margin-right: .1rem;
background: url('../../assets/image/icon_arrowDown.png') no-repeat;
content:''; background-size: 100%;
}
.choose>span{
float: none;
}
.e_phoneNum {
width: 100%;
padding-left: 0;
}
.e_phoneNum:global(.am-list-line){
padding-right:0;
justify-content: space-between;
}
.e_phoneNum:global(.am-input-control){
width: 1.5rem; height: .3rem;
border: 1px solid #F0F0F1;
border-radius: .04rem;
flex-grow: 0;
flex-basis: auto;
}
.e_phoneNum>input { padding: 0 .1rem; font-size: .15rem;}
:global(.am-list){
background-color: white;
}
:global(.am-list-content){
padding-left: .11rem;
}
.deta{
padding: 0 .1rem;
float: right;
background-color: #ddd;
font-size: .14rem;
border-radius: 10px;
color: white;
}
.chakantiaokuan{
min-height: 20px
}
.choose>span{
color: rgb(153, 153, 153);
font-size: .15rem;
}
.input::-webkit-input-placeholder {
color:rgb(153,153,153);
font-size: .15rem;
}
/* Mozilla Firefox 4 to 18 */
.input:-moz-placeholder {
color:rgb(153,153,153);
font-size: .15rem;
}
/* Mozilla Firefox 19+ */
.input::-moz-placeholder {
color:rgb(153,153,153);
font-size: .15rem;
}
/* Internet Explorer 10+ */
.input:-ms-input-placeholder {
color:rgb(153,153,153);
font-size: .15rem;
}
.choose>span{
color:#000;
line-height: .3rem;
}
:global(.am-list .am-list-item.am-radio-item .am-list-line .am-list-extra .am-radio:before){
position: absolute; width: .2rem; height: .2rem;
content:''; background: url(../../assets/image/icon_unChosen.png) no-repeat; background-size: 100%; right: .15rem; top: .14rem;
z-index: 9;
}
:global(.am-list .am-list-item.am-radio-item .am-list-line .am-list-extra .am-radio-checked:before) {
position: absolute;
width: .2rem;
height: .2rem;
content: '';
background:#fff url(../../assets/image/icon_chosen.png) no-repeat;
background-size: 100%;
right: .15rem;
top: .14rem;
z-index: 9;
}
:global(.am-list .am-list-item.am-radio-item .am-list-line .am-list-extra .am-radio-checked:after) {
position: absolute;
width: .8rem;
height: 90%;
content: '';
background: #fff;
right: .15rem;
top: .02rem;
z-index: 8;
}
:global(.am-modal-body ){
overflow-x: hidden;
}
.modal{
position: fixed;
margin-left: -2.07rem;
left: 50%;
width: 4.14rem;
max-width: 680px;
max-height: 6rem;
overflow-y: scroll;
overflow-x: hidden;
}
.inputDisabled{
background: none;
border: none !important;
font-size: 0.15rem;
-webkit-opacity:1;
opacity: 1;
color: #000;
-webkit-text-fill-color: #000;
}
import React, { Component } from 'react';
import { connect } from 'dva';
import styles from './PlanEditor.css';
import LocalizedModal from "../../components/Modal";
import Table from "../../components/Table";
import { Modal,Button, List,Radio, WhiteSpace, WingBlank ,Picker} from 'antd-mobile';
import share from '../../utils/share';
import shareHide from '../../utils/shareHide';
import DatePicker from "../../components/DatePicker";
import ConfirmPop from '../../components/Modal/confirmPop';
import SelectPicker from '../../components/SelectPicker';
import InputModal from '../../components/InputModal';
import moment from 'moment';
import { Toast } from 'antd-mobile';
import 'moment/locale/zh-cn';
import {getBirthdayAge,urlGetParams,getPlanInListWithCode,filterDate,arrayDeal,StandardFormat} from '../../utils/dataFilter'
moment.locale('zh-cn');
let RadioItem = Radio.RadioItem;
let alert = Modal.alert;
let isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps = '';
if (isIPhone) {
moneyKeyboardWrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
let today = new Date()
class AddPlanEditor extends Component {
constructor(props){
super(props)
this.state = {
coverageValue: "",
fjAmountValue: "",
dataList2014: [
{ value: "0", label: 5000 },
{ value: "1", label: 10000 },
{ value: "2", label: 15000 },
{ value: "3", label: 20000 }
],
dataList2014_1: [
{ value: "0", label: 5000 },
{ value: "1", label: 10000 },
],
selectd: 0,
isShowTips: false,
comfirm: 0,
selectRecognizeeSex: true, // 投保人性别
recipientsSex: true, //收件人性别
recipientsName: "", //收件人姓名
recipients: false,
color: false,
date: "2018-02-03",
modal1: false,
modal2: false,
modal3: false,
modal4: false,
visible: false,
initInsurance: true,
insuranceValue: 0, //医保通 的 社保标志
insuranceLabel: "医保通", //医保通
insurance1: true,
riskName: "",
riskCode: "",
termList: [],
mainInsuranceTitle: [
{
title: "险种",
dataIndex: "0",
width: "25%",
align: "center"
},
{
title: "保额",
dataIndex: "1",
width: "25%",
align: "center"
},
{
title: "保费",
dataIndex: "2",
width: "25%",
align: "center"
},
{
title: "缴费期限",
dataIndex: "3",
width: "25%",
align: "center"
}
],
mainInsurance: false,//主险
mainInsuranceTable: [{}],//主险表格列表
fjTable: [],
clauseUrlList: [], //条款列表详情
roleId: "", //角色id
/*主险*/
protectTime: "", //后端保额传值
microPlanInfo: {}, //获取的主险信息
paymentList: [], //缴费期间
coverage: "", //缴费期间
insuranceDurationList: [], //保险期间
payTime: "", //保险期间后端传值
insuranceDuration: "", //保险期间
inputValue: "", //保额
inputValue1: "", //保费
copies: "", //份数
seriNo: "",
mainRiskCode: "", //主险riskCode
//saveMain: false,
//editorNum: 0, //编辑:0,修改>0
minAmnt: "10000", //最低保额
minPrem: "10000", //最低保费
minAmnt1: "10000", //最低保额 placeholder使用
minPrem1: "10000", //最低保费placeholder使用
/* 附加险 */
fjInsuranceList: [], //附加险列表
defaultfjInsuranceList: [], //默认附加险列表
social: "有", //有无社保
social_mid: "有", //有无社保,作为中间值,当点击确定的时候赋值给social
addProtectTime: "100", //附加险保险期间序号
addInsuranceDuration: "趸缴", //附加险保险期间值
fjRiskCode: "", //附加险code值
fjRiskName: "", //附加险名称
addCoverage: "", //附加险缴费期间值
addPayTime: "", // 附加险缴费期间的序号
fjAmount: 5000, // 附加险保额
fjPrem: 0, // 附加险保费
totalPrem: "0", //首年保费(总)
fjRiskCodeList: [],//已添加的附加险code列表
buyFjList: [],
fjParam: [], //附加险入参集合
/* 被保人信息 */
insName: "",
insSex: true,
insPhone: "",
insBirthday: (new Date().getFullYear() - 30) + "-01-01",
/* 投保人信息 */
appName: "",
appSex: true,
appPhone: "",
appBirthday: (new Date().getFullYear() - 30) + "-01-01",
calculationMethod: "0", //0:保额算保费 , 1:保费算保额 , 2:份数算保费
loadingFlag: true,
mainRiskFlag: "",//主险种标志
fjRiskFlag: "",//附加险种标志
thumbnail: "",
mianWithKBList: [], //主险的所有捆绑险数据
mianWithKB: [], //主险添加的捆绑险
fjhuomianAmount: "", //华夏福 附加投保人豁免保费重大疾病险种的 保额
riskNotTogetherList: [], //不能同时购买的险种
minInsYear: "", //被保人最大年龄
userid: "",
selectChange1: {}, //选择框所选的返回值
planNumTotal50:false,//已生成得计划书数量 是否多余50条
};
}
showToast=(val)=>{
Toast.info(val,);
}
/* 获取当前已生成得计划书列表*/
getMyAllPlanList = (date) => {
let that = this;
this.props.dispatch({
type:'home/getMyPlan',
payload:{
cusManager:localStorage.getItem("id"),
pageNo:"0"
},
callback(data){
that.setState({
planNumTotal50 : (data && data.length>49) ? true : false
})
},
})
}
/* 投保人出生日期*/
getDate = (date) => {
let date_value = moment(date).format('YYYY-MM-DD');
this.setState({
appBirthday:date_value,
})
let that = this;
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,date)
}
},0)
}
/* 被保人出生日期*/
getDate1=(date)=>{
let date_value = moment(date).format("YYYY-MM-DD");
this.setState({
insBirthday :date_value,
})
let that = this;
setTimeout(function () {
if(that.state.mainInsurance){
that.setState({
mainInsurance:false,
})
that.getInsurance(0,0,0,0,0,0,0,date)
}
},0)
}
componentWillMount(){
Toast.loading('loading...',0);
let url = window.location.href;
const params = urlGetParams(url);
let isShare = params.isShare;
let riskName = params.riskName;
let riskCode = params.riskCode;
let calculationMethod = params.calculationMethod;
let thumbnail = params.thumbnail;
let selectd = params.selectd;
let roleId = params.roleId;
let ID = params.ID;
let seriNo = params.seriNo;
seriNo = seriNo ? seriNo : (sessionStorage.getItem("seriNo") || '');//结果页面返回会保存seriNo,实现回显
let urlShare = "";
if(isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = window.location.href+`&isShare=t&phoneNum=${localStorage.getItem('number')}`;
}
share({
decodeUrl: window.location.href.split('#')[0],
title: riskName,
desc: '您的专属保险计划书,请您查收!',
shareUrl: urlShare,
thumbnail: thumbnail,
record:{
"operCode": riskCode,
"operTitle": riskName,
"operFunction": 100120,
"operType": 202,
"phoneNum": isShare ? params.phoneNum : ""
}
});
this.setState({
calculationMethod:Number(calculationMethod),
riskName:riskName,
riskCode:riskCode,
seriNo:isShare!=='t'?seriNo:'',
selectd:selectd,
roleId:roleId,
thumbnail: thumbnail,
seriNo:seriNo,
insBirthday: riskCode == '511404' ? moment(today).format("YYYY-MM-DD") : (today.getFullYear()-30)+'-01-01',//珍爱宝贝被保人默认为0岁
mainRiskFlag:getPlanInListWithCode('riskCode',riskCode,this.props.home.AllPlanList).riskFlag || '',
userid:ID,
});
let that = this;
if(seriNo){
this.setState({
initInsurance:false,
})
setTimeout(function () {
that.getMessage()
that.getProspectusaAditional(0)
},)
}
this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": riskCode,
"operFunction": 100120,
"operTitle": riskName,
"operType": 201,
"phoneNum": isShare ? params.phoneNum : ""
},
callback(data){
console.log('点击分享链接,记录一次')
}
})
}
componentDidMount(){
document.title= this.state.riskName
shareHide(false)
this.getRiskMaxAge();//获取险种投保人最大年龄
this.getProspectusaAditional3();//主险的捆绑险种
this.getProspectusaAditional(0);//查一次附加险
this.getMyAllPlanList();//查询目前已有多少条计划书
}
componentWillUnmount(){
document.title= ''
}
/* 获取附加险 */
getProspectusaAditional=(value)=>{
let age = getBirthdayAge(this.state.insBirthday);
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode":this.state.riskCode,
"riskType":"1" //0:主险 1:附加险
},
callback(data){
let fjInsuranceList = [];
for (var i = 0; i < data.data.length; i++) {
fjInsuranceList.push({
value: i,
label:data.data[i].riskName,
riskCode:data.data[i].riskCode,
fjcalculationMethod:data.data[i].calculationMethod,
riskFlag:data.data[i].riskFlag,
maxAge:data.data[i].maxAge,
noTogether:data.data[i].noTogether,
})
}
let arr = [];
for (var j = 0,l=fjInsuranceList; j < l.length; j++) {
if(that.state.fjRiskCodeList.indexOf(l[j].riskCode)<0){
arr.push(l[j])
}
}
if(arr.length){
that.onChangeFJ(arr[0]);
}else{
that.setState({
insuranceValue:-1,
})
}
that.setState({
fjInsuranceList:fjInsuranceList,
modal1:value===0?false:true,
defaultfjInsuranceList:data.data,
})
},
error(data){
this.showToast(data.message)
}
})
}
/* 获取条款列表 */
getProspectusaAditiona2=()=>{
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode": this.state.riskCode,
"riskType": "" //0:主险 ,1:附加险 ,''所有
},
callback(data){
let termList = [];
for (var i = 0; i < data.data.length; i++) {
termList.push({
key:0,
configName:data.data[i].riskName,
configCode:data.data[i].riskCode,
clauseUrl:data.data[i].clauseUrl,
cut:false,
},)
}
that.setState({
modal4:true,
termList:termList,
})
},
error(data){
this.showToast(data.message)
}
})
}
/*获取险种的投保最大年龄*/
getRiskMaxAge=()=>{
let that = this;
this.props.dispatch({
type:'home/getPlanList',
payload:{
"riskCode":this.state.riskCode,
"riskName":"",
"riskStatus":1, //1启用
"proId":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
callback(data){
that.setState({minInsYear:data.length>0 ? data[0].maxAge : ''})
},
})
}
/* 获取捆绑的附加险 */
getProspectusaAditional3=()=>{
let age = getBirthdayAge(this.state.insBirthday);
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode":this.state.riskCode,
"riskType":"2" //0:主险 1:附加险 2:捆绑险
},
callback(data){
Toast.hide();
that.setState({
mianWithKBList:data.data,
loadingFlag:false
})
},
error(data){
this.showToast(data.message)
}
})
}
/* 获取险种信息*/
getMessage=()=>{
let that = this;
let riskName= this.state.riskName;
if(!this.state.seriNo){
return;
}
this.props.dispatch({
type:'planEditor/getMyPlanMessage',
payload:{
"seriNo":this.state.seriNo || '',
"interestRate":"0.03"
},
callback(data){
if(!data){
if(!that.state.initInsurance){
that.setState({
initInsurance:true,
})
}
return;
}
let microPlanInfo = data.microPlanInfo
let microPlanFJInfo = data.microPlanFJInfo
let totalPrem = 0;
let fjhuomianAmount = Number(microPlanInfo.prem);
let mainTable = [
{
key:0,
0:microPlanInfo.riskName,
1:Number(microPlanInfo.amnt)||'-',
2:Number(microPlanInfo.prem)||'-',
3:microPlanInfo.payTimeName||'-',
4:microPlanInfo.payTime
}
];
//将捆绑险添加到主险下面
let mianWithKB = microPlanInfo.microPlanInfo2 ? microPlanInfo.microPlanInfo2 : [];
for(let ii in mianWithKB){
mainTable.push({
key:ii+1,
0:mianWithKB[ii].riskName,
1:mianWithKB[ii].amnt ||'-',
2:mianWithKB[ii].prem ||'-',
3:Number(mianWithKB[ii].payTime)==0 ? "趸交" : mianWithKB[ii].payTimeName||'-',
4:mianWithKB[ii].payTime
})
fjhuomianAmount = fjhuomianAmount + Number(mianWithKB[ii].prem);
}
totalPrem += Number(microPlanInfo.prem)
let fjTable = [];
let fjParam = [];
let fjRiskCodeList=[];
let fjInsuranceList=[];
if(microPlanFJInfo.length>0){
for (var i = 0; i < microPlanFJInfo.length; i++) {
if(microPlanFJInfo[i].riskType != "2"){//捆绑险种不添加到下方的附加险列表中
fjTable.push({
key:i,
0:microPlanFJInfo[i].riskName||'-',
1:Number(microPlanFJInfo[i].amnt)||'-',
2:Number(microPlanFJInfo[i].prem)||'-',
3:microPlanFJInfo[i].payTimeName||'-',
value:microPlanFJInfo[i].riskCode == '111703'?0:1,
riskCode:microPlanFJInfo[i].riskCode,
fjcalculationMethod:microPlanFJInfo[i].calculationMethod,
riskFlag:microPlanFJInfo[i].riskFlag,
maxAge:microPlanFJInfo[i].maxAge,
noTogether:microPlanFJInfo[i].noTogether,
label:microPlanFJInfo[i].riskName,
})
//获取的附加险列表
fjInsuranceList.push({
value:microPlanFJInfo[i].riskCode == '111703'?0:1,
label:microPlanFJInfo[i].riskName,
riskCode:microPlanFJInfo[i].riskCode,
fjcalculationMethod:microPlanFJInfo[i].calculationMethod,
riskFlag:microPlanFJInfo[i].riskFlag,
maxAge:microPlanFJInfo[i].maxAge,
noTogether:microPlanFJInfo[i].noTogether,
})
fjRiskCodeList.push(microPlanFJInfo[i].riskCode)
}
fjParam.push({
"riskName": microPlanFJInfo[i].riskName,
"riskCode": microPlanFJInfo[i].riskCode,
"amount": microPlanFJInfo[i].calculationMethod != 0 ?0:microPlanFJInfo[i].amnt,
"prem": microPlanFJInfo[i].calculationMethod != 1 ?0:microPlanFJInfo[i].prem,
"copies": microPlanFJInfo[i].calculationMethod != 2 ?'':microPlanFJInfo[i].copies,
"payTime": microPlanFJInfo[i].payTime,
"protectTime":microPlanFJInfo[i].protectTime,
"riskFlag":microPlanFJInfo[i].riskFlag,
})
totalPrem += Number(microPlanFJInfo[i].prem)
}
}
that.setState({
fjParam:fjParam,
buyFjList:fjParam,
microPlanInfo:microPlanInfo,
selectRecognizeeSex:microPlanInfo.appSex=='M'?true:false,
fjInsuranceList:fjInsuranceList,
insName:microPlanInfo.insName,
insSex: microPlanInfo.insSex=='M'?true:false,
insPhone:microPlanInfo.insPhone,
insBirthday:microPlanInfo.insBirthday,
appBirthday:microPlanInfo.appBirthday,
appName: microPlanInfo.appName,
appSex: microPlanInfo.appSex=='M'?true:false,
appPhone: microPlanInfo.appPhone,
totalPrem:totalPrem, //首年保费(总)
payTime:microPlanInfo.payTime,
protectTime:microPlanInfo.protectTime,
coverage:microPlanInfo.payTimeName||'3年交', //缴费期间
insuranceDuration:microPlanInfo.protectTimeName||'趸缴' ,//保险期间
inputValue:microPlanInfo.amnt, //保额
inputValue1:microPlanInfo.prem, //保费
copies:microPlanInfo.copies,
mainInsuranceTable:mainTable, //主险集合
initInsurance:mainTable.length>0 ? false : true,//主险有数据就不展示
mainInsurance:true,
fjTable:fjTable, //附加险集合
mainRiskCode:microPlanInfo.riskCode, //主险riskCode
fjRiskCodeList:fjRiskCodeList,
fjhuomianAmount:fjhuomianAmount,// 附加投保人豁免保费重大疾病险种 的保额
recipientsName:microPlanInfo.receiveName || '',
recipientsSex: microPlanInfo.receiveSex == '0' ? true : false,
recipients: microPlanInfo.receiveName ? true : false,
})
},
error(data){
this.showToast(data.message)
}
})
}
showModal = (key,index,item) => (e) => {
e.preventDefault(); // 修复 Android 上点击穿透
if(key == 'modal2'){
//修改主险
this.getPayMoney(key,'editor')
}else if(key == 'modal3'){
let items = getPlanInListWithCode('riskCode',item.riskCode,this.state.fjInsuranceList) || {};
this.onChangeFJ(item)
this.getPayMoney1(index,key)
}
}
hideModalConfirm=(v)=>{
this.setState({
visible:false,
})
}
onClose = key => (e) => {
e.preventDefault();
this.setState({
[key]: false,
});
}
//主险购买
buy = (key) => (e) => {
e.preventDefault();
let selectChange1 = Object.assign({},this.state.selectChange1);
let that = this;
let inputValue = document.getElementById('inputValue') ? document.getElementById('inputValue').value : this.state.inputValue;
let inputValue1 = document.getElementById('inputValue1') ? document.getElementById('inputValue1').value : this.state.inputValue1;
if(selectChange1.label){
this.setState({
[key]: false,
seriNo:this.state.seriNo || '',
coverageValue: selectChange1.value,
coverage:selectChange1.label,
payTime:selectChange1.payTime,
minAmnt:selectChange1.minAmnt,
minPrem:selectChange1.minPrem,
inputValue:inputValue,
inputValue1:inputValue1,
},function(){
that.buyConfirm();
});
}else{
this.setState({
[key]: false,
seriNo:this.state.seriNo || '',
inputValue:inputValue,
inputValue1:inputValue1,
},function(){
that.buyConfirm();
});
}
}
buyConfirm(){
let buyFjList = this.state.buyFjList;
//主险每次购买或者修改的时候 把附件险中的 豁免险值修改 需要重新计算算
for(let jj in buyFjList){
if(buyFjList[jj].riskCode=='121513'){
buyFjList[jj].payTime = this.state.payTime;
buyFjList[jj].protectTime = this.state.protectTime;
}
}
if(this.state.mianWithKBList.length>0){
this.state.mianWithKBList.map((item,idx)=>{
//先在buyFjList里面找之前添加的附加险里面有没有 捆绑险,有的话就删除重新添加进去
for(let i in buyFjList){
if(buyFjList[i].riskCode == item.riskCode){
buyFjList.splice(i,1);
}
}
buyFjList.push({
"riskName": item.riskName,
"riskCode": item.riskCode,
"amount": item.calculationMethod == 0 ? this.state.inputValue : 0,
"prem": item.calculationMethod == 1 ? this.state.inputValue1 : 0,
"copies": item.calculationMethod == 2 ? 1 : "",
"payTime": this.state.payTime,
"protectTime": this.state.protectTime,
"riskFlag": item.riskFlag,
})
})
};
if(this.state.calculationMethod == '1'){
if(this.state.inputValue1||this.state.microPlanInfo.prem){
// 买入 主险保险
this.payInsurance(buyFjList)
}else{
Toast.info(`最低保费不能低于${this.state.minPrem}!`)
return false;
}
}else if (this.state.calculationMethod == '0'){
if(this.state.inputValue||this.state.microPlanInfo.amnt){
// 买入 主险保险
this.payInsurance(buyFjList)
}else{
Toast.info(`最低保额不能低于${this.state.minAmnt}!`)
return false;
}
}
}
payInsurance=(fj)=>{
Toast.loading('loading...', 88);
let riskCode = this.state.riskCode;
let seriNo = this.state.seriNo;
let riskName = this.state.riskName;
let that = this;
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid,
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
"sex":this.state.appSex ==true?'M':'F',
"birthday":this.state.appBirthday,
"name":this.state.appName,
"phone":this.state.appPhone
},
"insureds":{
"name":this.state.insName,
"sex":this.state.insSex == true?'M':'F',
"birthday":this.state.insBirthday,
"phone":this.state.insPhone
},
"mainMicroPlan":{
"riskName":riskName, //险种名称
"riskCode":riskCode, //险种编码
"amount":this.state.calculationMethod !=0?0:this.state.inputValue||this.state.microPlanInfo.amnt, // 保额 ----
"prem":this.state.calculationMethod=== 1 ?this.state.inputValue1||this.state.microPlanInfo.prem:0, // 保费 -----
"copies":this.state.calculationMethod=== 2?1:"", //份数
"payTime":this.state.payTime, //缴费期间
"protectTime":this.state.protectTime,
"riskFlag": this.state.mainRiskFlag || '',
},
"additionalMicroPlan":fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
that.setState({
mainInsurance:false,
initInsurance:false,
seriNo:data.data.seriNo,
})
that.getMessage();
},
error(data){
that.setState({
mainInsurance:false,
initInsurance:true,
buyFjList:[],
totalPrem:0,
selectChange1:{}
})
that.getMessage();
that.showToast(data.message)
}
})
}
/* 买入附加险*/
payFjInsurance=(fj)=>{
Toast.loading('loading...', 88);
let riskCode = this.state.riskCode;
let that = this;
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid,
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
"sex":this.state.appSex===true?'M':'F',
"birthday":this.state.appBirthday,
"name":this.state.appName,
"phone":this.state.appPhone
},
"insureds":{
"name":this.state.insName,
"sex":this.state.insSex===true?'M':'F',
"birthday":this.state.insBirthday,
"phone":this.state.insPhone
},
"mainMicroPlan":{
"riskCode":this.state.riskCode, //险种编码
"amount":this.state.microPlanInfo.amnt, // 保额 ----
"prem":this.state.microPlanInfo.prem, // 保费 -----
"copies":this.state.copies, //份数
"payTime":this.state.payTime, //缴费期间
"protectTime":this.state.protectTime, //保险期间 ----
"riskFlag":this.state.mainRiskFlag || '', //险种标志 (新加) ----
},
"additionalMicroPlan": fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
that.setState({
mainInsurance:false,
initInsurance:false,
})
that.getMessage();
},
error(data){
let buyFjList = that.state.buyFjList;
buyFjList.pop()
that.setState({
buyFjList,
insuranceValue:0
})
that.showToast(data.message)
}
})
}
//选择投保人和被保人日期时,调用主险算费接口
getInsurance=(insSex,insBirthday,appName,insName,appPhone,insPhone,appSex,appBirthday,selectd)=>{
Toast.loading('loading...', 88);
let riskCode = this.state.riskCode;
let that = this;
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid, //客户经理id
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
"sex": appSex? appSex == 'M'?'M' : 'F': this.state.appSex == true ? 'M' : 'F',
"birthday":this.state.appBirthday,
"name":appName||this.state.appName,
"phone":this.state.appPhone,
},
"insureds":{
"name":insName||this.state.insName,
"sex":insSex? insSex == 'M'?'M' : 'F': this.state.insSex == true ? 'M' : 'F' ,
"birthday":this.state.insBirthday,
"phone":this.state.insPhone,
},
"mainMicroPlan":{
"riskCode":riskCode, //险种编码
"amount":this.state.calculationMethod !=0?0:this.state.microPlanInfo.amnt, // 保额 ----
"prem":this.state.calculationMethod !=1?0:this.state.microPlanInfo.prem, // 保费 -----
"copies":this.state.calculationMethod !=2?'':this.state.copies, //份数
"payTime":this.state.payTime, //缴费期间
"protectTime":this.state.protectTime||this.state.microPlanInfo.protectTime, //保险期间 ----
"riskFlag": this.state.mainRiskFlag || '',
},
"additionalMicroPlan": this.state.fjParam, //fjTable
"isSecurity":this.state.social=='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
that.getMessage();
},
error(data){
that.setState({
totalPrem:0,
mainInsurance:false,
initInsurance:true,
buyFjList:[],
selectChange1:{}
})
that.getMessage();
that.showToast(data.message)
}
})
}
//处理Input组件,聚焦问题。ios手机上有异常
blur =(key,value,phone)=>{
setTimeout(function(){
// alert(1);
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
},10)
if(value){
if(this.state.mainInsurance){
if(this.state.selectd == 1){
// 投保人姓名
this.getInsurance(0,0,value)
}else {
//被保人姓名
this.getInsurance(0,0,0,value)
}
}
}
if(phone){
if(phone.length<11){
this.showToast('手机号码有误!')
}
if(this.state.mainInsurance){
if(this.state.selectd ==1){
this.getInsurance(0,0,0,0,phone)
}else{
this.getInsurance(0,0,0,0,0,phone)
}
}
}
}
fjAmount = (e) =>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
fjAmount :value
})
}
fjPrem = (e) =>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
fjPrem :value
})
}
delete =(seriNo,deleteType,riskCode)=>{
let that = this;
this.props.dispatch({
type:'planEditor/deletePlan',
payload:{
"seriNo":seriNo,
"deleteType":deleteType,
"riskCode":riskCode
},
callback(){
let buyFjList = that.state.buyFjList;
let fjInsuranceList = that.state.fjInsuranceList;
if(deleteType== 1){
//附加险删除
for (var i = 0; i < buyFjList.length; i++) {
if(buyFjList[i].riskCode == riskCode){
buyFjList.splice(i,1);
fjInsuranceList.splice(i,1)
}else{
that.setState({
insuranceValue:buyFjList[i].value,
insuranceLabel:buyFjList[i].label,
})
}
}
that.setState({
buyFjList:buyFjList,
fjInsuranceList:fjInsuranceList
})
}
that.setState({
totalPrem:0,
})
if(deleteType ==0){
that.setState({
initInsurance:true,
mainInsurance:false,
seriNo:'',
buyFjList:[],
fjInsuranceList:[],
});
let storage = window.localStorage;
sessionStorage.setItem("seriNo",'');
}else{
that.getMessage()
}
},
error(data){
that.showToast(data.message)
}
})
}
onChangeFJ = (item) => {
this.setState({
insuranceValue:Number(item.value),
insuranceLabel:item.label,
fjRiskCode:item.riskCode,
fjRiskName:item.label,
fjcalculationMethod:Number(item.fjcalculationMethod),
fjRiskFlag:item.riskFlag,
riskNotTogetherList:item.noTogether || [],
fjAmount: item[1] ? item[1] : '5000'
});
}
closeInsurance = ()=>{
this.setState({
modal1: false,
modal3: false,
insurance1:true,
});
}
handleOk=()=>{
let that = this;
if(this.state.comfirm ==0){
// 是否在跟进中
this.props.dispatch({
type: 'addUser/addUser',
payload: {
"number":this.state.appPhone,
"currentState":0,
"cusManager":localStorage.getItem('id') || this.state.userid,
"name":this.state.appName||'',
"sex": this.state.appSex == true ? '0' : '1',
"age":this.state.appBirthday||"",
},
callback(data){
that.setState({
isShowTips:false,
})
that.goCover()
},
error(data){
that.setState({
isShowTips:false,
});
that.showToast(data.message)
}
})
}
}
goCover = ()=>{
let seriNo = this.state.seriNo;
let riskName = this.state.riskName;
let riskCode = this.state.riskCode;
let thumbnail = this.state.thumbnail;
let recipientsSex =this.state.recipientsSex ? "0" : "1";
let recipientsName =this.state.recipientsName;
let recipients =this.state.recipients;
//收件人信息添加
let that = this;
this.props.dispatch({
type: 'planEditor/addReceiveInfo',
payload: {
"seriNo":seriNo,
"receiveName":recipientsName,
"receiveSex":recipientsSex,
},
callback(data){
console.log('addReceiveInfo-->',data)
window.location.href = window.location.href.split('#')[0]+'#/planResult?seriNo='+seriNo+'&riskName='+riskName +'&riskCode='+riskCode+'&thumbnail='+thumbnail+'&recipients='+recipients+'&recipientsSex='+recipientsSex+'&recipientsName='+recipientsName
},
error(data){
that.showToast(data.message)
}
})
}
/*附加险 查询 缴费期间,*/
getPayMoney1=(index,key)=>{
let that = this;
let fjRiskCode = this.state.fjRiskCodeList[index] ?this.state.fjRiskCodeList[index]: this.state.fjRiskCode;
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
payload:{
"riskCode":fjRiskCode,
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1,
"mainCode": this.state.riskCode
},
callback(data){
if (data.length == 0) {
that.setState({
paymentList:[],
insuranceDurationList:[],
[key]:true,
fjRiskFlag:''
})
return
}
let insuranceDurationList = [],
paymentList=[];
let data1 = []
for (var i = 0; i < data.length; i++) {
data1.push({label:data[i].protectTimeName,protectTime:data[i].protectTime,id:false})
paymentList.push({value:i,label:data[i].payTimeName,payTime:data[i].payTime,minAmnt:data[i].minAmnt,minPrem:data[i].minPrem})
}
var result = [];
var obj = {};
for(var i =0; i<data1.length; i++){
if(!obj[data1[i].id]){
result.push({value:i,label:data1[i].label,protectTime:data1[i].protectTime,minAmnt:data[i].minAmnt,minPrem:data[i].minPrem});
obj[data1[i].id] = true;
}
}
if(result.length>0){
if(fjRiskCode=='121513'){//华夏福附加险中的重大豁免险种
that.setState({
addProtectTime: (that.state.payTime-1), //保险期间后端传值
addInsuranceDuration:'保'+(that.state.payTime-1)+'年', //保险期间
})
}else{
that.setState({
addProtectTime: result[0].protectTime, //保险期间后端传值
addInsuranceDuration: result[0].label, //保险期间
})
}
}
if(paymentList.length>0){
if(fjRiskCode=='121513'){
that.setState({
addCoverage:(that.state.payTime-1)+'年交', //缴费期间
addPayTime :that.state.payTime-1,
minPrem:paymentList[paymentList.length-1].minPrem,
fjAmount:that.state.fjhuomianAmount,
})
}else{
that.setState({
addCoverage:paymentList[paymentList.length-1].label, //缴费期间
addPayTime :paymentList[paymentList.length-1].payTime,
minPrem:paymentList[paymentList.length-1].minPrem,
minPrem1:paymentList[paymentList.length-1].minPrem,
})
}
}
that.setState({
paymentList:paymentList,
insuranceDurationList:result,
[key]:true,
fjRiskFlag:data[0].riskFlag || '',
})
},
error(data){
this.showToast(data.message)
}
})
}
/* 获取保额,保费列表*/
getPayMoney=(key,param)=>{
let that = this;
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1,
"mainCode": this.state.riskCode
},
callback(data){
Toast.hide();
if(data.length==0){
that.setState({
paymentList:[],
insuranceDurationList:[],
loadingFlag:false,
})
return;
}
let insuranceDurationList = [],
paymentList=[];
let data1 = []
for (var i = 0; i < data.length; i++) {
data1.push({label:data[i].protectTimeName,protectTime:data[i].protectTime,id:false})
paymentList.push({value:i,label:data[i].payTimeName,payTime:data[i].payTime,minAmnt:data[i].minAmnt,minPrem:data[i].minPrem})
}
var result = [];
var obj = {};
for(var i =0; i<data1.length; i++){
if(!obj[data1[i].id]){
result.push({value:i,label:data1[i].label,protectTime:data1[i].protectTime,minAmnt:data[i].minAmnt,minPrem:data[i].minPrem});
obj[data1[i].id] = true;
}
}
that.setState({
paymentList:paymentList,
insuranceDurationList:result,
loadingFlag:false,
mainRiskFlag:data.length>0 ? data[0].riskFlag : '',//主险的riskFlag
})
if(result.length>0){
that.setState({
protectTime:result[0].protectTime, //保险期间后端传值
insuranceDuration:result[0].label, //保险期间
})
}
console.log('----getPayMoney----->',that.state.mainInsuranceTable[0],paymentList)
if(paymentList.length>0){
//当缴费期间列表值根据其他条件变化了的时候,需要特殊处理下,比如之前选的20年交项在新的列表里没有时
if(!getPlanInListWithCode('payTime',that.state.payTime,paymentList).label){
that.setState({
coverage:paymentList[paymentList.length-1].label, //缴费期间
payTime:paymentList[paymentList.length-1].payTime,
coverageValue:paymentList[paymentList.length-1].value,
minPrem:paymentList[paymentList.length-1].minPrem,
minAmnt:paymentList[paymentList.length-1].minAmnt,
minPrem1:paymentList[paymentList.length-1].minPrem,
minAmnt1:paymentList[paymentList.length-1].minAmnt,
});
}else{
that.setState({
coverage:that.state.coverage?that.state.coverage:paymentList[paymentList.length-1].label, //缴费期间
payTime:that.state.payTime===0||that.state.payTime?that.state.payTime:paymentList[paymentList.length-1].payTime,
coverageValue:that.state.coverageValue?that.state.coverageValue:paymentList[paymentList.length-1].value,
minPrem:paymentList[paymentList.length-1].minPrem,
minAmnt:paymentList[paymentList.length-1].minAmnt,
minPrem1:paymentList[paymentList.length-1].minPrem,
minAmnt1:paymentList[paymentList.length-1].minAmnt,
})
if(param == 'editor'){//修改主险的时候
if(that.state.mainInsuranceTable.length>0){
let payTimeValue = that.state.mainInsuranceTable[0][4];//主险信息
let obj = getPlanInListWithCode('payTime',payTimeValue,paymentList);
that.setState({
coverage:obj.label, //缴费期间
payTime:obj.payTime,
coverageValue:obj.value,
minPrem:obj.minPrem,
minAmnt:obj.minAmnt,
});
that.handleSelectChange({
label:obj.label,
payTime:obj.payTime,
value:obj.value,
minPrem:obj.minPrem,
minAmnt:obj.minAmnt,
});
}
}
}
}
if(data.length ===0){
Toast.info('年龄不符合投保规则!')
return false;
}else{
that.setState({
[key]:true,
})
}
},
error(data){
this.showToast(data.message)
}
})
}
//选择缴费期间时 从组件中带回来的值
handleSelectChange=(item)=>{
console.log('-----handleSelectChange--------->>>>>',item)
this.setState({
selectChange1:item,
minAmnt1: item.minAmnt, //最低保额 placeholder使用
minPrem1: item.minPrem, //最低保费placeholder使用
});
}
render() {
let url = window.location.href;
const isShare = urlGetParams(url).isShare ? urlGetParams(url).isShare : "";
let {fjRiskCodeList,insSex,appSex,paymentList,recipients,mainInsuranceTable,fjTable,fjInsuranceList,riskNotTogetherList,fjcalculationMethod,fjRiskCode,payTime,minPrem,minAmnt,appBirthday} = this.state
const value = this.state;
let microPlanInfo = this.state.microPlanInfo;
let mainInsuranceTotalPrem = 0;//主险的首年保费
if(mainInsuranceTable.length>0){
for(let i in mainInsuranceTable){
mainInsuranceTotalPrem += Number(mainInsuranceTable[i][2]);
}
}
let age11 = getBirthdayAge(this.state.insBirthday);//被保人年龄
let age22 = getBirthdayAge(this.state.appBirthday);//投保人年龄
//投保人年龄限制,豁免险 投保人年龄是18岁的时候 如果生日是当天 或者 前一天则不能购买
let before18 = moment().subtract(18, "years").format("YYYY-MM-DD");
let appBirthday_mid = StandardFormat(appBirthday);
let appFlag = before18==moment(appBirthday_mid).format("YYYY-MM-DD") || moment(before18).subtract(1, "days").format("YYYY-MM-DD")==moment(appBirthday_mid).format("YYYY-MM-DD") ? true : false;
console.log('------render------>>>>>>>>>>>>>>>>>>>',mainInsuranceTable,fjTable,fjInsuranceList,age11,age22,this.state.coverageValue,payTime,minPrem,minAmnt,before18,moment(appBirthday).format("YYYY-MM-DD"))
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={styles.box}>
{/*被保人信息*/}
<div className={styles.recognizee}>
<div className={styles.message}>
被保人信息
</div>
<div className={styles.detail}>
<div className={styles.sex}>
<div className={styles.left}>
性别
</div>
<div className={styles.right}>
<span className={insSex=== true?styles.selectBoy:styles.boy} onClick={()=>{
this.setState({insSex:true})
if(this.state.mainInsurance){
this.setState({
mainInsurance:false,
})
this.getInsurance('M')
}
}}>
男
</span>
<span className={insSex===true?styles.girl:styles.selectGirl} onClick={()=>{
this.setState({insSex:false})
if(this.state.mainInsurance){
this.setState({
mainInsurance:false,
})
this.getInsurance('F')
}
}}>
女
</span>
</div>
</div>
<div className={styles.sex}>
<div className={styles.left}>
出生日期
</div>
<div className={styles.right}>
<span className={styles.date}>{this.state.insBirthday}</span>
<img src={require('../../assets/image/calendar.png')} alt="" onClick={(e)=>{
this.child1.showDate1('app')
}}/>
</div>
</div>
</div>
</div>
{/*投保人非本人*/}
<div className={styles.recognizee}>
<div className={styles.message}>
<div className={styles.self}>
投保人非本人 &nbsp;
<span style={{fontSize:'.15rem'}}>(豁免相关)</span>
</div>
<div className={styles.select} >
<div>
<img src={this.state.selectd == 1?require('../../assets/image/selected.png'):require('../../assets/image/no-selected.png')} alt="" className={styles.selectd1}
onClick={()=>{
this.setState({
selectd:1
})
let that = this;
setTimeout(function () {
if(that.state.mainInsurance) {
that.getInsurance(0, 0, 0, 0, 0, 0, 0, 0, 1)
}
},0)
}}
/>
<span className={styles.yes}>是</span>
</div>
<div>
<img src={this.state.selectd ==2?require('../../assets/image/selected.png'):require('../../assets/image/no-selected.png')} alt="" className={styles.selectd2} onClick={()=>{
this.setState({
selectd:2
})
let that = this;
setTimeout(function () {
if(that.state.mainInsurance) {
that.getInsurance(0, 0, 0, 0, 0, 0, 0, 0, 2)
}
},0)
}}
/>
<span className={styles.no}>否</span>
</div>
</div>
</div>
<div className={styles.detail}>
{this.state.selectd !=0 && <div className={styles.sex}>
<div className={styles.left}>
姓名
<input type="text" placeholder="请输入投保人姓名" value={this.state.appName} onBlur={()=>{
::this.blur('',this.state.appName)}
} onChange={(e)=>{
this.setState({
appName:e.target.value,
})
}} />
</div>
</div> }
{this.state.selectd !=0 &&
<div className={styles.sex}>
<div className={styles.left}>
手机号码
<input type="number" placeholder="请输入投保人手机号码" onBlur={()=>{
::this.blur('','',this.state.appPhone)
}} value={this.state.appPhone} onChange={(e)=>{
let value = e.target.value
value = value.substring(0, 11);
this.setState({
appPhone:value,
})
}
}/>
</div>
</div>}
{this.state.selectd == 1 && <div className={styles.sex}>
<div className={styles.left}>
性别
</div>
<div className={styles.right}>
<span className={appSex==false?styles.boy:styles.selectBoy} onClick={()=>{
this.setState({appSex:true})
if(this.state.mainInsurance){
this.getInsurance(0,0,0,0,0,0,'M')
}
}}>
男
</span>
<span className={appSex==false?styles.selectGirl:styles.girl} onClick={()=>{
this.setState({appSex:false})
if(this.state.mainInsurance){
this.getInsurance(0,0,0,0,0,0,'F')
}
}}>
女
</span>
</div>
</div>
}
{
this.state.selectd == 1 &&
<div className={styles.sex}>
<div className={styles.left}>
出生日期
</div>
<div className={styles.right}>
<span className={styles.date}>{this.state.appBirthday}</span>
<img src={require('../../assets/image/calendar.png')} alt="" onClick={()=>{
this.child.showDate('ins')
}
}/>
</div>
</div>}
</div>
</div>
{/*险种选择*/}
<div className={styles.recognizee}>
<div className={styles.message}>
险种选择
</div>
{this.state.initInsurance &&<div className={styles.detail}>
<div className={styles.sex} >
<div className={styles.left} >
{this.state.riskName}
</div>
<div className={styles.right}>
<img src={require('../../assets/image/editor.png')} alt="" className={styles.editor} onClick={
()=>{
if(this.state.planNumTotal50){
alert('提示', '计划书数量过多,请删除不需要的计划书', [
{ text: '取消', onPress: () => console.log('取消') },
{ text: '去删除', onPress: () => {
this.props.history.push({pathname:"/prospectusList",query:{key:"我的"}});
}},
])
return
}
this.getPayMoney('modal2')
}
} />
</div>
</div>
</div>}
{this.state.mainInsurance&&<div className={styles.detail} >
<div className={styles.sex} style={{height:'auto'}}>
<div className={styles.left}>
{this.state.riskName} <span style={{marginLeft:'.2rem'}}>首年保费 {mainInsuranceTotalPrem.toFixed(2)+"元"}</span>
</div>
<div className={styles.right} style={{zIndex:1}}>
<img src={require('../../assets/image/editor.png')} alt="" className={styles.editor} onClick={ this.showModal('modal2')
} style={{position:'initial'}}/>
<img src={require('../../assets/image/delete.png')} alt="" className={styles.editor} onClick={(e)=>{
e.preventDefault()
this.delete(this.state.seriNo,0,this.state.mainRiskCode)
}
} style={{marginLeft:'.2rem',position:'initial'}}/>
</div>
<div>
<Table listTitle={this.state.mainInsuranceTitle} listTable={mainInsuranceTable}></Table>
</div>
</div>
{
this.state.fjTable && this.state.fjTable.map((item,index)=>{
return (
<div className={styles.sex} style={{height:'auto'}} key={index}>
<div className={styles.left}>
{this.state.fjTable[index][0]} <span style={{marginLeft:'.2rem'}}>首年保费 {this.state.fjTable[index][2].toFixed(2)+"元"}</span>
</div>
<div className={styles.right} style={{zIndex:1}}>
<img src={require('../../assets/image/editor.png')} alt="" className={styles.editor} onClick={
this.showModal('modal3',index,this.state.fjTable[index])
}
style={{position:'initial'}}/>
<img src={require('../../assets/image/delete.png')} alt="" className={styles.editor} onClick={
(e)=>{
let fjRiskCodeList = this.state.fjRiskCodeList
e.preventDefault()
this.delete(this.state.seriNo,1,fjRiskCodeList[index])
}
} style={{marginLeft:'.2rem',position:'initial'}}/>
</div>
<div>
<Table listTitle={this.state.mainInsuranceTitle} listTable={[this.state.fjTable[index]]}></Table>
</div>
</div>
)
})
}
<div style={{height:'.5rem',marginTop:'.1rem'}}>
{
this.state.defaultfjInsuranceList.length>0 && (
<span style={{border:'1px solid #FF5167', borderRadius:'5px', padding:'.05rem .1rem',color:'#FF5167',float:'none',position:'relative',right:'-2.25rem',top:'.15rem'}} onClick={(e)=>{
e.preventDefault()
this.getProspectusaAditional();
}
}> + 添加主/附加险</span>
)
}
</div>
</div>
}
</div>
{/*收件人信息*/}
<div className={styles.recognizee}>
<div className={styles.message}>
<div className={styles.self}>
收件人信息
</div>
<div className={styles.select} >
<div>
<img src={recipients=== true?require('../../assets/image/selected.png'):require('../../assets/image/no-selected.png')} alt="" className={styles.selectd2 && styles.recipients} onClick={()=>{
this.setState({
recipients:!this.state.recipients
})
}}
/>
</div>
</div>
</div>
<div className={styles.detail}>
{recipients === true && <div className={styles.sex}>
<div className={styles.left}>
姓名
<input type="text" placeholder="请输入收件人姓名" value={this.state.recipientsName} onBlur={::this.blur} onChange={(e)=>{
this.setState({
recipientsName:e.target.value,
})
}
}/>
</div>
</div> }
{recipients === true &&
<div className={styles.sex}>
<div className={styles.left}>
性别
</div>
<div className={styles.right}>
<span className={this.state.recipientsSex === false?styles.boy:styles.selectBoy} onClick={()=>{
this.setState({
recipientsSex:true,
})
}
}>
男
</span>
<span className={this.state.recipientsSex === true?styles.girl:styles.selectGirl} onClick={()=>{
this.setState({
recipientsSex:false,
})
}
}>
女
</span>
</div>
</div>
}
</div>
</div>
<div className={styles.bottom}>
<div className={styles.left}>
<p>首年保费</p>
<p className={styles.num}>{this.state.totalPrem}<span>.00元</span></p>
</div>
<div className={styles.right}>
<span style={{marginRight:'.11rem'}} className={this.state.color ===true ?styles.color:''} onClick={()=>{
this.getProspectusaAditiona2()
}}>产品条款</span>
<span style={{marginRight:'.21rem'}} className={this.state.color ===false ?styles.color:''} onClick={()=>{
if(this.state.mainInsurance){
let storage = window.localStorage;
// window.sessionStorage.setItem("recipientsName",this.state.recipientsName)
// window.sessionStorage.setItem("recipientsSex",this.state.recipientsSex)
// window.sessionStorage.setItem("recipients",this.state.recipients)
window.sessionStorage.setItem("seriNo",this.state.seriNo)
window.sessionStorage.setItem("selectd",this.state.selectd)
let that = this;
if (isShare != 't') {
if(this.state.roleId ==3){
this.goCover()
}
else if(this.state.appPhone){
this.props.dispatch({
type: 'addUser/followCustomer',
payload: {
"number":this.state.appPhone,
"roleId":this.state.roleId,
"id":this.state.userid
},
callback(data){
if(data != ""){
// 有数据生成计划,
that.goCover();
}else{
//提示是否添加到跟进中,
that.setState({
comfirm:0, //跟进中
isShowTips:true,
})
}
}
})
}else{
this.goCover();
}
} else {
this.goCover();
}
}else{
this.showToast('请先选择险种信息!')
}
}}>生成计划书</span>
</div>
</div>
<WingBlank>
<WhiteSpace />
<Modal
popup
visible={this.state.modal2}
onClose={this.onClose('modal2')}
animationType="slide-up"
className={styles.modal}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>{this.state.riskName} <span style={{float:'right',}} onClick={this.onClose('modal2')}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}}/>
</span></div>} className="popup-list">
{/* 只有一个值*/}
{this.state.insuranceDuration != '' && this.state.insuranceDurationList.length==1 &&
<List.Item>保险期间
<div style={{float:'right',position:'relative'}} >
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}>{this.state.insuranceDuration}</div>
</div>
</List.Item>
}
{/* 有多个值 */}
{this.state.insuranceDurationList.length != 1 && <List.Item>保险期间
<div style={{float:'right',position:'relative'}} >
<Picker
data={this.state.insuranceDurationList}
cols={1}
disabled={this.state.insuranceDurationList.length==1?true:false}
onChange={
(s)=>{
let insuranceDurationList = this.state.insuranceDurationList;
for (var i = 0; i < insuranceDurationList.length; i++) {
if(i == s){
this.setState({
protectTime:insuranceDurationList[i].protectTime,
insuranceDuration:insuranceDurationList[i].label,
})
}
}
}
}
>
<div className={styles.choose} onClick={()=>{}}><span>{this.state.insuranceDuration!=='' ? this.state.insuranceDuration : this.state.insuranceDuration}</span></div>
</Picker>
</div>
</List.Item>
}
{/* 一个值*/}
{this.state.paymentList && paymentList.length ==1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}>{this.state.coverage}</div>
</div>
</List.Item>}
{/*多个值*/}
{
this.state.paymentList && paymentList.length>1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<SelectPicker List={this.state.paymentList}
value={this.state.coverageValue}
selectChange={this.handleSelectChange}>
</SelectPicker>
</div>
</List.Item>
}
{
this.state.calculationMethod == 0 && <List.Item >保额
<div style={{float:'right'}}>
<InputModal placeholder={'最低保额'+this.state.minAmnt1}
id="inputValue"
value={this.state.inputValue}
/>
</div>
</List.Item>
}
{
this.state.calculationMethod == 1 && <List.Item >保费
<div style={{float:'right'}}>
<InputModal placeholder={'最低保费'+ this.state.minPrem1}
id="inputValue1"
value={this.state.inputValue1}
/>
</div>
</List.Item>
}
{
this.state.calculationMethod == 2 && <List.Item >份数
<div style={{float:'right'}}>
1
</div>
</List.Item>
}
{/*主险的捆绑险种*/}
{
this.state.mianWithKBList.length>0 && <List>
{ this.state.mianWithKBList && this.state.mianWithKBList.map((i,idx) => {
return(
<RadioItem key={i}
checked
disabled
>
{i.riskName}
</RadioItem>
)
})
}
</List>
}
<List.Item>
<Button onClick={this.buy('modal2')} style={{color:'white',backgroundColor:'#FF9D5B',float:'none'}}>确定</Button>
</List.Item>
</List>
</Modal>
<Modal
popup
visible={this.state.modal1}
onClose={this.onClose('modal1')}
animationType="slide-up"
className={styles.modal}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>添加主/附加险 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}} onClick={()=>{
this.setState({
modal1:false,
})
}
}/>
{/*确定*/}
</span></div>} className="popup-list">
</List>
<List>
{ this.state.fjInsuranceList && this.state.fjInsuranceList.map((i,idx) => {
let NotTogetherList = this.state.riskNotTogetherList;
NotTogetherList = NotTogetherList.indexOf(i.riskCode) >-1 ? NotTogetherList : NotTogetherList.concat(i.riskCode)
let len = arrayDeal.Intersect(NotTogetherList,fjRiskCodeList.concat(i.riskCode)).length;
let selectdFlag = false,checked = false;
if(age11>i.maxAge){
selectdFlag = true;
}else{
if(i.riskCode == '121513'){//华夏福豁免险种 投保人是本人时 不能选择
if(this.state.selectd != 1 || Number(payTime)==0 || age22<18 || age22>60){
selectdFlag = true;
}else{
if(age22 > (69-(payTime-1))){
selectdFlag = true;
}
if(age22==18 && appFlag){
selectdFlag = true;
}
}
}
if(i.riskCode == '111703'){//医保通,选择了医保通之后 2014只能选 5000,10000.所以医保通在2014不是这两个值的时候不能选
let obj = getPlanInListWithCode('riskCode','121705',fjTable);
if(obj[1] && (String(obj[1]) != '5000' && String(obj[1]) != '10000') ){
selectdFlag = true;
}
}
}
return(
<RadioItem key={i.value}
className="fjRadio"
checked={selectdFlag ? false : (len>1 ? false : this.state.insuranceValue===i.value ? true : false)}
disabled={selectdFlag || (fjRiskCodeList.indexOf(i.riskCode)>-1 ?true: len>1 ? true : false)}
onChange={() => this.onChangeFJ(i)}>
{i.label}
</RadioItem>
)
})
}
</List>
<List.Item>
<Button onClick={()=>{
if(this.state.fjRiskCodeList.length==this.state.fjInsuranceList.length){
}else{
//此处判断互斥的险种
let NotTogetherList = this.state.riskNotTogetherList;
NotTogetherList = NotTogetherList.indexOf(this.state.fjRiskCode) >-1 ? NotTogetherList : NotTogetherList.concat(this.state.fjRiskCode)
let len = arrayDeal.Intersect(NotTogetherList,fjRiskCodeList.concat(this.state.fjRiskCode)).length;
let ckeckedNUm = document.getElementsByClassName('fjRadio am-radio-item-disabled').length;//被禁用的元素的个数
if(len>1 || ckeckedNUm == this.state.fjInsuranceList.length){
return;
}
this.setState({
modal1:false,
modal3:true,
})
this.getPayMoney1('modal3')
}
}} style={{color:'white',backgroundColor:'#FF9D5B',float:'none'}}>确定</Button>
</List.Item>
</Modal>
<Modal
popup
visible={this.state.modal3}
onClose={this.onClose('modal3')}
animationType="slide-up"
className={styles.modal}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>{this.state.insuranceLabel} <span style={{float:'right',}} onClick={
()=>{
this.setState({
insurance1:true,
})
this.closeInsurance()
}
}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.insuranceDurationList.length == 1 &&<List.Item >保险期间
<div style={{float:'right'}}>
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}>{this.state.addInsuranceDuration}</div>
</div>
</List.Item> }
{this.state.insuranceDurationList.length>1 &&<List.Item>保险期间
<div style={{float:'right',position:'relative'}} >
<Picker
data={this.state.insuranceDurationList}
cols={1}
disabled={this.state.insuranceDurationList.length==1?true:false}
onChange={
(s)=>{
let insuranceDurationList = this.state.insuranceDurationList;
for (var i = 0; i < insuranceDurationList.length; i++) {
if(i == s){
this.setState({
addProtectTime:insuranceDurationList[i].protectTime,
addInsuranceDuration:insuranceDurationList[i].label,
})
}
}
}
}
>
<div className={styles.choose} ><span>{ this.state.addInsuranceDuration }</span></div>
</Picker>
</div>
</List.Item> }
{
this.state.paymentList && paymentList.length ==1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}> { this.state.addCoverage}</div>
</div>
</List.Item>
}
{
this.state.paymentList && paymentList.length > 1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<Picker
data={this.state.paymentList}
cols={1}
disabled={paymentList.length===1?true:false}
onChange={
v => {
let paymentList = this.state.paymentList;
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
addCoverage:paymentList[i].label,
addPayTime:paymentList[i].payTime,
minAmnt:paymentList[i].minAmnt,
minPrem:paymentList[i].minPrem,
})
}
}
}
}
>
<div className={styles.choose} ><span >{this.state.addCoverage}</span></div>
</Picker>
</div>
</List.Item>
}
{
this.state.fjcalculationMethod == 0 && this.state.fjRiskCode === '121705' && <List.Item >保额
<div style={{float:'right',position:'relative'}} >
<Picker
data={fjRiskCodeList.indexOf('111703')>-1 ? this.state.dataList2014_1 : this.state.dataList2014}
cols={1}
value={[this.state.fjAmountValue]}
onChange={
v => {
let paymentList = fjRiskCodeList.indexOf('111703')>-1 ? this.state.dataList2014_1 : this.state.dataList2014;
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
fjAmount:paymentList[i].label,
fjAmountValue:paymentList[i].value
})
}
}
}
}
>
<div className={styles.choose} ><span>{this.state.fjAmount !='' ? this.state.fjAmount : '5000'}</span></div>
</Picker>
</div>
</List.Item>
}
{
this.state.fjcalculationMethod == 0 && this.state.fjRiskCode != '121705' && <List.Item >保额
<div style={{float:'right'}}>
<input style={{width:'1.5rem',border:'1px solid #ddd',paddingLeft:'.1rem',height:'.3rem',fontSize:'.15rem'}}
placeholder={'最低保额'+this.state.minAmnt1}
onBlur={::this.blur}
className={this.state.fjRiskCode == '121513' ? styles.inputDisabled : null}
disabled={this.state.fjRiskCode == '121513' ? true : false}
id="pp" type="number" pattern="[0-9]*" name="password" value={this.state.fjAmount} onChange={this.fjAmount}/>
</div>
</List.Item>
}
{
this.state.fjcalculationMethod == 1 && <List.Item >保费
<div style={{float:'right'}}>
<input style={{width:'1.5rem',border:'1px solid #ddd',paddingLeft:'.1rem',height:'.3rem',fontSize:'.18rem'}}
placeholder={'最低保费'+this.state.minPrem1}
onBlur={::this.blur}
id="pp" type="number" pattern="[0-9]*" name="password" value={this.state.fjPrem} onChange={this.fjPrem}/>
</div>
</List.Item>
}
{
this.state.fjcalculationMethod == 2 && <List.Item >份数
<div style={{float:'right'}}>
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}> 1</div>
</div>
</List.Item>
}
{
this.state.fjRiskCode == '111703' && <List.Item>有无社保
<div style={{float:'right',position:'relative'}} >
<Picker
data={[{value:'0',label:'有'},{value:'1',label:'无'}]}
cols={1}
onChange={
v => {
let paymentList = [{value:'0',label:'有'},{value:'1',label:'无'}];
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
social_mid:paymentList[i].label,
})
}
}
}
}
>
<div className={styles.choose} ><span>{this.state.social_mid !=='' ? this.state.social_mid : '请选择'}</span></div>
</Picker>
</div>
</List.Item>
}
<List.Item>
<Button onClick={()=>{
let buyFjList = this.state.buyFjList;
//修改附件险种的时候,先删除之前添加的
for(let i in buyFjList){
if(buyFjList[i].riskCode == this.state.fjRiskCode){
buyFjList.splice(i,1);
}
}
buyFjList.push({
"riskName": this.state.insuranceLabel,
"riskCode": this.state.fjRiskCode,
"amount": this.state.fjcalculationMethod == 0 ? this.state.fjAmount : 0,
"prem": this.state.fjcalculationMethod == 1 ? this.state.fjPrem : 0,
"copies": this.state.fjcalculationMethod == 2 ? 1 : "",
"payTime": this.state.addPayTime,
"protectTime": this.state.addProtectTime,
"riskFlag": this.state.fjRiskFlag,
})
let that = this;
this.setState({
modal3:false,
buyFjList:buyFjList,
social:this.state.social_mid
},function(){
that.payFjInsurance(buyFjList)
})
}} style={{color:'white',backgroundColor:'#FF9D5B',float:'none'}}>确定</Button>
</List.Item>
</List>
</Modal>
<Modal
popup
visible={this.state.modal4}
onClose={this.onClose('modal4')}
animationType="slide-up"
className={styles.modal}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>条款列表<span style={{float:'right',}} onClick={this.closeInsurance}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}} onClick={this.onClose('modal4')}/>
</span></div>} className="popup-list">
</List>
<List>
<List.Item >
<div style={{color:'#999999'}}>{this.state.riskName}</div>
</List.Item>
{this.state.termList.map((item,index)=>{
return(
<List.Item style={{left:'.1rem'}} key={index}>{item.configName}
<div style={{float:'right',position:'relative',right:'.1rem'}} >
<img src={item.cut !== true?require('../../assets/image/open.png'):require('../../assets/image/off.png')} alt="" style={{width:'.14rem',height:'.08rem'}} onClick={()=>{
let that = this;
let termList = this.state.termList;
termList[index].cut = !termList[index].cut
this.setState({
termList:termList,
})
/* 条款列表详情接口 */
this.props.dispatch({
type:'planEditor/PlanClause',
payload:{
"riskCode":item.configCode,
"pageNo":1
},
callback(data){
that.setState({
clauseUrlList:data.data[0].clauseUrlList
})
},
error(data){
this.showToast(data.message)
}
})
}}/>
</div>
{
item.cut && <div>
<div className={styles.chakantiaokuan}>
<span style={{color:'#888',fontSize:'.14rem',float:'left'}}>条款预览</span>
<span className={styles.deta} onClick={()=>{
if(item.clauseUrl){
//跳转前 先保存下险种及其他页面数据
// window.sessionStorage.setItem("recipientsName",this.state.recipientsName)
// window.sessionStorage.setItem("recipientsSex",this.state.recipientsSex)
// window.sessionStorage.setItem("recipients",this.state.recipients)
window.sessionStorage.setItem("seriNo",this.state.seriNo)
window.sessionStorage.setItem("selectd",this.state.selectd)
window.location.href = item.clauseUrl
}
}}> 查看详情</span>
</div>
{this.state.clauseUrlList.map((item,index)=>{
return(
<div key={index}>
<img src={item.configInfo} alt="" style={{height:'100%',width:'100%'}}/>
</div>
)
})
}
</div>
}
</List.Item>
)
})}
</List>
</Modal>
</WingBlank>
<DatePicker onRef = {(ref)=>{
this.child = ref;
}}
birthday = {moment(this.state.appBirthday).format("YYYY-MM-DD")}
getDate = {(date)=>{
this.getDate(date)
}}
//minYear={filterDate.FromDateToTarget(60)}
>
</DatePicker>
<DatePicker onRef = {(ref)=>{
this.child1 = ref;
}}
birthday = {moment(this.state.insBirthday).format("YYYY-MM-DD")}
getDate = {(date)=>{
this.getDate1(date)
}}
minYear={filterDate.FromDateToTarget(this.state.minInsYear)}
>
</DatePicker>
<ConfirmPop show={this.state.isShowTips} title="提示" handleOK={this.handleOk}
handleCancel={() => {
this.setState({
isShowTips: false
})
if(this.state.comfirm == 0){
this.goCover()
}
}}
>
<p>您是否确定添加该客户到跟进中?</p>
</ConfirmPop>
</div>
)
}
}
AddPlanEditor.propsTypes = {}
export default connect(({planEditor,home})=>({planEditor,home}))(AddPlanEditor)
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.box{
position: relative;
width: 100%;
height: 100%;
/* padding-bottom: 1rem; */
overflow-y: scroll;
}
/* 列表 */
.base{
/*margin-top: .1rem;*/
/*padding-left: .1rem;*/
background: white;
}
.profession{
height: .5rem;
position: relative;
line-height: .5rem;
border-bottom: 1px solid #f8f8f8;
}
.start{
position: absolute;
font-size: .15rem;
color: #FF2654;
}
.base_massage{
position: absolute;
left: .1rem;
color: #101010;
}
.profession>input{
position: absolute;
left: 1.2rem;
top: .15rem;
border: none;
}
.profession>input::-webkit-input-placeholder {
color: #aab2bd;
}
input:disabled{
background-color: white;
}
.select{
position: absolute;
right: .1rem;
}
.select>img{
width: .08rem;
height: .14rem;
}
.professionBox{
margin-top: .1rem;
padding-left: .1rem;
background: white;
}
/* 分享*/
.shareBox{
}
.share{
float: right !important;
font-size: .17rem;
color: white;
padding: 0.05rem .15rem;
background-color: #FF9D5C;
border-radius: 18px;
position: relative;
right: .1rem;
top: .1rem;
height: .4rem;
}
.userAdd{
float: right !important;
color: #666666;
font-size: .15rem;
position: relative;
top: .16rem;
right: 0.2rem;
}
.partingLine{
height: .8rem;
line-height: 1rem;
margin-top: .2rem;
color: #101010;
font-size: .15rem;
padding: 0 .11rem;
MARGIN-BOTTOM: .2rem;
}
.left {
float: left;
width: 39%;
max-width: 255px;
height: .5rem;
border-bottom: 1px dashed;
margin-right: 0;
}
.mine{
float: left;
margin: 0 .1rem;
}
.right {
float: left;
width: 39%;
max-width: 255px;
height: .5rem;
margin-right: 0;
border-bottom: 1px dashed;
}
.addLabel{
color: rgba(253, 129, 21, 0.67);
text-align: center;
height: 1rem;
position: relative;
padding: .2rem 1.4rem;
}
.addLabel>span{
border: 1px solid;
border-radius: 20px;
padding: .1rem .2rem;
}
.label{
padding: 0 0 0 0.12rem;
}
.label>img{
margin-left: .2rem;
width: 3.5rem;
margin-top: .1rem;
/* margin-bottom: 1rem; */
}
.label>ul{
list-style: none;
padding: 0;
position: static;
}
.li{
list-style: none;
float: left;
width: .7rem;
height: .44rem;
border: 1px solid;
margin-right: .1rem;
text-align: center;
line-height: .44rem;
background-color: white;
margin-bottom: .1rem;
border-radius: .05rem;
}
.li.check{
background:#FB5150; color:#fff;
}
.li>span{
margin: 0;
float: none;
}
.label>ul>li{
float: left;
width: .7rem;
height: .44rem;
border: 1px solid;
margin-right: .1rem;
text-align: center;
line-height: .44rem;
background-color: white;
margin-bottom: .1rem;
}
.addLabel>span{
margin:0 ;
float: none;
}
/* 底部固定 */
.bottom{
width: 100%;
max-width:680px;
margin: 0 auto;
height: .74rem;
background-color: white;
position: fixed;
bottom: 0;
padding-left: .11rem;
z-index: 5;
}
.bottom>.right{
width: 100%;
max-width: 100%;
display: block;
font-size: .15rem;
margin-top: .1rem;
border-bottom: none;
}
.bottom>.right> span{
padding: .07rem .13rem;
border: 1px solid #FF9D5C;
border-radius: 4px;
color: #FF9D5C;
margin-right: .2rem;
float: right;
}
.bottom>.right>.color{
background-color: #FF9D5C;
color:white;
border: 1px dashed #FF9D5C;
}
:global(.am-list-item){
padding-left: 0;
}
:global(.am-list-content){
/*width: 6rem !important;*/
/*font-size: .15rem !important;*/
/*color: #999 !important;*/
}
.black{
color:#000 !important;
}
:global(.am-list-item .am-input-control input:disabled){
color: #000 !important;
opacity: 1;
-webkit-opacity:1;
-webkit-text-fill-color: #000;
}
import React, {Component} from 'react'
import {connect} from 'dva'
import share from '../../utils/share';
import styles from './AddUser.css'
import css from '../../routes/GovernorTraining/css.less'
import {Toast, InputItem, Picker,} from 'antd-mobile';
import DatePicker from "../../components/DatePicker";
import ConfirmPop from '../../components/Modal/confirmPop';
import shareHide from "../../utils/shareHide";
import {urlGetParams,getPlanInListWithCode,filterDate} from "../../utils/dataFilter";
import moment from 'moment';
moment.locale('zh-cn');
class AddUser extends Component {
constructor(props) {
super(props)
this.state = {
color:false,
message:'',//提交至督训,确定
labelList: ['医疗', '健康', '少儿', '意外', '温和', '严肃', '孝顺', '富有', '小康', '拮据'],
addLabel:[],
showLabelList:false,
ageAry:[],
provinceCitys:[],
disabled:false,
visible:false,
submit:{
title: '提示',
content: '您是否确定添加该客户信息?',
okText: '确认',
cancelText: '取消',
},
matchs1:'',
/* 客户信息*/
id:null,
name:"",
sex:"0", //1:女, 0:男
age:"0",
phone:"",
maritalStatus:'',
education:"",
occupational:[],
occupationalSelect:'',
annualIncome:[],
annualIncomeSelect:'',
province:[],
provinceSelect:'',
address:"",
regionData: [],
reverseData:[],
regionVal: '',
asyncValue:[],
product:[],
productSelect:'',
productCode:'',
paymentList:[],
payment:"",
frequency:"",
insuredAmount:"",
birthday:'',
loadingFlag:true,
}
}
blur =()=>{
let timer = setTimeout(function(){
// alert(1);
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
clearTimeout(timer)
},10)
}
hideModalConfirm = (v)=>{
this.setState({
visible:false,
})
// const isShare = localStorage.getItem('clientNeededInfoIsShare');
const isShare = urlGetParams(window.location.href).isShare === '1' ? false : true;
let that = this;
if (v === 'ok') {
let aLabel = this.state.addLabel.toString();
let cusManager = '';
let address = window.location.href;
const matchs = urlGetParams(window.location.href).id;
if (matchs) {
cusManager = matchs;
}
/* 确定 */
this.props.dispatch({
type:'addUser/addUser',
payload:{
"id":this.state.id||null,
"name":this.state.name||'',
"sex":this.state.sex,
"age": this.state.birthday||"",
// "birthday":this.state.birthday||'',
"number":this.state.phone||'',
"maritalStatus":this.state.maritalStatus||'',
"education":this.state.education||'',
"occupational":this.state.occupationalSelect||'',
"annualIncome":this.state.annualIncomeSelect||'',
"province":this.state.regionVal||'',
//regionVal
"address":this.state.address||'',
"product":this.state.productSelect||'',
"payment":this.state.payment===0?0:this.state.payment,
"frequency":this.state.frequency||'',
"insuredAmount":this.state.insuredAmount||"",
'label': aLabel, //添加的label标签。
"currentState":'0',//未提交状态
"cusManager": cusManager==='' ? localStorage.getItem('id'):cusManager, //当前登录的经理id
},
callback() {
!isShare && Toast.info('添加成功', 10000);
isShare && that.props.history.replace('/myUser');
},
error(data){
that.showToast(data.message)
}
})
}
}
showToast=(val)=>{
Toast.info(val,);
}
hideModalSubmit = (v)=>{
this.setState({
visible:false,
})
let that = this;
if (v === 'ok') {
let aLabel = this.state.addLabel.toString();
/*提交至督训 */
this.props.dispatch({
type:'addUser/addUser',
payload:{
"id": this.state.id||null,
"name":this.state.name||'',
"sex":this.state.sex,
"age": this.state.birthday||"",
"number":this.state.phone||'',
// "birthday":this.state.birthday||'',
"maritalStatus":this.state.maritalStatus||'',
"education":this.state.education||'',
"occupational":this.state.occupationalSelect||'',
"annualIncome":this.state.annualIncomeSelect||'',
"province": this.state.regionVal || '',
"address":this.state.address||'',
"product":this.state.productSelect,
"payment":this.state.payment,
"frequency":this.state.frequency||'',
"insuredAmount":this.state.insuredAmount||"",
'label': aLabel, //添加的label标签。
"currentState":'3',//已提交状态
"cusManager":localStorage.getItem('id'),
},
callback(){
that.props.dispatch({
type:'addUser/sendMaster',
payload:{
id:window.localStorage.getItem('superiorid'),
customerName:window.localStorage.getItem('name')
},
callback(){
that.props.history.push('/myUser')
}
})
},
error(data){
that.showToast(data.message)
}
})
}else{
}
}
//获取产品列表
getPlanList(){
const storeItem = JSON.parse(localStorage.getItem('clientNeededInfo'));
let that =this;
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1 启用
},
callback(data){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].riskCode,label:data[i].riskName})
that.setState({
product:ary,
productCode: (storeItem && storeItem.product) ? getPlanInListWithCode('label',storeItem.product,ary).value : '' ,
})
}
},
})
}
showModal = key => (e) => {
e.preventDefault(); // 修复 Android 上点击穿透
this.setState({
[key]: true,
});
}
onClose = key => (e) => {
e.preventDefault();
this.setState({
[key]: false,
initInsurance:true,
});
}
/* 职业类型,所在省市,年收入 */
Dictionaries = (params)=>{
let that = this;
this.props.dispatch({
type:'addUser/Dictionaries',
payload: params,
callback(data){
if(params.configType ==='jobType' ){
let ary = []
for (let i = 0; i < data.length; i++) {
ary.push({value:data[i].configName,label:data[i].configName})
that.setState({
occupational:ary,
})
}
}else if(params.configType ==='yearMoney'){
let ary = []
for (let i = 0; i < data.length; i++) {
ary.push({value:data[i].configName,label:data[i].configName})
that.setState({
annualIncome:ary,
})
}
}else if(params.configType ==='provinces'){
let ary = []
for (let i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
province:ary,
})
}
}else if(params.oyhers){
let ary = []
for (let i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
provinceCitys:ary,
modal15:true,
})
}
}
}
})
}
setAgeRange() {
let arr = [];
for (let i = 0; i <= 100; i++){
arr.push({ label:i+'岁',value:i})
}
return arr;
}
componentWillUnmount() {
document.title = '';
}
componentWillMount(){
Toast.loading('loading...',0);
this.getPlanList();
}
componentDidMount() {
const _this = this;
let address = window.location.href;
document.title = '客户信息';
const matchs1 = urlGetParams(window.location.href).id
if(matchs1){
shareHide(false)
let urlShare = "";
if(urlGetParams(window.location.href).isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = window.location.href + '&isShare=1';
}
share({
decodeUrl: window.location.href.split('#')[0],
title: '我是'+ localStorage.getItem('name')+',您的保障待领取',
desc: '您与保障之间的距离只差一步',
shareUrl: urlShare,
thumbnail: 'https://zmt.ihxlife.com/customer1.png'
});
}else {
shareHide()
const storeItem = JSON.parse(localStorage.getItem('clientNeededInfo'));
if (storeItem) {
_this.setState({
"id": storeItem.id,
"name": storeItem.name || '',
"sex": storeItem.sex === '0' ? 0 : 1,
"age": storeItem.age === '' ? 0 : storeItem.age,
"birthday": storeItem.age === '' ? '' : storeItem.age,
"phone": storeItem.number || '',
"maritalStatus": storeItem.maritalStatus || '',
"education": storeItem.education || '',
"occupationalSelect": storeItem.occupational || '',
"annualIncomeSelect": storeItem.annualIncome || '',
"regionVal": storeItem.province || '',
"address": storeItem.address,
"productSelect": storeItem.product||'' ,
"payment": storeItem.payment || '',
"frequency": storeItem.frequency || '',
"insuredAmount": storeItem.insuredAmount || "",
addLabel: !storeItem.label ? [] : storeItem.label.split(','), //添加的label标签。
"currentState": storeItem.currentState,
cusManager: localStorage.getItem("id"),
})
if(storeItem.disabled1){
_this.setState({
disabled:true,
})
}
}
}
let ageAry = []
for (var i = 0; i < 101; i++) {
ageAry.push({value:i,label:i})
}
this.setState({
ageAry:ageAry,
matchs1:matchs1,
})
// 省市级联初始化
let clientInfo = JSON.parse(localStorage.getItem("clientNeededInfo"));
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
configType: 'provinces',
oyhers: 0
},
callback: (res) => {
Toast.hide();
if (res.status) {
let { data } = res, arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].configName,
value: data[i].configCode,
children: []
})
}
this.setState({
regionData: arr,
loadingFlag:false
}, () => {
if (clientInfo) {
const namearr = clientInfo.province.split(',');
if (namearr.length) {
let havedata = false;
arr.forEach((element, i) => {
if (element.label==namearr[0]) {
havedata = true;//匹配到了有数据
console.log("6666666666666666666----->>>>",element)
_this.fillSecData(element.value, i, (list) => {
if (namearr[1]) {
list && list.forEach(el => {
if (el.configName === namearr[1]) {
_this.setState({
regionVal: element.label+','+el.configName,
asyncValue: [element.value, el.configCode]
})
}
});
} else {
_this.setState({
regionVal: element.label,
asyncValue: [element.value]
})
}
})
}
});
if(!havedata){//没有匹配到
_this.fillSecData(data[0].configCode, 0)
}
}
} else {
_this.fillSecData(data[0].configCode, 0)
}
})
}
}
});
}
getDate=(date)=>{
// let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
let date_value = moment(date).format("YYYY-MM-DD");
this.setState({
birthday :date_value,
})
}
handleDate1 = (val)=>{
this.setState({birthday : val});
}
reverseData(list) {
let j = {};
list.forEach((v) => {
j[v.value] = { label: v.label };
if (v.children && v.children.length) {
j[v.value].children = {};
v.children.forEach(val => {
j[v.value].children[val.value] = val.label;
})
}
})
return j;
}
onRegionPickerChange(v) {
const asyncValue = [...v];
this.setState({
asyncValue
})
if (this.state.regionData.length) {
const { regionData } = this.state;
for (let i = 0, l = regionData.length; i < l; i++) {
if (regionData[i].value === v[0]) {
this.fillSecData(v[0], i);
}
}
}
}
fillSecData(v, i, cb) {
const _this = this;
let { regionData } = this.state;
if (!regionData[i].children.length) {
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
configType: 'provinces',
oyhers: v
},
callback(res) {
if (res.status && res.data.length) {
let { data } = res,arr=[];
for (let i = 0, l = data.length; i < l; i++){
arr.push({
label: data[i].configName,
value: data[i].configCode
})
}
regionData[i].children = arr;
_this.setState({
regionData
}, () => {
const list = _this.reverseData(_this.state.regionData);
let asyncValue = _this.state.asyncValue;
if(asyncValue.length==1){
asyncValue[1] = arr[0].value;
}
console.log(_this.state.regionVal,_this.state.asyncValue,list,list[_this.state.asyncValue[0]])
_this.setState({
reverseData: list,
// regionVal:_this.state.regionVal,
asyncValue: asyncValue
},function(){
cb && cb(data);
})
})
}
}
})
}
}
render() {
// const isShare = localStorage.getItem('clientNeededInfoIsShare');
const isShare = urlGetParams(window.location.href).isShare === '1' ? false : true;
const storeItem = JSON.parse(localStorage.getItem('clientNeededInfo'));
const frequency = [
//趸交、月交、季交、半年交、年交
{value:'月交',label:'月交'},
{value:'季交',label:'季交'},
{value:'半年交',label:'半年交'},
{value:'年交',label:'年交'},
];
if(this.state.loadingFlag){
return <div></div>
}
let disabled_P = true;
//华夏红你。华夏福。福临门不显示缴费频次
if(this.state.productCode === '411405'||this.state.productCode === '411204'||this.state.productCode === '511403'){
disabled_P = false;
}
return (
<div style={{position:'relative',height:'100%',background:'white'}}>
<DatePicker onRef = {(ref)=>{
this.child = ref;
}} getDate = {(date)=>{
this.getDate(date)
}}
birthday = {this.state.birthday ? moment(this.state.birthday).format("YYYY-MM-DD"):null}
>
</DatePicker>
<div className={css.ac_wrap}>
<div id="scrollSection">
<ul className={css.aclist_wrap}>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="text"
value={this.state.name}
disabled={this.state.disabled}
//editable={!this.state.disabled}
onBlur={::this.blur}
onChange={v => {
if(!this.state.disabled){
this.setState({
name: v,
})
}
}}
placeholder = {this.state.disabled?'':"请输入客户姓名"}
>姓名</InputItem>
</li>
<li>
<span className={css.label}>性别</span>
<Picker
data={[
{ label: '男', value: 0 },
{ label: '女', value: 1 }
]}
cols={1}
value={[0]}
disabled={this.state.disabled}
onChange={
s => {
this.setState({sex:s[0]})
}
}
>
<div className={css.choose}><span className={styles.black}>{this.state.sex == 0 ? '男' : '女'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li >
<span className={css.label}>出生日期</span>
<span
className={this.state.birthday?styles.black:''}
style={{width:'3rem',lineHeight: '.5rem',
fontSize:'.15rem',
color:'#999',
}} onClick={()=>{
if(!this.state.disabled){
this.child.showDate1()
}
}}> {this.state.disabled?this.state.birthday:this.state.birthday?this.state.birthday:'请选择出生日期'}</span>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="phone"
value={this.state.phone}
disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v => {
if(!this.state.disabled){
this.setState({
phone: v.replace(/\s*/g, ''),
})
}
this.setState({
})
}}
placeholder = "请输入手机号码"
>手机号码</InputItem>
</li>
<li>
<span className={css.label}>婚姻状况</span>
<Picker
data={[
{ label: '未婚', value: '未婚' },
{ label: '已婚', value: '已婚' },
{ label: '离异', value: '离异' }
]}
cols={1}
value={[this.state.maritalStatus]}
disabled={this.state.disabled}
onChange={
s => this.setState({maritalStatus:s[0]})
}
>
<div className={css.choose}><span className={this.state.maritalStatus?styles.black:''}>{this.state.disabled?this.state.maritalStatus:this.state.maritalStatus?this.state.maritalStatus:'请选择婚姻状况'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li>
<span className={css.label}>学历</span>
<Picker
data={[
{ label: '初中及以下', value: '初中及以下' },
{ label: '高中', value: '高中' },
{ label: '大专', value: '大专' },
{ label: '本科', value: '本科' },
{ label: '硕士', value: '硕士' },
{ label: '博士', value: '博士' },
{ label: '其他', value: '其他' }
]}
disabled={this.state.disabled}
cols={1}
value={['本科']}
onChange={
s => this.setState({education:s[0]})
}
>
<div className={css.choose}><span className={this.state.education?styles.black:''}>{this.state.disabled?this.state.education:this.state.education!=='' ? this.state.education : '请选择学历'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
</ul>
<ul className={css.aclist_wrap}>
<li onClick={()=>{this.Dictionaries({configType:'jobType'})}}>
<span className={css.label}>职业类型</span>
<Picker
data={this.state.occupational}
cols={1}
disabled={this.state.disabled}
onChange={
s =>{
this.setState({occupationalSelect:s[0]})
}
}
>
<div className={css.choose}><span className={this.state.occupationalSelect?styles.black:''}>{this.state.disabled?this.state.occupationalSelect:this.state.occupationalSelect||'请选择职业类型'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li onClick={()=>{this.Dictionaries({configType:'yearMoney'})}}>
<span className={css.label}>年收入(万元)</span>
<Picker
data={this.state.annualIncome}
cols={1}
disabled={this.state.disabled}
onChange={
s =>{
this.setState({annualIncomeSelect:s[0]})
}
}
>
<div className={css.choose}><span className={this.state.annualIncomeSelect?styles.black:''}>{this.state.disabled?this.state.annualIncomeSelect:this.state.annualIncomeSelect||'请选择年收入'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
</ul>
<ul className={css.aclist_wrap}>
<li>
<span className={css.label}>所在省市</span>
<Picker
data={this.state.regionData}
cols={2}
disabled={this.state.disabled}
value={this.state.asyncValue}
onPickerChange={this.onRegionPickerChange.bind(this)}
onOk={(v) => {
// const asyncValue = [...v];
const asyncValue = [...v].length>1 ? [...v] : this.state.asyncValue;
const { reverseData } = this.state;
let label = '';
label = asyncValue.length > 1 ? reverseData[asyncValue[0]].label + ',' + reverseData[asyncValue[0]].children[asyncValue[1]] : reverseData[asyncValue[0]].label;
this.setState({
regionVal: label,
asyncValue:asyncValue
})
}}
>
<div className={css.choose}>
<span className={this.state.regionVal?styles.black:''}>{this.state.disabled?this.state.regionVal:this.state.regionVal === '' ? '请选择所在省市' : this.state.regionVal}</span>
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li>
<InputItem
className={css.e_phoneNum}
type="text"
value={this.state.address}
disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v=>this.setState({address:v})}
placeholder = {this.state.disabled?'':"请输入详细地址"}
>详细地址</InputItem>
</li>
</ul>
<ul className={css.aclist_wrap}>
<li>
<span className={css.label}>希望购买的产品</span>
<Picker
data={this.state.product}
cols={1}
disabled={this.state.disabled}
value={[this.state.productSelect]}
onChange={
s =>{
let namelabel = getPlanInListWithCode('value',s[0],this.state.product).label;
this.setState({
productSelect: namelabel,
productCode: s[0],
payment:"",
})
}
}
>
<div className={css.choose}>
<span className={this.state.productSelect?styles.black:''}>{this.state.disabled?this.state.productSelect : this.state.productSelect == '' ? "请选择产品": this.state.productSelect}</span>
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li onClick={()=>{
if(this.state.disabled){
return;
}
if(this.state.productCode){
let that =this;
let date = new Date();
let nowDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.productCode,
// "maxAge":this.state.,
"birthday": this.state.productCode=='511404' ? nowDate : '1981-02-23',
"pageNo":1,
"mainCode": this.state.productCode
},
callback(data){
let paymentList = [];
for (var i = 0; i < data.length; i++) {
paymentList.push({value:data[i].payTime,label:data[i].payTimeName,})
}
that.setState({
paymentList:paymentList,
})
}
})
}else{
Toast.info('请选择产品!',)
return false;
}
}}>
<span className={css.label}>缴费期间</span>
<Picker
data={this.state.paymentList}
cols={1}
//disabled={this.state.productCode==''?true:false}
disabled={this.state.disabled ? this.state.disabled: this.state.productCode==''?true:false}
onChange={
s =>{
this.setState({payment:s[0]===0?'趸交':s[0]+'年交'})
}
}
>
<div className={css.choose}><span className={this.state.payment !==''?styles.black:''}>{this.state.disabled?this.state.payment :this.state.payment === '' ? '请选择缴费期间':this.state.payment}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
{disabled_P &&
<li>
<span className={css.label}>缴费频次</span>
<Picker
disabled={this.state.disabled}
data={frequency}
cols={1}
onChange={
s =>{
this.setState({frequency:s[0]})
}
}
>
<div className={css.choose}><span className={this.state.frequency !=''?styles.black:''}>{this.state.disabled?this.state.frequency == '' ?"":this.state.frequency==0? '趸交' : this.state.frequency:this.state.frequency == '' ?'请选择缴费频次':this.state.frequency==0? '趸交' : this.state.frequency}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
}
<li>
<InputItem
className={css.e_phoneNum}
type="phone"
value={this.state.insuredAmount}
disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v => {
this.setState({
insuredAmount: v.replace(/\s+/g,''),
})
}}
placeholder = {this.state.disabled?'':"请输入保额"}
>保额</InputItem>
</li>
</ul>
<div style={{minHeight:"180px",marginBottom:"0.75rem"}}>
{
this.state.matchs1 && <div className={styles.shareBox}>
{/*<span className={styles.share}>分享</span>*/}
<span className={styles.userAdd}>可分享空白页面至客户自己填写</span>
<span style={{display: 'block', clear: 'both',height:'1px',marginTop:'-1px',overflow:'hidden'}}></span>
</div>
}
<div className={styles.partingLine}>
<span className={styles.left}></span>
<span className={styles.mine}>客户标签</span>
<span className={styles.right}></span>
</div>
{ !this.state.showLabelList &&
<div style={{paddingLeft: '.11rem'}}>
<div style={{ overflow: 'hidden', width: '100%' }}>
{
this.state.addLabel.map((item,index)=>{
return (
<li key={index} className={styles.li+' '+ styles.check}>
<span >{item}</span>
</li>
)
})
}
</div>
{!this.state.disabled
&&<div className={styles.addLabel} onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})
}
}>
<span>+ {!this.state.addLabel.length?'添加':'更改'}标签</span>
</div>
}
</div>
}
{
this.state.showLabelList && <div className={styles.label}>
<ul>
{
this.state.labelList.map((item,index)=>{
let ischeck = false;
let { addLabel } = this.state;
for (let i = 0; i < addLabel.length; i++) {
if (item === addLabel[i]) {
ischeck = true;
break;
}
}
return (
<li key={index} className={styles.li+' '+(ischeck?styles.check:'')}
onClick={() => {
let isck = false;
for (let i = 0; i < addLabel.length; i++) {
if (item === addLabel[i]) {
isck = true;
addLabel.splice(i, 1);
this.setState({
addLabel
})
break;
}
}
!isck && this.setState({
addLabel: [...addLabel,item]
})
}}>
{
!ischeck && <span>+ </span>
}
<span>{item}</span>
</li>
)
})
}
</ul>
<img src={require('../../assets/image/confirmAdd.png')} alt="" onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})
}
} />
</div>
}
</div>
</div>
</div>
<div>
{!this.state.disabled && <div className={styles.bottom}>
<div className={styles.right}>
<span className={styles.color}
onClick={()=>{
console.log(this.state.name);
console.log(this.state.name.length);
if(this.state.name ==''){
this.showToast('请输入姓名!')
return false;
}else if(this.state.phone==''){
this.showToast('请输入手机号!')
return false;
}else if(this.state.phone.length !=11){
this.showToast('请输入正确的手机号!')
return false;
}
this.setState({
color:false,
visible:true,
message:'确定',
submit:{ title: storeItem?'修改':'提示',
content: '您是否确定' + (storeItem ? '修改' : '添加') + '该客户信息?',
okText: '确认',
cancelText: '取消',}
})
}}>确定</span>
{isShare && <span onClick={() => {
if (this.state.name === '') {
this.showToast('请输入姓名!')
return false;
} else if (this.state.phone === '') {
this.showToast('请输入手机号!')
return false;
}else if(this.state.phone.length !=11){
this.showToast('请输入正确的手机号!')
return false;
}
this.setState({
color: true,
visible: true,
message: '督训',
submit: {
title: '提交',
content: '您是否确定将该条客户信息提交?',
okText: '确认',
cancelText: '取消',
}
})
}}>提交</span>
}
</div>
</div>
}
<ConfirmPop show={this.state.visible}
title={this.state.submit.title}
handleOK={() => {
if (this.state.message !== '督训') {
this.hideModalConfirm('ok');
} else {
this.hideModalSubmit('ok');
}
}}
handleCancel={() => {
this.setState({
visible: false
})
}}
>
<p style={{ width:'80%',margin:'0 auto .2rem'}}>{this.state.submit.content}</p>
</ConfirmPop>
{
this.state.disabled && <div style={{position:'absolute',top:0,left:0,right:0,bottom:0,opacity:0}}></div>
}
</div>
</div>
)
}
}
AddUser.propsTypes = {}
export default connect()(AddUser)
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.box{
width: 100%;
padding-bottom: 1rem;
}
/* 列表 */
.base{
margin-top: .1rem;
padding-left: .1rem;
background: white;
}
.profession{
height: .5rem;
position: relative;
line-height: .5rem;
border-bottom: 1px solid #f8f8f8;
}
.start{
position: absolute;
font-size: .15rem;
color: #FF2654;
}
.base_massage{
position: absolute;
left: .1rem;
color: #101010;
}
.profession>input{
position: absolute;
left: 1.2rem;
top: .15rem;
border: none;
}
.profession>input::-webkit-input-placeholder {
color: #aab2bd;
}
input:disabled{
background-color: white;
}
.select{
position: absolute;
right: .1rem;
}
.select>img{
width: .08rem;
height: .14rem;
}
.professionBox{
margin-top: .1rem;
padding-left: .1rem;
background: white;
}
/* 分享*/
.shareBox{
}
.share{
float: right;
font-size: .17rem;
color: white;
padding: 0.05rem .15rem;
background-color: #FF9D5C;
border-radius: 18px;
position: relative;
right: .1rem;
top: .1rem;
}
.userAdd{
float: right;
color: #666666;
font-size: .15rem;
position: relative;
top: .16rem;
right: 0.2rem;
}
.partingLine{
height: .8rem;
line-height: 1rem;
margin-top: .2rem;
color: #101010;
font-size: .15rem;
padding: 0 .11rem;
MARGIN-BOTTOM: .2rem;
}
.left {
float: left;
width: 1.55rem;
max-width: 255px;
height: .5rem;
border-bottom: 1px dashed;
margin-right: 0;
}
.mine{
float: left;
margin: 0 .1rem;
}
.right {
float: left;
width: 1.55rem;
max-width: 255px;
height: .5rem;
margin-right: 0;
border-bottom: 1px dashed;
}
.addLabel{
color: rgba(253, 129, 21, 0.67);
text-align: center;
/*position: relative;
left: 50%;
margin-left: .5rem;*/
}
.addLabel>span{
border: 1px solid;
border-radius: 20px;
padding: .1rem .2rem;
}
.label{
padding: 0 0 0 0.12rem;
position: absolute;
margin-bottom: 1rem;
width: 4.14rem;
max-width: 680px;
}
.label>img{
margin-left: .2rem;
width: 3.5rem;
margin-top: .1rem;
}
.label>ul{
list-style: none;
padding: 0;
overflow:hidden;zoom:1;
}
.label>ul>li{
float: left;
width: .7rem;
height: .44rem;
border: 1px solid;
margin-right: .1rem;
text-align: center;
line-height: .44rem;
background-color: white;
margin-bottom: .1rem;
}
.li{
list-style: none;
float: left;
width: .7rem;
height: .44rem;
border: 1px solid;
margin-right: .1rem;
text-align: center;
line-height: .44rem;
background-color: white;
margin-bottom: .1rem;
}
.label>ul>li>span{
margin: 0;
float: none;
}
/* 底部固定 */
.bottom{
width: 100%;
max-width:680px;
margin: 0 auto;
height: .74rem;
background-color: white;
position: fixed;
bottom: 0;
padding-left: .11rem;
}
.bottom>.right{
width: 3.5rem;
display: block;
color: #101010;
font-size: .15rem;
position: relative;
top: 0.3rem;
right: -2.2rem;
border-bottom: none;
}
.bottom>.right> span{
padding: .1rem .13rem;
border: 1px solid #FF9D5C;
border-radius: 4px;
color: #FF9D5C;
float: none;
}
.bottom>.right>.color{
background-color: #FF9D5C;
color:white;
border: 1px dashed #FF9D5C;
}
/* {
this.state.showLabelList && <div className={styles.label}>
<ul>
{
this.state.labelList.map((item,index)=>{
return (
<li key={index}
style={
{backgroundColor:item.select==true? 'rgb(246, 49, 50)':'white'}
}
onClick={()=>{
let labelList =this.state.labelList
labelList.splice(item.id,1,{id:item.id,text:item.text,select:!item.select})
this.setState({
labelList:labelList
})
}}>
{
!item.select && <span>+ </span>
}
<span > {item.text}</span>
</li>
)
})
}
</ul>
<img src={require('../../assets/image/confirmAdd.png')} alt=""/>
</div>
}*/
import React, {Component} from 'react'
import {connect} from 'dva'
import styles from './AmendClient.css'
import {Modal,List,Radio} from 'antd-mobile';
import LocalizedModal from "../../components/Modal";
import shareHide from "../../utils/shareHide";
const RadioItem = Radio.RadioItem;
class AmendClient extends Component {
constructor(props) {
super(props)
this.state = {
baseList: [
{
start: true,
name: '姓名',
placeholder: '请输入客户姓名',
select: false,
value:'',
},
{
start: false,
name: '性别',
placeholder: '请选择性别',
select: '性别',
value:'女',
},
{
start: false,
name: '年龄',
placeholder: '请选择年龄',
select: '年龄',
value:'32',
},
{
start: true,
name: '手机号码',
placeholder: '请输入手机号码',
select: false,
value:'',
},
{
start: false,
name: '婚姻状况',
placeholder: '请选择婚姻状况',
select: '婚姻状况',
value:'已婚',
},
{
start: false,
name: '学历',
placeholder: '请选择学历',
select: '学历',
value:'本科',
},
],
professionList: [
{
start: false,
name: '职业类型',
placeholder: '请选择职业类型',
select: '职业类型',
value:'22',
},
{
start: false,
name: '年收入(万元)',
placeholder: '请选择年收入',
select: '年收入',
value:'22',
},
],
addressList: [
{
start: false,
name: '所在省市',
placeholder: '请选择所在省市',
select: '所在省市',
value:'33',
},
{
start: false,
name: '详细地址',
placeholder: '请输入详细地址',
select: false,
value:'',
},
],
insuranceList: [
{
start: false,
name: '希望购买产品',
placeholder: '请选择产品',
select: '产品',
value:'55',
},
{
start: false,
name: '缴费期间',
placeholder: '请选择缴费期间',
select: '缴费期间',
value:'55',
},
{
start: false,
name: '缴费频次',
placeholder: '请选择缴费频次',
select: '缴费频次',
value:'55',
},
{
start: false,
name: '保额',
placeholder: '请选择保额',
select: false,
value:'55',
},
],
color:false,
message:'',//提交至督训,确定
labelList:[
{
id:0,
text:'医疗',
select:false,
},
{
id:1,
text:'健康',
select:false,
},
{
id:2,
text:'少儿',
select:false,
},
{
id:3,
text:'意外',
select:false,
},
{
id:4,
text:'温和',
select:false,
},
{
id:5,
text:'严肃',
select:false,
},
{
id:6,
text:'孝顺',
select:false,
},
{
id:7,
text:'富有',
select:false,
},
{
id:8,
text:'小康',
select:false,
},
{
id:9,
text:'拮据',
select:false,
},
],
showLabelList:false,
modal5:false,
modal6:false,
modal7:false,
modal8:false,
modal9:false,
modal10:false,
modal11:false,
modal12:false,
modal13:false,
modal14:false,
modal115:false,
ageAry:[],
cityValue:'',
addLabel:[],
provinceCitys:[],
visible:false,
submit:{
title: '提示',
content: '您是否确定添加该客户信息?',
okText: '确认',
cancelText: '取消',
},
addedList:[
{
id:0,
text:'健康',
select:true,
},
{
id:1,
text:'少儿',
select:true,
},
],
/* 客户信息*/
name:"测试",
sex:"0", //0:女, 1:男
age:"0",
phone:"",
maritalStatus:"0",
education:"",
occupational:[],
occupationalSelect:'',
annualIncome:[],
annualIncomeSelect:'',
province:[],
provinceSelect:'',
address:"",
product:[],
productSelect:'',
payment:"22",
frequency:"22",
insuredAmount:"22"
}
}
hideModalConfirm = (v)=>{
this.setState({
visible:false,
})
if(v=== 'ok'){
let that = this;
this.props.dispatch({
type:'addUser/addUser',
payload:{
"id":null,
"name":this.state.name||'',
"sex":this.state.sex||0,
"age":this.state.age||0,
"number":this.state.phone||'',
"maritalStatus":this.state.maritalStatus||'',
"education":this.state.education||'',
"occupational":this.state.occupationalSelect||'',
"annualIncome":this.state.annualIncomeSelect||'',
"province":this.state.provinceSelect||'',
"address":this.state.address||'',
"product":this.state.productSelect||'',
"payment":this.state.payment||'',
"frequency":this.state.frequency||'',
"insuredAmount":this.state.insuredAmount||"",
'addLabel':this.state.addLabel||[], //添加的label标签。
},
callback(data){
console.log(55555)
that.props.history.push('/myUser')
},
error(data){
that.showToast(data.message)
}
})
}else{
}
}
hideModalSubmit = (v)=>{
this.setState({
visible:false,
})
if(v=== 'ok'){
// this.props.dispatch({
// type:'addUser/addUser',
// payload:{
// "id":null,
// "name":this.state.name||'',
// "sex":this.state.sex||0,
// "age":this.state.age||0,
// "number":this.state.phone||'',
// "maritalStatus":this.state.maritalStatus||'',
// "education":this.state.education||'',
// "occupational":this.state.occupationalSelect||'',
// "annualIncome":this.state.annualIncomeSelect||'',
// "province":this.state.provinceSelect||'',
// "address":this.state.address||'',
// "product":this.state.productSelect||'',
// "payment":this.state.payment||'',
// "frequency":this.state.frequency||'',
// "insuredAmount":this.state.insuredAmount||"",
// 'addLabel':this.state.addLabel||[], //添加的label标签。
// }
// })
}else{
}
}
showModal = key => (e) => {
e.preventDefault(); // 修复 Android 上点击穿透
this.setState({
[key]: true,
});
}
onChange = (value,label,modal) => {
this.setState({
sex:value,
});
if(modal === 'modal5'){
let list = this.state.baseList;
list[1].value = label;
this.setState({
baseList :list
})
}else if(modal==='modal6'){
let list = this.state.baseList;
list[2].value = label;
this.setState({
baseList :list,
age:label,
})
}else if(modal==='modal7'){
let list = this.state.baseList;
list[4].value = label;
this.setState({
baseList :list,
maritalStatus:value,
})
}else if(modal==='modal8'){
let list = this.state.baseList;
list[5].value = label;
this.setState({
baseList :list,
education:label,
})
}else if(modal==='modal9'){
let list = this.state.professionList;
list[0].value = label;
this.setState({
professionList :list,
occupationalSelect:label,
})
}else if(modal==='modal10'){
let list = this.state.professionList;
list[1].value = label;
this.setState({
professionList :list,
annualIncomeSelect:label,
})
}else if(modal==='modal11'){
let list = this.state.addressList;
list[0].value = label;
this.setState({
addressList :list,
provinceSelect:label,
cityValue:value
})
}else if(modal==='modal12'){
let list = this.state.insuranceList;
list[0].value = label;
this.setState({
insuranceList :list,
productSelect:label,
riskCode:value,
})
}else if(modal==='modal13'){
let list = this.state.insuranceList;
list[1].value = label;
this.setState({
insuranceList :list,
payment:label,
})
}else if(modal==='modal14'){
let list = this.state.insuranceList;
list[2].value = label;
this.setState({
insuranceList :list,
frequency:label,
})
}
};
onClose = key => (e) => {
e.preventDefault();
this.setState({
[key]: false,
initInsurance:true,
});
}
/* 职业类型,所在省市,年收入 */
Dictionaries = (params)=>{
let that = this;
this.props.dispatch({
type:'addUser/Dictionaries',
payload: params,
callback(data){
if(params.configType ==='jobType' ){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
occupational:ary,
modal9:true,
})
}
}else if(params.configType ==='yearMoney'){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
annualIncome:ary,
modal10:true,
})
}
}else if(params.configType ==='provinces'){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
province:ary,
modal11:true,
})
}
}else if(params.oyhers){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
provinceCitys:ary,
modal15:true,
})
}
}
}
})
}
componentDidMount(){
shareHide();
// let item = this.props.location.query.item;
// let item = this.props.myUser;
// console.log(item);
// let that = this;
/*this.props.dispatch({
type:'myUser/getAllUser',
payload:{
name:item.name||null,
number:item.number||null,
startTime:null,
endtime:null,
pageNo:1,
currentStatus:this.state.currentStatus, // 0 :跟进中, 1:已提交
},
callback(data){
let baseList = that.state.baseList,
professionList=that.state.professionList,
addressList= that.state.addressList,
insuranceList =that.state.insuranceList,
labelList = that.state.labelList;
for (var i = 0; i < baseList.length; i++) {
if(i === 0 ){
baseList[0].value = data[0].name;
}else if(i ===1){
baseList[1].value = data[0].sex===1?'男':'女';
}else if(i ===2){
baseList[2].value = data[0].age;
}else if(i ===3){
baseList[3].value = data[0].number;
}else if(i ===4){
baseList[4].value = data[0].maritalStatus===0?'未婚':data[0].maritalStatus===1?'已婚':'离异';
}else if(i ===5){
baseList[5].value = data[0].education;
}
}
for (var i = 0; i < professionList.length; i++) {
if(i === 0){
professionList[0].value = data[0].occupational
}else if(i ===1){
professionList[1].value = data[0].annualIncome
}
}
for (var i = 0; i < addressList.length; i++) {
if(i ===0){
addressList[0].value = data[0].province
}else if(i ===1){
addressList[1].value = data[0].address
}
}
for (var i = 0; i < insuranceList.length; i++) {
if(i === 0){
insuranceList[0].value=data[0].product
}else if(i === 1){
insuranceList[1].value=data[0].payment
}else if(i === 2){
insuranceList[2].value=data[0].frequency
}else if(i === 3){
insuranceList[3].value=data[0].insuredAmount
}
}
for (var i = 0; i < labelList.length; i++) {
if(data[0].label !=null){
for (var j = 0; j < data[0].label.length; j++) {
if(labelList[i].text === data[0].label){
labelList[i].select=true;
}
}
}
}
that.setState({
baseList:baseList,
professionList:professionList,
addressList:addressList,
insuranceList:insuranceList,
labelList:labelList,
addedList:data[0].label
})
}
})*/
let ageAry = [];
for (var i = 0; i < 101; i++) {
ageAry.push({value:i,label:i})
}
this.setState({
ageAry:ageAry,
})
}
render() {
const data = [
{ value: 0, label: '女' },
{ value: 1, label: '男' },
];
const education = [
{ value: 0, label: '初中及以下' },
{ value: 1, label: '高中' },
{ value: 2, label: '大专' },
{ value: 3, label: '本科' },
{ value: 4, label: '硕士' },
{ value: 5, label: '博士' },
{ value: 6, label: '其他' },
];
const frequency = [
//趸交、月交、季交、半年交、年交
{value:'0',label:'趸交'},
{value:'1',label:'月交'},
{value:'2',label:'季交'},
{value:'3',label:'半年交'},
{value:'4',label:'年交'},
];
return (
<div className={styles.box}>
<div className={styles.base}>
{
this.state.baseList.map((item, index) => {
return (
<div className={styles.profession} key={index}>
<span className={styles.start}>{item.start ? '*' : ''}</span> <span
className={styles.base_massage}>{item.name}</span>
<input placeholder={item.value?item.value:item.placeholder} disabled={item.select?'disabled':''} onChange={(e)=>{
if(index ===0){
this.setState({
name:e.target.value
})
}else if(index===3){
this.setState({
phone:e.target.value
})
}
}}></input>
{
item.select && <span className={styles.select}>
<img src={require('../../assets/image/next-step.png')} alt="" onClick={index===1?this.showModal('modal5'):index===2?this.showModal('modal6'):index===4?this.showModal('modal7'):this.showModal('modal8')}/>
</span>
}
</div>
)
})
}
</div>
<div className={styles.professionBox}>
{
this.state.professionList.map((item, index) => {
return (
<div className={styles.profession} key={index}>
<span className={styles.start}>{item.start ? '*' : ''}</span>
<span
className={styles.base_massage}>{item.name}</span>
<input placeholder={item.value?item.value:item.placeholder} ></input>
{
item.select && <span className={styles.select}>
<img src={require('../../assets/image/next-step.png')} alt="" onClick={()=>{
if(index===0){
this.Dictionaries({configType:'jobType'})
}else if(index===1){
this.Dictionaries({configType:'yearMoney'})
this.showModal('modal10')
}
}
}/>
</span>
}
</div>
)
})
}
</div>
<div className={styles.professionBox}>
{
this.state.addressList.map((item, index) => {
return (
<div className={styles.profession} key={index}>
<span className={styles.start}>{item.start ? '*' : ''}</span> <span
className={styles.base_massage}>{item.name}</span> <input placeholder={item.value?item.value:item.placeholder} onChange={(e)=>{
this.setState({
address:e.target.value
})
}}></input>
{
item.select && <span className={styles.select}>
<img src={require('../../assets/image/next-step.png')} alt="" onClick={()=>{
this.Dictionaries({configType:'provinces',})
this.showModal('modal11')
}}/>
</span>
}
</div>
)
})
}
</div>
<div className={styles.professionBox}>
{
this.state.insuranceList.map((item, index) => {
return (
<div className={styles.profession} key={index}>
<span className={styles.start}>{item.start ? '*' : ''}</span> <span
className={styles.base_massage}>{item.name}</span>
<input placeholder={item.value?item.value:item.placeholder} onChange={(e)=>{
this.setState({
insuredAmount:e.target.value,
})
}}></input>
{
item.select && <span className={styles.select}>
<img src={require('../../assets/image/next-step.png')} alt="" onClick={()=>{
let that = this;
if(index===0){
this.setState({
modal12:true,
})
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1 启用
},
callback(data){
let ary = []
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].riskCode,label:data[i].riskName})
that.setState({
product:ary,
})
}
},
})
}else if(index===1){
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"maxAge":this.state.age,
"pageNo":1,
"mainCode": this.state.riskCode
},
callback(){
that.setState({
modal13:true,
})
}
})
}else if(index===2){
this.setState({
modal14:true,
})
}
}
}/>
</span>
}
</div>
)
})
}
</div>
<div className={styles.shareBox}>
<span className={styles.share}>分享</span>
<span className={styles.userAdd}>可分享空白页面至客户自己填写</span>
<span style={{display: 'block', clear: 'both',height:'1px',marginTop:'-1px',overflow:'hidden'}}></span>
</div>
<div className={styles.partingLine}>
<span className={styles.left}></span>
<span className={styles.mine}>客户标签</span>
<span className={styles.right}></span>
</div>
<div style={{paddingLeft:'.11rem',overflow:'hidden',width:'100%'}}>
{
!this.state.showLabelList &&this.state.addedList&& this.state.addedList.map((item,index)=>{
return(
<li key={index} className={styles.li} style={{backgroundColor:'red'}}>{item.text}</li>
)
})
}
<li style={{display:'block',clear:'both'}}></li>
</div>
{/* <ul>
{
!this.state.showLabelList && this.state.addedList && this.state.addedList.map((item,index)=>{
return(
<span key={index}> {item.text}</span>
)
})
}
<li style={{display:'block',clear:'both'}}></li>
</ul>*/}
{ !this.state.showLabelList &&
<div className={styles.label}>
<div className={styles.addLabel} onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})}
}>
<img src={require('../../assets/image/amendLabel.png')} alt="" style={{width:'1.2rem'}}/>
</div>
</div>
}
{
this.state.showLabelList && <div className={styles.label}>
<ul>
{
this.state.labelList.map((item,index)=>{
return (
<li key={index}
style={
{backgroundColor:item.select===true? 'rgb(246, 49, 50)':'white'}
}
onClick={()=>{
let labelList = this.state.labelList;
let addLabel = [];
labelList.splice(item.id,1,{id:item.id,text:item.text,select:!item.select})
for (var i = 0; i < labelList.length; i++) {
if(labelList[i].select){
addLabel.push(labelList[i])
}
}
this.setState({
labelList:labelList,
addedList:addLabel
})
}}>
{
!item.select && <span>+ </span>
}
<span > {item.text}</span>
</li>
)
})
}
</ul>
<img src={require('../../assets/image/confirmAdd.png')} alt="" onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})
let ary = []
for (var i = 0; i < this.state.labelList.length; i++) {
if(this.state.labelList[i].select){
ary.push(this.state.labelList[i].text)
}
}
this.setState({
addLabel:ary,
})
}
} />
</div>
}
<div className={styles.bottom}>
<div className={styles.right}>
<span style={{marginRight:'.11rem'}} className={this.state.color ===true ?styles.color:''} onClick={()=>{
this.setState({
color:true,
visible:true,
message:'督训',
submit:{ title: '提交',
content: '您是否确定将该条客户信息提交至督训进行审核?',
okText: '确认',
cancelText: '取消',
}
})
}}>提交至督训</span>
<span style={{marginRight:'.21rem'}}
className={this.state.color ===false ?styles.color:''}
onClick={()=>{
this.setState({
color:false,
visible:true,
submit:{
title: '提示',
content: '您是否确定添加该客户信息?',
okText: '确认',
cancelText: '取消',
}
})
// this.props.history.push('/cover')
}}>确定</span>
</div>
</div>
<Modal
popup
visible={this.state.modal5}
onClose={this.onClose('modal5')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择性别 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal5')}/>
</span></div>} className="popup-list">
</List>
<List>
{data.map(i => (
<RadioItem key={i.value} checked={this.state.baseList['1'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal5')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal6}
onClose={this.onClose('modal6')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
height:'7rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择年龄 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal6')}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.ageAry.map(i => (
<RadioItem key={i.value} checked={this.state.baseList['2'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal6')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal7}
onClose={this.onClose('modal7')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择婚姻状况 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal7')}/>
</span></div>} className="popup-list">
</List>
<List>
{[{value:'0',label:'未婚'},{value:'1',label:'已婚'},{value:'2',label:'离异'}].map(i => (
<RadioItem key={i.value} checked={this.state.baseList['4'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal7')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal8}
onClose={this.onClose('modal8')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择学历 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal8')}/>
</span></div>} className="popup-list">
</List>
<List>
{education.map(i => (
<RadioItem key={i.value} checked={this.state.baseList['5'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal8')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal9}
onClose={this.onClose('modal9')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择学历 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal9')}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.occupational && this.state.occupational.map(i => (
<RadioItem key={i.value} checked={this.state.professionList['0'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal9')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal10}
onClose={this.onClose('modal10')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择年收入 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal10')}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.annualIncome&&this.state.annualIncome.map(i => (
<RadioItem key={i.value} checked={this.state.professionList['1'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal10')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal11}
onClose={this.onClose('modal11')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择所在省/市<span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={(e)=>{
e.preventDefault()
this.setState({
// modal15:true,
modal11:false,
})
this.Dictionaries({configType:'provinces',oyhers:this.state.cityValue})
}}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.province && this.state.province.map(i => (
<RadioItem key={i.value} checked={this.state.addressList['0'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal11')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal12}
onClose={this.onClose('modal12')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择产品 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal12')}/>
</span></div>} className="popup-list">
</List>
<List>
{this.state.product && this.state.product.map(i => (
<RadioItem key={i.value} checked={this.state.insuranceList['0'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal12')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal13}
onClose={this.onClose('modal13')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择缴费期间 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal13')}/>
</span></div>} className="popup-list">
</List>
<List>
{[{value:'0',label:'226666'}].map(i => (
<RadioItem key={i.value} checked={this.state.insuranceList['1'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal13')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<Modal
popup
visible={this.state.modal14}
onClose={this.onClose('modal14')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxHeight:'5rem',
maxWidth: '680px'}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}} >请选择缴费频次 <span style={{float:'right',}}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal14')}/>
</span></div>} className="popup-list">
</List>
<List>
{frequency.map(i => (
<RadioItem key={i.value} checked={this.state.insuranceList['2'].value === i.label} onChange={() => this.onChange(i.value,i.label,'modal14')}>
{i.label}
</RadioItem>
))}
</List>
</Modal>
<LocalizedModal visible={this.state.visible} hideModal={this.hideModalConfirm} onClick={this.state.submit} message={this.state.message}
/>
</div>
)
}
}
AmendClient.propsTypes = {}
export default connect(({ myUser }) => ({ myUser }))(AmendClient)
import React, { Component } from 'react'
import { connect } from 'dva'
import { withRouter } from 'dva/router'
class App extends Component {
render() {
let { children, location } = this.props;
return (
<div>
</div>
)
}
}
App.propTypes = {}
export default withRouter(
connect(({ app, loading }) => ({
app,
loading
}))(App)
)
import React, { Component } from 'react';
import { connect } from 'dva';
import { Tabs,Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import css from './css.less';
class Background extends Component{
constructor(props) {
super(props);
this.state = {
templatesList:[],
backgroudTemp:{},//选中的背景
current:0,
loadingFlag:true,
}
}
componentDidMount() {
Toast.loading('loading...',0)
document.title = '选择背景';
let _this = this;
shareHide();
let cardInfo = JSON.parse(sessionStorage.getItem("cardInfo"));
let backgroudId = cardInfo.cardBackground;//已选择的背景
//获取名片背景列表
this.props.dispatch({
type: 'BusinessCard/GetCardBackgroundTmpsList',
payload: {},
callback(res) {
let current = _this.state.current;
if(res && res.length>0){
for(let ii in res){
if(res[ii].id == backgroudId){
current = Number(ii);
break;
}
}
}
_this.setState({
templatesList:res || [],
current:current,
backgroudTemp:res[current],
loadingFlag:false
})
Toast.hide();
}
})
}
confirmOk = () => {
let _this = this;
let bgdid = this.state.backgroudTemp.id;
let cardInfo = JSON.parse(sessionStorage.getItem("cardInfo"));
let userId = cardInfo.id || JSON.parse(localStorage.getItem("id"));
this.props.dispatch({
type: 'BusinessCard/UpdateBusinessCardInfo',
payload: {
id:userId,
cardBackground:bgdid,
},
callback(res) {
_this.props.history.go(-1);
}
})
}
handleSelect = (index,item)=>{
this.setState({
current:index,
backgroudTemp:item
})
}
render() {
let {templatesList,current} = this.state;
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={css.bgdtemplate}>
{
templatesList.length>0 ? (
<div>
<div className={css.bgdSection}>
{
templatesList.map((item,index)=>{
return(
<div className={css.bgdItem} key={item.id} onClick={()=>{this.handleSelect(index,item)}}>
<img className={css.bgdImg} src={item.backgroundPath} alt="" />
{current === index ? <img className={css.selected} src={require("../../assets/image/selected_white.png")} /> : ""}
</div>
)
})
}
</div>
<div className={css.footerBtn} onClick={()=>{this.confirmOk()}}>
<img src={require("../../assets/image/queding.png")} alt="" />
</div>
</div>
) : (
<div className={css.haveNoData}>
<img src={require('../../assets/image/clientless.png')} alt="" />
<div className={css.text}>暂无背景</div>
</div>
)
}
</div>
)
}
}
export default connect()(Background);
import React, { Component } from 'react';
import { connect } from 'dva';
import { InputItem,Toast} from 'antd-mobile';
import { Upload, Icon, message } from 'antd';
import shareHide from "../../utils/shareHide";
import {getCardName} from '../../utils/dataFilter'
import request from '../../utils/request'
import css from './css.less';
import styles from '../../routes/GovernorTraining/css.less'
function beforeUpload(file) {
const isJPG = (file.type === 'image/jpeg'||file.type === 'image/png');
if (!isJPG) {
message.error('只能上传jpg和png格式的图片!');
}
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
message.error('图片大小不能大于5MB!');
}
return isJPG && isLt5M;
}
class AddCardEditor extends Component{
constructor(props) {
super(props);
let cardInfo = JSON.parse(sessionStorage.getItem("cardInfo"));
this.state = {
cardInfo:cardInfo,
headUrl:cardInfo.headUrl || "",//头像
name: cardInfo.name || "",//名字
postName: getCardName(cardInfo.roleId) || "",//职位
Orgwork:cardInfo.orgName || "",//机构
phone:cardInfo.number || "",//手机号
qrcode: cardInfo.qrcode || "",//微信二维码
loading: false,//头像的
loading2: false,//二维码的
userId:cardInfo.id || JSON.parse(localStorage.getItem("id")),//用户ID
}
}
componentDidMount() {
document.title = '我的信息';
let _this = this;
shareHide();
}
componentWillUnmount(){
Toast.hide();
}
handleChange = info => {
if (info.file.status === 'uploading') {
this.setState({ loading: true });
return;
}
if (info.file.status === 'done') {
this.setState({
loading: false,
})
}
}
handleChange2 = info => {
if (info.file.status === 'uploading') {
this.setState({ loading2: true });
return;
}
if (info.file.status === 'done') {
this.setState({
loading2: false,
})
}
}
saveHandle=()=>{
let _this = this;
this.props.dispatch({
type: 'BusinessCard/UpdateBusinessCardInfo',
payload: {
"id":this.state.userId,
"qrcode":this.state.qrcode,
"headUrl":this.state.headUrl,
},
callback(res) {
//保存卡片数据
Toast.info("保存成功",2)
setTimeout(function(){
_this.props.history.go(-1);
},2000)
}
})
}
render() {
let {fileList,qrcode,headUrl} = this.state;
const uploadButton2 = (
<div className={css.qrcodeSection}>
<div className={css.text}>
{this.state.loading2 ? <Icon type="loading" /> : <div style={{fontSize:".24rem"}}>+</div>}
</div>
</div>
);
const uploadButton = (
this.state.loading ? <Icon type="loading" /> : <img src={require("../../assets/image/defaultHead.png")} alt="avatar" />
);
const propsUpload1 = {
listType:"picture-card",
className:"avatar-uploader",
showUploadList:false,
beforeUpload:beforeUpload,
customRequest:(files)=>{
let file = files.file;
let fileType = file.name.substring(file.name.lastIndexOf('.') + 1);
let userId = this.state.userId;
let formData = new FormData();
formData.append('file', file);
formData.append('fileType', "head");
formData.append('functionType', 'businessCard');
formData.append('userId', userId);
request(`/o2o/ai/fileUpload`, {
method: 'POST',
body: formData
}).then((res) => {
if (res.data.status) {
this.setState({
headUrl:res.data.data.fileAddress,
loading: false,
})
}
})
},
onChange:this.handleChange
};
const propsUpload2 = {
listType:"picture-card",
className:"avatar-uploader",
showUploadList:false,
beforeUpload:beforeUpload,
customRequest:(files)=>{
let file = files.file;
let fileType = file.name.substring(file.name.lastIndexOf('.') + 1);
let userId = this.state.userId;
let formData = new FormData();
formData.append('file', file);
formData.append('fileType', "QRcode");
formData.append('functionType', 'businessCard');
formData.append('userId', userId);
request(`/o2o/ai/fileUpload`, {
method: 'POST',
body: formData
}).then((res) => {
if (res.data.status) {
this.setState({
qrcode:res.data.data.fileAddress,
loading2: false,
})
}
})
},
onChange:this.handleChange2
};
return (
<div className={css.businessCardEditWrap} style={{ background: '#fff' }}>
<div className={styles.ac_wrap}>
<div id="scrollSection">
<ul>
<li className={css.headsection}>
<label className={css.headText}>头像</label>
<div className={css.uploadHeadImg}>
<Upload {...propsUpload1}>
{headUrl ? (this.state.loading ? <Icon type="loading" /> : <img src={headUrl} alt="avatar" /> ) : uploadButton }
</Upload>
</div>
</li>
<li className={styles.require}>
<InputItem
type="text"
disabled={true}
value={this.state.name}
placeholder = {this.state.disabled?'':"请输入姓名"}
>姓名</InputItem>
</li>
<li className={styles.require}>
<InputItem
type="text"
disabled={true}
value={this.state.postName}
>职务</InputItem>
</li>
<li className={styles.require}>
<InputItem
type="text"
disabled={true}
value={this.state.Orgwork}
>机构</InputItem>
</li>
<li className={styles.require}>
<InputItem
type="text"
disabled={true}
value={this.state.phone}
>手机号</InputItem>
</li>
<div className={css.QRcode}>
<div className={css.codeText}>上传二维码</div>
<div className={css.code}>
<Upload {...propsUpload2}>
{qrcode ? (this.state.loading2 ? <Icon type="loading" /> : <img src={qrcode} alt="avatar" /> ) : uploadButton2 }
</Upload>
</div>
</div>
<div className={css.saveBtn} onClick={()=>{this.saveHandle()}}>
<img src={require("../../assets/image/baocun.png")} alt="" />
</div>
</ul>
</div>
</div>
</div>
)
}
}
export default connect(({BusinessCard})=>({BusinessCard}))(AddCardEditor);
.businessCardWrap{
position: relative;
width:100%;
height:100%;
background:#F5F5F5;
overflow-x: hidden;
overflow-y: auto;
.session_top{
background:#F5F5F5;
height:2.2rem;
.changebgd{
position: absolute;
right: 0;
top: .23rem;
padding: 2px 5px;
background-color: rgba(143, 143, 143, 0.28);
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
color: #fff;
}
img{
height:100%;
width:100%;
}
}
.section_card{
height:2rem;
position: absolute;
width: 100%;
margin-top:-1.5rem;
padding: 0 .23rem;
z-index: 2;
.card{
width:100%;
height:100%;
background:url("../../assets/image/businessCardbgd.png");
padding:.253rem;
background-repeat: no-repeat;
background-size: cover;
.card_header{
display:flex;
img{
width: .77rem;
height: .77rem;
border-radius: .38rem;
}
.card_header_name{
margin-left: .22rem;
}
.card_header_name1{
font-size: .253rem;
font-weight: bold;
margin-top: .1rem;
}
}
.card_footer{
display: flex;
position: relative;
top: .3rem;
justify-content: space-between;
color: #000;
img{
width:.12rem;
margin-right:.08rem;
margin-bottom: 5px;
}
a{
color:#000;
}
}
}
}
.section_mid{
min-height: 2.5rem;
position: relative;
padding: .23rem;
margin: 0 auto;
text-align: center;
background:url("../../assets/image/businessBackground.png");
width:100%;
position: relative;
margin-top: -.26rem;
.content{
margin-top:.6rem;
img{
width: 2rem;
height: 2rem;
}
.weixintext{
margin:.15rem 0;
}
.qrcodeSection{
width: 2rem;
height: 2rem;
background: #fff;
position: relative;
text-align: center;
left: 50%;
transform: translate(-50%);
.text{
position: relative;
top: 50%;
transform: translateY(-50%);
color:#DEDEDE;
img{
width:.6rem !important;
height:.6rem !important;
}
}
}
}
}
.section_bottom{
background:white;
min-height: 1.694rem;
padding: 0 .11rem;
margin-bottom:0.92rem;
.headertext{
color:#999999;
font-size:.176rem;
padding: .16rem 0;
}
.plansection{
display:flex;
flex-wrap: wrap;
.planitem{
margin:5px 0;
}
}
img{
width: .88rem;
height: .88rem;
margin: 0 .05rem;
}
}
.section_footer{
position:fixed;
width:100%;
bottom:0;
background:white;
height:0.74rem;
text-align: right;
padding: 10px 10px 0 0;
:global(.am-button-primary::before){
border: none;
}
.bianji_Btn{
margin-right:6px;
border: 1px solid #FF9D5C;
color: #FF9D5C;
}
.zhuanfa_Btn{
text-align: center;
color: white;
background-color: #FF9D5C;
font-size: 16px;
height: 45px;
line-height: 45px;
span{
margin:0
}
}
}
}
.bgdtemplate{
width:100%;
height:100%;
background: #fff;
overflow:auto;
position: relative;
.bgdSection{
display:flex;
flex-wrap:wrap;
margin: 10px 4px;
margin-bottom: 1.1rem;
.bgdItem{
position: relative;
width: 50%;
height: 1.1rem;
padding: 5px;
.bgdImg{
width:100%;
height:100%;
background-repeat: no-repeat;
}
.selected{
width: 24px;
height: 24px;
position: absolute;
right: .15rem;
top: .15rem;
}
}
}
.footerBtn{
width: 100%;
height: 0.957rem;
position: fixed;
bottom: 0;
background: #fff;
padding: 0 .11rem;
img{
width:100%;
//height:100%;
}
}
.haveNoData{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
img{
width:2rem;
height:2rem;
}
.text{
text-align: center;
font-size: .2rem;
margin-top: .1rem;
}
}
}
.businessCardEditWrap{
width:100%;
height:100%;
background:#F5F5F5;
overflow-x: hidden;
overflow-y: auto;
.headsection{
position:relative;
width: 100%;
background: white;
display: flex;
padding: 0 15px;
height: .7rem;
justify-content: space-between;
:global(.avatar-uploader > .ant-upload) {
width: .6rem;
height: .6rem;
}
:global(.ant-upload.ant-upload-select-picture-card) {
margin:0;
}
:global(.avatar-uploader) {
position: relative;
width: 100%;
height: 100%;
display: block;
}
.uploadHeadImg{
position: absolute;
right: 10px;
img{
width: .6rem;
height: .6rem;
border-radius: 50%;
}
}
.headText{
font-size: .15rem;
color: #000;
line-height: .6rem;
}
}
input{
text-align: right;
}
:global(.ant-upload.ant-upload-select-picture-card) {
border:none;
background: white;
}
:global(.am-list-item.am-input-disabled .am-input-label){
color:#000;
font-size: .15rem;
}
:global(.am-list-item.am-input-item) {
border-bottom: 1px solid #F8F8F8;
}
:global(.am-list-item .am-input-control input){
font-size: .15rem;
}
.QRcode{
position: relative;
padding: .15rem;
background: white;
:global(.avatar-uploader > .ant-upload) {
width: 1.5rem;
height: 1.5rem;
}
:global(.anticon) {
color: #FF9D5C;
}
.codeText{
font-size: .15rem;
color: #000;
height: .52rem;
line-height: .52rem;
}
.code{
img{
width: 1.5rem;
height: 1.5rem;
}
.qrcodeSection{
color: #FF9D5C;
background: #fff;
position: relative;
text-align: center;
border: 1px dashed #FF9D5C;
width: 100%;
height: 100%;
.text{
position: relative;
top: 50%;
transform: translateY(-50%);
}
}
}
}
.saveBtn{
padding: 15px;
img{
width: 100%;
}
}
.labelText{
color:#000;
}
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react';
import { connect } from 'dva';
import { Button,Toast } from 'antd-mobile';
import { routerRedux } from 'dva/router';
import shareHide from "../../utils/shareHide";
import share from '../../utils/share';
import {getTargetList,getCardName,urlGetParams} from '../../utils/dataFilter'
import css from './css.less';
class Index extends Component{
constructor(props) {
super(props);
let url = window.location.href;
const params = urlGetParams(url);
this.state = {
urlParams:params || {},//url参数
cardInfo:{},
AllPlanList:[],//计划书列表
loadingFlag:true,
}
}
componentWillMount(){
Toast.loading('loading...',0);
}
componentDidMount() {
document.title = '名片';
sessionStorage.clear();
let _this = this;
let urlParams = this.state.urlParams;
//获取名片的信息
this.props.dispatch({
type: 'BusinessCard/GetBusinessCardInfo',
payload: {
"phoneNum":urlParams.number
},
callback(res) {
_this.setState({
cardInfo:res,
loadingFlag : false,
})
//保存卡片数据
sessionStorage.setItem("cardInfo", JSON.stringify(res))
//添加分享功能
let urlShare = "";
if(urlParams.isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = window.location.href+'&isShare=true';
}
share({
decodeUrl: window.location.href.split('#')[0],
title: `我是${res.name},您的保险管家`,
desc: '用我的专业为万千家庭带来保障',
shareUrl: urlShare,
thumbnail: res.headUrl || "https://iwpuat.ihxlife.com/defaultHead.png",
});
Toast.hide();
},
error(mes){
Toast.info(mes,2)
}
})
/* 计划书接口 */
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1启用
proId:urlParams.project,
website:urlParams.website,
orgId:urlParams.orgId,
},
callback(data){
_this.setState({
AllPlanList:data
})
}
})
shareHide(false);
}
componentWillUnmount() {
document.title = '';
}
changeBackground=()=>{
console.log('banckground')
this.props.history.push({ pathname: "/businessCard/cardBackground" });
}
editorCard=()=>{
console.log('banckground')
this.props.history.push({ pathname: "/businessCard/addEdit" });
// this.props.dispatch(routerRedux.push({
// pathname: '/businessCard/addEdit',
// query: {cardInfo: this.state.cardInfo}
// }));
}
shareCard=()=>{
console.log('banckground')
}
gaotoPlan =(item)=>{
let storage = window.localStorage;
storage.setItem("riskName",item.riskName)
storage.setItem("riskCode",item.riskCode)
storage.setItem("calculationMethod",item.calculationMethod)
storage.setItem("selectd",1)
storage.setItem("seriNo",'')
storage.setItem("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
storage.setItem("recipientsName",'')
window.location.href = window.location.href.split('#')[0] + '#/addplaneditor?riskName=' + item.riskName + '&riskCode=' + item.riskCode + '&calculationMethod=' + item.calculationMethod + '&recipients=false&riskIntroduce=&thumbnail=' + item.thumbnail +'&recipientsName=&selectd=1&roleId='+localStorage.getItem("roleId") +'&Id='+ localStorage.getItem('id')+'&seriNo='
}
render() {
let {cardInfo,AllPlanList} = this.state;
let roleName = getCardName(cardInfo.roleId);
let hotPlanList = getTargetList("热门",AllPlanList);//热销计划书
let phonenumber = "tel:" + cardInfo.number;
console.log("render--------render----->>",hotPlanList)
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={css.businessCardWrap}>
<div className={css.session_top}>
{ this.state.urlParams.isShare != "true" && <div className={css.changebgd} onClick={()=>{this.changeBackground()}}>更换背景</div>}
<img src={cardInfo.cardBackgroundTem ? cardInfo.cardBackgroundTem : require("../../assets/image/businessbgd1.png")} alt="" />
</div>
<div>
</div>
<div className={css.section_card}>
<div className={css.card}>
<div className={css.card_header}>
<div>
<img src={cardInfo.headUrl ? cardInfo.headUrl : require("../../assets/image/defaultHead.png")} alt="" />
</div>
<div className={css.card_header_name}>
<div className={css.card_header_name1}>{cardInfo.name || "***"}</div>
<div>{roleName}</div>
</div>
</div>
<div className={css.card_footer}>
<div><img src={require("../../assets/image/wangdian.png")} alt="" />{cardInfo.orgName}</div>
<div><img src={require("../../assets/image/phoneNumber.png")} alt="" /><a href={phonenumber}>{cardInfo.number}</a></div>
</div>
</div>
</div>
<div className={css.section_mid}>
<div className={css.content}>
{cardInfo.qrcode ? <img src={cardInfo.qrcode ? cardInfo.qrcode : ""} alt="" /> : (
<div className={css.qrcodeSection}>
<div className={css.text}><img className={css.wechatimg} src={require("../../assets/image/wechat.png")} alt="" /><div>暂无二维码</div></div>
</div>
)}
<div className={css.weixintext}>扫一扫上面的二维码,加我微信</div>
</div>
</div>
<div className={css.section_bottom}>
<div className={css.headertext}>保险计划书</div>
<div className={css.plansection}>
{hotPlanList.length>0 && hotPlanList.map((item,idx)=>{
return (
<div key={item.seq} className={css.planitem} onClick={()=>{this.gaotoPlan(item)}}>
<img src={item.thumbnail} alt="" />
</div>
)
})}
</div>
</div>
{this.state.urlParams.isShare != "true" && (
<div className={css.section_footer}>
<Button className={css.zhuanfa_Btn} inline onClick={()=>{this.editorCard()}}>编辑名片</Button>
</div>
)}
</div>
)
}
}
export default connect(({home})=>({home}))(Index)
body{
width: 100%;
max-width:680px;
margin: auto;
}
.welcome{
overflow: hidden;
width: 4.14rem;
height: 100%;
background: #FFF7F1;
}
.welcome img{
width: 3.94rem;
height: 5.74rem;
margin: .76rem .1rem;
}
.welcome >p {
text-align: center;
position: relative;
top: -1.8rem;
margin-bottom: 0;
color: #FF9D5C;
font-size: .2rem;
}
.welcome>div{
height: 100%;
background: url('../../assets/image/cover.png')no-repeat center center/100% ;
}
import React, { Component } from 'react'
import { connect } from 'dva'
import $ from "jquery";
import styles from './Cover.css'
class Cover extends Component {
constructor(){
super()
this.state={}
}
go = ()=>{
this.props.history.push('/planResult')
// let seriNo = localStorage.getItem("seriNo")
// let riskName = localStorage.getItem("riskName")
// let riskCode = localStorage.getItem("riskCode")
// let thumbnail = localStorage.getItem("thumbnail")
let seriNo = sessionStorage.getItem("seriNo")
let riskName = sessionStorage.getItem("riskName")
let riskCode = sessionStorage.getItem("riskCode")
let thumbnail = sessionStorage.getItem("thumbnail")
window.location.href = window.location.href.split('#')[0]+'#/planResult?seriNo='+seriNo+'&riskName='+riskName +'&riskCode='+riskCode+'&thumbnail='+thumbnail
}
componentDidMount() {
setTimeout(()=>{
this.go()
},2000)
}
render() {
let recipientsSex =localStorage.getItem("recipientsSex")
let recipientsName =localStorage.getItem("recipientsName")
let recipients =localStorage.getItem("recipients")
return (
<div className={styles.welcome} onClick={this.go}>
<div/>
{ recipients == 'true' && <p>{recipientsName.substring(0,1)}{recipientsSex =='true'?'先生':'女士'}</p> }
{ recipients != 'true' && <p>敬呈</p> }
<p>亲启</p>
</div>
)
}
}
Cover.propsTypes = {}
export default connect()(Cover)
ul,li,dl,dt,dd{
list-style:none;
margin:0; padding:0;
}
*{
margin:0; padding:0;
}
.pList {
height: 100%; overflow-y: auto;
dl{
display:flex; margin-top:.1rem; margin-left: .11rem;
dt{
width:.8rem; height: .8rem; border-radius: .04rem; flex-shrink: 0;background: pink; overflow: hidden;
img{ width: 100%; height: 100%;}
}
dd{
flex:1; margin-left: .14rem;
border-bottom:1px solid #F8F8F8;
span {
display:block; font-size: .17rem; color:#333; line-height: .24rem;
}
p{
font-size: .14rem; color:#666; margin-top: .04rem;
height: .48rem; overflow: hidden;
}
}
}
.pTagList{
overflow-x: scroll; background: #f8f8f8; height: .6rem;
display: box;
display: -webkit-box;
width: auto;
ul{
display: flex; width: auto;
}
li{
flex-shrink: 0; padding: 0 .16rem; line-height: .34rem; background:#fff; border-radius: .25rem; color:#101010; font-size: .17rem;box-shadow:0px 0px 4px 0px rgba(0,0,0,0.1); height: .34rem; margin-left: .1rem; margin-top: .12rem;
}
:global(li.on){
background:#FF9D5C; color:#fff;
}
}
.fileList{
padding-left: .57rem;
li{
position: relative; height: .6rem; border-bottom: 1px solid #F8F8F8; line-height: .6rem;
span{
display: block; width: 3.2rem; overflow:hidden; color:#333; font-size: .17rem; height: .6rem; text-overflow: ellipsis;white-space:nowrap;
}
&::before{
position: absolute; left:-.46rem; top:.1rem; width:.32rem; height: .4rem; background: url('../../assets/image/icon_pdf.png') no-repeat;
background-size: 100%; content:'';
}
&:after{
position: absolute; top: 0; content:'>'; right: .11rem; color:#ABABAB;
}
}
:global(li.ppt){
&::before{ background-image: url('../../assets/image/icon_ppt.png')}
}
:global(li.video){
&::before{ background-image: url('../../assets/image/icon_video.png')}
}
:global(li.pdf){
&::before{ background-image: url('../../assets/image/icon_pdf.png')}
}
:global(li.word){
&::before{ background-image: url('../../assets/image/icon_word.png')}
}
:global(li.excel){
&::before{ background-image: url('../../assets/image/icon_excel.png')}
}
:global(li.img){
&::before{ background-image: url('../../assets/image/icon_img.png')}
}
}
}
.nomore {
color:#ABABAB; font-size:.15rem; text-align: center; line-height: .22rem; margin: .36rem 0 .3rem;
&:before{
display: inline-block; width:.25rem; height: .18rem; content: ''; background: url(../../assets/image/iocn_nomore.png) no-repeat; background-size: 100%; vertical-align: middle;
}
}
.preview {
position: absolute; left: 0; top:0; width: 100%; height: 100%; background: #fff; overflow-y: auto;
img{ max-width: 100%;}
}
import React, { Component } from 'react'
import { connect } from 'dva'
import { Toast } from 'antd-mobile';
import { NavLink } from 'dva/router'
import shareHide from "../../utils/shareHide";
import css from './databank.less';
class DataBank extends Component {
constructor(){
super()
this.state={
dataList: []
}
}
componentDidMount() {
sessionStorage.clear();
document.title = '资料库'
const _this = this;
shareHide();
Toast.loading('loading...');
this.props.dispatch({
type: 'databank/getDataBankList',
payload: {
"configType": "prospectus",
},
callback(res) {
if (res.status && res.data.length > 0) {
Toast.hide();
_this.setState({
dataList: res.data
})
}
}
})
}
componentWillUnmount(){
document.title = ''
}
render() {
const { dataList } = this.state;
return (
<div className={css.pList}>
{
dataList.map((el, i) => {
return <NavLink key={i} to={{
pathname: "/databank/infolist",
search: 'riskCode=' + el.configCode + '&riskName=' + el.configName,
}}><dl>
<dt><img src={el.configInfo} alt='' /></dt>
<dd>
<span>{el.configName}</span>
<p>{el.others}</p>
</dd>
</dl>
</NavLink>
})
}
<NavLink to={{
pathname: "/databank/preview",
state: {
url: 'https://zmt.ihxlife.com/describe.png'
}
}}><dl>
<dt><img src={require('../../assets/image/platformIcon.png')} alt='' /></dt>
<dd>
<span>平台使用说明</span>
<p>线上有效展业,不错过任何客户</p>
</dd>
</dl>
</NavLink>
<div className={css.nomore}>没有更多啦</div>
</div>
)
}
}
export default connect(({ databank }) => ({ databank }))(DataBank)
import React, { Component, Fragment } from 'react'
import { connect } from 'dva'
import { routerRedux } from 'dva/router';
import { Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import css from './databank.less';
class InfoList extends Component {
constructor(){
super()
this.state={
dataList: [],
filter: [],
chooseIdx: 0,
productId:''
}
}
componentDidMount() {
const { search } = this.props.location;
const _this = this;
let key = Number(sessionStorage.getItem('key'));
shareHide();
Toast.loading('loading...');
if (search) {
const matchs = decodeURI(search).match(/riskCode=(.*)&riskName=(.*)/i)
let riskCode = matchs[1]
let riskName = matchs[2]
document.title = riskName
this.props.dispatch({
type: 'addUser/Dictionaries',
payload: {
configType: 'dataConfig'
},
callback(data) {
if (data.length) {
_this.setState({
filter: data,
productId:riskCode
});
_this.props.dispatch({
type: 'databank/getDataInfoList',
payload: {
productId: riskCode,
dataType: data[key].configCode,
orgId: window.localStorage.getItem('orgId'),
proId: window.localStorage.getItem('project')
},
callback(res) {
if (res.status) {
Toast.hide();
_this.setState({
dataList: res.data
})
}
}
})
}
}
})
}
}
filterData(configCode) {
const _this = this;
Toast.loading('loading...');
_this.props.dispatch({
type: 'databank/getDataInfoList',
payload: {
productId:this.state.productId,
dataType: configCode,
orgId: window.localStorage.getItem('orgId'),
proId: window.localStorage.getItem('project')
},
callback(res) {
if (res.status) {
Toast.hide();
_this.setState({
dataList: res.data
})
}
}
})
}
render() {
let chooseIdx = 0;
if(sessionStorage.getItem("key")){
chooseIdx = Number(sessionStorage.getItem("key"))
}
const { dataList } = this.state;
return (
<Fragment>
<div className={css.pList}>
<div className={css.pTagList}>
<ul>
{
this.state.filter.length > 0 && this.state.filter.map((el, i) => <li key={i} className={chooseIdx === i ? 'on' : ''} onClick={() => {
this.filterData(el.configCode)
this.setState({
chooseIdx: i
})
sessionStorage.setItem( "key", i);
}}>{el.configName}</li>)
}
</ul>
</div>
<ul className={css.fileList}>
{
dataList && dataList.map((el, i) => {
let type = 'pdf';
switch (el.dataFormat.toLowerCase()) {
case 'pdf':
type = 'pdf';
break;
case 'mp4':
type = 'video';
break;
default:
type = '';
break;
}
if(/doc|docx/i.test(el.dataFormat)) type = 'word';
if(/ppt|pptx/i.test(el.dataFormat)) type = 'ppt';
if(/png|jpg|gif/i.test(el.dataFormat)) type = 'img';
if(/xls|xlsx/i.test(el.dataFormat)) type = 'excel';
return <li key={i} className={type} onClick={() => {
//记录点击数
this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": el.dataCode,
"operFunction": 100100,
"operTitle": el.dataName,
"operType": 201,
},
callback(data){
console.log('资料库点击一次')
}
});
if (type === 'pdf') {
window.location.href = el.dataPath
} else if (/doc|docx|xls|xlsx|ppt|pptx/i.test(el.dataFormat)) {
window.location.href = 'https://view.officeapps.live.com/op/view.aspx?src=' + el.dataPath
} else {
this.props.dispatch(routerRedux.push({
pathname: '/databank/preview',
state: {
url:el.dataPath
},
}));
}
}}>
<span>{el.dataName+'.'+el.dataFormat.toLowerCase()}</span>
</li>
})
}
</ul>
<div className={css.nomore}>没有更多啦</div>
</div>
</Fragment>
)
}
}
export default connect(({ databank }) => ({ databank }))(InfoList)
import React, { Component } from 'react'
import shareHide from "../../utils/shareHide";
import css from './databank.less';
shareHide();
class Preview extends Component {
constructor(){
super()
this.state={ }
}
componentDidMount(){
if(this.videoElement){//解决ios自动全屏问题
this.videoElement.setAttribute('webkit-playsinline', 'true');// Fix fullscreen problem on IOS 8 and 9
this.videoElement.setAttribute('playsinline', 'true'); // Fix fullscreen problem on IOS 10
this.videoElement.setAttribute('x5-playsinline', 'true'); // Fix fullscreen problem on IOS 10
}
}
render() {
const { state } = this.props.location;
let fileType = '';
if (state) {
const i = state.url.lastIndexOf('.');
fileType = state.url.substring(i+1, state.url.length);
fileType = fileType.toLocaleLowerCase();
}
return (
<div className={css.preview}>
{/* {fileType==='pdf' && <embed width="100%" height="100%" name="plugin" id="plugin" src={state && state.url} type="application/pdf" internalinstanceid="8" />} */}
{
(fileType==='png' || fileType ==='jpg' || fileType==='gif') && <div style={{textAlign:'center'}}> <img src={state.url} alt="" /></div>
}
{
// (/doc|docx|xls|xlsx|ppt|pptx/i.test(fileType)) && <iframe src={'https://view.officeapps.live.com/op/view.aspx?src='+state.url} width='100%' height='100%' frameBorder='1' title="docPreview">
// </iframe>
}
{
(fileType==='mp4') && (
<video width="100%" style={{background:'black'}} ref={(node) =>{this.videoElement = node}} src={state.url} controls ></video>
)
}
</div>
)
}
}
export default Preview
.exchangeCommunityWrap{
height: 100%;
overflow-y: auto;
overflow-x: hidden;
:global(.am-tabs-tab-bar-wrap){
height: .6rem;
}
:global(.am-tabs-default-bar-tab){
padding:0; font-size: .17rem; color:#ABABAB;
&:after{ display:none !important;}
}
:global(.am-tabs-default-bar-tab-active){
color:#101010; font-size: .17rem;
}
:global(.am-tabs-default-bar-underline){
border-color:#FF9D5C; border-width: .02rem;
}
.splitline {
width: 100%;
height: .1rem;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
opacity: 0.1041;
}
.header_section{
background: #fff;
height: 1rem;
padding: 5px 10px;
:global(.am-search){
background-color: #fff;
}
:global(.am-search-input){
background-color: #efeff4;
}
.questionText{
margin: 5px;
color:#101010;
.questionNum{
color:#bbb;
}
}
}
.addquestion_section{
position: relative;
background-color: #fff;
padding: 10px;
:global(.am-button-primary::before){
border: none;
}
.addquestion_text{
}
.addquestion_img{
padding: 10px 0;
:global(.am-image-picker-list .am-image-picker-upload-btn){
background:url("../../assets/image/camera.png");
background-repeat: no-repeat;
border:none;
background-size: cover;
background-position-x: -8px;
}
}
.addquestion_btn{
//margin-right: 6px;
float: right;
position: absolute;
bottom: 5px;
right: 5px;
text-align: center;
background-color: #FF9D5C;
border-radius: 18px;
color: white;
border: none;
padding: 5px 12px;
}
}
.questionList{
position: relative;
.scrollIOS{
-webkit-overflow-scrolling: touch;
}
.questionItem{
background-color: #fff;
margin: 10px 0;
padding: 10px 15px;
.question_Content{
font-size: .2rem;
color: #333333;
margin: 10px 0;
}
.question_img{
display: flex;
flex-wrap: wrap;
img{
width:1.2rem;
height:1.2rem;
margin-right:5px;
}
}
.question_userInfo{
height: .5rem;
line-height: .5rem;
margin: 5px 0;
&:after{
content:'';
height: 0;
clear:both;
}
.img_esction{
float:left;
img{
width: .44rem;
height: .44rem;
}
}
.name{
float:left;
margin: 0 .11rem;
color:#999999;
}
.date{
float:right;
color:#999999;
}
}
.question_answer{
margin: 5px 0 10px 0;
.question_answer_list{
display:flex;
.question_answer_name{
color: #101010;
}
.question_answer_text{
width: 80%;
color:#666666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.question_footer{
display: flex;
justify-content: space-between;
.question_num{
color:#FF5167
}
}
.question_no_answer{
display:none;
height: 0;
position: relative;
width: 100%;
opacity: 0;
background: #fff;
}
.question_add_answer{
//height:1rem;
display:block;
}
.addquestion_btn2{
.btn{
text-align: center;
background-color: #FF9D5C;
border-radius: 18px;
color: white;
border: none;
padding: 5px 12px;
}
}
:global(.am-list-item){
border: 1px solid gainsboro;
margin: 5px 0;
}
}
}
.search {
position: relative;
display: flex;
padding: .1rem .17rem;
background: white;
::before {
position: absolute;
width: .15rem;
height: .15rem;
content: '';
background: url(../../assets/image/search.png) no-repeat;
background-size: 100%;
left: .35rem;
top: .19rem;
z-index: 10;
}
input{
box-sizing: border-box;
width: 100%;
border: none;
border-radius: .16rem;
background: #F4F4F4;
height: .32rem;
line-height: .32rem;
padding: 0;
padding-left: .42rem;
font-size: .14rem;
}
.cancelButton{
font-size: .16rem;
color: #101010;
width: .5rem;
padding: .05rem 0 0 .05rem;
}
}
}
.questionDetailWrap{
padding: 10px;
background: #fff;
margin-bottom:1.2rem;
.question_answer_Item{
background-color: #fff;
border-bottom:1px solid #F8F8F8;
padding: 5px 0;
.usersection{
img{
width: .44rem;
height: .44rem;
}
.name{
margin:0 .11rem;
color:#101010;
}
}
.answersection{
color:#666666;
}
.answerfooter{
display: flex;
justify-content: space-between;
color:#FF5167;
.date{
color:#999999;
}
}
.question_no_answer{
display:none;
height: 0;
position: relative;
width: 100%;
opacity: 0;
background: #fff;
}
.question_add_answer{
display:block;
}
.addquestion_btn2{
.btn{
text-align: center;
background-color: #FF9D5C;
border-radius: 18px;
color: white;
border: none;
padding: 5px 12px;
}
}
:global(.am-list-item){
border: 1px solid gainsboro;
margin: 5px 0;
}
}
}
.answerFooterSection{
position: absolute;
display:flex;
bottom: 0;
width: 100%;
background: white;
padding: .1rem;
height: .7rem;
//line-height: .7rem;
align-items: center;
text-align: center;
z-index: 5;
:global(.am-textarea-control){
padding-top: 4px;
padding-bottom: 4px;
}
:global(.am-button::before){
border: none;
}
:global(.am-list-item){
border-radius: 22px;
background-color: #F4F4F4;
min-height: 36px;
}
:global(.am-textarea-control){
padding-left: .1rem;
}
.btntijiao{
width: 0.8rem;
padding-left: 5px;
.btn{
text-align: center;
background-color: #FF9D5C;
border-radius: 18px;
color: white;
border: none;
padding: 5px 12px;
}
}
}
.haveNoData{
position: relative;
top: 0;
left: 0;
margin: 50% 0 0 50%;
transform: translate(-50%,-50%);
img{
width:2rem;
height:2rem;
}
.text{
text-align: center;
font-size: .2rem;
margin-top: .1rem;
}
}
.modalImg{
position: fixed;
height: 100%;
width: 100%;
top: 0;
z-index: 10;
background: #101010a1;
padding: 15px;
.modalSection{
background: white;
height: 100%;
border: 1px solid gray;
.close{
text-align: right;
font-size: 18px;
margin-right: 10px;
}
.imgsection{
position: relative;
top: 0;
left: 0;
width: 100%;
height: 92%;
display: flex;
align-items: center;
overflow-y: auto;
.imgPreview{
width: 100%;
//height: 100%;
}
}
}
}
import React, { Component } from 'react';
import {findDomNode} from 'react-dom'
import { connect } from 'dva';
import request from '../../utils/request'
import { Tabs, Toast ,SearchBar,Button,TextareaItem,ImagePicker,Icon,PullToRefresh} from 'antd-mobile';
import {GetLength,urlGetParams} from '../../utils/dataFilter';
import css from './css.less';
import shareHide from "../../utils/shareHide";
import Iscroll from "../../components/Iscroll";
import NoData from "../../components/NoData";
import $ from "jquery"
function beforeUpload(file) {
const isJPG = (file.type === 'image/jpeg'||file.type === 'image/png');
if (!isJPG) {
Toast.info('只能上传jpg和png格式的图片!');
}
const isLt5M = file.size / 1024 / 1024 < 4;
if (!isLt5M) {
Toast.info('图片大小不能大于5MB!');
}
return isJPG && isLt5M;
}
class Index extends Component{
constructor(props) {
super(props);
this.state = {
searchValue: "",
allQuestionList:[],//所有问题
myQuestionText:'',//我的问题
totalCount:0,//问题的总条数
loadingFlag:true,//进入页面时的加载圈圈
current:null,//当前回复的问题编号
answers:"",//回复的回答内容
keyTab:"",
files:[],//问题上传图片列表
uploadImgList:[],//上传图片的地址
loading:false,//上传图片的loading
currentUserInfo:null,//当前用户的信息
currentPage:1,//当前查询的页码
pageSize:10,//查询每页的条数
scrollH: document.documentElement.clientHeight-(1.6*100),//可以滚动的区域高度
answerFlag:false,
dataEnd:false,//数据加载完成后的标志,即没有数据了
};
this.scrollPullUpHandle = this.scrollPullUpHandle.bind(this);
}
componentWillMount(){
document.title = '互动社区';
Toast.loading('loading...',0);
let _this = this;
let url = window.location.href;
let urlParams = urlGetParams(url);
//获取当前用户的信息
this.props.dispatch({
type: 'exchangeCommunity/getLoginUserInfo',
payload: {
id:urlParams.id
},
callback(res) {
_this.setState({currentUserInfo:res})
sessionStorage.setItem("currentUserInfo",JSON.stringify(res));
},
error(message){
Toast.info(message,2);
Toast.hide();
}
})
}
componentDidMount() {
shareHide();
const _this = this;
let data = {};
let userinfo = JSON.parse(sessionStorage.getItem("currentUserInfo"));
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = userinfo.openid;
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = userinfo.openid;
}
this.getQuestionList(data);
}
componentWillUnmount() {
document.title = '';
}
blur =()=>{
setTimeout(function(){
// alert(1);
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
},10)
}
//下拉刷新数据
scrollPullDownHandle=()=>{
this.setState({currentPage:1,dataEnd:false});
let data = {};
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = this.state.currentUserInfo.openid || "";
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = this.state.currentUserInfo.openid || "";
}
this.getQuestionList(data);
}
//上拉加载更多数据
scrollPullUpHandle(){
let _this = this;
let data = {};
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = this.state.currentUserInfo.openid || "";
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = this.state.currentUserInfo.openid || "";
}
data.pageNo = this.state.currentPage +1;
data.question = this.state.searchValue;
data.pageSize = this.state.pageSize;
this.props.dispatch({
type: 'exchangeCommunity/getAllQuestionList',
payload: data,
callback(res) {
Toast.hide();
let allQuestionList = _this.state.allQuestionList;
let currentPage = _this.state.currentPage;
let dataEnd = _this.state.dataEnd;
if(res.data && res.data.length>0){
allQuestionList = allQuestionList.concat(res.data);
currentPage = currentPage +1;
dataEnd = false;
}else{
dataEnd = true;
}
_this.setState({
allQuestionList:allQuestionList,
currentPage:currentPage,
loadingFlag:false,
current:null,
files:[],
uploadImgList:[],
dataEnd:dataEnd
})
},
error(message){
Toast.info(message,2);
_this.setState({
loadingFlag:false,
current:null,
files:[],
uploadImgList:[],
})
}
})
}
//获取问题列表
getQuestionList(param){
let _this = this;
let params = param ? param : {};
params.pageNo = this.state.currentPage;
params.question = this.state.searchValue;
params.pageSize = this.state.pageSize;
this.props.dispatch({
type: 'exchangeCommunity/getAllQuestionList',
payload: params,
callback(res) {
_this.setState({
allQuestionList:res.data || [],
loadingFlag:false,
current:null,
files:[],
uploadImgList:[],
answers:'',
totalCount:res.totalCount
})
Toast.hide();
},
error(message){
Toast.info(message,2);
_this.setState({ allQuestionList:[] })
}
})
}
//提交回复答案
addAnswerConfirm=(param)=>{
let _this = this;
this.props.dispatch({
type: 'exchangeCommunity/addAnswer',
payload: param,
callback(res) {
Toast.info("提交成功",2);
//刷新一下页面数据
let data = {};
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
_this.getQuestionList(data);
},
error(message){
Toast.info(message.message);
}
})
}
onChangeValue = (itm) => {
this.setState({searchValue:itm})
}
//搜索问题,模糊查询
searchQuestion=(itm)=>{
let _this = this;
console.log('searchQuestion----->',itm)
//刷新一下页面数据
let data = {};
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
this.getQuestionList(data);
}
//跳转问题详情页面
gotoDetail=(item)=>{
this.props.history.push({ pathname: "/exchangeCommunity/questionDetail"});
sessionStorage.setItem("questionDetail",JSON.stringify(item));
this.clickQuestionHandle(item.id);//更新点击率
}
//点击回复消息按钮
addAnswerClick=(index)=>{
console.log('click-->',index,this.state.answerFlag)
let answerFlag = this.state.answerFlag
if(index == this.state.current){
answerFlag = !answerFlag;
}else{
answerFlag = true;
}
this.setState({
current:index,
answerFlag:answerFlag,
answers:''
})
}
//提交回答按钮
addAnswerHandle=(item)=>{
let answer = this.state.answers;
console.log('addAnswerHandle-----',item,answer)
if(answer == ""){
Toast.info("回复内容不能为空",2)
return;
}
if(GetLength(answer)>200){
Toast.info("评论字数不能大于100个",2)
return;
}
let params = {
"questionId":item.id,
"answer":answer,
"beAnswered": item.weixinName,//被回复人的名字
"initAnswerId": item.id,
"weixinId":this.state.currentUserInfo.openid,
"weChatName": this.state.currentUserInfo.nickname,
"weChatImage": this.state.currentUserInfo.headImgUrl,
}
this.addAnswerConfirm(params);
this.clickQuestionHandle(item.id);//更新点击率
}
addAnswerChange=(val)=>{
this.setState({ answers:val})
}
//发布问题
addQuestionHandle=()=>{
console.log('addQuestionHandle-----',this.state.files,this.addQuestionTextarea.state.value)
let _this = this;
let question = this.addQuestionTextarea.state.value;
if(question == ""){
return Toast.info("提问的问题不能为空",2)
}
if(GetLength(question)>100){
return Toast.info("问题字数不能超过50个!",2)
}
this.props.dispatch({
type: 'exchangeCommunity/AddQuestion',
payload: {
"question":question,
"questionImageList":this.state.uploadImgList,
"weixinId":this.state.currentUserInfo.openid,
"weChatName": this.state.currentUserInfo.nickname,
"weChatImage": this.state.currentUserInfo.headImgUrl,
},
callback(res) {
Toast.info("发布成功",2);
_this.addQuestionTextarea.state.value = "";
//刷新一下页面数据
let data = {};
if(sessionStorage.getItem("key_exchange")=="2"){
data.requestType = "question";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
if(sessionStorage.getItem("key_exchange")=="3"){
data.requestType = "answer";
data.weixinId = _this.state.currentUserInfo.openid || "";
}
_this.getQuestionList(data);
},
error(mess){
Toast.info(mess.message,2);
}
})
}
clickTabHandle=(key)=>{
Toast.loading('loading...',0);
let params = {};
sessionStorage.setItem( "key_exchange", key);
switch (key) {
case "1":
this.setState({keyTab:"",currentPage:1,searchValue:"",dataEnd:false},()=>{
setTimeout(()=>{
this.getQuestionList();
},1000)
});
break;
case "2":
params.requestType = "question";
params.weixinId = this.state.currentUserInfo.openid || "";
this.setState({keyTab:"question",currentPage:1,searchValue:"",dataEnd:false},()=>{
setTimeout(()=>{
this.getQuestionList(params);
},1000)
});
break;
case "3":
params.requestType = "answer";
params.weixinId = this.state.currentUserInfo.openid || "";
this.setState({keyTab:"answer",currentPage:1,searchValue:"",dataEnd:false},()=>{
setTimeout(()=>{
this.getQuestionList(params);
},1000)
});
break;
default:
break;
}
}
//上传文件时的事件
onChangeImage = (files, type, index) => {
console.log('onChangeImage---->>>',files, type, index);
if(type == "add"){
//上传前校验格式
let file = files[files.length-1].file;
if(beforeUpload(file)){
this.setState({
loading:true
},()=>{
this.uploadFile(files);
});
}
}
if(type == "remove"){
let imglist = this.state.uploadImgList;
imglist.splice(index,1);
this.setState({
files,
uploadImgList:imglist,
});
}
}
//文件上传接口
uploadFile(files){
Toast.loading('上传中...',0);
let _this = this;
let userId = this.state.currentUserInfo.id;
let file = files[files.length-1].file;
let fileType = file.name.substring(file.name.lastIndexOf('.') + 1);
let formData = new FormData();
formData.append('file', file);
formData.append('fileType', "filesImg");
formData.append('functionType', 'exchangeCommunity');
formData.append('userId', userId);
request('/o2o/ai/fileUpload', {
method: 'POST',
body: formData
}).then((res) => {
if (res.data.status) {
Toast.info('上传成功!',1);
_this.setState({
files,
uploadImgList:_this.state.uploadImgList.concat([{imageUrl:res.data.data.fileAddress}]),
loading:false,
});
}else{
Toast.info('上传失败!');
}
})
}
//更新问题的点击率
clickQuestionHandle=(id)=>{
this.props.dispatch({
type: 'exchangeCommunity/updateClickNum',
payload: {
questionId:id
},
callback(res) {
console.log("添加点击率成功");
},
error(message){
console.log("添加点击率出错");
}
})
}
_quesrionItem(list,nameKey){
if(list.length>0){
return list.map((item,idx)=>{
return(
<div className={css.questionItem} key={nameKey + idx}>
<div onClick={()=>{this.gotoDetail(item)}}>
<div className={css.question_Content}>{item.question}</div>
<div className={css.question_img}>
{item.questionImageList.length>0 && item.questionImageList.map((itm,index1)=>{
return <img key={itm.id} src={itm.imageUrl}/>
})}
</div>
</div>
<div className={css.question_userInfo}>
<div className={css.img_esction}><img src={item.weixinImageurl ? item.weixinImageurl : require("../../assets/image/myUser.png")}/></div>
<div className={css.name}>{item.weixinName || "***"}</div>
<div className={css.date}>{item.createTime}</div>
</div>
<div className={css.question_answer}>
{
item.answers && item.answers.map((item2,index2)=>{
return (
<div className={css.question_answer_list} key={item2.id}>
<div className={css.question_answer_name}>{item2.weixinName + ":"}</div>
<div className={css.question_answer_text} dangerouslySetInnerHTML = {{__html:item2.answer.replace(/(\r\n)|(\n)/g,'<br>')}}></div>
</div>
)
})
}
</div>
<div className={css.question_footer}>
<div onClick={()=>{this.gotoDetail(item)}}><span className={css.question_num}>{item.answerCount}</span>个回答</div>
<div onClick={()=>{this.addAnswerClick(idx)}}><img style={{width: '.2rem'}} src={require("../../assets/image/addquestion.png")}/></div>
</div>
<div className={(this.state.current == idx && this.state.answerFlag) ? css.question_add_answer : css.question_no_answer}>
<TextareaItem
placeholder="请输入您的回答"
rows={2}
value={this.state.answers}
onBlur={::this.blur}
onChange={this.addAnswerChange}
/>
<div className={css.addquestion_btn2}>
<button className={css.btn} onClick={()=>{this.addAnswerHandle(item)}}>提交</button>
</div>
</div>
</div>
)
})
}else{
return <NoData />
}
}
removeImageHandle(idx){
console.log('item-remove--->>',idx)
let files = this.state.files;
files.splice(idx,1);
//this.onChangeImage(files,'remove',idx);
}
componentDidUpdate(){
// let _this = this;
// $('.am-image-picker').find('.am-image-picker-item-remove').each( function(i) {
// console.log('-----------click------>',i)
// $(this).on('click',function(event){
// event.stopPropagation();
// _this.removeImageHandle(i);
// })
// });
}
render() {
let {allQuestionList,currentUserInfo,files,uploadImgList,scrollH} = this.state;
let check = sessionStorage.getItem("key_exchange")-1;
let totalCount = this.state.totalCount || 0;
if(this.state.loadingFlag){
return <div></div>
}
const SearchBtn = (props) => (
<div style={{color:'black'}}>搜索</div>
)
return (
<div className={css.exchangeCommunityWrap}>
<Tabs
tabs={[{ title: '全部', sub: '1' }, { title: '提问', sub: '2' }, { title: '回答', sub: '3' }]}
initialPage ={check}
swipeable={false}
onChange={(t, i) => {
this.clickTabHandle(t.sub)
}}
>
{/** 问题部分**/}
<div className="scrollSection">
<div className={css.splitline}></div>
<div className={css.header_section}>
<div className={css.search}>
<input
onChange={(e) => {
this.onChangeValue(e.target.value);
}}
value={this.state.searchValue}
type="search"
id="inputElem1"
placeholder={"请输入搜索内容"} />
<div className={css.cancelButton} onClick={()=>{this.searchQuestion()}}>搜索</div>
</div>
<div className={css.questionText}>
所有问题<span className={css.questionNum}>{"(" + totalCount + "个)"}</span>
</div>
</div>
<div className={css.questionList} style={{height: this.state.scrollH}}>
<Iscroll key="0"
id="community1"
iscrollOptions={{
preventDefault: true,
}}
onPullDownLoadMore={() => this.scrollPullDownHandle()}
onPullUpLoadMore={() => this.scrollPullUpHandle()}
hasUp={true}
hasDown={true}
dataEnd={this.state.dataEnd}
haveBackTop={true}
noUpStr={'已全部加载完毕'}>
{this._quesrionItem(allQuestionList,'allquestion')}
</Iscroll>
</div>
</div>
{/** 提问部分**/}
<div className="scrollSection">
<div className={css.splitline}></div>
<div className={css.header_section}>
{/*<SearchBar placeholder="请输入搜索内容"
onClear={value => console.log(value, 'onClear')}
onChange={this.onChangeValue}
value={this.state.searchValue}
cancelText={<SearchBtn />}
onCancel={this.searchQuestion}
/>*/}
<div className={css.search}>
<input
onChange={(e) => {
this.onChangeValue(e.target.value);
}}
value={this.state.searchValue}
type="search"
id="inputElem1"
placeholder={"请输入搜索内容"} />
<div className={css.cancelButton} onClick={()=>{this.searchQuestion()}}>搜索</div>
</div>
<div className={css.questionText}>
我的提问<span className={css.questionNum}>{"(" + totalCount + "个)"}</span>
</div>
</div>
<div className={css.questionList} style={{height: this.state.scrollH}}>
<Iscroll key="0"
id="community2"
iscrollOptions={{
preventDefault: true,
}}
onPullDownLoadMore={() => this.scrollPullDownHandle()}
onPullUpLoadMore={() => this.scrollPullUpHandle()}
hasUp={true}
hasDown={true}
dataEnd={this.state.dataEnd}
haveBackTop={true}
noUpStr='已全部加载完毕'>
<div className={css.addquestion_section} id="addquestion_section">
<div className={css.addquestion_text}>
<TextareaItem
placeholder="请输入您的问题"
onBlur={::this.blur}
autoHeight
ref={el => this.addQuestionTextarea = el}
/>
</div>
<div className={css.addquestion_img}>
<ImagePicker
className={css.backgroundUploadImg}
files={files}
onChange={this.onChangeImage}
selectable={files.length < 9}
disableDelete={true}
/>
</div>
<button className={css.addquestion_btn} onClick={()=>{this.addQuestionHandle()}}>发布</button>
</div>
<div style={{position:'relative',minHeight:(this.state.scrollH-187)}}>
{this._quesrionItem(allQuestionList,'allquestion')}
</div>
</Iscroll>
</div>
</div>
{/** 回答部分**/}
<div className="scrollSection">
<div className={css.splitline}></div>
<div className={css.header_section}>
{/* <SearchBar placeholder="请输入搜索内容"
onClear={value => console.log(value, 'onClear')}
onChange={this.onChangeValue}
value={this.state.searchValue}
cancelText={<SearchBtn />}
onCancel={this.searchQuestion}
/>*/}
<div className={css.search}>
<input
onChange={(e) => {
this.onChangeValue(e.target.value);
}}
value={this.state.searchValue}
type="search"
id="inputElem1"
placeholder={"请输入搜索内容"} />
<div className={css.cancelButton} onClick={()=>{this.searchQuestion()}}>搜索</div>
</div>
<div className={css.questionText}>
我的回答<span className={css.questionNum}>{"(" + totalCount + "个)"}</span>
</div>
</div>
<div className={css.questionList} style={{height: this.state.scrollH}}>
<Iscroll key="0"
id="community3"
iscrollOptions={{
preventDefault: true,
}}
onPullDownLoadMore={() => this.scrollPullDownHandle()}
onPullUpLoadMore={() => this.scrollPullUpHandle()}
hasUp={true}
hasDown={true}
dataEnd={this.state.dataEnd}
haveBackTop={true}
noUpStr='已全部加载完毕'>
{this._quesrionItem(allQuestionList,'myanswer')}
</Iscroll>
</div>
</div>
</Tabs>
</div>
)
}
}
export default connect()(Index);
import React, { Component } from 'react';
import { connect } from 'dva';
import { Tabs, Toast ,SearchBar,InputItem,TextareaItem,Button} from 'antd-mobile';
import { Icon, Modal } from 'antd';
import shareHide from "../../utils/shareHide";
import {GetLength} from '../../utils/dataFilter';
import Iscroll from "../../components/Iscroll";
import css from './css.less';
class Index extends Component{
constructor(props) {
super(props);
let questionInfo = JSON.parse(sessionStorage.getItem("questionDetail"));
let currentUserInfo = JSON.parse(sessionStorage.getItem("currentUserInfo"));
this.state = {
questionInfo:questionInfo || null,//问题数据
currentUserInfo:currentUserInfo,//当前用户
questionAnswerList:[],
textarea:"",
textarea2:"",
weixinId:"25",//当前用户的微信ID
publicId:"18",//当前用户的公众号ID
answerCurrent:null,//当前回复的那一条回答
answerFlag : false,
previewImage:'',//图片预览
previewVisible: false,
}
}
componentDidMount() {
document.title = '问题详情';
shareHide();
this.getQuestionInfo();
}
blur =()=>{
setTimeout(function(){
// alert(1);
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
},10)
}
handlePreview = async url => {
this.setState({
previewImage: url,
previewVisible: true,
});
};
handleCancel = () => {
this.setState({ previewVisible: false });
};
getQuestionInfo(){
let _this = this;
let questionInfo = this.state.questionInfo;
this.props.dispatch({
type: 'exchangeCommunity/getQuestionInfo',
payload: {
"id": questionInfo.id,
},
callback(res) {
_this.setState({
questionAnswerList:res.discussList,
answerCurrent:null,
textarea:'',
textarea2:'',
})
}
})
}
addAnswerChange = (value)=>{
this.setState({textarea:value})
}
addAnswerChange2 = (value)=>{
this.setState({textarea2:value})
}
//点击回复消息按钮
addAnswerClick1=(index)=>{
console.log('click-->',index,this.state.answerFlag)
let answerFlag = this.state.answerFlag
if(index == this.state.answerCurrent){
answerFlag = !answerFlag;
}else{
answerFlag = true;
}
this.setState({
answerCurrent:index,
answerFlag:answerFlag,
textarea2:''
})
}
//提交回答按钮
addAnswerHandle=(key,itm)=>{
let _this = this;
let answer = this.state.textarea;//评论的内容;
let answer2 = this.state.textarea2;//评论回答的内容;
let questionInfo = this.state.questionInfo;
console.log('addAnswerHandle-----',answer);
if(key=='question'){
if(answer==""){
return Toast.info("评论内容不能为空",2)
}
if(GetLength(answer)>200){
Toast.info("评论字数不能大于100个",2)
return;
}
}
if(key == 'answer'){
if(answer2==""){
return Toast.info("回复内容不能为空",2)
}
if(GetLength(answer2)>200){
Toast.info("回复字数不能大于100个",2)
return;
}
}
let params = {
initAnswerId: questionInfo.id,
weixinId:this.state.currentUserInfo.openid,
weChatName: this.state.currentUserInfo.nickname,
weChatImage: this.state.currentUserInfo.headImgUrl,
}
if(key=="answer"){
params.answerId = itm.id;
params.beAnswered = itm.weixinName;
params.answer = answer2;
}else {
params.questionId = questionInfo.id;
params.beAnswered = questionInfo.weixinName;
params.answer = answer;
}
this.props.dispatch({
type: 'exchangeCommunity/addAnswer',
payload: params,
callback(res) {
Toast.info("提交成功",2);
//刷新一下页面数据
_this.getQuestionInfo();
},
error(mes){
Toast.info(mes.message,2);
}
})
}
_answerCompoent(item){
let answer = item.answer ? item.answer.replace(/(\r\n)|(\n)/g,'<br>') : item.answer;
return(
<div>回复<span style={{color:"#FF9D5C"}}>{item.beAnswered+':'}</span><span dangerouslySetInnerHTML = {{__html:answer}}></span></div>
)
}
_answerCompoent2(itm){
let answer = itm ? itm.replace(/(\r\n)|(\n)/g,'<br>') : itm;
return(
<span dangerouslySetInnerHTML = {{__html:answer}}></span>
)
}
//问题的回答部分组件
_answerContent(AnswerList,answerCurrent){
let _this = this;
if(AnswerList.length>0){
return AnswerList.map((item,index2)=>{
return (
<div className={css.question_answer_Item} key={item.id}>
<div className={css.usersection}>
<img src={item.weixinImageurl ? item.weixinImageurl : require("../../assets/image/myUser.png")}/>
<span className={css.name}>{item.weixinName}</span>
</div>
<div className={css.answersection}>
{item.beAnswered ? this._answerCompoent(item) : this._answerCompoent2(item.answer) }
</div>
<div className={css.answerfooter}>
<div className={css.date}>{item.createTime}</div>
<div onClick={()=>{this.addAnswerClick1(index2)}}><img style={{width: '.2rem'}} src={require("../../assets/image/addquestion.png")}/></div>
</div>
<div className={(answerCurrent == index2 && this.state.answerFlag) ? css.question_add_answer : css.question_no_answer}>
<TextareaItem
placeholder="请输入您的回答"
onBlur={::this.blur}
rows={2}
value={this.state.textarea2}
onChange={this.addAnswerChange2}
/>
<div className={css.addquestion_btn2}>
<button className={css.btn} onClick={()=>{this.addAnswerHandle("answer",item)}}>提交</button>
</div>
</div>
</div>
)
})
}else{
return <div></div>
}
}
render() {
let {questionInfo,questionAnswerList,answerCurrent,previewImage,previewVisible} = this.state;
if(!questionInfo){
return <div></div>
}
return (
<div className={css.exchangeCommunityWrap}>
<Iscroll id="communityDetail"
iscrollOptions={{
probeType:2
}}
haveBackTop={true}>
<div>
<div className={css.questionList}>
<div className={css.questionItem}>
<div className={css.question_Content}>{questionInfo.question}</div>
<div className={css.question_img}>
{
questionInfo.questionImageList.length>0 && questionInfo.questionImageList.map((itm,index1)=>{
return <img key={itm.id} onClick={()=>{this.handlePreview(itm.imageUrl)}} src={itm.imageUrl}/>
})
}
</div>
<div className={css.question_userInfo}>
<div className={css.img_esction}><img src={questionInfo.weixinImageurl ? questionInfo.weixinImageurl : require("../../assets/image/myUser.png")}/></div>
<div className={css.name}>{questionInfo.weixinName || "***"}</div>
<div className={css.date}>{questionInfo.createTime}</div>
</div>
<div className={css.question_footer}>
<div><span className={css.question_num}>{questionAnswerList.length}</span>个回答</div>
</div>
</div>
<div style={previewVisible ? {display:'block'} : {display:'none'}}
className={css.modalImg}>
<div className={css.modalSection}>
<div className={css.close} onClick={this.handleCancel}>×</div>
<div className={css.imgsection}><img alt="" className={css.imgPreview} src={previewImage} /></div>
</div>
</div>
</div>
<div className={css.questionDetailWrap}>
{this._answerContent(questionAnswerList,answerCurrent)}
</div>
</div>
</Iscroll>
<div className={css.answerFooterSection}>
<div style={{width:"100%"}}>
<TextareaItem
placeholder="评论一下..."
onBlur={::this.blur}
value={this.state.textarea}
rows={1}
onChange={this.addAnswerChange}
/>
</div>
{/*<div className={css.btntijiao}><Button className={css.btn} activeStyle={false} size="small" inline onClick={()=>{this.addAnswerHandle("question")}}>提交</Button></div>*/}
<div className={css.btntijiao}><button className={css.btn} onClick={()=>{this.addAnswerHandle("question")}}>提交</button></div>
</div>
</div>
)
}
}
export default connect()(Index);
import React, { Component } from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Tabs, Toast } from 'antd-mobile';
import MemberList from '../../components/MemberList/MemberList';
import { dataFilter } from '../../utils/dataFilter';
import shareHide from "../../utils/shareHide";
import css from './css.less';
const stateName = ['未提交','已提交','已提交','已提交','已成单','已上传','跟进中','停止跟进']
class Audit extends Component{
constructor(props) {
super(props);
this.state = {
clientList: [],
cientListed: [],
storeclientList: [],
storecientListed: [],
isShowPassedInfo: false,
infoList: {},
show: false,
show1: false
}
}
componentDidMount() {
document.title = '我的客户';
shareHide();
// Toast.loading('loading...', 88);
this.getClientUnpassList();
// this.getClientPassedList();
}
getClientPassedList() {
Toast.loading('loading...',88);
const _this = this;
this.props.dispatch({
type: 'governortraining/getClientList',
payload: {
id: window.localStorage.getItem("id"),
auditedState: 1
},
callback(res) {
if (res.status) {
_this.setState({
cientListed: res.data,
storecientListed: res.data,
show: true
}, () => {
Toast.hide();
})
}
}
})
}
getClientUnpassList() {
const _this = this;
this.props.dispatch({
type: 'governortraining/getClientList',
payload: {
id: window.localStorage.getItem("id"),
// auditedState: 0
},
callback(res) {
if (res.status) {
_this.setState({
clientList: res.data,
storeclientList: res.data,
show1: true
}, () => {
Toast.hide();
})
}
}
});
}
chooseClient(pass, item) {
localStorage.setItem('auditClientInfo', JSON.stringify({ ...item, isShowPassedInfo: pass }));
// this.props.dispatch(routerRedux.push({
// pathname: '/governortraining/auditinfo'
// }));
this.props.history.push({pathname: '/governortraining/auditinfo'})
}
render() {
return <div className={css.auditWrap}>
<div>
{
this.state.clientList.length === 0 && this.state.show1 && (
<div>
<div className={css.splitline}></div>
<div className={css.noData}>
<div className={css.img}></div>
当前无数据
</div>
</div>
)
}
{ this.state.clientList.length>0 && this.state.show1 && <MemberList
id="audit"
height='86vh'
dataList={this.state.storeclientList}
renderType={['name']}
filterData={(keywords) => {
this.setState({
storeclientList: dataFilter(this.state.clientList, ['name'], keywords)
})
}}
renderItem={item => {
return <div className={css.clientItem}>
<span className={css.name}>{item.name}</span>
<span className={css.time}>{item.commitTime ? item.commitTime.substr(0,16) : ""}</span>
<span className={css.status}>{stateName[item.currentState]}</span>
</div>
}}
chooseClient={this.chooseClient.bind(this,false)}
pTitle='客户' />}
</div>
</div>
}
}
export default connect()(Audit);
import { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Toast, InputItem, Picker } from 'antd-mobile';
import ConfirmPop from '../../components/Modal/confirmPop';
import shareHide from "../../utils/shareHide";
import css from './css.less';
import {getPlanInListWithCode} from '../../utils/dataFilter'
class AddClient extends Component {
constructor(props) {
super(props);
this.state = {
id:'',
age: null,
sex: [0],
idcard: '',
maritalStatus: '未婚',
education: '本科',
number: '',
address:'',
regionData: [],
reverseData:[],
regionVal: '',
asyncValue: [],
asyncOrz: [],
orgList: [],
orgReverseList: [],
orgVal: '',
asyncProj: [],
projList: [],
projReverseList: [],
projVal: '',
asyncNet: [],
netList: [],
netReverseList: [],
netVal: '',
isShowTips: false,
dataTypes: [false,false,false,false,false,false],
disabled:false,
}
this.onRegionPickerChange = this.onRegionPickerChange.bind(this);
this.addClient = this.addClient.bind(this);
}
genArr(data) {
let arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].orgName,
value: data[i].orgId
})
}
return arr;
}
componentDidMount() {
document.title = '客户经理信息';
const _this = this;
shareHide();
let clientInfo = JSON.parse(window.localStorage.getItem('governortrainingClient'));
let userInfo = JSON.parse(window.localStorage.getItem('userInfo'));
// 省市级联初始化
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
configType: 'newprovinces',
oyhers: 0
},
callback: (res) => {
if (res.status) {
let { data } = res, arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].configName,
value: data[i].configCode,
children: []
})
}
this.setState({
regionData: arr
}, () => {
if (clientInfo) {
const namearr = clientInfo.province.split(',');
if (namearr.length) {
let havedata = false;
arr.forEach((element, i) => {
if (element.label===namearr[0]) {
havedata = true;//匹配到了有数据
_this.fillSecData(element.value, i, (list) => {
if (namearr[1]) {
list && list.forEach(el => {
if (el.configName === namearr[1]) {
_this.setState({
regionVal: element.label+','+el.configName,
asyncValue: [element.value, el.configCode]
})
}
});
} else {
_this.setState({
regionVal: element.label,
asyncValue: [element.value]
})
}
})
}
});
if(!havedata){//没有匹配到
_this.fillSecData(data[0].configCode, 0)
}
}
} else {
_this.fillSecData(data[0].configCode, 0)
}
})
}
}
});
if (clientInfo) {
this.setState({
id: clientInfo.id,
dataTypes:[true,true,true,true,true,true],
name: clientInfo.name,
number: clientInfo.number,
age: clientInfo.age,
sex: [clientInfo.sex],
idcard: clientInfo.idcard,
maritalStatus: clientInfo.maritalStatus,
education: clientInfo.education,
address: clientInfo.address
})
if(clientInfo.disabled2){
_this.setState({
disabled:true,
})
}
}
_this.getOrzList(0, (list) => {
const arr = _this.genArr(list);
const reverseList = _this.reverseData(arr);
_this.setState({
orgList: arr,
asyncOrz: [userInfo.orgId],
orgVal: reverseList[userInfo.orgId].label,
orgReverseList: reverseList
}, () => {
_this.getOrzList(userInfo.orgId, (list) => {
const projarr = _this.genArr(list);
const projreverseList = _this.reverseData(projarr);
_this.setState({
projList: projarr,
projReverseList: projreverseList,
}, () => {
_this.getOrzList(userInfo.project, (list) => {
const netarr = _this.genArr(list);
let netarr_2 = [];
let websitelist = userInfo.website ? userInfo.website.split(','):[];//该督训所属的网点
for(let i in websitelist){
netarr_2.push(getPlanInListWithCode('value',websitelist[i],netarr))
}
const netreverseList = _this.reverseData(netarr_2);
_this.setState({
netList: netarr_2,
netReverseList: netreverseList,
asyncProj: [userInfo.project],
projVal: projreverseList[userInfo.project].label
}, () => {
if(clientInfo){
_this.setState({
asyncNet: [clientInfo.website],
netVal: netreverseList[clientInfo.website] ? netreverseList[clientInfo.website].label : '',
})
}
})
});
})
});
})
});
}
setAgeRange() {
let arr = [];
for (let i = 0; i <= 100; i++){
arr.push({ label:i+'岁',value:i})
}
return arr;
}
reverseData(list) {
let j = {};
list.forEach((v) => {
j[v.value] = { label: v.label };
if (v.children && v.children.length) {
j[v.value].children = {};
v.children.forEach(val => {
j[v.value].children[val.value] = val.label;
})
}
})
return j;
}
fillSecData(v, i, cb) {
const _this = this;
let { regionData } = this.state;
if (!regionData[i].children.length) {
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
configType: 'newprovinces',
oyhers: v
},
callback(res) {
if (res.status && res.data.length) {
let { data } = res,arr=[];
for (let i = 0, l = data.length; i < l; i++){
arr.push({
label: data[i].configName,
value: data[i].configCode
})
}
regionData[i].children = arr;
_this.setState({
regionData
}, () => {
const list = _this.reverseData(_this.state.regionData);
let asyncValue = _this.state.asyncValue;
if(asyncValue.length==1){
asyncValue[1] = arr[0].value;
}
console.log(_this.state.regionVal,_this.state.asyncValue,list,list[_this.state.asyncValue[0]])
_this.setState({
reverseData: list,
asyncValue: asyncValue
},function(){
cb && cb(data);
})
})
}
}
})
}
}
onRegionPickerChange(v) {
const asyncValue = [...v];
this.setState({
asyncValue
})
if (this.state.regionData.length) {
const { regionData } = this.state;
for (let i = 0, l = regionData.length; i < l; i++) {
if (regionData[i].value === v[0]) {
this.fillSecData(v[0], i);
}
}
}
}
getOrzList(orgId, cb) {
this.props.dispatch({
type: "governortraining/getOrzList",
payload: {
orgId
},
callback: (res) => {
if (res.status && res.data.length) {
if (cb) cb(res.data);
}
}
});
}
addClient() {
const _this = this;
Toast.loading('loading',100);
this.props.dispatch({
type: "governortraining/updateManager",
payload: {
id:this.state.id,
roleId: 2,
superiorid: window.localStorage.getItem("id"),
name: this.state.name,
sex: this.state.sex[0],
age: this.state.age,
idcard: this.state.idcard,
number: this.state.number,
maritalStatus: this.state.maritalStatus,
education: this.state.education,
orgId: this.state.asyncOrz[0],
project: this.state.asyncProj[0],
website: this.state.asyncNet[0],
province: this.state.regionVal,
address: this.state.address
},
callback: (res) => {
if (res.status) {
Toast.hide();
_this.setState({
dataTypes: [false, false, false, false, false, false]
})
_this.props.history.replace('/governortraining/gtclientlist');
} else {
Toast.info(res.message,);
}
},
error:(message)=>{
Toast.info(message,);
}
})
this.setState({
isShowTips: false
})
}
blur =()=>{
let timer = setTimeout(function(){
if(document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA'){
return
}
let result = 'pc';
if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
document.querySelector('body').scrollIntoView();
}
clearTimeout(timer)
},10)
}
render() {
let clientInfo = JSON.parse(window.localStorage.getItem('governortrainingClient'));
return (
<Fragment>
<div className={css.ac_wrap}>
<ul className={css.aclist_wrap}>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="text"
disabled={this.state.disabled}
value={this.state.name}
onBlur={::this.blur}
onChange={v => {
let { dataTypes } = this.state;
dataTypes[0] = (v.trim() !== '');
this.setState({
name: v,
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入客户经理姓名"}
>姓名</InputItem>
</li>
<li className={css.require}>
<span className={css.label}>性别</span>
<Picker
data={[
{ label: '男', value: 0 },
{ label: '女', value: 1 }
]}
disabled={this.state.disabled}
cols={1}
onChange={
s => this.setState({sex:s})
}
>
<div className={css.choose} style={{color:'#101010'}}><span>{parseInt(this.state.sex[0])===0 ? '男' : '女'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li className={css.require}>
<span className={css.label}>年龄</span>
<Picker
data={this.setAgeRange()}
cols={1}
disabled={this.state.disabled}
value={[30]}
onChange={s => {
this.setState({ age: s[0] })
}}
>
<div className={css.choose}><span style={{color: (this.state.age !== null && this.state.age !== "")?'#101010':'#999'}}>{this.state.disabled ? this.state.age : (this.state.age == null || this.state.age == "") ? '请选择年龄': this.state.age +'岁' }</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="text"
disabled={this.state.disabled}
onBlur={::this.blur}
value={this.state.idcard}
onChange={v => {
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
let { dataTypes } = this.state;
dataTypes[1] = reg.test(v.length > 18 ? v.substr(0, 18) : v);
this.setState({
idcard: v.length>18?v.substr(0,18): v,
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入身份证号码"}
>身份证号码</InputItem>
</li>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="phone"
disabled={this.state.disabled}
value={this.state.number}
onBlur={::this.blur}
onChange={v => {
let { dataTypes } = this.state;
dataTypes[2] = v.replace(/\s/g, '').length > 10
this.setState({
number: v.replace(/\s*/g, ''),
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入手机号码"}
>手机号码</InputItem>
</li>
<li>
<span className={css.label}>婚姻状况</span>
<Picker
data={[
{ label: '未婚', value: '未婚' },
{ label: '已婚', value: '已婚' },
{ label: '离异', value: '离异' }
]}
cols={1}
disabled={this.state.disabled}
value={this.state.maritalStatus ? [this.state.maritalStatus]:['未婚']}
onOk={
s => this.setState({maritalStatus:s[0]})
}
>
<div className={css.choose} style={{color:this.state.maritalStatus!==''? '#101010':'#999'}}><span>{this.state.disabled ? this.state.maritalStatus : (this.state.maritalStatus ? this.state.maritalStatus : "请选择婚姻状况")}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li>
<span className={css.label}>学历</span>
<Picker
data={[
{ label: '初中及以下', value: '初中及以下' },
{ label: '高中', value: '高中' },
{ label: '大专', value: '大专' },
{ label: '本科', value: '本科' },
{ label: '硕士', value: '硕士' },
{ label: '博士', value: '博士' },
{ label: '其他', value: '其他' }
]}
cols={1}
disabled={this.state.disabled}
value={this.state.education ? [this.state.education]:['本科']}
onOk={
s => this.setState({education:s[0]})
}
>
<div className={css.choose} style={{color:this.state.education!==''? '#101010':'#999'}}><span>{this.state.disabled ? this.state.education : (this.state.education ? this.state.education : "请选择学历")}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
</ul>
<ul className={css.aclist_wrap}>
<li className={css.require}>
<span className={css.label}>所属机构</span>
<div className={css.choose}><span style={{color:'#101010'}}>{this.state.orgVal}</span></div>
{/*</Picker>*/}
</li>
<li className={css.require}>
<span className={css.label}>合作项目</span>
<div className={css.choose}><span style={{color:'#101010'}}>{this.state.projVal}</span></div>
{/*</Picker>*/}
</li>
<li className={css.require}>
<span className={css.label}>所属网点</span>
<Picker
data={this.state.netList}
value={this.state.asyncNet}
cols={1}
disabled={this.state.disabled}
onOk={v=>{
const asyncNet = [...v];
this.setState({
asyncNet,
netVal: this.state.netReverseList[v[0]].label
});
}}
>
<div className={css.choose}><span style={{color:this.state.netVal!==''? '#101010':'#999'}}>
{this.state.disabled ? this.state.netVal : (this.state.netVal!=='' ? this.state.netVal : '请选择所属网点')}</span>
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
</ul>
<ul className={css.aclist_wrap}>
<li>
<span className={css.label}>所在省市</span>
<Picker
data={this.state.regionData}
cols={2}
disabled={this.state.disabled}
value={this.state.asyncValue}
onPickerChange={this.onRegionPickerChange}
onOk={(v) => {
// const asyncValue = [...v];
const asyncValue = [...v].length>1 ? [...v] : this.state.asyncValue;
const { reverseData } = this.state;
let label = '';
label = asyncValue.length > 1 ? reverseData[asyncValue[0]].label + ',' + reverseData[asyncValue[0]].children[asyncValue[1]] : reverseData[asyncValue[0]].label;
this.setState({
regionVal: label,
asyncValue:asyncValue
})
}}
>
<div className={css.choose} style={{color:this.state.regionVal!==''? '#101010':'#999'}}>
{this.state.disabled ? this.state.regionVal : (this.state.regionVal === '' ? '请选择所在省市' : this.state.regionVal)}
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
</li>
<li>
<InputItem
className={css.e_phoneNum}
type="text"
disabled={this.state.disabled}
value={this.state.address}
onBlur={::this.blur}
onChange={v=>this.setState({address:v})}
placeholder = {this.state.disabled ? "" : "请输入详细地址"}
>详细地址</InputItem>
</li>
</ul>
<div style={{height:'.7rem'}}></div>
<div className={css.ac_confirm}>
<span className={css.confirm} onClick={()=>{
if(this.state.disabled){
this.props.history.go(-1);
return;
}
let { dataTypes } = this.state;
dataTypes[3] = this.state.asyncOrz.length>0;
dataTypes[4] = this.state.asyncProj.length>0;
dataTypes[5] = this.state.asyncNet.length > 0;
let tit = '',idx=-1;
for (let i = 0, l = dataTypes.length; i < l; i++){
if (!dataTypes[i]) {
idx = i;
break;
}
}
switch (idx) {
case 0:
tit = '姓名不能为空!';
break;
case 1:
tit = '身份证号码错误或为空!';
break;
case 2:
tit = '手机号错误或为空!';
break;
case 3:
tit = '所属机构不能为空!';
break;
case 4:
tit = '合作项目不能为空!';
break;
case 5:
tit = '所属网点不能为空!';
break;
default:
break;
}
if (idx < 0) {
this.setState({ isShowTips: true });
} else {
Toast.info(tit);
}
}}>确定</span>
</div>
</div>
<ConfirmPop show={this.state.isShowTips} title="确定" handleOK={this.addClient}
handleCancel={() => {
this.setState({
isShowTips: false
})
}}
>
<p>您是否确定{clientInfo?'修改':'添加'}该客户经理?</p>
</ConfirmPop>
</Fragment>
)
}
}
export default connect()(AddClient);
import { Component, Fragment } from 'react';
import { connect } from 'dva';
import MemberList from '../../components/MemberList/MemberList';
import { dataFilter } from '../../utils/dataFilter';
import css from './css.less';
import shareHide from "../../utils/shareHide";
import { Toast } from 'antd-mobile';
class ChooseClient extends Component {
constructor(props) {
super(props);
this.state = {
unManagerList:[],
storeunManagerList: []
}
}
componentDidMount() {
shareHide();
Toast.loading('loading...');
this.props.dispatch({
type: "governortraining/getManagerList",
payload: {
superiorid: -1,
roleId: 2,
pageNo: ''
},
callback: (res) => {
if (res.status) {
Toast.hide();
this.setState({
unManagerList: res.data,
storeunManagerList: res.data
})
}
}
})
}
render() {
return (
<Fragment>
{
<MemberList
dataList={this.state.unManagerList}
renderType={['name']}
filterData={(keywords) => {
this.setState({
unManagerList: dataFilter(this.state.storeunManagerList, ['name'], keywords)
})
}}
chooseClient={item => {
this.props.dispatch({
type: "governortraining/updateManager",
payload: {
id: item.id,
superiorid: window.localStorage.getItem("id")
},
callback: () => {
this.props.history.push('/governortraining/gtclientlist')
}
})
}}
renderItem={item => {
return <div className={css.managerItem}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.number}</span>
</div>
}}
pTitle='客户经理' />
}
</Fragment>
)
}
}
export default connect()(ChooseClient);
import React, { Component } from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import ConfirmPop from '../../components/Modal/confirmPop';
import shareHide from "../../utils/shareHide";
import css from './css.less';
let isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps = '';
if (isIPhone) {
moneyKeyboardWrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
const stateName = ['未提交','已提交','已提交','已提交','已成单','已上传','跟进中','停止跟进']
class ClientInfo extends Component {
constructor(props) {
super(props);
this.state = {
dataList: null,
isShowTips: false,
tit: '',
isPass: false,
confirmTit: '确定'
}
}
componentDidMount() {
document.title = '客户信息';
const auditInfo = JSON.parse(localStorage.getItem('auditClientInfo'));
shareHide();
if (auditInfo) {
this.setState({
dataList: auditInfo
})
}
}
handlePass(item) {
this.props.dispatch({
type: "governortraining/updateClientInfo",
payload: {
id: item.id,
currentState: 3
},
callback: (res) => {
this.props.dispatch(
routerRedux.replace("/governortraining/audit")
);
}
})
}
handleReject(item) {
this.props.dispatch({
type: "governortraining/updateClientInfo",
payload: {
id: item.id,
currentState: 2
},
callback: (res) => {
this.props.dispatch(
routerRedux.replace("/governortraining/audit")
);
}
})
}
render(){
let labels = [];
const { dataList } = this.state;
if(!dataList){
return <div/>
}
return (
<div className={css.clientInfoBox}>
<ul className={css.itemBox}>
<li>
<span className={css.label}>姓名</span>
<span className={css.value}>{dataList.name}</span>
</li>
<li>
<span className={css.label}>性别</span>
<span className={css.value}>{
dataList.sex === '0' ? '男' : dataList.sex === '1' ? '女' : ''
}</span>
</li>
<li>
<span className={css.label}>提交时间</span>
<span className={css.value}>{dataList.commitTime ? dataList.commitTime.substr(0,16) : ""}</span>
</li>
<li>
<span className={css.label}>跟进情况</span>
<span className={css.value}>{stateName[dataList.currentState]}</span>
</li>
<li>
<span className={css.label}>所属客户经理</span>
<span className={css.value}>{dataList.managerName}</span>
</li>
</ul>
</div>
)
}
}
export default connect()(ClientInfo);
import React, { Component } from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router'
import { ActionSheet, Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import { dataFilter } from '../../utils/dataFilter';
import MemberList from '../../components/MemberList/MemberList';
import css from './css.less'
// fix touch to scroll background page on iOS
const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let wrapProps;
if (isIPhone) {
wrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
class ClientList extends Component {
constructor(props){
super(props)
this.state={
managerList: [],
storeManagerList: [],
show: false
}
}
showActionSheet = () => {
const BUTTONS = ['新增', '取消'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
maskClosable: true,
'data-seed': 'logId',
wrapProps,
},
(buttonIndex) => {
// if (BUTTONS[buttonIndex] === '选择客户经理') {
// this.props.history.push('/governortraining/chooseclient');
// }
if (BUTTONS[buttonIndex] === '新增') {
window.localStorage.setItem('governortrainingClient', null);
this.props.history.push('/governortraining/addclient');
}
});
}
getManagerList() {
this.props.dispatch({
type: "governortraining/getManagerList",
payload: {
superiorid: window.localStorage.getItem("id")
},
callback: (res) => {
if (res.status) {
Toast.hide();
this.setState({
show:true,
managerList: res.data,
storeManagerList: res.data
})
}
}
})
}
componentDidMount() {
document.title = '我的客户经理';
shareHide();
Toast.loading('loading...', 99);
this.getManagerList();
}
componentWillUnmount(){
ActionSheet.close();
}
render() {
const _this = this;
return (
<div className={css.box}>
{this.state.managerList.length === 0 && this.state.show && <div className={css.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={css.client} />
<p>
您当前并无客户经理
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers2.png')} alt="" className={css.add} onClick={() => {
this.showActionSheet()
}} />
</div>}
{
(this.state.managerList.length > 0) && this.state.show && < MemberList
height="74vh"
dataList={this.state.storeManagerList}
renderType={['name']}
filterData={(keywords) => {
this.setState({
storeManagerList: dataFilter(this.state.managerList, ['name'], keywords)
})
}}
renderItem={item => {
return <div className={css.managerItem} onClick={()=>{
let governortrainingClient = {...item ,disabled2:true};
localStorage.setItem('governortrainingClient', JSON.stringify(governortrainingClient));
this.props.dispatch(routerRedux.push('/governortraining/addclient'));
}}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.number}</span>
</div>
}}
handleEdit={(item) => {
window.localStorage.setItem('governortrainingClient', JSON.stringify(item));
this.props.dispatch(routerRedux.push('/governortraining/addclient'))
}}
handleAction={item => {
this.props.dispatch({
type: "governortraining/updateManager",
payload: {
id: item.id,
superiorid: -1
},
callback: (res) => {
if(res.status)
_this.getManagerList();
else
Toast.info(res.message,3)
}
})
}}
showActionSheet = {this.showActionSheet}
pTitle='客户经理' />
}
</div>
)
}
}
export default connect()(ClientList)
ul,dl,li,dt,dd {
margin:0; padding:0; list-style: none;
}
body{background:#fff;}
:global(.am-picker-popup){
z-index: 9999;
}
span {
float: none;
}
.box {
height: 100%; background:#F8F8F8;
}
.clientless {
height: 100%;
overflow: hidden;
.add{
position: absolute;
bottom: 1rem;
width: 3.5rem;
//height: .7rem;
margin: 0 .32rem 0;
}
}
.splitline {
width: 100%;
height: .1rem;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
opacity: 0.1041;
}
.clientless>.client {
width: 1.51rem;
margin: 0 1.32rem .2rem;
margin-top: 1.75rem;
}
.clientless>p {
text-align: center;
font-size: .15rem;
color: #666666;
margin-bottom: .02rem;
}
.ac_wrap {
position: relative;
height: 100%;
background: #F8F8F8;
padding-top: .1rem;
overflow-y: auto;
z-index:1;
.aclist_wrap {
background: white; margin-bottom: .1rem; padding-left: .11rem;
span{ margin-right: 0;}
li{
position: relative; display:flex; border-bottom: 1px solid #F8F8F8; height: .5rem; box-sizing: content-box;text-align: left;
div {
flex:1;
}
&.require:before{
position: absolute; content:'*'; left:0; top:0; color:red;line-height: .5rem; z-index: 10;
}
:global(.am-list-item.am-input-item){
padding-left: .14rem; height: .5rem; width: 100%; min-height: inherit;
}
:global(.am-list-item .am-input-label.am-input-label-5){
width: 1.22rem; font-size: .15rem; color:#101010;margin:0; padding:0; flex:none;
}
:global(.am-list-item .am-input-control input){
font-size: .15rem;
}
.label{
width: 1.36rem; flex-shrink:0; line-height: .5rem;
text-align: left;text-indent: .14rem; font-size: .15rem; color:#101010; flex-shrink: 0;
}
.choose {
line-height: .5rem; font-size: .15rem; color:#999; text-align: left;
}
.icon_arrow{
position: absolute; width:.08rem; height: .14rem; background: url(../../assets/image/next-step.png) no-repeat; background-size: 100%; top: .18rem; right:.11rem;
}
}
}
.ac_confirm{
position: fixed; height: .6rem; background: white; width: 100%; left:0; bottom:0; z-index: 999;
.confirm {
position: absolute; right:.11rem; top:.09rem;
width: .75rem; height: .4rem; background:#FF9D5C; color:#fff; font-size: .15rem; line-height: .4rem; text-align: center; border-radius: .04rem;
}
}
}
:global(.am-action-sheet-button-list .am-action-sheet-cancel-button){
padding-top:0; height: .7rem; line-height: .7rem; color:#101010;
}
:global(.am-action-sheet-button-list .am-action-sheet-cancel-button-mask){
display: none;
}
:global(.am-action-sheet-button-list-item){
color: #FF9D5C;
}
.auditWrap{
height: 100%; background: #f8f8f8;
:global(.am-tabs-tab-bar-wrap){
height: .6rem;
}
:global(.am-tabs-default-bar-tab){
padding:0; font-size: .17rem; color:#ABABAB;
&:after{ display:none !important;}
}
:global(.am-tabs-default-bar-tab-active){
color:#101010; font-size: .17rem;
}
:global(.am-tabs-default-bar-underline){
border-color:#FF9D5C; border-width: .02rem;
}
.noData {
padding-top: 2.25rem;
text-align: center;
padding-bottom: 2rem; font-size: .15rem; color:#666;
.img {
margin: 0 auto .2rem;
width: 1.5rem;
height: 1.3rem;
background: url('../../assets/image/clientless.png') no-repeat;
background-size: 100%;
}
}
}
.managerItem{
display:flex;
justify-content: space-between;
.name{
width: .8rem; margin-left: .11rem; overflow: hidden;
text-overflow: ellipsis;height: .5rem; white-space: nowrap; margin-right: .1rem;
}
.time {
margin-right: .3rem;
}
}
.clientItem {
display:flex;justify-content: space-between;
.name{
width: .8rem; margin-left: .11rem; overflow: hidden;
text-overflow: ellipsis;height: .5rem; white-space: nowrap; margin-right: .1rem;
}
.time{
margin-right: .3rem;
}
.status{
width: .72rem; height: .24rem; line-height: .24rem; font-size: .13rem; color:#fff; border-radius: .12rem; background:#DADADA;
margin-top: .12rem; margin-right: .3rem; text-align: center;
}
}
.infoBox{
:global(.am-modal-body) {
background:#F8F8F8;
}
}
.clientInfoBox {
position: fixed;
width: 100%;
height:100%;
overflow: hidden;
background: #fff;
left:0;
top:0;
.itemBox{
margin-top:.1rem; background:#fff;
li{
font-size:.15rem; color:#101010; line-height: .5rem; border-bottom:1px solid #f8f8f8; text-align: left;
box-sizing: border-box; padding-left:.25rem; padding-right:.1rem; display:flex;
.label{
width:1.23rem; position: relative;
}
.value{
color:#000; line-height: .21rem; margin: .15rem 0 .14rem;
}
&.require{
position: relative;
&:before{
position: absolute; left: .1rem; top:0; content:'*'; color:#FF2654;
}
}
}
}
.clientLabels{
background: #f8f8f8;
.tit{
position: relative; margin:0 .11rem; height: .21rem; line-height: .21rem; margin-top: .3rem;
&:before{
position: absolute; width: 100%; height: 0; overflow: hidden; border-top: 1px dashed #999; top: .11rem;left:0; content:''; z-index: 1;
}
span{
position: absolute; width: .92rem; text-align: center; left:50%; margin-left: -.46rem; top:0; height: .21rem; background: #f8f8f8; z-index: 4; color:#101010; font-size: .15rem;
}
}
.labels{
display: flex; padding: 0 .05rem; margin-top: .1rem; margin-bottom: .22rem;flex-wrap: wrap;
span{
display:block; padding: .08rem .19rem; background:#FB5150; color:#fff; font-size:.16rem; margin: .05rem; border-radius: .05rem; flex-shrink: 0;
}
}
}
}
.footer {
position: fixed;
height: 10vh;
font-size: .15rem;
background: #fff;
width: 100%;
left: 0;
bottom: 0;
z-index: 99999;
.btn_reject {
position: absolute;
right: .92rem;
top: .09rem;
color: #FF9D5C;
border: 1px solid #FF9D5C;
border-radius: .04rem;
text-align: center;
line-height: .4rem;
width: .75rem;
box-sizing: border-box;
}
.btn_passed {
position: absolute;
right: .11rem;
top: .09rem;
border: 1px solid #FF9D5C;
border-radius: .04rem;
text-align: center;
line-height: .4rem;
width: .75rem;
box-sizing: border-box;
background: #FF9D5C;
color: #fff;
}
}
.choose>span {
float: none !important;
}
.label{
margin-right: 0;
}
:global(.am-list-item .am-input-control input:disabled){
color: #000 !important;
opacity: 1;
-webkit-opacity:1;
-webkit-text-fill-color: #000;
}
\ No newline at end of file \ No newline at end of file
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.box{
width: 100%;
height: 100%;
background: #f8f8f8;
overflow-y: scroll;
}
/*搜索模块*/
.header{
width: 100%;
max-width: 680px;
background-color: white;
}
.search{
position: relative;
width: 100%;
padding: .1rem .17rem;
z-index: 10;
top: 0;
}
.search::before {
position: absolute;
width: .15rem;
height: .15rem;
content: '';
background: url(../../assets/image/search.png) no-repeat;
background-size: 100%;
left: .35rem;
top: .19rem;
z-index: 10;
}
.search input{
box-sizing: border-box;
width: 100%;
border: none;
border-radius: .16rem;
background: #F4F4F4;
height: .32rem;
line-height: .32rem;
padding: 0;
padding-left: .42rem;
font-size: .14rem;
}
/*content*/
.content{
position: relative;
width: 100%;
background-color: #F8F8F8;
/* padding-top: 16px; */
padding-bottom: .9rem;
}
.content > .banner{
width:3.92rem;
height:1.8rem;
/*background-color: #FF9D5C;*/
border-radius:.12rem;
overflow: hidden;
margin: 0 auto;
}
.content > .banner :global(ul.slider-list){
height:1.4rem !important;
}
.content > .banner :global(.ant-carousel .slick-dots){
position: absolute;
/*bottom: 50px;*/
}
/* UI的1.6倍*/
/*nav*/
.nav{
display: flex;
font-size: 0.18rem;
margin: .2rem 0;
flex-wrap: wrap;
}
.module{
text-align: center;
/* flex: 1; */
width: 25%;
margin-bottom: 0.15rem;
}
.module>img{
width: .5rem;
height: .5rem;
}
.module>p{
margin: 0;
color: #666666;
font-size: .13rem;
}
/*计划书列表*/
.planList{
width: 3.92rem;
background-color: white;
/* border-radius: 16px; */
margin: 0 auto .4rem ;
}
.planList > div >p {
font-size:.16rem;
color: #999999;
padding: .15rem 0 0 .1rem;
}
.item{
height: 1rem;
}
.left{
margin: 0 .1rem 0;
width: .8rem;
height: .8rem;
float: left;
}
.left>img{
width: 100%;
height: 100%;
}
.right{
width: 2.9rem;
height: .8rem;
float: right;
position: relative;
}
.top{
position: relative;
}
.title{
display: inline-block;
float: left;
font-size: .17rem;
color: #333333;
}
.orangeSpan{
float: right;
margin-right: .1rem;
}
.orangeSpan>img{
width: .34rem;
height: .18rem;
}
.redSpan{
float: right;
}
.redSpan>img{
width: .34rem;
height: .18rem;
}
.blueSpan{
float: right;
margin-right: .1rem;
}
.blueSpan>div{
background-color: #8ec5f3;
font-size: .15rem;
width: .4rem;
height: .2rem;
line-height: .2rem;
margin-top: .03rem;
text-align: center;
color: white;
border-radius: 5px;
transform: scale(0.9);
}
.label{
display: inline-block;
float: right;
height: 0;
position: absolute;
top: 0;
right: 0;
}
.planList span{
margin-right: .1rem;
float: right;
}
.labelImg{
width: .34rem;
}
.buttom{
position: absolute;
bottom: 0px;
color: #888888;
font-size: .14rem;
height: .3rem;
line-height: 0px;
width: 100%;
border-bottom: 1px solid #F8F8F8;
}
.noMore{
width: 3.9rem;
height: .6rem;
background-color: white;
border-radius: 10px;
}
.noMore>div{
margin-top: .1rem;
}
.noMore>div>img{
width: .21rem;
height: .17rem;
}
.noMore>div>span{
font-size: .15rem;
color: #ABABAB;
float: none;
margin-left: .1rem;
}
.noMore>div{
text-align: center;
}
.noMore >.line{
text-align: center;
width: 1.5rem;
height: .02rem;
border-radius: 2px;
background-color: black;
margin-top: .2rem;
}
.code{
position: relative; background: #fff; overflow: hidden; font-size: .17rem; padding: 0 .1rem .1rem;
border-radius: .1rem; font-size: .15rem;
}
.code img {
display: block; width: 100%;margin: .2rem auto;
}
.codeWrap{
/* background:#FF9D5C; */
}
:global(.codeWrap .am-modal-transparent .am-modal-content){
padding:0;
}
:global(.am-modal-close){
top: .1rem; right: .24rem; width: .15rem; height: .15rem;
}
:global(.am-modal-close-x){
width:.15rem; height: .15rem; background-size: 100%; margin:0;
}
:global(.am-wingblank.am-wingblank-lg){
margin: 0;
}
/*消息中心*/
.infolist{
display: flex;
width: 3.92rem;
background-color: white;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
border-bottom: 1px solid #F8F8F8;
margin: 0 auto;
}
.infolist .carousel_item {
height: 36px;
line-height: 36px;
padding-left: 10px;
background-color: white;
color: #000000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.infolist .newInfo{
position: relative;
color:#FB5150;
float: none;
margin: 0;
}
.infolist .arrowBtn{
width:.6rem;
line-height:36px;
text-align: right;
padding-right: .08rem;
}
/*站内搜索*/
.searchWarp{
width:100%;
height:100%;
}
.searchWarp .searchContent{
width: 100%;
height: calc(100vh - 44px);
}
.searchWarp .tabsContent{
display: flex;
justify-content: center;
background-color: #fff;
height: calc(100vh - 120px);
overflow-y: auto;
position: relative;
}
.searchWarp .tabsContent .tipsRight1{
background: url("../../assets/image/tips1.png");
background-size: cover;
}
.searchWarp .tabsContent .tipsRight2{
background: url("../../assets/image/tips2.png");
background-size: cover;
}
.searchWarp .tabsContent .tipsRight3{
background: url("../../assets/image/tips3.png");
background-size: cover;
}
.searchWarp .tabsContent .tipsRight4{
background: url("../../assets/image/tips4.png");
background-size: cover;
}
.searchWarp .tabsContent .tipsRight5{
background: url("../../assets/image/tips5.png");
background-size: cover;
}
.searchWarp .tabsContent .tipsRight1,.tipsRight2,.tipsRight3,.tipsRight4,.tipsRight5{
color: white;
display: inline;
padding: 5px;
border-radius: 10px;
font-size: 12px;
}
.searchContent .tabsHeader{
background: white;
padding: 10px 8px;
}
.searchContent .tabsHeader>button{
border-radius: 16px;
line-height: 24px;
padding: 5px 16px;
border: none;
background: white;
margin: 5px 8px;
cursor: pointer;
color: #101010;
border: 1px solid #e8e8e8;
font-size: .175rem;
box-shadow: 0px 0px 5px #e8e8e8;
}
.searchContent .tabsHeader>button.active{
color: white;
background: #FF9D5C
}
.searchWarp :global(.am-list-line){
padding: 8px 10px;
}
.searchWarp .search {
position: relative;
display: flex;
padding: .1rem .17rem;
background: white;
}
.searchWarp .search::before {
position: absolute;
width: .15rem;
height: .15rem;
content: '';
background: url(../../assets/image/search.png) no-repeat;
background-size: 100%;
left: .35rem;
top: .19rem;
z-index: 10;
}
.searchWarp .search input{
box-sizing: border-box;
width: 100%;
border: none;
border-radius: .16rem;
background: #F4F4F4;
height: .32rem;
line-height: .32rem;
padding: 0;
padding-left: .42rem;
font-size: .14rem;
}
.searchWarp .search .cancelButton{
font-size: .16rem;
color: #101010;
width: .5rem;
padding: .05rem 0 0 .05rem;
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react'
import { connect } from 'dva'
import { Modal, Toast, NoticeBar, WhiteSpace,Carousel } from 'antd-mobile';
import {Icon } from 'antd';
import Swiper from "../../components/Swiper/index"
import BottomNav from "../../components/BottomNav/index"
import ExpertVideo from '../expertVideo/index'
import styles from './Home.css'
import { routerRedux } from 'dva/router';
import shareHide from "../../utils/shareHide";
import Iscroll from "../../components/Iscroll";
import $ from "jquery";
import {urlGetParams} from "../../utils/dataFilter";
class Home extends Component {
constructor(props){
super(props)
this.state={
planList:[],
moduleList:[
{
img:require('../../assets/image/myUser.png'),
text:'我的客户',
url:'myUser'
},
{
img:require('../../assets/image/projectPlan.png'),
text:'计划书',
url:'prospectusList'
},
{
img:require('../../assets/image/poster.png'),
text:'海报',
url:'poster'
},
{
img:require('../../assets/image/dataBank.png'),
text:'资料库',
url:'databank'
},
{
img:require('../../assets/image/invitation.png'),
text:'邀请函',
url:'invitation'
},
{
img:require('../../assets/image/busunessCard.png'),
text:'名片',
url:'businessCard'
},
{
img:require('../../assets/image/hydt.png'),
text:'行业动态',
url:'industrynews'
}
],
moduleList1:[
{
img:require('../../assets/image/projectPlan.png'),
text:'计划书',
url:'prospectusList'
},
{
img:require('../../assets/image/poster.png'),
text:'海报',
url:'poster'
},
{
img:require('../../assets/image/myUser.png'),
text:'我的客户',
url:'governortraining/audit',
},
{
img:require('../../assets/image/dataBank.png'),
text:'资料库',
url:'databank'
},
{
img:require('../../assets/image/invitation.png'),
text:'邀请函',
url:'invitation'
},
{
img:require('../../assets/image/busunessCard.png'),
text:'名片',
url:'businessCard'
},
{
img:require('../../assets/image/hydt.png'),
text:'行业动态',
url:'industrynews'
}
],
select:0,
navTitle: "华夏O2O智慧工作平台",
chooseExpert: false,
showChoosePop: false,
userOpenId:'', //微信号
publicOpenId:'', //公众号
phoneNum:'', //手机号码
stream: null,
swiperList: [], //轮播图
roleId: '',
hasRoom: false,
isCodeShow: false,
infolist:null,//系统消息
loadingFlag:true,
}
this.handleClose = this.handleClose.bind(this);
this.handleShowExpert = this.handleShowExpert.bind(this);
this.handleFeedback = this.handleFeedback.bind(this);
this.handleShowChoosePop = this.handleShowChoosePop.bind(this);
}
history = (index,item)=>{
if(item.url === "businessCard"){
let number = localStorage.getItem("number");
let project = localStorage.getItem("project");
let website = localStorage.getItem("website");
let orgId = localStorage.getItem("orgId");
let id = localStorage.getItem("id");
window.location.href = window.location.href.split('#')[0] + '#/businessCard?number=' + number + '&project=' + project + '&website=' + website + '&orgId=' + orgId +'&id='+id;
}else{
this.props.history.push("/" + item.url);
}
}
goGtclientlist=()=>{
this.props.history.push("/governortraining/gtclientlist")
}
goPerformance =()=>{
this.props.history.push('/home/myCenter')
}
handleClose() {
this.setState({
chooseExpert: false
})
}
handleShowExpert(e) {
this.setState({
chooseExpert: true
})
}
handleFeedback(id) {
this.setState({
showChoosePop: false,
chooseClientId: id
})
}
handleShowChoosePop(e) {
e.preventDefault();
this.props.dispatch(routerRedux.push('/video/chooseclient'))
}
goPlan =(item)=>{
let storage = window.localStorage;
storage.setItem("riskName",item.riskName)
storage.setItem("riskCode",item.riskCode)
storage.setItem("calculationMethod",item.calculationMethod)
storage.setItem("selectd",1)
storage.setItem("seriNo",'')
//storage.setItem("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
//storage.setItem("recipientsName",'')
window.location.href = window.location.href.split('#')[0] + '#/addplaneditor?riskName=' + item.riskName + '&riskCode=' + item.riskCode + '&calculationMethod=' + item.calculationMethod + '&riskIntroduce=&thumbnail=' + item.thumbnail +'&selectd=1&roleId='+localStorage.getItem("roleId") +'&Id='+ localStorage.getItem('id')+'&seriNo='
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
sessionStorage.clear();
shareHide();
if(!this.props.location.query){
Toast.loading('loading...',0);
}
const that = this;
let url = window.location.href;
const params = urlGetParams(window.location.href);
let userOpenId = ''
let publicOpenId = '';
let phoneNum = '';
if (params.userOpenId) {
userOpenId = params.userOpenId;
publicOpenId = params.publicOpenId;
phoneNum = params.phoneNum;
this.setState({
userOpenId, //微信号
publicOpenId, //公众号
phoneNum //手机号码
})
}
//在缓存中查找一边,解决从其他页面返回此页面时,发接口事件过长,moduleList显示默认值
if (window.localStorage.getItem('roleId') == '3') {
this.setState({
moduleList: this.state.moduleList1,
})
}
//localStorage.clear();
this.props.dispatch({
type:'home/getCustomerInfo',
payload: {"phoneNum":phoneNum||localStorage.getItem("number")},
callback(data) {
let userInfo = data.userInfo
let storage = window.localStorage;
that.setState({
roleId: userInfo.roleId
})
if (userInfo.roleId != '2') {//如果不是客户经理 就显示督训的页面
that.setState({
moduleList: that.state.moduleList1,
})
}
storage.setItem("id",userInfo.id) //id
storage.setItem("roleId",userInfo.roleId) //角色
storage.setItem("number",userInfo.number) //手机号
storage.setItem("name",userInfo.name) //名字
storage.setItem("public_id",userInfo.public_id) //公众号
storage.setItem("weixin_id",userInfo.weixin_id) //微信号
storage.setItem("superiorid", userInfo.superiorid) //上级用户id
storage.setItem("orgId", userInfo.orgId ? userInfo.orgId : '') //机构id
storage.setItem("project", userInfo.project ? userInfo.project:'') //项目id
storage.setItem("website", userInfo.website ? userInfo.website:'') //网点id
storage.setItem("userInfo",JSON.stringify(userInfo)); //用户信息
/* 轮播消息列表 ,放在次数查因为 用到id 此接口id必须有值*/
that.props.dispatch({
type: 'infoCenter/GetInformationsList',
payload: {
"roleId":userInfo.roleId,
"id":userInfo.id
},
callback(res) {
that.setState({
infolist: res
})
},
error(err) {
Toast.error(err.message)
}
})
that.getOtherData(userInfo);
}
})
}
getOtherData(userInfo) {
const _this = this;
this.props.dispatch({
type: 'home/getRoomList',
payload: {
index: 0
},
callback(data) {
_this.setState({
hasRoom: data.rooms.length > 0
})
}
})
// 选取的客户
if (this.props.location.query) {
const { query: { chosenClient } } = this.props.location;
const id = userInfo.id || null;
let clientNum = '';
Toast.loading('loading...');
if (chosenClient) {
clientNum = '__'+chosenClient.number;
}
this.props.dispatch({
type: 'getcode/getCodeUnlimit',
payload: {
scene: id + clientNum
},
callback(res) {
if (res.data.status) {
Toast.hide();
_this.setState({
isCodeShow: true,
chooseExpert: false,
stream: res.data.data
})
}
}
});
}
/* 计划书接口 */
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1启用
"proId":userInfo.project || null,
"website":userInfo.website || null,
"orgId":userInfo.orgId || null,
},
callback(data){
_this.setState({
planList:data,
loadingFlag:false,
})
Toast.hide();
},
})
}
static getDerivedStateFromProps(props, state){
return null
}
componentDidUpdate(){
if(this.inputSearch){
$('#searchqqq').on('focus',()=>{
console.log('onfocus--')
this.props.history.push({pathname:'/search'})
})
}
}
componentWillUnmount(){
document.title = '';
}
gotoInfoCenter=(e)=>{
e.preventDefault();
let userInfo = JSON.parse(localStorage.getItem("userInfo"));
if(userInfo.roleId == 3){
this.props.history.push('/infocenter')
}else{
this.props.history.push({pathname:'/infocenter/list',search:'sign=2'})
}
}
render() {
let infoItem = [],list = [];
let haveNewInfo = false;//消息列表中有没有新消息
if(this.state.infolist){
list = (this.state.infolist).DATABASE;
haveNewInfo = (this.state.infolist).READ == "0" ? true : false;
}
if(list.length>0){
list.map((item,index)=>{
infoItem.push(
<div className={styles.carousel_item} key={item.id}>{item.messageHeader}</div>
);
if(String(item.viewStatus) == "0"){
haveNewInfo = true;
}
})
}
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={styles.box}>
<Iscroll id="home"
iscrollOptions={{
probeType:2
}}>
<div className={styles.content}>
<div className={styles.search}>
<input placeholder={"输入关键字"} id="searchqqq" ref={ref => this.inputSearch = ref} />
</div>
<div className={styles.banner}>
<Swiper swiperList={this.state.swiperList} />
</div>
<div className={styles.nav}>
{
this.state.moduleList.map((item,index)=>{
return (
<div className={styles.module} key={index} onClick={()=>{
this.history(index,item)
}}>
<img src={item.img} alt=""/>
<p>{item.text}</p>
</div>
)
})
}
</div>
<div className={styles.infolist}>
<div style={{width:'1.2rem',lineHeight:"36px",fontSize:'.14rem'}}> <img src={require("../../assets/image/notice.png")} style={{color:"#666666",margin:"-3px 5px 0 8px",width: '.2rem'}} /> 系统消息:</div>
<div style={{width:'2.5rem'}}>
{
infoItem.length>0 ? (
<Carousel vertical
dots={false}
dragging={false}
swiping={false}
autoplay
infinite>
{infoItem}
</Carousel>
) : <div className={styles.carousel_item} key="info">当前无最新消息!</div>
}
</div>
<div className={styles.arrowBtn} onClick={(e)=>{this.gotoInfoCenter(e)}}>
{haveNewInfo && <span className={styles.newInfo}>新</span>}
<Icon type="right" />
</div>
</div>
{
this.state.planList.length>0 &&<div className={styles.planList}>
<div>
<p>推荐计划书</p>
</div>
{
this.state.planList.map((item,index)=>{
return(
<div className={styles.item} key={index} onClick={()=>this.goPlan(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 == '新品' || ite == '热门' ? (ite == '新品' ? styles.orangeSpan:styles.redSpan) : styles.blueSpan}>
{ ite =='新品' && <img src={require("../../assets/image/label-newProduct.png")} alt=""/>}
{ ite =='热门' && <img src={require("../../assets/image/label-hot.png")} alt=""/>}
{ (ite !='新品' && ite !='热门') && <div><b style={{fontWeight:'lighter'}}>{ite}</b></div> }
</span>
)
})}
</div>
<div className={styles.buttom}>
{item.riskIntroduce}
</div>
</div>
</div>
)
})
}
<div className={styles.noMore}>
<div><img src={require('../../assets/image/no-more.png')} alt=""/>
<span>没有更多啦</span>
</div>
{/*<div className={styles.line}></div>*/}
</div>
</div>
}
</div>
</Iscroll>
<BottomNav handleShowExpert={this.handleShowExpert} hasRoom={this.state.hasRoom} roleId={this.state.roleId} goGtclientlist = {this.goGtclientlist} goPerformance = {this.goPerformance}/>
<ExpertVideo
show={this.state.chooseExpert}
handleShowChoosePop = {
this.handleShowChoosePop
}
handleNoneClient={() => {
const _this = this;
const id = window.localStorage.getItem('id');
Toast.loading('loading...');
this.props.dispatch({
type: 'getcode/getCodeUnlimit',
payload: {
scene:id
},
callback(res) {
if (res.data.status) {
Toast.hide();
_this.setState({
isCodeShow: true,
chooseExpert: false,
stream: res.data.data
})
}
}
});
}}
handleClose = {
this.handleClose
}
/>
<Modal
closable
transparent
className={styles.codeWrap}
onClose={()=>{this.setState({isCodeShow:false})}}
visible = {this.state.isCodeShow}
>
<div className={styles.code}>
<img src={this.state.stream} alt='' />
<div>长按识别二维码进入在线咨询</div>
</div>
</Modal>
</div>
)
}
}
Home.propsTypes = {}
export default connect()(Home)
import React from 'react';
import { connect } from 'dva'
import { SearchBar, Button, Tabs ,List ,Toast} from 'antd-mobile';
import styles from './Home.css'
import shareHide from "../../utils/shareHide";
import NoData from "../../components/NoData";
import $ from 'jquery';
import { routerRedux } from 'dva/router';
const Item = List.Item;
const { TabPane } = Tabs;
const tabs = [
{ title: '全部', sub: '1' },
{ title: '资料库', sub: '2' },
{ title: '行业动态', sub: '3' },
];
class Index extends React.Component{
constructor(props) {
super(props);
this.state = {
searchValue: "",
allList:null,
currentTab:"1",//默认全部
inputType:'',
isFirst:true,
}
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
shareHide();
let that= this;
let searchObj = sessionStorage.getItem("searchObj") ? JSON.parse(sessionStorage.getItem("searchObj")) : null;
if(searchObj){
this.setState({searchValue:searchObj.value,currentTab:searchObj.tab},()=>{
this.getAllData(searchObj.value,searchObj.tab);
})
}else {
this.getAllData("","1");
}
$('#inputElem').focus();
//监听手机键盘输入的内容,输入汉字还是其他的
$('#inputElem').on('compositionstart', function () {
that.setState({inputType:'字母'})
});
$('#inputElem').on('compositionend', function (e) {
that.setState({inputType:'汉字'})
that.getAllData(that.state.searchValue,that.state.currentTab);
});
}
componentWillUnmount(){
document.title= ''
$('#inputElem').off('compositionstart');
$('#inputElem').off('compositionend');
}
//获取查询的结果
getAllData = (key,type) =>{
let that = this;
let otherKey={};
if(type === "1"){
otherKey.searchType = "102"
if(key === ''){
otherKey.searchType = "101"
}
}
if(type === "2"){
otherKey.searchType = "100100"
}
if(type === "3"){
otherKey.searchType = "100110"
}
Toast.loading('loading...',0);
this.props.dispatch({
type: 'home/getSearchList',
payload: {
"key":key,
...otherKey
},
callback(res) {
let data = res || [];
that.setState({
allList: data,
isFirst: key !== "" ? false : true
})
Toast.hide();
},
error(err) {
Toast.error(err.message)
}
})
}
onChange= (value) => {
this.setState({ searchValue:value });
//this.setState({ isFirst: value !== "" ? false : true });
if(this.state.inputType){
if(this.state.inputType == '汉字'){
this.getAllData(value,this.state.currentTab);
}
}else{
this.getAllData(value,this.state.currentTab);
}
}
goTargetPage =(item) =>{
console.log('goTargetPage----->',item)
let searchType = item.searchType + "";
if(searchType === '100100'){//资料库
if(item.dataPath){
let type = 'pdf';
switch (item.dataFormat.toLowerCase()) {
case 'pdf':
type = 'pdf';
break;
case 'mp4':
type = 'video';
break;
default:
type = '';
break;
}
if(/doc|docx/i.test(item.dataFormat)) type = 'word';
if(/ppt|pptx/i.test(item.dataFormat)) type = 'ppt';
if(/png|jpg|gif/i.test(item.dataFormat)) type = 'img';
if(/xls|xlsx/i.test(item.dataFormat)) type = 'excel';
if (type === 'pdf') {
window.location.href = item.dataPath
} else if (/doc|docx|xls|xlsx|ppt|pptx/i.test(item.dataFormat)) {
window.location.href = 'https://view.officeapps.live.com/op/view.aspx?src=' + item.dataPath
} else {
this.props.dispatch(routerRedux.push({
pathname: '/databank/preview',
state: {
url:item.dataPath
},
}));
}
}
}
if(searchType === '100110'){//行业动态
this.props.history.push({ pathname: "/industrynews/detail", search: 'id=' + item.id });
}
sessionStorage.setItem("searchObj",JSON.stringify({tab:this.state.currentTab,value:this.state.searchValue}))//跳转的时候先缓存下来
}
clickTab = (tab) =>{
console.log('clickTab', tab.sub);
let value = this.state.searchValue;
this.setState({ currentTab:tab.sub });
this.getAllData(value,tab.sub);
sessionStorage.setItem("searchObj",JSON.stringify({tab:this.state.currentTab,value:this.state.searchValue}))
}
_extraContent(item){
return(
<div><span className={item.dataType ? styles["tipsRight"+item.dataType] : styles.tipsRight5}>{item.dataTypeName}</span></div>
)
}
render() {
const {allList,currentTab,searchValue,isFirst} = this.state;
const content=(
<div onClick={()=>{this.goTargetPage()}}>资料</div>
);
let tab = this.state.currentTab -1;//页签默认展示的值
return (
<div className={styles.searchWarp}>
<div className={styles.search}>
<input
onChange={(e) => {
this.onChange(e.target.value);
}}
value={this.state.searchValue}
type="search"
id="inputElem"
ref={ref => this.autoFocusInst = ref}
placeholder={"请输入关键字"} />
<div className={styles.cancelButton} onClick={()=>{this.props.history.go(-1)}}>取消</div>
</div>
<div className={styles.searchContent}>
<div className={styles.tabsHeader}>
{tabs.map((item,index)=>{
return <button className={tab === index ? styles.active : ""} key={item.sub} onClick={()=>{this.clickTab(item)}}>{item.title}</button>
})}
</div>
<div className={styles.tabsContent}>
{allList !== null &&(
allList.length>0 ? <List style={{width:'100%'}}>
{allList.map((item,index)=>{
return <Item key={index} extra={this._extraContent(item)} onClick={()=>{this.goTargetPage(item)}}>{item.dataName}</Item>
})}
</List> : <NoData />
)
}
</div>
</div>
</div>
)
}
}
export default connect(({home})=>({home}))(Index);
\ No newline at end of file \ No newline at end of file
.wrap {
height: 100%; background: #F8F8F8; overflow-y: auto;
-webkit-overflow-scrolling: touch;
dl,dt,dd{
margin:0; padding: 0;
}
.system{
display: flex; height: .8rem; background: #fff;
dt{
width: .5rem; height: .5rem; background: url(../../assets/image/icon_Infosystem.png) no-repeat;
background-size: 100%; margin-top: .15rem; margin-left: .12rem; flex-shrink: 0;
}
dd{
flex: 1; margin-left: .15rem; margin-right: .11rem; width: 3.2rem;
.title{
display: flex; justify-content: space-between;
}
.tit{
color:#333; font-size: .17rem; line-height: .24rem; margin-top: .15rem; padding-right: .12rem;
}
.unread{
position: relative;
&:after{
position: absolute; right:0; top:.09rem; width: .06rem; height: .06rem; background:#FB5150; border-radius: 50%; content: '';
}
}
.time{
color:#B6B6B6; font-size: .13rem; line-height: .24rem; margin-top: .16rem; margin-right: 0;
}
.infoTit {
font-size: .14rem; color:#666; line-height: .24rem; height: .24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.noneInfo{
color:#999;
}
}
}
.custom{
margin-top: .1rem;
dt{
width: .5rem; height: .5rem; background: url(../../assets/image/icon_Infocustom.png) no-repeat;
background-size: 100%; margin-top: .15rem; margin-left: .12rem;
}
}
}
.noInfo{
background: url(../../assets/image/clientless.png) center center no-repeat; background-size: 40%;
position: relative;
&:after{
position: absolute; left: 0; top: 62%; content: '暂无数据'; color: rgb(102, 102, 102); width: 100%; text-align: center; font-size: .15rem;
}
}
.listItm{
.infoTime{
color:#ABABAB; font-size: .13rem;line-height: .24rem; padding: .08rem 0 .07rem; text-align: center;
}
.infoContent{
background:#fff; border-radius: .06rem; margin: 0 .1rem;
.tit{
font-size: .17rem; line-height: .24rem; color:#333; padding: .1rem .12rem;
}
dl{
display: flex;
dt{
width:.68rem; height: .68rem; margin-left:.08rem; margin-right: .08rem; flex-shrink: 0; margin-bottom: .12rem;
}
.product{
background: url(../../assets/image/icon_pdt.png) no-repeat; background-size: 100%;
}
.system{
background: url(../../assets/image/icon_sys.png) no-repeat; background-size: 100%;
}
.activity{
background: url(../../assets/image/icon_act.png) no-repeat; background-size: 100%;
}
.customer{
background: url(../../assets/image/icon_new.png) no-repeat; background-size: 100%; width: .6rem; height: .6rem;
}
dd{
color:#666; font-size: .14rem; line-height: .24rem; margin-right:.12rem;
}
}
}
dl{
}
}
import React, { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Toast } from 'antd-mobile';
import moment from 'moment';
import shareHide from "../../utils/shareHide";
import css from './css.less';
class Index extends Component{
constructor(props) {
super(props);
this.state = {
userId: '',
list: []
}
}
componentDidMount() {
document.title = '信息中心';
const _this = this;
shareHide();
const userId = localStorage.id;
this.setState({
userId
})
Toast.loading('loading...',1000)
this.props.dispatch({
type: 'infoCenter/GetInfoList',
payload: {
roleId: 3,
userId
},
callback(res) {
_this.setState({
list:res
})
Toast.hide();
},
error(err) {
Toast.error(err.message)
}
})
}
render() {
const { list } = this.state;
return <div className={css.wrap}>
{
list.length===2 && <Fragment>
<dl className={css.system} onClick={() => {
this.props.history.push({ pathname:'/infoCenter/list', search:'sign=1'})
}}>
<dt></dt>
<dd>
<div className={css.title}>
<span className={css.tit + ' ' + (list[0].read !== '1' && css.unread)}>系统消息</span>
{
list[0].messageHeader !== '暂无消息' && <span className={css.time}>{moment(list[0].updateTime).format('YYYY-MM-DD HH:mm')}</span>
}
</div>
<div className={css.infoTit + ' ' + (list[0].messageHeader === '暂无消息' && css.noneInfo)}>{list[0].messageHeader}</div>
</dd>
</dl>
<dl className={css.system + ' ' + css.custom} onClick={() => {
this.props.history.push({ pathname: '/infoCenter/list', search: 'sign=2'})
}}>
<dt></dt>
<dd>
<div className={css.title}>
<span className={css.tit + ' ' + (list[1].read !== '1' && css.unread)}>客户提醒</span>
{
list[1].messageHeader !== '暂无消息' && <span className={css.time}>{moment(list[1].updateTime).format('YYYY-MM-DD HH:mm')}</span>
}
</div>
<div className={css.infoTit + ' ' + (list[1].messageHeader === '暂无消息' && css.noneInfo)}>{list[1].messageHeader}</div>
</dd>
</dl>
</Fragment>
}
</div>
}
}
export default connect()(Index);
import React, { Component } from 'react';
import { connect } from 'dva';
import { Toast } from 'antd-mobile';
import moment from 'moment';
import shareHide from "../../utils/shareHide";
import css from './css.less';
class InfoList extends Component{
constructor(props) {
super(props);
this.state = {
userId: '',
isloading: true,
infolist: []
}
}
componentDidMount() {
document.title = '信息中心';
const _this = this;
shareHide();
Toast.loading('loading...', 1000);
const userId = localStorage.id;
const roleId = localStorage.roleId;
this.setState({
userId
})
const { search } = this.props.location;
let subData = { roleId };
if (search) {
const sign = search.substr(6);
if (roleId === '3') {
if (sign === '1') {
subData.supervisionId = userId;
subData.requestType = 'system';
}
if (sign === '2') {
subData.supervisionId = userId;
subData.requestType = 'customer';
}
}
}
this.props.dispatch({
type: 'infoCenter/GetSubInfoList',
payload: {
...subData,
orgId:localStorage.getItem('orgId')
},
callback(res) {
_this.setState({
infolist: res,
isloading: false
}, () => {
Toast.hide();
})
},
error(err) {
Toast.error(err.message)
}
})
}
render() {
const { infolist,isloading } = this.state;
return <div className={css.wrap+' '+(infolist.length===0 && !isloading?css.noInfo:'')}>
{
infolist.length>0 && infolist.map((itm,index) => {
return <div key={index} className={css.listItm}>
<div className={css.infoTime}>{moment(itm.updateTime).format('YYYY-MM-DD HH:mm:ss')}</div>
<div className={css.infoContent}>
<div className={css.tit}>{itm.messageHeader}</div>
<dl>
<dt className={css[itm.infoType]}></dt>
<dd>{itm.notification}</dd>
</dl>
</div>
</div>
})
}
</div>
}
}
export default connect()(InfoList);
import React, { Component } from 'react';
import { connect } from 'dva';
import { Modal,InputItem, DatePicker, TextareaItem, Button,Toast } from 'antd-mobile';
import moment from 'moment';
import shareHide from "../../utils/shareHide";
import { Map } from 'react-bmap';
import $ from 'jquery';
import css from './css.less';
class AddEdit extends Component{
constructor(props) {
super(props);
this.state = {
userId: null,
nickname:'',
name: { value: '', error: false },
nameOfActivity: {value:'',error: false},
date: new Date(),
address: { value: '', error: false, point: null },
activityCity: '', // 城市
activityAdress:'',//具体地点
activityAdressError:false,//城市必填
phone: { value: '', error: false },
zoom: 11,
content: { value: '', error: false },
unit: '',
locationVisible: false,
searchPointList: [],
showdownlist: 'none',
invitationId: '',
id: '',
judegeId:0,
updateTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
locationSite: {
city: '',
site: '',
point: {},
detail: ''
},
ModalHeight:null,//定位弹框高度
}
}
map = null;
componentDidMount() {
document.title = '邀请函';
const invitationInfo = sessionStorage.getItem('invitationInfo') ? JSON.parse(sessionStorage.getItem('invitationInfo')) : null;
shareHide();
const userId = localStorage.id ? localStorage.id : null;
if (invitationInfo) {
if (invitationInfo.linkeName) {
this.setState({
userId,
zoom: 18,
nickname: invitationInfo.named === '贵宾' ? '' : invitationInfo.named,
nameOfActivity: { value: invitationInfo.activityName, error: false },
address: {
value: invitationInfo.activitySite, error: false, point: invitationInfo.specificLocation
},
activityCity: invitationInfo.activityCity,
activityAdress: invitationInfo.activityAdress,
date: new Date(moment(invitationInfo.activityTime)),
name: { value: invitationInfo.linkeName, error: false },
phone: { value: invitationInfo.number, error: false },
content: { value: invitationInfo.essay, error: false },
unit: invitationInfo.invitationMessage,
invitationId: invitationInfo.invitationId,
id: invitationInfo.id,
invitationPath: invitationInfo.invitationPath,
updateTime: invitationInfo.updateTime,
judegeId: invitationInfo.judegeId,
locationSite: {
city: invitationInfo.activityCity,
site: invitationInfo.activitySite,
point: invitationInfo.specificLocation,
detail: invitationInfo.activityAdress
}
})
} else {
this.setState({
userId,
invitationId: invitationInfo.invitationId,
invitationPath: invitationInfo.invitationPath,
address: { value: '', error: false, point: null }
})
}
}
//此处修改安卓手机点击输入框键盘弹出后地图顶出页面无法看到输入框问题
let oHeight = $(document).height(); //浏览器当前的高度
let _this = this;
$(window).resize(function(){
if($(document).height()<oHeight){
_this.setState({ModalHeight:$(document).height()-20})
}else{
_this.setState({ModalHeight:null})
}
});
}
handleShowNewInvt = () => {
this.setState({showAddInvt:true})
}
blur = () => {
let timer = setTimeout(function () {
if (document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA') {
return
}
let result = 'pc';
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
} else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if (result = 'ios') {
document.querySelector('body').scrollIntoView();
}
clearTimeout(timer)
}, 10)
}
handleGetPreview = () => {
const pass = this.checkRules(1);
const { nickname, userId, nameOfActivity, date, address, name, phone, content, unit, invitationId, id, invitationPath, updateTime, judegeId, activityAdress,activityCity } = this.state;
if (pass) {
const inviInfo = {
id,
named: nickname ? nickname : '贵宾',
activityName: nameOfActivity.value,
activitySite: address.value,
activityTime: moment(date).format('YYYY-MM-DD HH:mm'),
linkeName: name.value,
number: phone.value,
essay: content.value,
specificLocation: JSON.stringify(address.point),
invitationMessage: unit,
createName: userId,
invitationId,
invitationPath,
activityAdress: activityAdress,
activityCity: activityCity,
updateTime,
judegeId
}
const _this = this;
this.props.dispatch({
type: 'Invitation/addEdit',
payload: {
...inviInfo
},
callback(res) {
Toast.success(res.message, 2);
_this.props.history.push({ pathname: "/invitation/preview", search:'isprev=t&id='+res.data });
}, error(err) {
Toast.error(err.message, 2);
}
})
}
}
createContent = () => {
const pass = this.checkRules();
const { date, address,activityAdress } = this.state;
if (pass) {
const content = `我们非常荣幸邀请您作为嘉宾出席此次活动,本活动将于${moment(date).format('YYYY-MM-DD HH:mm')} 在${address.value + activityAdress}举行,诚邀您的到来! `;
this.setState({ content:{value:content,error:false} });
}
}
checkRules = (sign) => {
let pass = true;
if (this.state.nameOfActivity.value === '') {
pass = false;
this.setState({nameOfActivity:{value:'',error: true}})
}
if (this.state.address.value === '') {
pass = false;
this.setState({ address: { value: '', error: true } })
}
if (this.state.phone.value.replace(/\s/g, '').length !== 11) {
pass = false;
this.setState({ phone: { value: this.state.phone.value, error: true } })
}
if (sign && this.state.content.value === '') {
pass = false;
this.setState({ content: { value: '', error: true } })
}
if (this.state.name.value === '') {
pass = false;
this.setState({ name: { value: '', error: true } })
}
return pass;
}
handleSearchComplete = (results) => {
if (results) {
this.map.clearOverlays();
let s = [];
for (let i = 0; i < results.getCurrentNumPois(); i++) {
s.push({
name: results.getPoi(i).title,
addr: results.getPoi(i).address,
point: results.getPoi(i).point
})
}
this.setState({ searchPointList: s,showdownlist:'block' })
}
}
render() {
const _this = this;
const { searchPointList, activityAdress,activityCity,address,zoom, locationSite, date } = this.state;
return <div className={css.formWrap}>
<div>
<h3>被邀请人信息<span>(非必填)</span></h3>
<InputItem
clear
maxLength={10}
value={this.state.nickname}
placeholder="如不填则默认“贵宾”"
onBlur={this.blur.bind(this)}
onChange={v => {
this.setState({nickname:v})
}}
>称呼</InputItem>
<h3>活动信息<span>(必填)</span></h3>
<InputItem
clear
maxLength={20}
onBlur={this.blur.bind(this)}
error={this.state.nameOfActivity.error}
value={this.state.nameOfActivity.value}
onChange={v => {
if (v === '') {
this.setState({nameOfActivity: {value: v,error: true}})
} else {
this.setState({nameOfActivity:{value:v,error: false}})
}
}}
placeholder="请输入活动名称"
>活动名称</InputItem>
<DatePicker
value={date}
onChange={date => this.setState({ date })}
>
<div className={css.choosetime}>
<div className={css.choosetimew}><p>活动时间</p><span>{moment(date).format('YYYY-MM-DD HH:mm')}</span></div>
</div>
</DatePicker>
<InputItem
clear
value={this.state.address.value}
maxLength={20}
error={this.state.address.error}
onFocus={() => document.activeElement.blur()}
onBlur={this.blur.bind(this)}
onClick={() => {
this.setState({
locationVisible: true,
locationSite: {
city: activityCity,
site: address.value,
detail: activityAdress,
point: address.point
}
}, () => {
const _this = this;
this.map = new window.BMap.Map("activityMap"); // 创建地图实例
this.map.disableDragging();
this.map.disableDoubleClickZoom();
this.map.disablePinchToZoom();
let point = new window.BMap.Point(116.402544, 39.928216); // 创建点坐标
this.map.centerAndZoom(point, 18);
if (address.point) {
let ppoint = new window.BMap.Point(address.point.lng, address.point.lat); // 创建点坐标
this.map.centerAndZoom(ppoint, 18);
let marker = new window.BMap.Marker(ppoint); // 创建标注
this.map.addOverlay(marker);
}
});
}}
placeholder="请输入活动地点"
>活动地点</InputItem>
<InputItem
clear
error={this.state.name.error}
value={this.state.name.value}
maxLength={5}
onBlur={this.blur.bind(this)}
onChange={v => {
if (v === '') {
this.setState({ name: { value: v, error: true } })
} else {
this.setState({ name: { value: v, error: false } })
}
}}
placeholder="请输入联系人姓名"
>联系人姓名</InputItem>
<InputItem
clear
type='phone'
onBlur={this.blur.bind(this)}
error={this.state.phone.error}
value={this.state.phone.value}
onChange={v=>{
if (v.replace(/\s/g, '').length !== 11) {
this.setState({ phone: { value: v, error: true } })
} else {
this.setState({ phone: { value: v, error: false } })
}
}}
placeholder="请输入联系电话"
>联系电话</InputItem>
<h3>邀请函正文<span>(必填)</span> <div className={css.btnCreate} onClick={this.createContent}>一键生成</div></h3>
<TextareaItem
placeholder="请输入"
prefixListCls="invitation-area"
onBlur={this.blur.bind(this)}
rows={5}
error={this.state.content.error}
value={this.state.content.value}
onChange={v => {
if (v === '') {
this.setState({ content: { value: v, error: true } })
} else {
this.setState({ content: { value: v, error: false } })
}
}}
count={100}
/>
<h3>邀请人信息<span>(非必填)</span></h3>
<InputItem
clear
maxLength={20}
onBlur={this.blur.bind(this)}
value={this.state.unit}
onChange={v=>this.setState({unit:v})}
placeholder="请输入主办方名称"
>人/单位</InputItem>
<div className={css.btnWrap}><div className={css.btnGetPreview} onClick={this.handleGetPreview}></div></div>
</div>
<Modal
className='locatinSelectWrap'
style={{height:this.state.ModalHeight,overflowY:'auto'}}
closable
popup
visible={this.state.locationVisible}
animationType="slide-up"
onClose={() => this.setState({ locationVisible: false, showdownlist: 'none',ModalHeight:null })}
>
<div style={{marginTop:'15px'}}>
<InputItem
clear
className={css.city}
placeholder={locationSite.city ? locationSite.city : "请输入城市(必填)"}
error={this.state.activityAdressError}
onBlur={this.blur.bind(this)}
value={locationSite.city}
onChange={v => this.setState({
locationSite: {
...locationSite,
city:v
}
})}
>城市</InputItem>
</div>
<div className={css.localdownlist}>
<InputItem
clear
onBlur={this.blur.bind(this)}
value = {locationSite.site}
onChange={v => {
const _this = this;
let local = new window.BMap.LocalSearch(locationSite.city,
{
pageCapacity: 8,
onSearchComplete: function (results) {
_this.handleSearchComplete(results);
}
});
this.setState({
locationSite: {
...locationSite,
site: v
}
})
local.search(v);
}}
placeholder={address.value ? address.value : "请输入活动地点"}
>活动地点</InputItem>
<div className={css.downlist}>
<ul style={{display: this.state.showdownlist}}>
{
searchPointList && searchPointList.map((itm,i) => (
<li key={i} onClick={() => {
let marker = new window.BMap.Marker(itm.point);
this.map.addOverlay(marker);
this.map.centerAndZoom(itm.point, 18);
this.setState({
showdownlist: 'none',
locationSite: {
...locationSite,
site: itm.name,
point: itm.point
}
});
}}>
<p style={{color:'#00c'}}>{itm.name}</p>
<p>{itm.addr}</p>
</li>
))
}
</ul>
</div>
</div>
<div className={css.localcity}>
<InputItem
className={css.city}
maxLength={20}
onBlur={this.blur.bind(this)}
value={locationSite.detail}
onChange={v => {
this.setState({
showdownlist: 'none',
locationSite: {
...locationSite,
detail: v
}
});
}}
placeholder={activityAdress ? activityAdress : "街道、楼牌号等"}
>详细地址</InputItem>
<Button className={css.btnSearch} type="primary" size="small" inline onClick={() => {
if(locationSite.city == ""){
this.setState({activityAdressError:true});
return;
}
this.setState({
showdownlist: 'none',
address: {
value: locationSite.site,
point: locationSite.point,
error: false
},
activityAdress: locationSite.detail,
activityCity: locationSite.city,
locationVisible: false,
activityAdressError:false
});
}}>确定</Button>
</div>
<div className={css.map}>
<div id="activityMap"></div>
{/* <Map center={{ ...address.point}} zoom={zoom} ref={ref => {
if (ref) {
this.map = ref.map
ref.map.disableDragging();
}
}} ></Map> */}
</div>
</Modal>
</div>
}
}
export default connect()(AddEdit);
.splitline {
width: 100%;
height: .1rem;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
opacity: 0.1041;
}
.invitationWrap{
height: 100%;
:global(.am-tabs-tab-bar-wrap){
height: .6rem;
}
:global(.am-tabs-default-bar-tab){
padding:0; font-size: .17rem; color:#ABABAB;
&:after{ display:none !important;}
}
:global(.am-tabs-default-bar-tab-active){
color:#101010; font-size: .17rem;
}
:global(.am-tabs-default-bar-underline){
border-color:#FF9D5C; border-width: .02rem;
}
}
.tmpsWrap{
display: flex; flex-wrap: wrap; padding-top:.05rem; padding-left:.1rem;
.itm{
width: 30.8%; height: 2.24rem; margin-bottom: .1rem; margin-right:.1rem; border: 1px solid #ccc;
img{ width: 100%; height:100%; display: block;}
}
}
.mylistWrap{
padding: .05rem .1rem 0; height: calc(100% - .1rem); overflow-y: auto;
.itm{
display: flex; margin-bottom: .1rem;
dt{
width: .8rem; height: .8rem; border-radius: .06rem; overflow: hidden;
img{width: 100%; height: 100%; display: block; }
}
dd{
flex:1; margin-left: .14rem; margin-bottom:0;
border-bottom: 1px solid #f8f8f8;
}
.tit{
font-size: .17rem; color:#333; line-height: .24rem;
}
.updatetime {
color:#666; font-size: .14rem; line-height: .24rem; margin-top: .04rem;
span{float:none;}
}
.operation {
overflow: hidden;
span{ float:right; color: #999; font-size: .13rem; line-height: .24rem; padding-left: .22rem; margin-bottom:.05rem;}
.edit{
margin-right: .3rem; background: url(../../assets/image/icon_edit.png) 0 .03rem no-repeat;
background-size: 36%;
}
.del{
background: url(../../assets/image/icon_del.png) 0 .02rem no-repeat;
background-size: 36%;
}
}
}
}
.formWrap {
height: 100%;
background:#f8f8f8;
overflow-y: auto;
h3{
position: relative; color: #666; font-size: .13rem; line-height: .4rem; height: .4rem; margin:0; padding-left: .11rem; font-weight: normal;
span{ color:#ababab; float:none;}
.btnCreate{
position: absolute; right: .1rem; width:.75rem; height: .26rem; line-height: .26rem; border-radius: .04rem; border: 1px solid #FF9D5C; top: .07rem; color:#FF9D5C;
font-size: .15rem; text-align: center;
}
}
:global(.am-list-item.am-input-item){
padding-left:.11rem; height: .5rem;
}
:global(.am-list-item .am-input-label){
font-size: .15rem; width: .8rem;
}
:global(.am-list-item .am-input-control input){
font-size: .15rem;
}
:global(.am-list-item){
padding-left:.11rem;
}
:global(.am-textarea-control textarea){
font-size: .15rem;
}
:global(.am-textarea-control){
padding-top: .04rem; padding-right:.1rem;
}
:globl(.am-textarea-has-count){
padding-bottom:.12rem;
}
:global(.am-textarea-count){
color:#999; font-size: .15rem; right:.1rem;
span{color:#999; float: none; margin-right: 0;}
}
:global(.invitation-area-item){
background:#fff;
position: relative;
textarea{
padding-left: .1rem;
}
}
:global(.am-textarea-error .am-textarea-error-extra){
position: absolute; right:.2rem; top: 50%; margin-top: -0.1rem;
}
.choosetime {
font-size: .15rem; background:#fff; color:#101010;
.choosetimew{
display:flex; margin: 0 .11rem; border-bottom: 1px solid #f8f8f8;height: .5rem; line-height: .5rem;
}
p{
margin:0; width: .86rem;
}
span{ flex:1; background: url('../../assets/image/icon_date.png') right no-repeat;background-position-y: 12px;
background-size: 8%;}
}
.btnWrap{
width:3.92rem; height: 1.08rem; background: url(../../assets/image/btn_getpreview.png) no-repeat; background-size: 100%; margin: .17rem auto 0; overflow: hidden;
.btnGetPreview{
width: 3.92rem; height:.5rem; margin-top: .08rem;
}
}
}
.prevWrap { height: 100%; overflow: hidden;
.prev{
position: relative;
height: 100%;
overflow: hidden;
}
.isprev{
margin-top: -.3rem;
}
.bg{
position: relative; z-index: 1; width: 100%;
img{ width: 100%; display:block;}
}
.carouselWrap{
position: absolute; top: 48%; width: 3.4rem;
z-index: 9; color:#3E5F50; left: 50%; margin-left:-1.7rem;
height: 3rem;
}
.btnCreate{
position: absolute; z-index: 10; width: 3.92rem; height: .5rem; left: 50%; margin-left: -1.96rem; bottom:.1rem;
background:#FF9D5C; border-radius: .1rem; text-align: center; line-height: .5rem; color:#fff; font-size: .17rem;
}
.btn_left{
position: absolute; width:.4rem; height: .6rem; background: url(../../assets/image/icon_arrow.png) center center no-repeat; z-index: 99; left: .11rem; top: 50%;transform:scale(0.5);
}
.btn_right{
position: absolute; width:.4rem; height: .6rem; background: url(../../assets/image/icon_arrow.png) center center no-repeat; z-index: 99; right: .11rem; top: 50%;
transform:scale(-0.5);
}
.pagea{
text-align: center; height: 3rem;
.pageaWrap{
width: 94%; margin: 0 auto; min-height: 3rem;
}
.activityName {
font-size: .26rem; line-height: .37rem; margin-bottom: .06rem;
}
.subtit{
font-size: .16rem; line-height: .22rem; padding-top: .11rem;
}
.subcon {
font-size: .18rem; line-height: .25rem; margin-top: .02rem;
}
}
.pageb{
.pagebWrap{
width: 94%; margin: 0 auto;
}
.con {
font-size: .17rem; line-height: .28rem;
}
}
.mapWrap{
width: 98%; height: 1.2rem; margin: .1rem auto 0;
}
:global(#invitationMap){
height:1.5rem;
}
}
.localcity {
font-size: .14rem;
display: flex; justify-content: space-between;
span{margin-right: 0;}
.btnSearch{
margin-right: .1rem; margin-top: .06rem; background-color:#FF9D5C;
text-align: center;
&:before{ border:none !important;}
}
}
.map{
position: relative; z-index: 1;height: 4rem;
:global(#activityMap){
height: 4rem;
}
}
.localdownlist{
position: relative;z-index: 4;
.downlist{
position: absolute; left:0; top: 100%; width: 100%; background: #fff;
ul{ padding:0 .12rem;}
li{
text-align: left; list-style: none; border-bottom: 1px solid #ccc;
p{ margin: 0; }
}
}
}
:global(.locatinSelectWrap){
:global(.am-modal-close){
top: 10px;
}
:global(.am-list-item .am-input-label){
font-size: .15rem;
}
:global(.am-list-item .am-input-control input){
font-size: .15rem;
}
:global(.am-list-item .am-list-line){
&:after{
display:none !important;
}
}
}
.noInfo{
height: 100%;background: url(../../assets/image/clientless.png) center center no-repeat; background-size: 40%;
position: relative;
&:after{
position: absolute; left: 0; top: 62%; content: '当前无邀请函'; color: rgb(102, 102, 102); width: 100%; text-align: center; font-size: .15rem;
}
}
.btnCreatePriew{
position: absolute; z-index: 10; width: 100%; height: .8rem; bottom:0;
background:#fff !important; text-align: center; color:#fff;padding: 10px;
img{
width:100%;
}
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react';
import { connect } from 'dva';
import { Tabs, Toast, ActionSheet } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import Templates from './templates';
import MyList from './mylist';
import css from './css.less';
const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let wrapProps;
if (isIPhone) {
wrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
class Index extends Component{
constructor(props) {
super(props);
this.state = {
templates: [],
mylist: [],
isloading: false,
userId:null,
}
}
componentDidMount() {
document.title = '邀请函';
const _this = this;
const userId = localStorage.id ? localStorage.id : null;
Toast.loading('loading...', 1000);
shareHide();
this.setState({ userId })
this.props.dispatch({
type: 'Invitation/GetInvitationTmpsList',
payload: {},
callback(res) {
_this.setState({ templates: res })
Toast.hide();
}
})
this.props.dispatch({
type: 'Invitation/GetMyInvitList',
payload: {
createName: userId ? userId : ''
},
callback(res) {
_this.setState({ mylist: res, isloading: true })
}
})
}
invitationEdit = (data) => {
this.props.history.push({ pathname: "/invitation/addEdit" });
data.specificLocation = JSON.parse(data.specificLocation);
sessionStorage.setItem('invitationInfo', JSON.stringify(data));
}
invitationDel = (id) => {
const BUTTONS = ['删除', '取消'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
destructiveButtonIndex: BUTTONS.length - 2,
// title: '删除',
message: '确定删除此邀请函?',
maskClosable: true,
'data-seed': 'logId',
wrapProps,
},
(buttonIndex) => {
if (buttonIndex === 0) {
const _this = this;
_this.props.dispatch({
type: 'Invitation/del',
payload: {
id
},
callback(res) {
if (res.status === true) {
_this.props.dispatch({
type: 'Invitation/GetMyInvitList',
payload: {
createName: _this.state.userId ? _this.state.userId : ''
},
callback(data) {
_this.setState({ mylist: data })
}
})
}
Toast.info(res.message, 1);
}
})
}
});
}
invitationPrev = (id) => {
this.props.history.push({ pathname: "/invitation/preview", search: 'isprev=2&id=' + id });
}
addInvitation = (itm) => {
if (this.state.mylist.length >= 20) {
Toast.fail('邀请函数量过多,请删除不需要的邀请函',2);
} else {
this.props.history.push({ pathname: "/invitation/addEdit" })
sessionStorage.setItem('invitationInfo', JSON.stringify({ invitationId: itm.id, invitationPath: itm.invitationPath }))
}
}
render() {
let check = 0
if(sessionStorage.getItem("key") == '我的'){
check = 1
}
return <div className={css.invitationWrap} style={{ background: '#fff' }}>
<Tabs
tabs={[{ title: '所有模板', sub: '1' }, { title: '我的', sub: '2' }]}
initialPage ={check}
onChange={(t, i) => {
let checkTab = t.title;
sessionStorage.setItem( "key", checkTab);
// if (i === 0 && this.state.clientList.length === 0) { this.getClientUnpassList(); } else if (this.state.cientListed.length === 0){
// this.getClientPassedList();
// }
}}
>
<div>
<div className={css.splitline}></div>
<Templates
templates={this.state.templates}
addInvitation={this.addInvitation}
/>
</div>
<div className={(this.state.isloading && this.state.mylist.length === 0 ? css.noInfo : '')}>
<div className={css.splitline}></div>
<MyList
mylist={this.state.mylist}
invitationPrev={this.invitationPrev}
invitationEdit={this.invitationEdit}
invitationDel={this.invitationDel}
/>
</div>
</Tabs>
</div>
}
}
export default connect()(Index);
import moment from 'moment';
import css from './css.less';
const MyList = (props) => {
return (
<div className={css.mylistWrap}>
<div>
{
props.mylist && props.mylist.map((itm,i) => (
<dl className={css.itm} key={i}>
<dt onClick={() => {
props.invitationPrev(itm.id)}}><img src={itm.invitationPath} alt='' /></dt>
<dd>
<div className={css.tit} onClick={() => {
props.invitationPrev(itm.id)
}}>{itm.activityName}</div>
<div className={css.updatetime} onClick={() => {
props.invitationPrev(itm.id)
}}><span>更新时间: </span>{moment(itm.updateTime).format('YYYY-MM-DD')}</div>
<div className={css.operation}>
<span className={css.del} onClick={() => { props.invitationDel(itm.id)}}>删除</span>
<span className={css.edit} onClick={()=>{props.invitationEdit(itm)}}>编辑</span>
</div>
</dd>
</dl>
))
}
</div>
</div>
)
}
export default MyList;
import { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Carousel, Toast, ActionSheet } from 'antd-mobile';
import moment from 'moment';
import share from '../../utils/share';
import shareHide from '../../utils/shareHide';
import {urlGetParams} from '../../utils/dataFilter'
import css from './css.less';
const isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let wrapProps;
if (isIPhone) {
wrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
class Preview extends Component{
constructor(props) {
super(props);
this.state = {
index: 0,
inviInfo: null,
isprev:'t'
}
}
showActionSheet = () => {
const { inviInfo } = this.state;
const BUTTONS = ['导航','取消'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
maskClosable: true,
'data-seed': 'logId',
wrapProps,
},
(buttonIndex) => {
if (buttonIndex === 0) {
window.location.href = `https://api.map.baidu.com/marker?location=${JSON.parse(inviInfo.specificLocation).lat},${JSON.parse(inviInfo.specificLocation).lng}&title=目标位置&content=${inviInfo.activitySite}&output=html&src=webapp.baidu.openAPIdemo`;
}
});
}
componentDidMount() {
document.title = '邀请函';
const { search } = this.props.location;
const params = urlGetParams(window.location.href);
if (search) {
if(params.id){
this.setState({ isprev: ''+params.isprev });
this.getInfo(params);
}
}
}
getInfo = (params) => {
const _this = this;
this.props.dispatch({
type: 'Invitation/GetInvitListById',
payload: {
id:params.id
},
callback(res) {
const inviInfo = res[0];
let inviInfoCopy = { ...inviInfo, specificLocation: JSON.parse(inviInfo.specificLocation) };
let urlShare = "";
if(params.isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = `${window.location.href.split('?')[0]}?isprev=2&id=${params.id}&isShare=t&phoneNum=${localStorage.getItem('number')}`;
}
share({
decodeUrl: window.location.href.split('#')[0],
title: inviInfo.activityName,
desc: inviInfo.essay,
shareUrl: urlShare,
thumbnail: inviInfo.invitationPath,
record:{
"operCode": inviInfo.id,
"operTitle": inviInfo.activityName,
"operFunction": 100130,
"operType": 202,
"phoneNum": params.isShare ? params.phoneNum : ""
}
});
//点击记录
_this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": inviInfo.id,
"operFunction": 100130,
"operTitle": inviInfo.activityName,
"operType": 201,
"phoneNum":params.isShare ? params.phoneNum : ""
},
callback(data){
console.log('点击分享出去的链接进来记录一次')
}
});
shareHide(false);
sessionStorage.setItem('invitationInfo', JSON.stringify(inviInfoCopy))
_this.setState({ inviInfo }, () => {
const ppoint = inviInfoCopy.specificLocation;
var map = new window.BMap.Map("invitationMap"); // 创建地图实例
map.disableDragging();
map.disableDoubleClickZoom();
map.disablePinchToZoom();
var point = new window.BMap.Point(ppoint.lng, ppoint.lat); // 创建点坐标
var loadCount = 1;
map.centerAndZoom(point, 17);
let marker = new window.BMap.Marker(point); // 创建标注
map.addOverlay(marker);
// 解决地图初始化位置和标注偏移问题
map.addEventListener("tilesloaded", function () {
if (loadCount == 1) {
map.setCenter(point);
}
loadCount = loadCount + 1;
});
});
}, error(err) {
Toast.error(err.message, 2);
}
})
}
render() {
const { inviInfo, isprev } = this.state;
return (
<div className={css.prevWrap}>
{
inviInfo && <Fragment>
<div className={css.prev}>
<div className={css.bg + ' ' + (isprev === 't' ? css.isprev : '')}><img src={inviInfo.invitationPath} alt="" /></div>
<div className={css.carouselWrap} style={{ color: inviInfo.colour ? inviInfo.colour:'#fff'}}>
<Carousel
selectedIndex={this.state.index}
autoplay={false}
infinite
dots={false}
>
<div className={css.pagea}>
<div className={css.pageaWrap}>
<div className={css.activityName}>{inviInfo.activityName}</div>
<div className={css.subtit}>时间</div>
<div className={css.subcon}>{moment(inviInfo.activityTime).format('YYYY-MM-DD HH:mm')}</div>
<div className={css.subtit}>地点</div>
<div className={css.subcon}>{inviInfo.activitySite + inviInfo.activityAdress}</div>
</div>
</div>
<div className={css.pageb}>
<div className={css.pagebWrap}>
<div className={css.con}>尊敬的{inviInfo.named}: </div>
<div className={css.con} style={{ textIndent: '2em' }}>{inviInfo.essay}</div>
<div className={css.con} style={{ textAlign: 'right' }}>{moment(inviInfo.updateTime).format('YYYY-MM-DD')}</div>
<div className={css.con} style={{ textAlign: 'right' }}>{inviInfo.invitationMessage}</div>
</div>
</div>
<div className={css.pageb}>
<div className={css.pagebWrap}>
<div className={css.con}>联系电话:{inviInfo.number}</div>
<div className={css.con}>活动时间:{moment(inviInfo.activityTime).format('YYYY-MM-DD HH:mm')}</div>
<div className={css.con}>活动地点:{inviInfo.activitySite + inviInfo.activityAdress}</div>
<div className={css.mapWrap} onClick={this.showActionSheet}>
<div id="invitationMap" style={{ height: '100%' }}></div>
</div>
</div>
</div>
</Carousel>
</div>
<div className={css.btn_left} onClick={() => {
const { index } = this.state;
if (index !== 0) {
this.setState({ index: index - 1 })
} else {
this.setState({ index: 2 })
}
}}></div>
<div className={css.btn_right} onClick={() => {
const { index } = this.state;
if (index < 2) {
this.setState({ index: index + 1 })
} else {
this.setState({ index: 0 })
}
}}></div>
{isprev === 't' && <div className={css.btnCreatePriew} style={{ backgroundColor: inviInfo.colour ? inviInfo.colour : '#FF9D5C'}}
onClick={() => {
const _this = this;
this.props.dispatch({
type: 'Invitation/addEdit',
payload: {
...inviInfo,
judegeId: 1,
updateTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
},
callback(res) {
Toast.success(res.message, 2);
_this.props.history.push({ pathname: "/invitation" });
}, error(err) {
Toast.error(err.message, 2);
}
})
}}
><img src={require("../../assets/image/yaoqinghan.png")} /></div>}
</div>
</Fragment>}
</div>
)
}
}
export default connect()(Preview);
import css from './css.less';
const Templates = (props) => {
return (
<div className={css.tmpsWrap}>
{
props.templates && props.templates.map(itm => (
<div className={css.itm} key={itm.id} onClick={() => {
props.addInvitation(itm);
}}><img src={itm.invitationPath} alt='' /></div>
))
}
</div>
)
}
export default Templates;
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.box{
width: 100%;
/*overflow: hidden;*/
}
.logo{
width: 2.57rem;
height: 1.67rem;
margin: 1.12rem auto 0.67rem ;
}
.logo > img{
width: 100%;
height: 100%;
}
.phone{
text-align: center;
height: .8rem;
position: relative;
}
.phone img{
width:3.66rem;
height: .76rem;
}
.phone input{
position: absolute;
left: .5rem;
top:0.25rem;
border: none;
outline:none;
font-size:.18rem;
}
.phone span{
color: #FF9D5C;
position: absolute;
right: .5rem;
top:.25rem;
font-size:.18rem;
}
.verification{
text-align: center;
height: 1.2rem;
position: relative;
}
.verification img{
width:3.66rem;
height: .76rem;
}
.verification input{
position: absolute;
left: .5rem;
top:0.25rem;
border: none;
outline:none;
font-size:.18rem;
}
.approve{
width: 3.5rem;
height: 1.22rem;
margin:.26px auto 0;
}
.approve img{
width: 100%;
}
.bottom{
/*position: fixed;*/
/*bottom: 0;*/
color: #FF9D5C;
font-size: .15rem;
width: 100%;
max-width: 680px;
}
.bottom>p{
text-align: center;
}
/*认证失败*/
.pop{
position: fixed;
top:0;
left: 0;
width: 100%;
height: 100%;
background-color:rgba(0,0,0, 0.6);
}
.pop .up{
width: 3rem;
height: 1.5rem;
position: fixed;
top:50%;
left: 50%;
margin-left: -1.5rem;
margin-top: -.75rem;
background-color: white;
text-align: center;
border-radius: 7px;
}
.up p:nth-child(1){
color: #333333;
font-size: .18rem;
}
.up p:nth-child(2){
font-size:.15rem;
color: #666666;
}
.button{
position: relative;
font-size: .18rem;
}
.button span:nth-child(1){
position: absolute;
left: 50px;
top:12px;
}
.button span:nth-child(2){
position: absolute;
right: 50px;
top:12px;
}
import React, { Component } from 'react'
import { connect } from 'dva'
import styles from './Login.css'
import $ from 'jquery';
import { Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import {urlGetParams} from "../../utils/dataFilter";
let t1 = null;//是一个 全局事件
class Login extends Component {
constructor(props){
super(props)
this.state={
authenticationFailure:false,
num :1,
verificationCode:'',
mobile:'',
send:false,
second:60,
message:'' ,
submit:{},
userOpenId:'',
publicOpenId:''
}
}
history = ()=>{
let that = this;
let mobile = this.state.mobile;
let verificationCode = this.state.verificationCode;
if(!mobile){
this.showToast('请输入正确的手机号!')
return false;
}
if(!verificationCode){
this.showToast('请输入正确的验证码!')
return false;
}
$.ajax({
//几个参数需要注意一下
type: "POST",//方法类型
url: "https://iwpuat.ihxlife.com/o2o/authentication/mobile" ,//url
contentType: "application/x-www-form-urlencoded",
headers: {
'deviceId':this.state.userOpenId, //微信号 userOpenId
'gzhId':this.state.publicOpenId, //公众号 publicOpenId
Authorization:"Basic ZWR3aW5DbGllbnQ6ZWR3aW5TZWNyZXQ="
},
data: {"mobile":mobile ,"smsCode":verificationCode},
success: function (result) {
let userInfo = result.userInfo
let storage = window.localStorage;
storage.setItem("id",userInfo.id) //id
storage.setItem("roleId",userInfo.roleId) //角色
storage.setItem("number",userInfo.number) //手机号
storage.setItem("name",userInfo.name) //名字
storage.setItem("public_id",userInfo.public_id) //公众号
storage.setItem("weixin_id",userInfo.weixin_id) //微信号
storage.setItem("superiorid",userInfo.superiorid) //角色
storage.setItem("orgId", userInfo.orgId ? userInfo.orgId : '') //机构id
storage.setItem("project", userInfo.project ? userInfo.project:'') //项目id
storage.setItem("website", userInfo.website ? userInfo.website:'') //网点id
if(userInfo.roleId == 2 || userInfo.roleId == 3){
// that.props.history.push('/welcome');
// let url = window.location.href;
// let param1 = window.location.origin+'/index.html#/welcome?' + url.split('?')[1] + "&phoneNum="+mobile;
// window.location.href = param1;
that.props.history.push({pathname:'/welcome',query:{phoneNum:mobile}});
}else {
that.showToast('该用户无权限,请联系管理员。')
}
},
error : function(result) {
// console.log(result.responseJSON.content);
that.showToast('您所填写验证码错误,请重新验证')
}
});
}
showToast=(val)=>{
Toast.info(val);
}
componentWillUnmount() {
window.clearInterval(t1);//组件卸载时删除定时器
$('body,#root').removeClass('loginRelease');
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
localStorage.clear();
shareHide();
$(document).on('blur', 'input,textarea', function () {
document.activeElement.scrollIntoView();
})
$('body,#root').addClass('loginRelease');
let storage = window.localStorage;
storage.setItem("id",'') //id
storage.setItem("roleId",'') //角色
storage.setItem("number",'') //手机号
storage.setItem("name",'') //名字
storage.setItem("public_id",'') //公众号
storage.setItem("weixin_id",'') //微信号
storage.setItem("superiorid",'') //角色
let url = window.location.href;
const matchs = urlGetParams(url);
if(matchs){
let userOpenId = matchs.userOpenId;
let publicOpenId = matchs.publicOpenId;
this.setState({
userOpenId,
publicOpenId
})
}
}
render() {
return (
<div className={styles.box}>
<div className={styles.logo}>
<img src={require('../../assets/image/home-logo.png')} alt=""/>
</div>
<div className={styles.phone}>
<img src={require('../../assets/image/home-shadow.png')} alt=""/>
<input type="number" pattern="[0-9]*" placeholder="输入手机号码"
value={this.state.mobile}
onChange={
(e)=>{
this.setState({
mobile:e.target.value.substr(0,11)
})
let storage = window.localStorage;
storage.setItem("mobile",e.target.value)
}
}/>
{
!this.state.send && <span onClick={()=>{
let mobile = this.state.mobile;
let that = this;
if(mobile.length !== 11){
this.showToast('请填写正确的手机号!')
return false
}
if(that.state.send){//已发送之后不能再发送接口了
return;
}
that.props.dispatch({
type:'login/checkUser',
payload:{
"number": mobile
},
callback(){
$.ajax({url:"https://iwpuat.ihxlife.com/o2o/code/sms?mobile="+ mobile,
type : "get",
headers:{"deviceId": that.state.userOpenId},
success:function(result){
that.showToast('验证码已发送,请注意查收!')
that.setState({
send:true,
})
t1 = window.setInterval(function () {
that.setState({
second:that.state.second-1
})
if(that.state.second ===0 ){
that.setState({
send:false,
second:60
})
window.clearInterval(t1);//删除定时器
}
},1000)
}});
},
error(date){
that.showToast(date.message)
}
})
}}>获取验证码</span>
}
{
this.state.send &&<span>{this.state.second}秒</span>
}
</div>
<div className={styles.verification}>
<img src={require('../../assets/image/home-shadow.png')} alt="">
</img>
<input type="text" placeholder="输入验证码" onChange={(e)=>{
this.setState({
verificationCode:e.target.value,
})
}}/>
</div>
<div className={styles.approve} onClick={this.history}>
<img src={require('../../assets/image/home-approve.png')} alt=""/>
</div>
<div className={styles.bottom}><p>该平台仅供内部员工注册使用</p></div>
{this.state.authenticationFailure &&<div className={styles.pop}>
<div className={styles.up}>
<p>认证失败</p>
<p>该平台仅供内部员工注册使用!</p>
<div className={styles.button}>
<span>取消</span>
<span>确定</span>
</div>
</div>
</div>}
</div>
)
}
}
export default connect(({ login }) => ({ login }))(Login);
.myCenter{
width: 100%;
height: 100%;
overflow-y: auto;
}
.myCenter .headerCard{
background: url('../../assets/image/myCenterBackg.png') no-repeat;
height: 1.2rem;
background-size: cover;
display: flex;
align-items: center;
color: #FFFFFF;
font-size: .16rem;
margin-bottom: .12rem;
}
.myCenter .headerCard .head{
width: .80rem;
height: .80rem;
margin-left: .20rem;
}
.myCenter .headerCard .head img{
width: 100%;
height: 100%;
border-radius: 50%;
}
.myCenter .headerCard .info{
margin-left: .1rem;
}
.myCenter .senction1{
position: relative;
display: flex;
background: white;
margin: 0 .10rem;
padding: .12rem 0;
border-radius: 8px;
}
.myCenter .senction1 .childsection{
width: 50%;
text-align: center;
line-height: .40rem;
}
.myCenter .senction1 .childsection .header{
font-size: .15rem;
color: #666666;
}
.myCenter .senction2{
position: relative;
background: white;
margin: .10rem .10rem;
font-size: .18rem;
border-radius: 8px;
}
.myCenter .senction2 .item{
position: relative;
display: flex;
line-height: .5rem;
padding-left: .16rem;
border-bottom: 1px solid #F8F8F8;
}
.myCenter .senction2 .item .left{
width: 1rem;
color: #101010;
font-weight: 400;
}
.myCenter .senction2 .item .arrow{
right: 0;
width: .3rem;
position: absolute;
}
.myCenter .tipsContent{
position: relative;
width: 100%;
text-align: center;
margin: .40rem 0;
}
.websiteSection{
position: relative;
background: white;
margin: .15rem .15rem;
font-size: .18rem;
border-radius: 8px;
border: 1px solid #e7e7e7;
padding: .1rem .2rem;
}
.websiteSection .item{
position: relative;
display: flex;
line-height: .5rem;
border-bottom: 1px solid #F8F8F8;
}
.websiteNameCss{
white-space: nowrap;
width: 2.3rem;
overflow-x: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file \ No newline at end of file
import React, { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Toast } from 'antd-mobile';
import { Icon } from 'antd';
import shareHide from "../../utils/shareHide";
import css from './index.css';
import moment from 'moment';
import {getPlanInListWithCode} from '../../utils/dataFilter'
class Index extends Component{
constructor(props) {
super(props);
this.state = {
userInfo: JSON.parse(localStorage.getItem('userInfo')) || {},
performTotal:"0.00",//当月业绩
ranking:'0',//当月排名
websiteName:'',//所辖网点名
websiteList:[],//所辖网点
}
}
componentDidMount() {
document.title = '个人中心';
const _this = this;
shareHide();
this.performaceServer();
this.getAchievementRank();
this.getWebsiteNmae();
}
//当月业绩
performaceServer(){
let that = this;
this.props.dispatch({
type: 'Performance/performList',
payload: {
"daySize": "M",
"managerId": this.state.userInfo.id,
"roleId": this.state.userInfo.roleId,
},
callback(data){
if(data){
that.setState({
performTotal:data.amount?parseFloat(data.amount).toFixed(2):'0.00'
})
}
},
error(data){
Toast.info(data.message)
}
})
}
//当月排行
getAchievementRank(){
let that = this;
Toast.loading('loading...');
this.props.dispatch({
type: 'Performance/achievementRank',
payload: {
"month": moment().format('MM'),
"roleId": this.state.userInfo.roleId,
"userId": this.state.userInfo.id
},
callback(data){
Toast.hide();
if(data){
that.setState({
ranking:data.ranking
})
}
},
error(data){
Toast.info(data.message)
}
})
}
getWebsiteNmae(){
let _this = this;
this.props.dispatch({
type: "governortraining/getOrzList",
payload: {
orgId:this.state.userInfo.project
},
callback: (res) => {
if (res.status && res.data.length) {
let project = _this.state.userInfo.website ? _this.state.userInfo.website.split(',') : [];
let myProjectList=[];
let websiteName = [];
for(let ii in project){
let target = getPlanInListWithCode('orgId',project[ii],res.data);
if(target.orgId){
myProjectList.push(target);
websiteName.push(target.orgName);
}
}
_this.setState({websiteList:myProjectList,websiteName:websiteName.join(',')})
}
Toast.hide();
}
});
}
render() {
const { userInfo,performTotal,ranking ,websiteName,websiteList} = this.state;
return (
<div className={css.myCenter}>
<div className={css.headerCard}>
<div className={css.head}>
<img src={userInfo.headUrl ? userInfo.headUrl : require("../../assets/image/defaultHead.png")} alt="" />
</div>
<div className={css.info}>
<div style={{marginBottom:'5px'}}>{userInfo.name}<span style={{marginLeft:'20px'}}>{userInfo.roleId === 3 ? '督训':'客户经理'}</span></div>
<div>手机号:<span>{userInfo.number}</span></div>
</div>
</div>
<div className={css.senction1}>
<div className={css.childsection} onClick={()=>{this.props.history.push('/performance')}}>
<div className={css.header}>当月业绩</div>
<div style={{color:'#FF9D5C',fontSize:'.32rem'}}>{performTotal}<span style={{fontSize:'12px',margin:'0 8px'}}>元</span></div>
</div>
<img src={require('../../assets/image/lineH.png')} style={{height:'.9rem'}}/>
<div className={css.childsection} onClick={()=>{this.props.history.push('/myRank')}}>
<div className={css.header}>当月排名</div>
<div style={{color:'#FF9D5C',fontSize:'.16rem'}}>全渠道第<span style={{fontSize:'.32rem',margin:'0 8px'}}>{ranking}</span>名</div>
</div>
</div>
{userInfo.roleId === 2 && (
<div className={css.senction2}>
<div className={css.item}><div className={css.left}>所属机构</div><div>{userInfo.orgName}</div></div>
<div className={css.item}><div className={css.left}>所属网点</div><div>{userInfo.websiteName}</div></div>
<div className={css.item}><div className={css.left}>所属督训</div><div>{userInfo.superiorName}</div></div>
</div>
)}
{userInfo.roleId === 3 && (
<div className={css.senction2}>
<div className={css.item}><div className={css.left}>所属机构</div><div>{userInfo.orgName}</div></div>
<div className={css.item}><div className={css.left}>所属项目</div><div>{userInfo.projectName}</div></div>
<div className={css.item}><div className={css.left}>所辖网点</div><div className={css.websiteNameCss}>{websiteName}</div>
<div className={css.arrow} onClick={()=>{this.props.history.push({pathname:'/home/myUser/website',params:websiteList})}}><Icon type="right" /></div>
</div>
</div>
)}
<div className={css.senction2}>
<div className={css.item}><div className={css.left}>年龄</div><div>{userInfo.age}</div></div>
<div className={css.item}><div className={css.left}>性别</div><div>{userInfo.sex == '1' ? '女' : "男"}</div></div>
<div className={css.item}><div className={css.left}>手机号</div><div>{userInfo.number}</div></div>
</div>
<div className={css.tipsContent}>
<img src={require('../../assets/image/zhihuigongzuo.png')} style={{width:'60%'}}/>
</div>
</div>
)
}
}
export default connect()(Index);
import React, { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import css from './index.css';
import {getPlanInListWithCode} from '../../utils/dataFilter'
class Index extends Component{
constructor(props) {
super(props);
this.state = {
userInfo: JSON.parse(localStorage.getItem('userInfo')) || {},
websiteList:[]
}
}
componentDidMount() {
document.title = '所辖网点';
const _this = this;
shareHide();
if(this.props.location.params){
this.setState({websiteList:this.props.location.params})
return;
}
Toast.loading('loading...',0)
this.props.dispatch({
type: "governortraining/getOrzList",
payload: {
orgId:this.state.userInfo.project
},
callback: (res) => {
if (res.status && res.data.length) {
let project = _this.state.userInfo.website ? _this.state.userInfo.website.split(',') : [];
let myProjectList=[];
for(let ii in project){
myProjectList.push(getPlanInListWithCode('orgId',project[ii],res.data))
}
_this.setState({websiteList:myProjectList})
}
Toast.hide();
}
});
}
render() {
const { userInfo ,websiteList} = this.state;
if(websiteList.length == 0) return <div/>
return (
<div className={css.websiteSection}>
{
websiteList.length>0 && websiteList.map((item,index)=>{
return (
<div key={index} className={css.item}>
<div className={css.left}>{index+1}</div>
<div style={{textAlign:'right',width:'100%'}}>{item.orgName}</div>
</div>
)
})
}
</div>
)
}
}
export default connect()(Index);
.myRank{
width: 100%;
height: 100%;
overflow-y: auto;
margin: 0;
}
.myRank .section1{
line-height: .50rem;
height: .50rem;
background: white;
display: flex;
align-items: center;
border-radius: 24px;
margin: .10rem;
}
.myRank .section1 .part1,.part2{
width: 49%;
}
.myRank .section1 .part1 .select{
width: 90px;
position: relative;
float: right;
/* margin-right: .3rem; */
}
.myRank .section1 .part2 .select{
width: 90px;
position: relative;
margin-left: .30rem;
}
.myRank .section2{
padding: .10rem .20rem;
background: white;
text-align: center;
margin: .10rem;
color: #101010;
font-size: 16px;
}
.myRank .section2>div{
margin: .08rem 0;
}
.myRank .section3{
text-align: center;
margin: .10rem;
}
.myRank .overlayClassName{
width: .80rem;
}
.myRank .section3 .rankHeader{
padding: .10rem 0;
font-size: .16rem;
color: #666666;
}
.myRank .section3 .rankMe{
background: white;
margin: .10rem 0;
border-radius: 8px;
font-size: .17rem;
color: #101010;
line-height: .4rem;
padding: .08rem 0;
}
.myRank .section3 .rankList{
position: relative;
padding: .10rem 0 0 0;
background: white;
border-radius: 8px;
font-size: .17rem;
color: #101010;
}
.myRank .section3 .rankList .rankListItem{
padding: .1rem 0;
border-bottom: 1px solid #F8F8F8;
line-height: .40rem;
}
.myRank .section3 .rankList .tipNum{
position: relative;
font-size: .14rem;
text-align: center;
color: rgb(171, 171, 171);
width: 100%;
padding: .06px;
background: white;
line-height: 30px;
height: 30px;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.myRank .premNumber{
text-align: center;
/* padding-right: .1rem; */
color: #FF9D5C;
font-size: .24rem;
}
.myRank .listName{
text-align: center;
/* padding-left: .3rem; */
}
.myRank .listName img{
height: 0.4rem;
width: 0.4rem;
border-radius: 50%;
margin-right: 0.1rem;
}
:global(.ant-dropdown-menu){
overflow-y: auto;
max-height: 4rem;
}
\ No newline at end of file \ No newline at end of file
import React, { Component, Fragment } from 'react';
import { connect } from 'dva';
import { Toast } from 'antd-mobile';
import { Menu, Dropdown, Icon ,Row,Col} from 'antd';
import shareHide from "../../utils/shareHide";
import css from './index.css';
import Iscroll from "../../components/Iscroll";
import moment from 'moment';
import {getPlanInListWithCode} from '../../utils/dataFilter'
const monthM = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
const menuListM = [];
const nowM = new Date().getMonth()+1;
monthM.map((item,index)=>{
if(index<nowM){
let num = (String(index+1).length == 1) ? "0"+(index+1) : ""+(index+1);
menuListM.push({lable:item,id:num})
}
});
class Index extends Component{
constructor(props) {
super(props);
let userInfo = JSON.parse(localStorage.getItem('userInfo'));
let monthName = getPlanInListWithCode("id",moment().format('MM'),menuListM).lable || "";
this.state = {
userInfo: userInfo || {},
menuList1:[{lable:'全国',id:""},{lable:userInfo.orgName,id:userInfo.orgId}],
menuList2:menuListM,
managerList:[],
area:"全国",
areaId:"",
month: moment().format('MM'),
monthName: monthName,
scrollH:300,
ranking:"-",//排名
cusManAllNum:'0',//总人数
amountGap:0,//同上一名相差额度
selfRank:null,//自己的排行列表信息
otherRankList:[],//所有排行的人列表
}
}
componentDidMount() {
document.title = '排行榜';
const _this = this;
const windowH = window.screen.height;
const listH = document.getElementById("rankList").offsetHeight;
shareHide();
let isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let disH = isIPhone ? windowH-listH-138 : windowH-listH-90;
this.setState({scrollH:disH})
this.getAchievementRank();
}
//当月排行列表
getAchievementRank(){
let that = this;
Toast.loading('loading...',0);
this.props.dispatch({
type: 'Performance/achievementRank',
payload: {
"month": this.state.month,
"orgId": this.state.areaId,
"roleId": this.state.userInfo.roleId,
"userId": this.state.userInfo.id
},
callback(data){
Toast.hide();
if(data){
let selfRank = null;
//返回列表数据第一条是不是本人,不是的话就是没有本人数据,如果有则取第一条
if(data.rankingList[0]){
if(data.rankingList[0].userId == that.state.userInfo.id){
selfRank = data.rankingList[0]
}
}
that.setState({
ranking:data.ranking,
cusManAllNum:data.cusManAllNum,
amountGap:data.amountGap,
selfRank:selfRank,
otherRankList:selfRank ? data.rankingList.slice(1,) : data.rankingList,
})
}
},
error(data){
Toast.info(data.message)
}
})
}
_menuList(props,key){
return (
<Menu className={css.overlayClassName}>
{props && props.map((item,index)=>{
return (
<Menu.Item key={index}>
<p onClick={()=>{
if(key=='month'){
this.setState({month:item.id,monthName:item.lable},()=>{
this.getAchievementRank();
});
}else {
this.setState({area:item.lable,areaId:item.id},()=>{
this.getAchievementRank();
});
}
}}>{item.lable}</p>
</Menu.Item>
)
})}
</Menu>
)
}
arrowUpDown(item){
if(item){
if(item.ratio == '+1'){
return <Icon type="arrow-up" style={{color:'#FB5150'}} />
}
if(item.ratio == '-1'){
return <Icon type="arrow-down" style={{color: '#31DEB6'}} />
}
return <Icon type="line" style={{color: '#6c6c6c'}} />
}
}
render() {
const { userInfo ,menuList1,menuList2,managerList,area,monthName,scrollH,ranking,cusManAllNum,amountGap,selfRank,otherRankList} = this.state;
return (
<div className={css.myRank}>
<div className={css.section1}>
<div className={css.part1}>
<div className={css.select}>
<Dropdown
overlay={this._menuList(menuList1,'area')}
placement="bottomCenter"
trigger={['click']}
>
<div><span style={{marginRight:'.20rem'}}>{area}</span><Icon type="caret-down" /></div>
</Dropdown>
</div>
</div>
<img src={require('../../assets/image/lineH.png')} style={{height:'.30rem',width:'1px'}}/>
<div className={css.part2}>
<div className={css.select}>
<Dropdown
overlay={this._menuList(menuList2,'month')}
placement="bottomCenter"
trigger={['click']}
>
<div><span style={{marginRight:'.20rem'}}>{monthName}</span><Icon type="caret-down" /></div>
</Dropdown>
</div>
</div>
</div>
<div className={css.section2}>
<div>{area+"共有"}<span>{userInfo.roleId===3 ? '督训':'客户经理'}</span><span style={{color:'#FF9D5C',padding:"0 .05rem"}}>{cusManAllNum}</span>名</div>
<div>排名第<span style={{color:'#FF9D5C',fontSize:'.28rem',padding:"0 .05rem"}}>{ranking ? ranking : '-'}</span></div>
<div>同上一名业绩相差<span style={{color:'#FF9D5C',padding:"0 .05rem"}}>{amountGap ? parseInt(amountGap) : '-'}</span>元</div>
</div>
<div className={css.section3}>
<Row className={css.rankHeader}>
<Col span={3}>排名</Col>
<Col span={8} style={{textAlign:'center',}}>姓名</Col>
<Col span={9} style={{textAlign:'center',}}>标准保费 (元)</Col>
<Col span={3}>环比</Col>
</Row>
<Row className={css.rankMe}>
<Col span={3}>{selfRank ? selfRank.ranking : "-"}</Col>
<Col span={8} className={css.listName}>
{/*<img src={selfRank && selfRank.headUrl ? selfRank.headUrl : require('../../assets/image/defaultHead.png')} />*/}
{selfRank && selfRank.name ? (selfRank.name.length>4 ? selfRank.name.substr(0,4)+".." : selfRank.name) : userInfo.name}
</Col>
<Col span={9} className={css.premNumber}>{selfRank ? parseInt(selfRank.amount) : "-"}</Col>
<Col span={3}>{selfRank ? this.arrowUpDown(selfRank) : <Icon type="line" style={{color: '#6c6c6c'}} />}
</Col>
</Row>
<div className={css.rankList} id="rankList">
<div style={{minHeight:'100px',height:scrollH,position:'relative'}}>
<Iscroll id="planResult"
iscrollOptions={{
probeType:2
}}>
{
otherRankList.length>0 && otherRankList.map((item,index)=>{
return(
<Row className={css.rankListItem} key={index}>
<Col span={3}>{item.ranking}</Col>
<Col span={8} className={css.listName}>
{/*<img src={item.headUrl ? item.headUrl : require('../../assets/image/defaultHead.png')} />*/}
{item.name ? (item.name.length>4 ? item.name.substr(0,4)+".." : item.name) : ""}</Col>
<Col span={9} className={css.premNumber} >{item.amount ? parseInt(item.amount) : "0"}</Col>
<Col span={3}>{this.arrowUpDown(item)}
</Col>
</Row>
)
})
}
</Iscroll>
</div>
<div className={css.tipNum}>{'共'+cusManAllNum+'名'}<span>{userInfo.roleId===3 ? '督训':'客户经理'}</span>参加了排名</div>
</div>
</div>
</div>
)
}
}
export default connect()(Index);
import React, { Component } from 'react'
import { connect } from 'dva'
import Tabs from "../../components/Tabs";
import { dataFilter } from '../../utils/dataFilter';
import styles from './myUser.css'
import shareHide from "../../utils/shareHide";
import {Toast} from "antd-mobile"
class MyUser extends Component {
constructor(props){
super(props)
this.state={
tab:['未提交','已提交'],
user: true,
hasClient: [false, false],
letter:'',
currentStatus:0,
nameList: [],
storeNameList: [],
storeNameList1:[],
nameList1:[],
show:false,
loadingFlag:true
}
}
addUser = ()=>{
// this.props.history.push('/addUser');
let id = localStorage.getItem('id')
window.location.href = window.location.href.split('#')[0] + '#/addUser?id=' + id
localStorage.setItem('clientNeededInfo', 'null');
localStorage.setItem('clientNeededInfoIsShare', 1);
}
amentClient=()=>{
this.props.history.push('/amendClient')
}
componentWillMount(){
Toast.loading('loading...',0);
this.getUser();
}
componentDidMount(){
document.title = '我的客户';
shareHide();
this.getUser1();
}
componentWillUnmount(){
document.title = '';
}
getUser=()=>{
let that = this;
this.props.dispatch({
type: 'myUser/getAllUser',
payload: {
"id":localStorage.getItem("id"),
"currentState":0,
},
callback(data) {
Toast.hide();
let { hasClient } = that.state;
hasClient[0] = data.length > 0;
that.setState({
nameList: data,
storeNameList: data,
hasClient,
show:true,
//loadingFlag:false
})
}
})
}
getUser1=()=>{
let that = this;
this.props.dispatch({
type: 'myUser/getAllUser',
payload: {
"id":localStorage.getItem("id"),
},
callback(data){
Toast.hide();
let { hasClient } = that.state;
hasClient[1] = data.length > 0;
that.setState({
nameList1: data,
hasClient,
storeNameList1: data,
show:true,
loadingFlag:false
})
}
})
}
delete = (id)=>{
console.log(444);
let that = this;
this.props.dispatch({
type:'myUser/deleteCustomer',
payload:{
"id":id,
},
callback(){
that.getUser()
that.getUser1()
}
})
}
goAddUser = (item, status) => {
const storeItem = { ...item, isSubmit: status };
localStorage.setItem('clientNeededInfo', JSON.stringify(storeItem))
this.props.history.push('/addUser');
}
dataFilterToProp(keywords, idx) {
if (idx === 0) {
this.setState({
nameList: dataFilter(this.state.storeNameList, ['name'], keywords)
})
} else {
this.setState({
nameList1: dataFilter(this.state.storeNameList1, ['name'], keywords)
})
}
}
render() {
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={styles.box}>
{
this.state.show &&<Tabs title={this.state.tab}
user={this.state.user}
letter={this.state.letter}
addUser={this.addUser}
editor={this.editor}
delete={this.delete}
amentClient = {this.amentClient}
nameList = {this.state.nameList}
nameList1 = {this.state.nameList1}
storeNameList = {this.state.storeNameList}
storeNameList1 = {this.state.storeNameList1}
goAddUser = {this.goAddUser}
content={'修改'}
dataFilterToProp= {this.dataFilterToProp.bind(this)}
hasClient={this.state.hasClient} />
}
</div>
)
}
}
MyUser.propsTypes = {}
export default connect(({myUser})=>({myUser}))(MyUser)
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.box{
width: 100%;
height: 100%;
}
.logo{
width: 2.57rem;
height: 1.67rem;
margin: 1.12rem auto 0.67rem ;
}
.logo > img{
width: 100%;
height: 100%;
}
.phone{
text-align: center;
height: .8rem;
position: relative;
}
.phone img{
width:3.66rem;
height: .76rem;
}
.phone input{
position: absolute;
left: .5rem;
top:0.25rem;
border: none;
outline:none;
font-size:.18rem;
}
.phone span{
color: #FF9D5C;
position: absolute;
right: .5rem;
top:.25rem;
font-size:.18rem;
}
.verification{
text-align: center;
height: 1.2rem;
position: relative;
}
.verification img{
width:3.66rem;
height: .76rem;
}
.verification input{
position: absolute;
left: .5rem;
top:0.25rem;
border: none;
outline:none;
font-size:.18rem;
}
.approve{
width: 3.5rem;
height: 1.22rem;
margin:.26px auto 0;
}
.approve img{
width: 100%;
}
.bottom{
position: fixed;
bottom: 0;
color: #FF9D5C;
font-size: .15rem;
width: 100%;
max-width: 680px;
}
.bottom>p{
text-align: center;
}
/*认证失败*/
.pop{
position: fixed;
top:0;
left: 0;
width: 100%;
height: 100%;
background-color:rgba(0,0,0, 0.6);
}
.pop .up{
width: 3rem;
height: 1.5rem;
position: fixed;
top:50%;
left: 50%;
margin-left: -1.5rem;
margin-top: -.75rem;
background-color: white;
text-align: center;
border-radius: 7px;
}
.up p:nth-child(1){
color: #333333;
font-size: .18rem;
}
.up p:nth-child(2){
font-size:.15rem;
color: #666666;
}
.button{
position: relative;
font-size: .18rem;
}
.button span:nth-child(1){
position: absolute;
left: 50px;
top:12px;
}
.button span:nth-child(2){
position: absolute;
right: 50px;
top:12px;
}
/* 通讯录字母列表 */
.address{
position: fixed;
top: 1rem;
right: .1rem;
}
*{
margin: 0;
padding: 0;
list-style: none;
}
body{
width:100% ;
max-width: 680px;
margin: auto;
}
.performWrap{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.performtop{
width: 100%;
height: .5rem;
line-height: .5rem;
}
.performtop ul{
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 .15rem;
box-sizing: border-box;
align-items: center;
}
.text{
font-size: 0.19rem;
color: #101010;
}
.performtop .img{
color: #000000;
background-blend-mode:color;
font-size: .2rem;
}
.omit{
font-size: 0.19rem;
font-weight: 700;
}
.performContent{
width: 100%;
flex: 1;
background: #f5f5f5;
padding: 0 .1rem;
box-sizing: border-box;
overflow: auto;
}
.ptext{
display: block;
height: .2rem;
width: 100%;
text-align: center;
font-size: .15rem;
line-height: .2rem;
color: #666666;
margin-top: 5px;
}
.contentTop{
width: 100%;
height: .52rem;
margin: .1rem 0;
}
.contentLis{
width: 100%;
height: 100%;
background: #ffffff;
border-radius: .25rem;
display: flex;
align-items: center;
justify-content: space-around;
font-size: .15rem;
color: #666666;
padding: 0 .1rem;
box-sizing: border-box;
}
.contentLis>li{
text-align: center;
width: 25%;
border-right: .01rem solid #ccc;
}
.contentLis>li:last-child{
border: none;
}
.active{
color: #FF9D5C;
}
.contentEsh{
width: 100%;
min-height: 4.20rem;
background: #fff;
border-radius: .08rem;
padding: 0 .1rem;
box-sizing: border-box;
}
.itemEsh{
text-align: center;
}
.lispan{
padding: .1rem 0;
box-sizing: border-box;
font-size: .17rem;
color: #101010;
}
.litext{
font-size: .4rem;
color: #FF9D5C;
}
.radial{
width:100%;
height: 2.12rem;
background: linear-gradient(top,#FFC59F,#FF9D5B);
border-radius: .1rem;
display: none;
}
.allDate{
display: flex;
text-align: center;
background: #fff;
border-radius: .25rem;
justify-content: space-between;
overflow: hidden;
}
.am-list-line{
justify-content: space-between;
}
.date_picker_list{
width: 40%;
display: inline-block;
margin: 0 .1rem;
}
.policy>p{
text-align: center;
margin: .16rem 0;
font-size: .17rem;
color: #101010;
display: flex;
justify-content: space-around;
position: relative;
}
.spantext{
font-size: .14rem;
color: #999999;
position: absolute;
top:50%;
right: .05rem;
transform: translate3d(0,-50%,0);
}
.spantext>b{
color:#FF9D5C ;
padding: 0 .05rem;
box-sizing: border-box;
}
.policyList{
width: 100%;
min-height: 1.25rem;
background: #fff;
border-radius: .08rem;
margin: .1rem 0;
padding: .1rem .1rem;
box-sizing: border-box;
}
.ulis,.appntname,.ulilast{
font-size: .14rem;
color: #101010;
display: flex;
justify-content: space-between;
align-items: center;
padding: .1rem 0;
}
.ulis>span:last-child{
font-size: .14rem;
color: #999999;
}
.ulilast{
justify-content: space-around;
}
.ulilast>span:first-child{
font-size: .19rem;
color: #333333;
width: 50%;
}
.ulilast>span:last-child{
font-size: .16rem;
color: #333333;
width: 50%;
text-align: right;
box-sizing: border-box;
}
.ulilast>span:last-child>b{
font-size: .24rem;
color: #FF9D5C;
margin-right: .1rem;
}
.policyList>p{
font-size: .14rem;
color: #101010;
border-top:.01rem #f9f9f9 solid;
padding-top: .1rem;
box-sizing: border-box;
}
.display_block{
width:100%;
height: 2.12rem;
background: linear-gradient(top,#FFC59F,#FF9D5B);
border-radius: .1rem;
display: block;
padding: 0 .2rem;
box-sizing: border-box;
}
.display_block_img{
width:100%;
height: 2.12rem;
background: linear-gradient(top,#FFC59F,#FF9D5B);
border-radius: .1rem;
display: none;
box-sizing: border-box;
}
.cliessCentext{
text-align: center;
}
.cliessCentext>{
font-size: .15rem;
color: #666666;
}
.cliessImg{
width: 1.51rem;
height: 1.30rem;
margin-top: .15rem;
}
.action{
display: none;
}
.choose,.year{
position: relative;
height: .4rem;
flex-basis: 36%;
color: #101010;
font-size: .15rem;
line-height: .4rem;
}
.year>span{
display: inline-block;
width:0;
height:0;
border-width:.08rem .08rem 0;
border-style:solid;
border-color:#666666 transparent transparent;/*灰 透明 透明 */
z-index: 99999;
position: absolute;
top: 50%;
right:10%;
transform: translate3d(0,-50%,0);
}
.choose>span{
display: inline-block;
width:0;
height:0;
border-width:.08rem .08rem 0;
border-style:solid;
border-color:#666666 transparent transparent;/*灰 透明 透明 */
z-index: 99999;
position: absolute;
top: 50%;
right:10%;
transform: translate3d(0,-50%,0);
}
import React, {Component} from 'react';
import {connect} from 'dva'
import {withRouter} from 'react-router-dom'
import cliess from '../../assets/image/clientless.png'
import echarts from 'echarts/lib/echarts';
import 'echarts/lib/chart/line';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/title';
import {Toast, Picker} from 'antd-mobile';
import perform from './Performance.css'
import shareHide from "../../utils/shareHide"
class Performance extends Component {
constructor(props) {
super(props)
this.state = {
currentIndex: 0,
itemList : ['当日', '当月', '季度', '年度'],
dpValue: null,
customChildValue: null,
visible: false,
getFullYear:'',
getMonth:'',
arr:[],
perData:'D',
performArr:[],
Xdata:[],
getseriesData:[],
getXdata:[],
intervalDate:'',
amount:0.00,
}
this.setCurrentIndex = this.setCurrentIndex.bind(this)
}
// 改变index显示高亮
setCurrentIndex(index) {
let _this = this
this.setState({currentIndex: index},()=>{
_this.getIndex()
})
}
//个人业绩接口
getIndex = () =>{
switch (this.state.currentIndex) {
case 0:this.setState({perData:'D'},()=>{
this.performace()
});
break;
case 1:this.setState({perData:'M'},()=>{
this.performace()
});
break;
case 2:this.setState({perData:'Q'},()=>{
this.performace()
});
break;
case 3:this.setState({perData:'Y'},()=>{
this.performace()
});
break;
}
}
performace =()=>{
this.performaceServer()
}
//个人业绩接口
performaceServer(){
let that = this;
Toast.loading('loading...');
this.props.dispatch({
type: 'Performance/performList',
payload: {
"daySize": this.state.perData,
"managerId": localStorage.getItem("id"),
"roleId": localStorage.getItem("roleId"),
},
callback(data){
Toast.hide();
that.setState({
performArr:data
})
that.getEchares();//建立新的图表
},
error(data){
Toast.info(data.message)
}
})
}
//保单请求接口
filterData = () =>{
let that = this;
Toast.loading('loading...');
this.props.dispatch({
type: 'Performance/policyList',
payload: {
"daySize": "M",
"customSetDay":this.state.getFullYear+"-"+this.state.getMonth,
"managerId": localStorage.getItem("id"),
"roleId": localStorage.getItem("roleId")
},
callback(data){
Toast.hide();
that.setState({
arr:data
})
},
error(data){
Toast.info(data.message)
}
})
}
//echares图表
getEchares =()=>{
let myChart = echarts.init(document.getElementById('main'));
let { performArr } = this.state
let Xdata = performArr.achievements;
let getXdata = [];
let getseriesData = [];
let intervalDate=Math.ceil((performArr.achievements)&&(performArr.achievements).length/5)
Xdata && Xdata.map((item)=>{
getXdata.push(item.statisticaldate.substr(5));
getseriesData.push(item.totalprem);
})
// console.log(getXdata,intervalDate,getseriesData)
//此处需要在setOption之前处理dom显隐。否则样式会出问题,setOption是根据父元素的宽高来渲染图标大小
this.dealDay();
myChart.setOption({
xAxis: {
type: 'category',
data: getXdata,
axisLine:{
show:true,
onZero:true,
lineStyle:{
color: '#fff',
width: 2,
type: 'solid',
}
},
axisLabel: {
interval:intervalDate,
}
},
yAxis: {
type: 'value',
axisLine:{ //y轴
show:false,
lineStyle:{
color: '#fff',
width: 2,
type: 'solid'
}
},
axisTick:{ //y轴刻度线
show:false
},
splitLine: { //网格线
show: true
},
},
series: [{
data: getseriesData,
type: 'line',
areaStyle: {normal: {}},
// itemStyle: {
// normal: { //颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1,[{
// offset: 0, color: '#fff' // 0% 处的颜色
// }, {
// offset: 1, color: '#ffffff40' // 100% 处的颜色
// }]
// )
// },
// emphasis: { //线条样式
// }
// }
}],
color: {
colorStops: [{
offset: 0, color: '#fff' // 0% 处的颜色
}, {
offset: 1, color: '#fff' // 100% 处的颜色
}],
global: false // 缺省为 false
},
grid:{
x:50,
y:50,
x2:10,
y2:30,
borderWidth:1
},
subtextStyle:{
fontSize:5
}
});
}
// 处理月份
getDate () {
let arr = [];
for (let i = 1; i <= 12; i++){
if(i<10){
arr.push({ label:'0'+i+'月',value:i})
}else{
arr.push({ label:i+'月',value:i})
}
}
return arr;
}
// 处理年份
getYear () {
let arrYear = [];
let Dates = new Date();
let newYear = Dates.getFullYear()
for(let i = 1999 ; i<= newYear; i++){
arrYear.push({ label:i+'年',value:i})
}
return arrYear
}
goHome=()=>{
this.props.history.push('/home')
}
//当按天查询业绩的时候 显示默认图
dealDay(){
if(this.state.currentIndex == 0){
document.getElementById("main").style.display = "none";
document.getElementById("mainImg").style.display = "block";
}else{
document.getElementById("main").style.display = "block";
document.getElementById("mainImg").style.display = "none";
}
}
componentDidMount() {
shareHide()
document.title = '业绩';
let yearAry = [],monthAry = [];
let year = new Date().getFullYear(), month = new Date().getMonth()+1;
yearAry.push(year);
monthAry.push(month)
this.setState({
getFullYear: yearAry,
getMonth: monthAry
},()=>{
this.filterData()
})
this.performace()
}
componentWillUnmount(){
document.title = ''
}
render() {
let {itemList,arr,performArr} = this.state;
let amount = performArr.amount?parseFloat(performArr.amount).toFixed(2):'0.00';
return (
<div className={perform.performWrap}>
{/*<div className={perform.performtop}>
<ul>
<li className={perform.img} onClick={this.goHome}>X</li>
<li className={perform.text}> 业绩</li>
<li className={perform.omit}>…</li>
</ul>
</div>*/}
<div className={perform.performContent}>
<div className={perform.contentTop}>
<ul className={perform.contentLis}>
{
itemList.map ((item,i)=>{
return <li
key={i}
className={this.state.currentIndex === i ? perform.active : ''}
index={i}
onClick={()=>this.setCurrentIndex(i)}
>
{itemList[i]}
</li>
})
}
</ul>
</div>
<div style={{width: '100%',overflow: 'auto'}}>
<div className={perform.contentEsh}>
<ul className={perform.itemEsh}>
<li className={perform.lispan}>我的业绩</li>
<li className={perform.litext}>{performArr && amount} <span style={{fontSize:'.2rem',float:'none'}}>元</span> </li>
<li className={perform.lispan}>{this.state.currentIndex !=0 ? '业绩走势' : ''}&nbsp;</li>
</ul>
<div id="main" className={perform.display_block} ></div>
<img id="mainImg" src={require("../../assets/image/preformance_default.png")} className={perform.display_block_img} />
{this.state.currentIndex !=0 && <span className={perform.ptext}>该业绩统计以标准保费为口径</span>}
</div>
<div className={perform.policy}>
<p> <span>我的保单</span> <span className={arr.length > 0 ? perform.spantext:perform.action}>该月共<b>{ arr.length }</b>张保单</span></p>
<div className={perform.allDate}>
<div className={perform.date_picker_list} style={{ backgroundColor: 'white' }}>
<Picker
data={this.getYear()}
cols={1}
value={this.state.getFullYear}
onChange={v => {
const _this = this;
this.setState({ getFullYear: v },()=>{
_this.filterData()
})
}}
>
<div className={perform.year}>{ this.state.getFullYear +'年'} <span></span></div>
</Picker>
</div>
<div className={perform.date_picker_list} style={{ backgroundColor: 'white' }}>
<Picker
data={this.getDate()}
cols={1}
value={this.state.getMonth}
onChange={s => {
const _this = this;
this.setState({ getMonth: s },()=>{
_this.filterData()
})
}}
>
<div className={perform.choose}>{ this.state.getMonth < 10 ?'0'+this.state.getMonth +'月':this.state.getMonth +'月'} <span></span></div>
</Picker>
</div>
</div>
<div className={ arr.length > 0 ? perform.action:perform.cliessCentext}>
<img className={perform.cliessImg} src={cliess} alt=""/>
<p>您该月未开单哦~</p>
</div>
{
arr && arr.length > 0 && arr.map((item,i)=>{
return <div className={perform.policyList} key={i}>
<ul className={perform.policyUli}>
<li className={perform.ulis}><span>保单号:{item.contno}</span><span> {item.insuretime}</span></li>
<li className={perform.ulilast}><span>{item.planname}</span><span className={perform.spanPad}><b>{item.firstprem}元</b>首期保费</span></li>
</ul>
<p>客户:{item.appntname}</p>
</div>
})
}
</div>
</div>
</div>
</div>
);
}
}
Performance.propsTypes = {}
export default connect(({Performance})=>({Performance}))(withRouter(Performance));
body{
width:100%;
max-width: 680px;
margin: auto;
}
.all{
height: 100%;
}
.box{
width: 100%;
height: 100%;
overflow-y: scroll;
}
/*图片部分*/
.Bitmap{
width: 100%;
height:1.9rem;
position: relative;
}
.Bitmap>.share{
position: absolute;
right:.15rem;
top:.25rem;
width: .4rem;
height: .4rem;
}
.Bitmap>.main{
width: 100%;
height: 100%;
}
/*内容部分 */
.content{
width: 100%;
background-color: #FF9D5C;
padding-bottom: .11rem;
/*height: 5rem;*/
/*background-color: #FF9D5C;*/
/*margin: auto;*/
/*position: relative;*/
/*top: -.24rem;*/
/*border: 1 solid #FF9D5C;*/
/*border-radius: 10px;*/
}
/* 第一小节 */
.people{
width: 3.92rem;
background-color: white;
margin: auto;
position: relative;
top: -.24rem;
border-radius: 10px;
}
.life{
text-align: center;
position: relative;
top: -.2rem;
padding: 0 .11rem;
}
.life>img{
width: 1.38rem;
height: .48rem;
}
.life>p{
/* color: #FF9D5C;
font-size: .17rem;
position: absolute;
top: .08rem;
left: 50%;
margin-left: -.25rem; */
color: #FF9D5C;
font-size: .17rem;
position: relative;
top: -.38rem;
margin: 0 auto;
}
.insureMessage{
}
.mainInsurance{
font-size: .15rem;
color: #101010;
text-align: left;
line-height: .5rem;
height: .5rem;
}
.mainInsurance>span{
margin-left: .23rem;
}
.insureMessage>.title{
color: #666666;
font-size: .15rem;
display: flex;
}
.insureMessage>.title>span{
flex: 1;
}
.message{
color: #FF9D5C;
font-size: .18rem;
display: flex;
}
.insureMessage>.message>span{
flex: 1;
}
.button{
text-align: center;
position: relative;
top:.2rem;
}
.button>img{
width: .68rem;
height: .26rem;
}
/*第二小节*/
.content >.modal{
width: 3.92rem;
background-color: white;
margin: auto;
margin-top: -.11rem;
border-radius: 10px;
padding: .19rem 0;
}
.modal>.title{
display: flex;
}
.modal>.title>div{
flex: 1;
text-align: center;
color: #101010;
font-size: .14rem;
}
.modal>.title>div>img{
width: .44rem;
height:.44rem;
margin-bottom: .11rem;
}
/*第三小节*/
.health{
width: 3.92rem;
background-color: white;
margin: auto;
position: relative;
border-radius: 10px;
overflow: hidden;
margin-top: .11rem;
}
.health>.panel{
text-align: center;
color: #101010;
font-size: .17rem;
height: .4rem;
background-color: #FFF1E8;
line-height: .4rem;
font-weight: bold;
}
.insurance{
font-size: .17rem;
padding-left: .11rem;
}
.text{
padding: 0 .15rem 0rem;
}
.text>.subtitle{
color: #101010;
font-size: .17rem;
font-weight: bold;
padding: .1rem 0 0 0;
font-family: "PingFangSC-Medium";
/*font-family: "Adobe 黑体 Std R";*/
}
.trivia{
/*height: .15rem;*/
}
.dot{
float: none;
margin-right: 0;
}
.dot>img{
width: .08rem;
height: .08rem;
margin-right: .1rem;
margin-top: -.03rem;
}
.detail{
color: #666666;
font-size: .15rem;
}
.disease{
margin: .2rem 0;
padding: 0 .2rem;
}
.BenefitBox{
margin-top: .2rem;
text-align: center;
margin-bottom: .11rem;
}
.Benefit{
width: 1.5rem;
height: .4rem;
background-color: #FF9D5C;
border-radius: 10px;
display: inline-block;
font-size: .15rem;
color: #FFFFFF;
text-align: center;
line-height: .4rem;
}
.illness{
width: .87rem;
height: .4rem;
background-color: #FF9D5C;
border-radius: 6px;
display: inline-block;
/* margin-left: .82rem; */
font-size: .15rem;
color: #FFFFFF;
text-align: center;
line-height: .4rem;
margin-left: .2rem;
}
.illness_hxf{
width: .87rem;
height: .4rem;
background-color: #FF9D5C;
border-radius: 6px;
display: inline-block;
font-size: .15rem;
color: #FFFFFF;
text-align: center;
line-height: .4rem;
margin: 0 .2rem;
}
/* 保单利益*/
.getMoneyBox{
width: 3.64rem;
height: 1.32rem;
position: absolute;
top: 1.2rem;
z-index: 1;
}
.exempt{
color: #101010;
font-size: .17rem;
font-weight: bold;
/*padding: .1rem 0;*/
}
.moment{
width:3.11rem;
height:.4rem;
background-color:#FFF1E8;
font-size:.15rem;
text-align:center;
line-height:.44rem;
border-radius:10px;
margin:auto;
position: relative;
z-index: 8;
}
.moment>span{
color:#FF9D5C;
font-weight:bold;
/* display:inline-block; */
}
.moment>img{
width:.12rem;
height:.12rem;
margin-left:.1rem;
}
/** { touch-action: pan-y; }*/
span{float: none}
/*:global(.am-list-item){
padding-left: 0;
}*/
.list{
padding-left: .11rem;
/* margin-left: .2rem; */
height: .5rem;
font-size: .18rem;
color: #010101;
text-align: left;
border-bottom: 1px solid #ddd;
line-height: .5rem;
}
.illness1{
width: .9rem;
height: .4rem;
background-color: #FF9D5C;
border-radius: 6px;
display: inline-block;
/* margin-left: .82rem; */
font-size: .15rem;
color: #FFFFFF;
text-align: center;
line-height: .4rem;
margin-left: .2rem;
position: relative;
left: 50%;
margin: .2rem 0 0rem -.5rem;
}
:global(.am-list){
background: white;
}
.deta{
padding: 0 .1rem;
float: right;
background-color: #ddd;
font-size: .14rem;
border-radius: 10px;
color: white;
}
/* 亲启ye*/
.welcome{
position: relative;
overflow: hidden;
width: 4.14rem;
height: 100%;
background: #FFF7F1;
}
.welcome p.btn {
left: 50%;
bottom: 66px;
width: 1rem;
height: 1rem;
margin-left: -.43rem;
margin-bottom: 0;
text-align: center;
position: absolute;
top: 50%;
color: #FF9D5C;
font-size: .2rem;
line-height: .26rem;
margin-top: 2rem;
}
.welcome p span {
display: block;
}
.welcome>div{
height: 100%;
background: url('../../assets/image/cover.png')no-repeat center center/100% ;
}
.monery{
font-size: .18rem;
color:#FF9D5C;
}
.litter{
position: absolute;
width: .2rem;
bottom: 1.29rem;
height: .01rem;
left: .2rem;
}
.litter>img{
width: 100%;
}
.plus{
position: absolute;
width: .2rem;
bottom: 1.29rem;
height: .01rem;
right: .15rem;
}
.plus>img{
width: 100%;
}
.modalCss1{
position: fixed;
margin-left: -2.07rem;
left: 50%;
width: 4.14rem;
max-width: 680px;
max-height:6rem;
overflow-y:auto
}
import React, { Component } from 'react'
import { connect } from 'dva'
import styles from './PlanResult.css'
import Table from "../../components/Table"
import { Modal, List,Radio, WhiteSpace, WingBlank,Slider} from 'antd-mobile';
import moment from 'moment';
import shareHide from "../../utils/shareHide";
import 'moment/locale/zh-cn';
import share from "../../utils/share";
import Iscroll from "../../components/Iscroll";
import {urlGetParams} from '../../utils/dataFilter'
import {ProtectionItem,SeriousDiseaseList,
MiddleDiseaseList,GeneralDiseaseList,
SeriousDiseaseList_hxf,GeneralDiseaseList_hxf,
SeriousDiseaseList_hxf_huomian,GeneralDiseaseList_hxf_huomian,
SeriousDiseaseList_cqs,GeneralDiseaseList_cqs} from "../../utils/staticData";
moment.locale('zh-cn');
const RadioItem = Radio.RadioItem;
function closest(el, selector) {
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
while (el) {
if (matchesSelector.call(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
class PlanResult extends Component {
constructor(props){
super(props)
this.state={
termList:[],
clauseUrlList:[],
modal:ProtectionItem,
year:0,
age:0,
money:15236,
modal1: false,
modal2: false,
modal3: false,
modal4: false,
pdf:'',
allTime:[],
tableTitle:[
{
title: '年度',
dataIndex: '0',
width: '25%',
align:'center',
},
{
title: '年龄',
dataIndex: '1',
width: '25%',
align:'center',
},
{
title: '现金价值',
dataIndex: '2',
width: '50%',
align:'center',
}
],
tableTitleInsurance:[
{
title: '险种',
dataIndex: '0',
width: '25%',
align:'center',
},
{
title: '保额',
dataIndex: '1',
width: '25%',
align:'center',
},
{
title: '保费',
dataIndex: '2',
width: '25%',
align:'center',
},
{
title: '缴费期限',
dataIndex: '3',
width: '25%',
align:'center',
}
],
tableList: [],
tableMainList:[
{
key:0,
0:'12',
1:'35',
2:'65',
3:'74',
},
{
key:1,
0:'12',
1:'35',
2:'65',
3:'74',
}
],
insuranceValue:0,
cutButton:false,
seriNo:'',
insName:'', //姓名
insAge:'', //年龄
insAmnt:'', //保e
insPrem:'', //保费
hxfAmut:0, //华夏福保额
mainTable:[],//主险列表
fjTable:[],//主险列表
proposalInterest:[],//利益演示表
mainRiskCode:'', //主险code
fjRiskCodeList:[], //附加险code集合
cctHealth:false, // 常春藤-健康保障
hxfHealth:false, // 华夏福-健康保障
cqsHealth:false, // 常青树-健康保障
flmGetMoney:false, //福临门-固定领取
zhenaiGetMoney:false, //珍爱-固定领取
hxfGetMoney:false, //华夏福-固定领取
hxhnjGetMoney:false, //华夏红年金-固定领取
cctPremExempt:false, //常春藤保费豁免
flmPremExempt:false, // 福临门保费豁免
zhenaiPremExempt:false, // 珍爱保费豁免
hxfPremExempt:false,//华夏福附加重大豁免险种 保费豁免
cqsPremExempt:false,//常青树 保费豁免
hxhnjPremExempt:false,//华夏红年金 保费豁免
cctDieSafeguard:false , // 常春藤身故保障
flmDieSafeguard:false , // 福临门身故保障
zhenaiDieSafeguard:false , // 珍爱身故保障
hxfDieSafeguard:false , // 华夏福身故保障
cqsDieSafeguard:false , // 常青树身故保障
hxhnjDieSafeguard:false , // 华夏红年金身故保障
ybtHealthCase:false , // 医保通医疗保障
hxfHealthCase:false , // 华夏福医疗保障
ybtElseCase:false , // 医保通其他保障
cashValue:'0',
payTime:0, //几年交
illnessData:[],
illnessData3:SeriousDiseaseList,
illnessData1:MiddleDiseaseList,
illnessData2:GeneralDiseaseList,
hxfSeriousDisease:SeriousDiseaseList_hxf,
hxfGeneralDisease:GeneralDiseaseList_hxf,
hxfhmSeriousDisease:SeriousDiseaseList_hxf_huomian,
hxfhmGeneralDisease:GeneralDiseaseList_hxf_huomian,
cqsSeriousDisease:SeriousDiseaseList_cqs,
cqsGeneralDisease:GeneralDiseaseList_cqs,
illnessName:'所保重疾',
seriNo:'',
riskName:'',
riskCode:'',
cover:true,
totalPrem:'',
PaymentPeriodList:[],//保险期间list
mainWithFJPrem:0,//主险及其捆绑险种保费和
mainList:[],//主险列表
}
}
componentWillMount(){
// alert( '屏幕的高度'+ document.body.clientHeight ,'正文的高的'+ document.body.scrollHeight )
let url = window.location.href;
const params = urlGetParams(url);
console.log('params--->',params)
if(params.seriNo){
let seriNo = params.seriNo;
let riskName = params.riskName;
let riskCode = params.riskCode;
let thumbnail = params.thumbnail;
let urlShare = "";
if(params.isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = window.location.href+`&isShare=t&phoneNum=${localStorage.getItem('number')}`;
}
share({
decodeUrl: window.location.href.split('#')[0],
title: riskName,
desc: '您的专属保险计划书,请您查收!',
shareUrl: urlShare,
thumbnail: thumbnail,
record:{
"operCode": riskCode,
"operTitle": riskName,
"operFunction": 100120,
"operType": 202,
"phoneNum": params.isShare ? params.phoneNum : ""
}
});
this.setState({
seriNo:seriNo,
riskName:riskName,
riskCode:riskCode,
})
}else{
this.setState({
// cover:false,
seriNo:window.localStorage.getItem("seriNo"),
riskName:window.localStorage.getItem("riskName"),
riskCode:window.localStorage.getItem("riskCode"),
})
}
//点击记录
this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": params.riskCode,
"operFunction": 100120,
"operTitle": params.riskName,
"operType": 201,
"phoneNum": params.isShare ? params.phoneNum : ""
},
callback(data){
console.log('点击分享计划书结果页面链接,记录一次')
}
});
}
componentDidMount(){
document.title = this.state.riskName
let that = this;
shareHide(false);
if(this.state.cover){
setTimeout(()=>{
that.setState({
cover:false,
})
},3000)
}
this.getMessage();
this.getPerodList();//获取缴费期间值
}
componentWillUnmount(){
document.title = ''
}
getPerodList(){
let that = this;
let date = new Date();
let nowDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"birthday": this.state.riskCode=='511404' ? nowDate : '1981-02-23',
"pageNo":1,
"mainCode": this.state.riskCode
},
callback(data){
that.setState({
PaymentPeriodList:data,
})
}
})
}
/* 获取条款列表 */
getProspectusaAditiona2=()=>{
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode": this.state.mainRiskCode,
"riskType": "" //0:主险 ,1:附加险 ,''所有
},
callback(data){
let termList = [];
for (var i = 0; i < data.data.length; i++) {
termList.push({
key:0,
configName:data.data[i].riskName,
configCode:data.data[i].riskCode,
clauseUrl:data.data[i].clauseUrl,
cut:false,
},)
}
that.setState({
modal4:true,
termList:termList,
})
}
})
}
getMessage=()=>{
let that = this;
let riskName= this.state.riskName;
this.props.dispatch({
type: 'planEditor/getMyPlanMessage',
payload: {
"seriNo": this.state.seriNo,
// "seriNo": 319,
"interestRate": "0.03"
},
callback(data){
let microPlanInfo = data.microPlanInfo
// let modal = [];
let microPlanFJInfo = data.microPlanFJInfo
let proposalInterest = data.proposalInterest
let mainTable = [
{
key:0,
0:microPlanInfo.riskName,
1:Number(microPlanInfo.amnt)||'-',
2:Number(microPlanInfo.prem)||'-',
3:microPlanInfo.payTimeName||'-',
}
]
let allTime = [];
for (var i = 0; i < proposalInterest.length; i++) {
let age = i+ microPlanInfo.age;
allTime.push({value:i,label:<p className={styles.moment} style={{backgroundColor:'white'}}>保单年度 <span >{i}</span> 年,被保人 <span >{age}</span>岁时 </p> ,cashValue:Math.round(proposalInterest[i].cashValue/100),age:age,})
that.state.tableList.push({key:i,0:i,1:age,2:Math.round(proposalInterest[i].cashValue/100)})
}
let fjTable = [];
let Amut=0;
let Prem =Number(microPlanInfo.prem);
let fjRiskCodeList = [];
if(microPlanFJInfo.length>0){
for (var i = 0; i < microPlanFJInfo.length; i++) {
fjTable.push({
key:i,
0:microPlanFJInfo[i].riskName||'-',
1:Number(microPlanFJInfo[i].amnt)||'-',
2:Number(microPlanFJInfo[i].prem)||'-',
3:Number(microPlanFJInfo[i].payTime)==0 ? "趸交" : microPlanFJInfo[i].payTimeName||'-',
})
Amut += microPlanFJInfo[i].amnt
Prem += Number(microPlanFJInfo[i].prem)
fjRiskCodeList.push(microPlanFJInfo[i].riskCode)
//附加险
if(microPlanFJInfo[i].riskCode == '111703'){
that.setState({
ybtHealthCase:true , // 医保通医疗保障
ybtElseCase:true , // 医保通其他保障
})
}
if(microPlanFJInfo[i].riskCode == '121705'){
that.setState({
hxfHealthCase:true , // 华夏福医疗保障2014
hxfAmut:microPlanFJInfo[i].amnt
})
}
if(microPlanFJInfo[i].riskCode == '121513'){ //华夏福投保人豁免保费保险
that.setState({
hxfPremExempt:true, // 华夏福保费豁免
})
}
}
that.setState({
fjTable:fjTable,
fjRiskCodeList:fjRiskCodeList,
age:proposalInterest.length>0 ? proposalInterest[0].age : 0,
})
}
let mainTotalPrem = Number(microPlanInfo.prem);//计算主险和其捆绑险种的保费和
let lists = microPlanInfo.microPlanInfo2;
if(lists && lists.length>0){
for(let jj in lists){
mainTotalPrem += Number(lists[jj].prem);
}
}
//主险
if(microPlanInfo.riskCode == '511403'){
that.setState({
flmGetMoney:true, //福临门-固定领取
flmPremExempt:true, // 福临门保费豁免
flmDieSafeguard:true , // 福临门身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
age:microPlanInfo.age,
payTime:microPlanInfo.payTime,
})
}
if(microPlanInfo.riskCode == '511501'){
that.setState({
cctHealth:true, // 常春藤-健康保障
cctPremExempt:true, //常春藤保费豁免
cctDieSafeguard:true, //常春藤身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
payTime:microPlanInfo.payTime,
age:microPlanInfo.age,
})
}
if(microPlanInfo.riskCode == '511404'){
that.setState({
zhenaiGetMoney:true, //珍爱宝贝-固定领取
zhenaiPremExempt:true, // 珍爱宝贝保费豁免
zhenaiDieSafeguard:true , // 珍爱宝贝身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
age:microPlanInfo.age,
payTime:microPlanInfo.payTime,
})
}
if(microPlanInfo.riskCode == '411204'){
that.setState({
hxfHealth:true,//华夏福-健康保障
hxfGetMoney:true, //华夏福-固定领取
hxfDieSafeguard:true , // 华夏福身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
age:microPlanInfo.age,
payTime:microPlanInfo.payTime,
})
}
if(microPlanInfo.riskCode == '111505'){
that.setState({
cqsHealth:true,//常青树2015-健康保障
cqsPremExempt:true,//常青树2015保费豁免
cqsDieSafeguard:true , // 常青树2015身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
age:microPlanInfo.age,
payTime:microPlanInfo.payTime,
})
}
if(microPlanInfo.riskCode == '411405'){
that.setState({
hxhnjGetMoney:true, //华夏红年金-固定领取
hxhnjPremExempt:true,//保费豁免
hxhnjDieSafeguard:true,//身故保障
insAmnt:microPlanInfo.amnt,
insPrem:microPlanInfo.prem,
age:microPlanInfo.age,
payTime:microPlanInfo.payTime,
})
}
that.setState({
// modal:modal,
mainRiskNmae:microPlanInfo.riskName,
mainRiskCode:microPlanInfo.riskCode,
insSex:microPlanInfo.insSex,
insAge:microPlanInfo.age,
insYear:microPlanInfo.year,
// insAmnt:Number(Amut) ,
totalPrem:Prem ,
mainTable:mainTable,
proposalInterest:proposalInterest,
allTime:allTime,
mainWithFJPrem:mainTotalPrem,
mainList:microPlanInfo
})
}
})
}
log = (name) => {
return (value) => {
this.setState({
year:Number(value),
age:this.state.tableList[value]['1'],
cashValue:this.state.tableList[value]['2'],
})
};
}
changeValue=(year)=>{
if(year>-1 && year < this.state.tableList.length){
this.setState({
year:year,
age:this.state.tableList[year][1],
cashValue:this.state.tableList[year][2],
insuranceValue:this.state.tableList[year][0],
})
}
}
showModal = key => (e) => {
e.preventDefault(); // 修复 Android 上点击穿透
e.stopPropagation();
setTimeout(()=>{
this.setState({
[key]: true,
});
},100)
}
showModalillness=(list,name)=>(e)=>{
e.preventDefault();
e.stopPropagation();
setTimeout(()=>{
this.setState({
illnessData:list,
modal3:true,
illnessName:name
})
},100)
}
onClose = key => (e) => {
e.preventDefault();
this.setState({
[key]: false,
})
}
onChangeYear = key =>(e)=>{
e.preventDefault();
this.setState({
[key]: false,
initInsurance:false,
year:Number(this.state.insuranceValue),
age:this.state.insAge+this.state.insuranceValue,
// insuranceValue:this.state.cashValue,
cashValue:this.state.cashValue,
});
}
cutButton = ()=>{
this.setState({
cutButton:!this.state.cutButton,
})
}
onChange = (value,cashValue,label) => {
this.setState({
insuranceValue:value, //年度
cashValue:cashValue,
});
}
go(){
if(this.state.cover){
this.setState({
cover:false
})
}
}
render() {
const params = urlGetParams(window.location.href);
let recipientsSex = String(params.recipientsSex) == "0" ? true : false;
let recipientsName = params.recipientsName;
let recipients = recipientsName ? true : false;//有姓名默认有收件人
const data = this.state.allTime;
console.log("结果页面-------------------------》》》》",recipients,this.state.mainTable,this.state.fjTable,this.state.mainWithFJPrem,this.state.mainList,this.state.PaymentPeriodList,this.state.insAmnt);
let show = this.state.ybtHealthCase ||this.state.hxfHealthCase;
let showDieSafeguard = this.state.flmDieSafeguard ||this.state.cctDieSafeguard || this.state.zhenaiDieSafeguard || this.state.hxfDieSafeguard || this.state.cqsDieSafeguard || this.state.hxhnjDieSafeguard;//身故保障
let PremExempt = this.state.flmPremExempt || this.state.cctPremExempt || this.state.zhenaiPremExempt || this.state.hxfPremExempt || this.state.cqsPremExempt || this.state.hxhnjPremExempt;//保费豁免
let GetMoney = this.state.flmGetMoney || this.state.zhenaiGetMoney || this.state.hxfGetMoney || this.state.hxhnjGetMoney;//固定领取
let Health = this.state.cctHealth || this.state.hxfHealth || this.state.cqsHealth;//健康保障
let {ybtHealthCase,hxfHealthCase} = this.state;
return (
<div className={styles.all}>
{ this.state.cover &&
<div className={styles.welcome}>
<div></div>
<p className={styles.btn} onClick={()=>this.go()}>
{ recipients === true && <span>{recipientsName.substring(0,1)}{ recipientsSex === true?'先生':'女士' }<br/>亲启</span>}
{ recipients === false && <span>敬呈<br/>亲启</span> }
</p>
</div>
}
{
!this.state.cover &&
<div className={styles.box}>
<Iscroll id="planResult"
iscrollOptions={{
probeType:2
}}>
<div className={styles.Bitmap}>
{this.state.mainRiskCode == '511501'&& <img src={require('../../assets/image/cct.png')} className={styles.main} alt=""/>}
{this.state.mainRiskCode == '511403'&& <img src={require('../../assets/image/flm.png')} className={styles.main} alt=""/>}
{this.state.mainRiskCode == '511404'&& <img src={require('../../assets/image/zhenai.png')} className={styles.main} alt=""/>}
{this.state.mainRiskCode == '411204'&& <img src={require('../../assets/image/huaxiafu.png')} className={styles.main} alt=""/>}
{this.state.mainRiskCode == '111505'&& <img src={require('../../assets/image/cqs.jpg')} className={styles.main} alt=""/>}
{this.state.mainRiskCode == '411405'&& <img src={require('../../assets/image/huaxiahong.png')} className={styles.main} alt=""/>}
{/*<img src={require('../../assets/image/share.png')} alt="" className={styles.share} />*/}
</div>
<div className={styles.content}>
<div className={styles.people}>
<div className={styles.life}>
<img src={require('../../assets/image/rectangle.png')} alt=""/>
<p>{this.state.PaymentPeriodList.length>0 ? this.state.PaymentPeriodList[0].protectTimeName :''}</p>
<div className={styles.insureMessage}>
<div className={styles.title}>
<span>被保人性别</span>
<span>被保人年龄</span>
<span>首年保费</span>
</div>
<div className={styles.message}>
<span>{this.state.insSex=='F'?'女':'男'}</span>
<span>{this.state.insAge}</span>
<span>{this.state.totalPrem+"元"}</span>
</div>
{
this.state.cutButton && <div>
<div className ={styles.mainInsurance}>
{this.state.mainRiskNmae} <span style={{float:"right",marginRight:'0.2rem'}}>首年保费:{this.state.mainTable[0][2]+"元"}</span>
</div>
<Table listTitle={this.state.tableTitleInsurance} listTable={this.state.mainTable}/>
{
this.state.fjTable.map((item,index)=>{
return(
<div key={index}>
<div className ={styles.mainInsurance}>
{item['0']} <span style={{float:"right",marginRight:'0.2rem'}}>首年保费:{this.state.fjTable[index][2]+"元"}</span>
</div>
<Table listTitle={this.state.tableTitleInsurance} listTable={[item]}/>
</div>
)
})
}
</div>
}
<div className={styles.button} onClick={this.cutButton}>
<img src={this.state.cutButton == true?require('../../assets/image/flod.png'):require('../../assets/image/unflod.png')} alt=""/>
</div>
</div>
</div>
</div>
<div className={styles.modal}>
<div className={styles.title}>
{GetMoney &&
<div>
<img src={require("../../assets/image/getMoney.png")} alt=""/>
<div>固定领取</div>
</div>}
{Health &&
<div>
<img src={require("../../assets/image/health.png")} alt=""/>
<div>健康保障</div>
</div>
}
{show &&
<div>
<img src={require("../../assets/image/medical.png")} alt=""/>
<div>医疗保障</div>
</div>
}
{showDieSafeguard &&
<div>
<img src={require("../../assets/image/safeguard.png")} alt=""/>
<div>身故保障</div>
</div>
}
{PremExempt &&
<div>
<img src={require("../../assets/image/exempt.png")} alt=""/>
<div>保费豁免</div>
</div>
}
{this.state.ybtElseCase &&
<div>
<img src={require("../../assets/image/else.png")} alt=""/>
<div>其他保障</div>
</div>
}
</div>
</div>
{
GetMoney && <div className={styles.health}>
<div className={styles.panel}>固定领取</div>
{
this.state.flmGetMoney &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>福临门(智慧版)</div>
<div className={styles.text}>
<div className={styles.subtitle}>
{this.state.insAge + 5}岁起每年领取年金
<span className ={styles.monery}>
{this.state.insAmnt*0.3%10000 ==0? this.state.insAmnt*0.3/10000:(this.state.insAmnt*0.3).toFixed(0)}
{this.state.insAmnt*0.3%10000 ==0?'万元':'元'}
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
60岁至74岁每年领取关爱金
<span className ={styles.monery}>
{this.state.payTime == 0?(this.state.insPrem*0.06%10000 == 0?this.state.insPrem*0.06/10000:this.state.insPrem*0.06):this.state.payTime*this.state.insPrem*0.06%10000 == 0?this.state.payTime*this.state.insPrem*0.06/10000:this.state.payTime*this.state.insPrem*0.06}
{this.state.payTime == 0 ?this.state.insPrem*0.06%10000 == 0?'万元':'元':this.state.payTime*this.state.insPrem*0.06%10000 == 0?'万元':'元'}
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
75岁再领一笔养老金
<span className ={styles.monery}>
{this.state.payTime == 0?(this.state.insPrem*0.1%10000 == 0?this.state.insPrem*0.1/10000:this.state.insPrem*0.1):this.state.payTime*this.state.insPrem*0.1%10000 == 0?this.state.payTime*this.state.insPrem*0.1/10000:(this.state.payTime*this.state.insPrem*0.1).toFixed(0)}
{this.state.payTime == 0 ?this.state.insPrem*0.1%10000 == 0?'万元':'元':this.state.payTime*this.state.insPrem*0.1%10000 == 0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>收益稳,固定年金,领至终身</span>
</div>
</div>
</div>
}
{
this.state.zhenaiGetMoney &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>珍爱宝贝</div>
<div className={styles.text}>
<div className={styles.subtitle}>
18岁至24岁,每年领取深造教育金
<span className ={styles.monery}>
{this.state.insAmnt*1%10000 ==0? this.state.insAmnt*1/10000 : (this.state.insAmnt*1).toFixed(0)}
{this.state.insAmnt*1%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>年年领取100%基本保障,领取7年</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
30岁保险期满,一次性领取婚嫁金
<span className ={styles.monery}>
{this.state.payTime ? (this.state.payTime*1.2*this.state.insPrem%10000 == 0 ? this.state.payTime*1.2*this.state.insPrem/10000 : this.state.payTime*1.2*this.state.insPrem).toFixed(0) : 0}
{this.state.payTime ? (this.state.payTime*1.2*this.state.insPrem%10000 == 0 ? '万元' : '元') : '元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>满足婚嫁费用,携手走向幸福人生</span>
</div>
</div>
</div>
}
{
this.state.hxfGetMoney &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>华夏福两全保险</div>
<div className={styles.text}>
<div className={styles.subtitle}>
88周岁返还祝寿金
<span className ={styles.monery}>
{this.state.payTime==0 ? (this.state.mainWithFJPrem%10000 ==0 ? this.state.mainWithFJPrem.toFixed(0)/10000 : this.state.mainWithFJPrem.toFixed(0)) : (eval(this.state.mainWithFJPrem*this.state.mainList.payTime)%10000 ==0? eval(this.state.mainWithFJPrem*this.state.mainList.payTime)/10000:eval(this.state.mainWithFJPrem*this.state.mainList.payTime).toFixed(0))}
{eval(this.state.mainWithFJPrem*this.state.mainList.payTime)%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>给付完毕合同继续有效,提供高品质晚年生活</span>
</div>
</div>
</div>
}
{
this.state.hxhnjGetMoney &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
{eval(this.state.insAge + 10)<60 && (
<div className={styles.subtitle}>
{eval(this.state.insAge + 10) + "岁-59岁每年可领取年金"}
<span className ={styles.monery}>
{(this.state.insAmnt*0.2)%10000 == 0 ? (this.state.insAmnt*0.2)/10000 : (this.state.insAmnt*0.2).toFixed(0)}
{(this.state.insAmnt*0.2)%10000 == 0 ? '万元':'元'}
</span>
</div>
)}
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
{eval(this.state.insAge+10)>60 ? eval(this.state.insAge+10)+"岁后可领取年金" : "60岁后可领取年金"}
<span className ={styles.monery}>
{(this.state.insAmnt*0.4)%10000 == 0 ? (this.state.insAmnt*0.4)/10000 : (this.state.insAmnt*0.4).toFixed(0)}
{(this.state.insAmnt*0.4)%10000 == 0 ? '万元':'元'}
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
第5个保单周年日立即领取关爱金
<span className ={styles.monery}>
{this.state.payTime == 0 ? (this.state.insPrem*0.06)%10000 == 0 ? (this.state.insPrem*0.06)/10000 : (this.state.insPrem*0.06).toFixed(0) : (this.state.payTime*this.state.insPrem*0.06)%10000 == 0 ? (this.state.payTime*this.state.insPrem*0.06)/10000 : (this.state.payTime*this.state.insPrem*0.06).toFixed(0)}
{this.state.payTime == 0 ? (this.state.insPrem*0.06)%10000 == 0 ? "万元":"元" : (this.state.payTime*this.state.insPrem*0.06)%10000 == 0 ? "万元":"元"}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>保单第5年开始领至第9年,年年享受关爱</span>
</div>
</div>
</div>
}
</div>
}
{
Health &&<div className={styles.health}>
<div className={styles.panel}>健康保障</div>
{
this.state.cctHealth &&<div style={{paddingTop:'.11rem'}}>
<div className={styles.insurance}>常春藤(多倍版)</div>
<div className={styles.text}>
<div className={styles.subtitle}>
100种重疾保障最高可达
<span className ={styles.monery}>
{this.state.insAmnt*6%10000 ==0? this.state.insAmnt*6/10000:(this.state.insAmnt*6).toFixed(0)}
{this.state.insAmnt*6%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>重疾分六组,每组最多赔付一次,每次至少100%保额
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>首次确诊重疾给付
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:this.state.insAmnt}
{this.state.insAmnt%10000 ==0?'万元':'元'}/已交保费/现价较大者
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>第二、三、四、五、六次各自给付
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:this.state.insAmnt}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
20种中症保障最高可达
<span className ={styles.monery}> {this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:this.state.insAmnt}
{this.state.insAmnt%10000 ==0?'万元':'元'}</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>每次给付50%保额
{this.state.insAmnt*0.5%10000 ==0? this.state.insAmnt*0.5/10000:(this.state.insAmnt*0.5).toFixed(0)}
{this.state.insAmnt*0.5%10000 ==0?'万元':'元'}
</span>,累计两次为限
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
35种轻症保障最高可达
<span className ={styles.monery}>
{this.state.insAmnt*0.3*2%10000 ==0? this.state.insAmnt*0.3*2/10000:(this.state.insAmnt*0.3*2).toFixed(0)}
{this.state.insAmnt*0.3*2%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>每次给付30%保额
{this.state.insAmnt*0.3%10000 ==0? this.state.insAmnt*0.3/10000:(this.state.insAmnt*0.3).toFixed(0)}
{this.state.insAmnt*0.3%10000 ==0?'万元':'元'}
,累计两次为限
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
疾病终末期保障
<span className ={styles.monery}>
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:(this.state.insAmnt*1).toFixed(0)}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
/已交保费/现价较大者
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18岁前给付2倍已交保费,等待期90日内给付已交保费</span>
</div>
</div>
<div className={styles.disease}>
<span className={styles.illness} onClick={
this.showModalillness(this.state.illnessData3,'所保重疾')
}>所保重疾</span>
<span className={styles.illness} onClick={
this.showModalillness(this.state.illnessData1,'所保中症')
}>所保中症</span>
<span className={styles.illness} onClick={
this.showModalillness(this.state.illnessData2,'所保轻疾')
}>所保轻疾</span>
</div>
</div>
}
{
this.state.hxfHealth &&<div style={{paddingTop:'.11rem'}}>
<div className={styles.insurance}>华夏福两全保险</div>
<div className={styles.text}>
<div className={styles.subtitle}>
82种重疾保障至终身
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>未满18周岁:给付2倍基本保额
{this.state.insAmnt*2%10000 ==0? this.state.insAmnt*2/10000:(this.state.insAmnt*2).toFixed(0)}
{this.state.insAmnt*2%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18周岁-59周岁:至少给付基本保额
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:(this.state.insAmnt*1).toFixed(0)}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>60周岁及以后:至少给付1.2倍基本保额
{this.state.insAmnt*1.2%10000 ==0? this.state.insAmnt*1.2/10000:(this.state.insAmnt*1.2).toFixed(0)}
{this.state.insAmnt*1.2%10000 ==0?'万元':'元'}
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
42种轻疾保障至终身
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>第一次给付
{this.state.insAmnt*0.25%10000 ==0? this.state.insAmnt*0.25/10000:(this.state.insAmnt*0.25).toFixed(0)}
{this.state.insAmnt*0.25%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>第二次给付
{this.state.insAmnt*0.3%10000 ==0? this.state.insAmnt*0.3/10000:(this.state.insAmnt*0.3).toFixed(0)}
{this.state.insAmnt*0.3%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>第三次给付
{this.state.insAmnt*0.35%10000 ==0? this.state.insAmnt*0.35/10000:(this.state.insAmnt*0.35).toFixed(0)}
{this.state.insAmnt*0.35%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>每种轻症仅给付一次,给付后该轻症责任终止
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>轻症给付累计以三次为限,超过后轻症责任终止
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
疾病终末期、身故和全残保障至终身
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18周岁前给付2倍已交保费</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18周岁后至少给付
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000 : (this.state.insAmnt*1).toFixed(0)}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
</div>
</div>
<div className={styles.disease} style={{textAlign:'center'}}>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.hxfSeriousDisease,'所保重疾')
}>所保重疾</span>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.hxfGeneralDisease,'所保轻疾')
}>所保轻疾</span>
</div>
</div>
}
{
this.state.cqsHealth &&<div style={{paddingTop:'.11rem'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
61种重疾保障
<span className ={styles.monery}>
{this.state.insPrem*this.state.payTime %10000 ==0? this.state.insPrem*this.state.payTime/10000:(this.state.insPrem*this.state.payTime).toFixed(0)}
{this.state.insPrem*this.state.payTime%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>行业领先,全面呵护更心安
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
15种轻症保障
<span className ={styles.monery}>
{this.state.insAmnt*0.2%10000 ==0? this.state.insAmnt*0.2/10000:(this.state.insAmnt*0.2).toFixed(0)}
{this.state.insAmnt*0.2%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>每种疾病给付一次,累计三次为限
</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
疾病终末期保障
<span className ={styles.monery}>
{this.state.insPrem*this.state.payTime %10000 ==0? this.state.insPrem*this.state.payTime/10000:(this.state.insPrem*this.state.payTime).toFixed(0)}
{this.state.insPrem*this.state.payTime%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>确诊给付,疾病末期,更添关爱</span>
</div>
</div>
<div className={styles.disease} style={{textAlign:'center'}}>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.cqsSeriousDisease,'所保重疾')
}>所保重疾</span>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.cqsGeneralDisease,'所保轻疾')
}>所保轻疾</span>
</div>
</div>
}
</div>
}
{show &&<div className={styles.health}>
<div className={styles.panel}>医疗保障</div>
{
this.state.hxfHealthCase &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}> 华夏附加住院费用补偿医疗保险(2014)</div>
<div className={styles.text}>
<div className={styles.subtitle}>
住院报销额度
<span className ={styles.monery}>
{this.state.hxfAmut%10000 ==0? this.state.hxfAmut/10000:this.state.hxfAmut}
{this.state.hxfAmut%10000 ==0?'万元':'元'}</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>有社保社保报销之后95%赔付,无社保80%赔付;补偿住院费用,专注治疗。</span>
</div>
</div>
</div>
}
{
this.state.ybtHealthCase && <div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}> 医保通(普惠版)</div>
<div className={styles.text}>
<div className={styles.subtitle}>
一般医疗保险金
<span className ={styles.monery}>200万元 </span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>免赔额1万元,若不出险,每2年降低1000元免赔额</span>
<span className={styles.detail}>包含住院、特殊门诊、门诊手术、住院前后门急诊医疗保险金</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
100种重疾医疗
<span className ={styles.monery}>200万元</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>零免赔,100%报销,有无医保均可享</span>
<span className={styles.detail}>包含住重疾住院、特殊门诊、门诊手术、住院前后门急诊医疗保险金</span>
</div>
</div>
<span className={styles.illness1} onClick={
this.showModalillness(this.state.illnessData3,'所保重疾')
}>所保重疾</span>
</div>
}
</div>
}
{
showDieSafeguard && <div className={styles.health}>
<div className={styles.panel}>身故保障</div>
{
this.state.flmDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
不幸身故或全残给付已交保费与现价较大者
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>彰显生命价值,给家人留一份责任</span>
</div>
</div>
</div>
}
{
this.state.cctDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
18岁后给付
<span className ={styles.monery}>
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:this.state.insAmnt}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
/已交保费/现价较大者
</div>
<div className={styles.subtitle}>
18岁前给付已交保费的2倍
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>等待期90日内返还已交保费,合同终止</span>
</div>
</div>
</div>
}
{
this.state.zhenaiDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
不幸身故或全残给付已交保费与现价较大者
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>彰显大爱,给家人留一份责任</span>
</div>
</div>
</div>
}
{
this.state.hxfDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
疾病终末期、身故和全残保障至终身
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18周岁前给付2倍已交保费</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>18周岁后至少给付保额
{this.state.insAmnt%10000 ==0? this.state.insAmnt/10000:(this.state.insAmnt*1).toFixed(0)}
{this.state.insAmnt%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>给付后华夏福重大疾病保险计划合同终止</span>
</div>
</div>
</div>
}
{
this.state.cqsDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
终身身故/全残保障
<span className ={styles.monery}>
{this.state.insPrem*this.state.payTime%10000 ==0? this.state.insPrem*this.state.payTime/10000:(this.state.insPrem*this.state.payTime).toFixed(0)}
{this.state.insPrem*this.state.payTime%10000 ==0?'万元':'元'}
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>高额身价保障,给家人留一份爱与责任</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>等待期内因非意外患重疾/身故/全残,给付累计保费,合同终止
</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>被保险人身故/全残时未满18岁,给付累计保费,合同终止</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>重疾金、身故/全残金与疾病终末期金,仅给付一项</span>
</div>
</div>
</div>
}
{
this.state.hxhnjDieSafeguard &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
身故/全残金给付所交保费与现金价值较大者
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>彰显生命尊严,确保资金安全</span>
</div>
</div>
</div>
}
</div>
}
{
PremExempt && <div className={styles.health}>
<div className={styles.panel}>保费豁免</div>
{
this.state.flmPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
投保人意外身故或全残,免交后期保费,保障不断
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>人性化设计,尽显关爱,免除后顾之忧</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>交费期内出险,免交后期保费,保单继续有效</span>
</div>
</div>
</div>
}
{
this.state.cctPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
被保人确诊重疾/中症/轻症,免交后期保费
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>人性化设计,保障不断,尽显关爱</span>
</div>
</div>
</div>
}
{
this.state.zhenaiPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
投保人意外身故或全残,免交后期保费,保障不断
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>人性化设计,让父母无后顾之忧</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
投保人全残或身故,豁免后期保费,保单继续有效
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>交费期内出险,免交后期保费,保单继续有效</span>
</div>
</div>
</div>
}
{
this.state.hxfPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>投保人豁免</div>
<div className={styles.text}>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>被保人确诊轻症,豁免主与附加险后期保费,人性关怀更显体贴</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>投保人确诊重症/轻症/身故/全残,免交后期保费,保单继续有效</span>
</div>
</div>
<div className={styles.disease} style={{textAlign:'center'}}>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.hxfhmSeriousDisease,'所保重疾')
}>所保重疾</span>
<span className={styles.illness_hxf} onClick={
this.showModalillness(this.state.hxfhmGeneralDisease,'所保轻疾')
}>所保轻疾</span>
</div>
</div>
}
{
this.state.cqsPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>被保人罹患轻症,免交后期保费,养病可安心</span>
</div>
</div>
</div>
}
{
this.state.hxhnjPremExempt &&<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}>{this.state.riskName}</div>
<div className={styles.text}>
<div className={styles.subtitle}>
投保人意外身故或全残,免交后期保费,保障不断
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>人性化设计,让父母无后顾之忧</span>
</div>
</div>
<div className={styles.text}>
<div className={styles.subtitle}>
投保人全残或身故,豁免后期保费,保单继续有效
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>人性化设计,贴心显关爱</span>
</div>
</div>
</div>
}
</div>
}
{
this.state.ybtElseCase && <div className={styles.health}>
<div className={styles.panel}>其他保障</div>
{
<div style={{padding:'.11rem 0'}}>
<div className={styles.insurance}> 医保通(普惠版)</div>
<div className={styles.text}>
<div className={styles.subtitle}>
被保险人可凭医院处方,并且通过第三方合作机构的审核后,可到指定药房免费获得部分靶向类药品(或预约送药上门服务)
</div>
<div className={styles.subtitle}>
医保通不能单独购买,可搭配常青树系列、华夏福与福临门等系列产品
</div>
</div>
</div>
}
</div>
}
<div className={styles.health} onClick={this.getProspectusaAditiona2}>
<div className={styles.panel} >查看条款</div>
</div>
{
this.state.proposalInterest.length>0 &&<div className={styles.health}>
<div className={styles.panel}>保单利益</div>
<div className={styles.insurance} style={{padding:'.11rem 0 .11rem .11rem'}}> {this.state.riskName}</div>
<div className={styles.text} >
<p className={styles.exempt}>保单利益如下:</p>
<div>
<img src={require('../../assets/image/getMoneyBox.png')} alt="" className={styles.getMoneyBox}/>
<p className={styles.moment}>保单年度 <span >{this.state.year}</span> 年,被保人 <span >{this.state.age}</span> 岁时
<img src={require('../../assets/image/dropColor.png')} alt="" onClick={this.showModal('modal1')}/>
</p>
<p style={{fontSize:'.17rem',textAlign:'center',marginTop:'.11rem',height:'.7rem'}}>现金价值:
<span style={{color:'#FF9D5C',fontWeight:'bold'}}>{this.state.cashValue}</span> 元
</p>
<span className={styles.litter} onClick={() => this.changeValue(this.state.year-1,)}>
<img src={require("../../assets/image/little.png")} alt=""/>
</span>
<span className={styles.plus} onClick={() => this.changeValue(this.state.year+1,)}>
<img src={require("../../assets/image/plus.png")} alt=""/>
</span>
</div>
<div className="am-slider-example" style={{marginTop:'.rem' }}>
<WingBlank size="lg">
<Slider
style={{ marginLeft: 30, marginRight: 30,height:'.1rem',}}
defaultValue={0}
min={0}
max={this.state.tableList.length-1}
value={this.state.year}
onChange={this.log('change')
}
trackStyle={{
backgroundColor: '#FF9D5C',
height: '7px',
borderRadius: '7px',
}}
railStyle={{
backgroundColor: '#ddd',
height: '7px',
borderRadius: '7px',
}}
handleStyle={{
borderColor: '#FF9D5C',
height: '.15rem',
width: '.15rem',
marginLeft: '-7px',
marginTop: '-.04rem',
// backgroundColor: 'FF9D5C',
background:'#FF9D5C'
}}
/>
<p className="sub-title" style={{color:'#999',fontSize:'.14rem',textAlign:'center',marginTop:'.2rem'}}>
拖动按钮查看不同年龄段保单利益</p>
</WingBlank>
</div>
<div className={styles.BenefitBox}>
<span className={styles.Benefit} onClick={this.showModal('modal2')}>查看利益演示表</span>
</div>
</div>
</div>
}
{
this.state.riskCode != '411204' && (
<div className={styles.health}>
<div className={styles.panel}>风险提示</div>
<div className={styles.text} style={{padding:'0 .1rem .1rem'}}>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>投保人在保单犹豫期后解除合同会遭受一定损失,具体保单利益请以保单合同为准。</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>温馨提示:以上演示说明为本平台对上述产品的理解,便于保险从业人员学习、交流,演示数据仅供参考,请以实际为准。</span>
</div>
</div>
</div>
)
}
{
this.state.riskCode == '411204' && (
<div className={styles.health}>
<div className={styles.panel}>风险提示</div>
<div className={styles.text} style={{padding:'0 .1rem .1rem'}}>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>身故、全残、疾病终末期以及重大疾病保险金仅给付其中一项</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>本材料仅供参考,具体保险责任、责任免除事项以我司相关保险产品条款及生效保险合同为准</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>华夏福重大疾病保险计划由华夏福两全保险及附加华夏福重大疾病保险组成</span>
</div>
<div className={styles.trivia} >
<span className={styles.dot}>
<img src={require('../../assets/image/dot.png')} alt=""/>
</span>
<span className={styles.detail}>以上所述“已交保费”指华夏福两全保险及附加华夏福重大疾病保险合同的已交保险费之和</span>
</div>
</div>
</div>
)
}
</div>
</Iscroll>
<WingBlank>
<Modal
popup
visible={this.state.modal1}
onClose={this.onClose('modal1')}
animationType="slide-up"
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}}>保单利益 <span style={{float:'right',color:'green'}} onClick={this.onChangeYear('modal1')}>
完成</span></div>} className="popup-list">
</List>
<div style={{height:'60vh',overflowY:'scroll'}}>
<List>
{data.map(i => (
<RadioItem key={i.value} checked={this.state.insuranceValue == i.value} onChange={() => this.onChange(i.value,i.cashValue,i.age)}>
{i.label}
</RadioItem>
))}
</List>
</div>
</Modal>
<Modal
popup
visible={this.state.modal2}
onClose={this.onClose('modal2')}
animationType="slide-up"
className={styles.modalCss1}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}}>利益演示表<span style={{float:'right',color:'green'}} onClick={this.onClose('modal2')}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}}/>
</span></div>} className="popup-list">
</List>
<div>
<Table listTitle={this.state.tableTitle} listTable={this.state.tableList} scroll={{x:0, y:400}}></Table>
</div>
</Modal>
<Modal
popup
visible={this.state.modal3}
onClose={()=>this.setState({'modal3':false})}
animationType="slide-up"
>
<List renderHeader={() =>
<div style={{fontSize:'.18rem'}}>{this.state.illnessName} <span style={{float:'right',color:'green'}} onClick={this.onClose('modal3')}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}}/>
</span></div>} className="popup-list">
</List>
<div style={{height:'60vh',overflowY:'scroll',}}>
<List>
{this.state.illnessData.map(i => (
<div key={i.value} className={styles.list}>
{i.label}
</div>
))}
</List>
</div>
</Modal>
<Modal
popup
visible={this.state.modal4}
onClose={this.onClose('modal4')}
animationType="slide-up"
className={styles.modalCss1}
>
<List renderHeader={() => <div style={{fontSize:'.18rem'}}>条款列表<span style={{float:'right',}} onClick={this.closeInsurance}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.2rem',height:'.2rem'}} onClick={this.onClose('modal4')}/>
</span></div>} className="popup-list">
</List>
<List>
<List.Item >
<div style={{color:'#999999',marginLeft:'.11rem'}}>{this.state.mainRiskNmae}</div>
</List.Item>
{this.state.termList.map((item,index)=>{
return(
<List.Item style={{left:'.1rem'}} key={index}>{item.configName}
<div style={{float:'right',position:'relative',right:'.1rem'}} >
<img src={item.cut != true?require('../../assets/image/open.png'):require('../../assets/image/off.png')} alt="" style={{width:'.14rem',height:'.08rem'}}
onClick={()=>{
console.log(item);
let that = this;
let termList = this.state.termList;
termList[index].cut = !termList[index].cut
console.log(termList);
this.setState({
termList:termList,
// riskCode:item.configCode,
})
/* 条款列表详情接口 */
this.props.dispatch({
type:'planEditor/PlanClause',
payload:{
"riskCode":item.configCode,
"pageNo":1
},
callback(data){
console.log();
console.log(termList);
that.setState({
clauseUrlList:data.data[0].clauseUrlList
})
}
})
}}/>
</div>
{
item.cut && <div>
<span style={{color:'#888',fontSize:'.14rem'}}>条款预览</span>
<span className={styles.deta} onClick={()=>{
if(item.clauseUrl){
window.location.href = item.clauseUrl
}
}}> 查看详情</span>
{this.state.clauseUrlList.map((item,index)=>{
return(
<div key={index}>
<img src={item.configInfo} alt="" style={{height:'100%',width:'100%'}}/>
</div>
)
})
}
</div>
}
</List.Item>
)
})
}
</List>
</Modal>
</WingBlank>
</div>
}
</div>
)
}
}
PlanResult.propsTypes = {}
export default connect()(PlanResult)
import React, { Component } from 'react'
import { connect } from 'dva'
import { Link } from 'dva/router'
import shareHide from "../../utils/shareHide";
import {Toast} from "antd-mobile";
import NoData from "../../components/NoData";
import styles from './poster.less';
class Poster extends Component {
constructor(){
super()
this.state={
posterList: [],
selIdx: 0,
filterType: ['鸡汤', '节日', '产品'],
loadingFlag:true
}
}
componentWillMount(){
//Toast.loading('loading...',0);
}
componentDidMount() {
document.title = '海报'
shareHide();
let key = Number(sessionStorage.getItem("key"));
if(key == 1){
this.filter('节日');
}else if (key == 2) {
this.filter('产品');
}else{
this.filter('鸡汤');
}
}
componentWillUnmount(){
document.title = ''
}
filter(type) {
Toast.loading('loading...',0)
const _this = this;
this.props.dispatch({
type: 'poster/getPosterList',
payload: {
reportType: type,
agentCode1: window.localStorage.getItem('orgId'),
agentCode2: window.localStorage.getItem('project')
},
callback(res) {
Toast.hide();
if (typeof res.data === 'object') {
_this.setState({
posterList: res.data,
loadingFlag:false
})
} else {
_this.setState({
posterList: [],
loadingFlag:false
})
}
}
})
}
render() {
let selIdx = 0;
if(sessionStorage.getItem("key")){
selIdx = Number(sessionStorage.getItem("key"))
}
const { posterList } = this.state;
if(this.state.loadingFlag){
return <div></div>
}
return (
<div className={styles.wrapper}>
<div className={styles.tabCon}>
<div className={styles.splitline}></div><ul className={styles.tags}>
{
this.state.filterType.map((el, i) => {
return <li className={selIdx ===i?'on':''} key={i} onClick={() => {
this.filter(el);
this.setState({
selIdx:i
})
sessionStorage.setItem( "key", i);
}}>{el}</li>
})
}
</ul>
<ul className={styles.pList}>
{
posterList.length>0 ? posterList.map((el, i) => {
return <li key={i}>
<Link to={{
pathname: "/poster/info",
state: {
id: el.reportCode,
reportImage: el.reportImage
}
}}><img alt="" src={el.reportImage} /></Link>
</li>
}): <NoData />
}
</ul>
</div>
</div>
)
}
}
export default connect(({ poster }) => ({ poster }))(Poster)
import React,{ Component, Fragment } from 'react';
import { connect } from "dva";
import html2canvas from 'html2canvas';
import shareHide from "../../utils/shareHide";
import styles from './poster.less'
import moment from 'moment';
import { Toast } from "antd-mobile";
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
class PosterInfo extends Component{
constructor(props) {
super(props);
this.state = {
info: null
}
}
componentDidMount() {
document.title = '海报'
const posterImgWrap = this.posterImgWrap;
const { state } = this.props.location;
shareHide();
const _this = this;
let userInfo = JSON.parse(localStorage.getItem("userInfo"));
if (state) {
const id = state.id;
Toast.loading('loading...');
_this.props.dispatch({
type: "poster/getPosterInfo",
payload: {
reportCode: id
},
callback(res) {
let info = {};
info.position = userInfo.roleId == 2 ? '客户经理' : '督训';
info.img = res.reportImage;
info.name = userInfo.name;
info.phone = userInfo.number;
info.qrcode = userInfo.base64;
info.imgtype = _this.getImgExtention(state.reportImage);
info.codeType = _this.getImgExtention(userInfo.qrcode);
_this.setState({
info
}, () => {
Toast.hide();
html2canvas(_this.poster).then(function (canvas) {
var image = new Image();
image.src = canvas.toDataURL("image/png");
posterImgWrap.appendChild(image);
});
});
},
error(err) {
console.log(err);
}
});
}
// share({
// decodeUrl: window.location.href.split('#')[0],
// title: '我是'+info.name + ',您身边的保险管家',
// desc: '用我的专业为万千家庭带来保障',
// shareUrl: window.location.href,
// thumbnail: info.img
// });
}
getImgExtention = (img) => {
const pointIndex = img.lastIndexOf(".");
return img.substr(pointIndex+1);
}
componentWillUnmount(){
document.title = ''
}
render() {
const { info } = this.state;
let weekday = Number(moment().format("d"));
const nowDate = moment().format('YYYY年MM月DD日') + " " + moment.weekdays()[weekday];//当天日期
return (
<div className={styles.posterWrapper}>
<div className={styles.poster} ref={el => (this.poster = el)}>
{
info && <Fragment>
<img src={'data:image/'+info.imgtype+';base64,'+info.img} alt="" />
<div className={styles.date_section}>{nowDate}</div>
<div className={styles.info}>
<div className={styles.content}>
<img className={styles.contentBg} src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApQAAAC0CAMAAAAdIkwRAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADAUExURf///////////////////////////0dwTP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+DDa38AAABAdFJOU+bk5/MBAuIA5eME6fUD6u7wEfLoB+GL3x3bONLAN+3QsBr3KtS21l6TEF9blFxrbQnxzh4Yvs19evQmjBRVE1NKRO8YAAAEVElEQVR42u3a13LrNhSFYbBugaRIqpDqvbj33t//rUJJcc6ZRPJdJhjk/2484yuM9vLChsZKtvxA5POrXC0L9d+rxb2G+HKQL41eXFOwRbFclV+fIsGfQ1ffmXwt13mSxSacsdbqdH8OZbfTIpQWibMkX5ev36nchjKQ6+cwSZ3QMWTUbr8600GB9F0GaZNaFb00CZ+vd2NX2yHfT+duaE73aO9UosOhjOTU00zStmCG7nx6v01lFcq6LG690KTrUCfnPzfleUIobYyld7uo4liFMpDZ401o1unSwQ8vneqdM0hZKW0U3jzOqkAqX9rTZmjY4XTz4vD9HclFk6K0NJXNaVt8FcjT3LRMKicbtg9VZfVXNMwc5mdpKudPEihZFK55d6H2rjbLxT51ueKZY+9e6RaLaqd8ewkNPFtLj/Zf4JGMNF9SWlyVL2+i3tdGPhqc8eRuX1fW5W4y5vK2uCrT9bv6yM0csc4fZhL9ba/0I5k95FzeNnPyD1Wa+pWfzicjCeq/xdKvBzKakEm76aRUK2NfsnqsL9siQRT4leqHSPuy+iVzs7sps5Vamvv/Nk7LG56d/GrKk7Oh12KftH2pjJeqMPh/G2o6aw6Oj/rdRqPbPzoeNDPNu9t6bmH4AR2dJp7b6fU6rpekmpqEEW0ZajeuuDqkJWFQMCt8CgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAf1GtwqcAcwIZajeuuDokmDCBo9PEczu9Xsf1klQ7fCL/C4VrcEvqrDk4Pup3G41u/+h40Mw0bWk9t1DL2Ng5Oy1veHYifzk5G3otytL2fS1eqlVm6pj1WF+2RYIo8CvVD5H2ZfVL5mb3xpatVJkYOmWdT0YS1P1fTenXAxlNclJpNZ2U6iN3DM3kw0yi3yK5jWUkswdSaXdT5h/qfZ2auFQ648md1OUf6nI3GbNXWrxSput3JW8voYFHa+mRRLJHJCPd4g1urfDlTZQsCte8GWvval9P7rryyuMCt7Yo3WIhKpCnuXFV6WTDtvj7Q+lLe5hxgdtalPMnCVQ142nTtFTq5sX+y3t3gV80qUpLM9mcVm2kJJDZ441Zqaylg8ahotxUZWOQslVamcmbx1kVSLVZ0ha3nlH/7aCT8+poBwVynlCVFu6ToXe72Dwl1HbI99O5a1AstXd6+Pbe3N+nPHUsjKQ7n95vy0jtquf6OUxSJ3QMCabb/7kp+y5DtCqQVfTSJHy+3o1d7da0QF7LdZ5ksRFHbHW6h1fKzVLZ7fBVpU3iLMnX5asEu6kr+U6lfH6Vq2VhQijjXuPnUDZ6MaG0R7FclV+f8p1J+QNVbEqZ5PA0MwAAAABJRU5ErkJggg==' />
<div className={styles.info_name}>{info.name}</div>
<div className={styles.info_mid}>
<div>{info.position}</div>
<div>{info.phone}</div>
</div>
<div className={styles.info_img}>
{info.qrcode ? <Fragment>
<img className={styles.info_bg} src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJwAAACcBAMAAAB4lt9+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUdwTDQ0NDMzMwAAAEBAQDMzMzMzMzMzMzQ0NDMzMzY2NjU1NTg4ODMzMzMzM5nVlb8AAAAPdFJOUwCUBQEIjJaRkwrePoiGl/QBlTMAAAC0SURBVGje7doxCoMwFIfxlxpxqBRdxLG4dcsRcgSn7g7uXqFX6D2EHqHn6NSjdKjQOAr/gsP3299HsgXyzLSObf3TjjFsGc78NZmubw8r50GVa15PK6az6qKHYjL3vneJrYl09nKqzFW60zly5MiRI0eO3CqX97pc3puPuueTsrU8gsI+WwAAAAAAAAAAAABEsrDP1peP0pb4u5efd3LkyJEjR+6POe1ytXj1W7yYLl6b1/oACHovZWyChAQAAAAASUVORK5CYII=' />
<img className={styles.info_qrcode} src={'data:image/'+info.codeType+';base64,'+info.qrcode} alt="" />
</Fragment> : <img className={styles.info_qrcode} src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABMCAYAAACWA2JIAAAXv0lEQVR4Xt2dCZhcVZXH/+fe92rvJb1kJfsCWSCyy8iWIToSZRQDkc8P2UbDEmBERRwZhhZHBWfcAAnCIIrAMEGWIIvI5AsKCoPEIJAQiIQsZO2k966qt9x75ruvqjq9VHVXdVebbt73dd579e56fvecc7f3QijTwW7nMey7/8Lszyflvk2+vpFqJr9epuQ/8MlQOWrIydYPa/bWsu9GoFywckHaO+C+s+4ToqOpWlt255bmxlcWLGtwy5HfBzGNsoDQ7Xsf0b7zGSgngAA/DVYO9NaN0Ml2wAohZIfvsE77wooPohDLUafygGh67xnlpz8O3wH76SyINPz3NoE0g6yQtm37bOu05U+Uo9AfxDSGDML52cXz9MT5j8p5pxwO7WQg+Gmoxt3g1hZIO9xG0ro0vPjKhz6IAixXnYYEov2uC+dDWC+wtMdQVR1k7UQADO5sBzyfdZr2q5Q+v/qiG35brgIPdzrcvnu+JnkWLHsSQJ1M4qX3tu/9zezZs53hzHtIIDrvvvB2H3IFWSHAsiGsMJilD8fer5NiG4fCu6x4vCHxuS+N+N4TM1u6deutgLyUQQJkgYQESIKktZUIl1Gk6tnhgjEkEB0/uWi8iIlzNUJxGQ7tVgitd7bTx6zqqlOpInpAJOJNVjR8Z+RjF28ergqUK13VuOF7WtO1JCwgAJA7ywwQYfnCss6lcOXj5cqzezpDAlGoQO2rbp0nxySWIBFVsOUjseOWbR+Owg8mTf+Fuz6plPoi+2o6aU1Kec3Slu/KuSd/lklGYUDktCGAYu4NCKMZ9n4R0zOI6tsHk3d/cYYFhMlwxx9XRcePiZzgsvdOfN7S3eUu+GDS47X3jnfJ36F8z4JWyPz5QDgKa+ZRyGiDnRF+9i/4LQCR1RAZutBK1N03mPwPCYhcprxqlaRly9RQC84/XW6n69RExaEqy4YTdmgnLbujo5R09639SaIK9vtK+VXdQbBlw54xLyNsaWeB5GDk7jPmiqS8SVZNvrGUfIsJO2waUUzmA4VhbhCpx/YuJeASBk4mQoKzkYjhEdEbEPxQ2LZ+SktuaxsoPfPcff7ui5Xy72HlU04jWCtYU2eBwnFAHtSK3hpi7smOXC6rp9xZTF6lhBmxINKPrpijoe9n4PiBKkTAPkl8RfjsOx8ZKGwAY+3KK5Xv/5CVsoxpMiAoGoWcODkwTdRlnuwATNc9M9Trv/lU5MxvlH1gOiJBuKuvPM5X6lkGxhQj2CAMg4n4+thn7ry5mDjp/711MSu+l5V3mAFhtIMSCYixE0AylDFP0viLrM8gAXfDi+A9W3yC/2+JS+4x+eQUtJgs+w0z4kB0PrJ8ApFcx6BxpdaOCEyMC6OfueOBYuK2PPndMXa7fp8TVow4A4OlgKiugUhUgUIRMAjc3gr//XfAHc1ZB68goH+c+MK9Xyomn2LCjDgQqceueFAzPltM4fOGIbSyh3mJZXfsGSgNbmgQ7eNEi1ZehaiSEAkBsM70pAyUXK9K627XWWBaQUJdnFj+y58PlE8xz0cUiPSjX5yjyX6TAZG/8MYSmCLnzvlDEfEPYp9e+bWBBGBAdMxMtOi0U8FpM33vQcQAUUEgmRP+QcHnAOUgCegXK5bfd8pA+RTzfESBSD5++XXM9K28BRdxAaoQ8FxoLwlwmkUYKuDS5+DdsbNXTqMBbLgBkTp6XItKORXsuDAwdNoBpx2QUJAJbJPVtAdaLWTtR7TKaErgT1gpZn195fL7bilG0AOFGVEgOh5b8QAB5/QuNIUqCXKczW4K7CbBXhLspEDSUyIRyjtGUZY3qfKsu/b3JwADwjllWoufcirgeuC0B+04QNqFSDsPeI6/oubrt7Tyqmuina43ixRPtYSK+a6bJuL1sUvu3TGQgIt9PqJAtD+24leC8InehRexGTZrKXuDgJ9iWRN1IHpWg0CCCdPjn7p910Ag3I/NbVGOU8GuD3ZdkOM3Uyq9Ivb5r/53sUIsR7gRBaLz8StXAb1BMCg2KwJNIh8IURtLE1GPbiQRBAMzBwLhbHx0AbniT8pxI+z5EGAfcfkUheTDoQg/STOXtZZDyMWkMaJAdDx21f8QYUnPgjMoPisKhfwaURtPohcIABLEs/oD4b791DUM/WXSYiJ7ikC6FSGZzOVNhE4wbrXnrLuDqEEXI8yhhBkQhPPmqnnMvATEh1uCQpqhtOYmQWIrgddb4YpXafaSsiyadDx+5UNEdGYfHxGbEYei/CDqE31mQgmQDJ5TCIT77prLAL7C5EPEM1hjJwh56mAGJvREeMYZ/zqQkN3Na44hSWcQME0zJBHt16ReDU0b/zTRggE3TRQEkd60+nDS+haATytcCCYmdAD0JEH8JDz3028MVOD+nidXX/Ugoy8IOWZWlBL1IfYcQHlg3wX7HqBcJluldds+D6y6zFMGhD4iHwhn24vzBeg2UFcXOdcfLlA0gs/4VnTq363xtr38UZA6FYBDJNbJw9LPYVd8gud71xLRUfk6acy8LW17X6mcuKjfjkNeEP5fnz5Ta/1jgCJFC5agWfMD24W4afYgNSS5+ur7OY9GmLGDNfHIGCVqQ8EgC0Yvs9PYrBnaZ92+z+OO/Q77rgbYQljMjX/8R32m352dr94sgMOLrpfJDdgkWf6ZSX+uu7AZYjvAYwncv5xIvGVNOPr63r6sexn6gPC2rDmVtb49sLODOvgVm/3LBmOukk9cfR9DLAGRDSJJZnqBTUM38w+k5NhZYYrVhgHF0Ebe2TOYc4MsTrV5OtnkI5meG1/aEwTvfWOmp+UNQgSJFn1oZiWMAhEPSiZaM9lEK2n8/P8rlGkPELz19xM88P0ExIsuZf6Av7annfbt7o9416sxeKkwpqxp7e78+NWfVnlJ+XsjWN9LTYH2q8w0AweCNtMNKns2974WNeOFqDBBsiPeXJjgXpuBFgfxPPddNO1JdRxoWlJ3+X07TVn8A5uXMdNHhli3QUUXwGZZN8s08LxHDxDOjpduFuDjBpVTr0jK0ysiM05+m7e+OsGV7tWC+VgQCTCSmrEexA+Hp3zkzfRfVh/OTXs3HZzbCVp6l6CzLb/HvRhTA1FRmf0tEz4z4s2Ay0Ey96Kq5jbY8smw3fYHPfW8KzS4qhz1KzkNZt+qnvItIso7AO0C4b7/yoeI6JslZ1AgAgPPuS7/KhSm7xEjX+WZQWvI90/13339nIPCHxiECUsVVRCVlV3CzweSDIgxNfdAihYgBFE7axxVTNgmQpWdhWazylX/PuloUHurt7J66tTmfHl0gfB2vf6vDJ5XroKQwD7NaCHGnP7SJOWG/M3rl5YKIljMiScgszAyWpCZOQ3MWmDSFMSY2pWwQs0kw9UUqZ4hBCm2Evtl1aRtiI/NK5RyyaBnOgKppHooMXZs3lnhAERn46aJYdbf1Jmpzb/pIXw35L39yudLMU3dTRdFY4GZyvyWBZCFEPiMqtpbZchuIjtWyVakhoTQmQEgMUSkk6onvU+Jw3ZJO2QGSGbWV0Ca5QZzLYN7Ahm5ZGWjKTM5nDsbceXGe2ZAX/hIQz0ej9fn3UgRJJ7es+kfLUEf/ZsSyGXmO2Hv7Ze/OFgQwUxoJAJKVPRy7hkNkTV1/0mWaAKbrhZ8aNPvJR/MirUfTKOyog6p1aaQ9N6hRQ3p3nIwNhRgiQ0bBObPJ+zeLTFhAjU1NckaIQSICFVCoCMpQQlKibSFFAkSQkSiJOGQQJjE1t0Htk+fPr1P+ia/AITXtOVaMOoPCQjPCTsbfne1EVpgXro5Xu66zvWcsuanhzPP/hayIbOaEaRl/IgBUVf3HSKryQg8AGCEr6HY3GuzukM++yroboHZcz3eVqX0ZlrSUNRmhHLJjJqb36tOwLqmXAmWnA57MrXtzYVmjMZtO6fDaZ1ohgXBwKnbmYJ7k7o5G1OQec6+2wHl+0GrCoeFCEeNahihvgWt2a6oeIYFJY3wDQSW0oc2EHzFZtEhuM6AYKWVDH5TWtjYl+7A1sqzGvodEZdc3wIRiDv2HKl9fVa5Ehx0OkKwt/GJMzl1YFpJaXjpVmavsysOWWGyQmOEHV3JAin4GVOU0QCjJplzMALMXWtoSbl7g0wrtgwQaO2nO2ORyA78DvuoYfgm/8hr2bNYWHJhSZUfhsACgp3X7r+A/XRJ/XzWbis8p+dGMyFCFI49QxB7OPAHxhyJwO51mSSwkkYLjHnSyJgmkGKjHcG9UCy8zLVBJ9glL7U3uqtzH116l1duEZCfPLCUwGY//aE9nLTtvfHQpQD36LnJsfOqEKqMsHkJxkz6OZ1gtxOcbINKtQHJ5rSoim/sXvhgTkfLXyAW0fC1mRJXnNMGZbSClAi0wZgkM8AypswYRwOFNbSvWWRgBBCUlwXDARRB3ByN7ttPi36e1/EORpDktx9YCosiZprZmFkpIZTZlm5miLW2uiXaXUDdr0uatylUSN2ytV5tef683s+tGadOQrSuMlgUSneAk63QnU3Q7Y3QrfuA9n2uNWHs833SZf1wJCEfTfnhRVAwe12z8x9aycAvGEEbcyQUKz+rBaRY+IGwMxphQrmajUhYGf+vIViHJDT7rDV5ybb9Lc3jL/jlQdM4GAoH+8b5YzMHrVNg3TqxtbZWTrMswmG2QJMtUWP61kIEfx0kkiJtxRAzXW4BcizHcUQ4EhWO68pwOEyu61shM4sHkEfCsoMemwkL6ZulzS1rTlAH/rrM8EcmXNAW7JmLZiFaU1MIBBsQE8c/17sGRPhT9Iwbv9n03HVVYRk7GVrYPfwAtDJtP2j12gv0AEbgwjezyBlzZJ4JV7MI6ZAJbQBoxfCz1+asfNbCd2OObsO5d3SavVWDYfE3H8AVKmTquZsuYKKzez8Pzf3E8YjWTCqoEW2Njpw04Zk+IIC90cU3XBb0s579ajxtJU4kRsi08YwJyrRuNlqR8wOkgp1jGXPE2lyzhA75HJwDANpnSNbsmVgeswzr4N5cQ6oU2pN166d0lurYRwwIZ+23r9OMY/qAOOLMkzhSM7k/ENbkSav7miboiLPnIlpyW7DytmPVNdHa6sQxJCiU8QOmxetugu/mBxzFHJbKAAhMUlgopLIAAhBhzZ7RBo/ZYg3fCs6sHIZvm3ePdNpnZ8PGjelFDc8HXeuBjhEDIrn2Oz8korreBRY108cKKx5j7QG+B20ctvEXZm9T2jjupKbKir4vwjCIffpG7KNf73q2+emrwhOtyiMJ2uyIysCwjWlyM17DaEgPPxDSkGkNP6w5pwnKYxjhK4vZNuFdZiem4TvMUYfZjmv208xemNlLsptO+eMmz3RoUUO/QEYEiPfWNkTGy+htYC6ww2+g9pT/uRTyrtAp1/ZYjDHvWXQeNuYIEhQJTE+2Z2Rchh3sKsvvB1hqDW1lzJIxQ1ZUw3eZba1ZhRhemnVI6xwAToRZe1GuczoYVTFG6zaN+vleISAjAkTyhZunkBbfMAtygxN5/ljE/EzktOv6bKHnVefK9orps4SfhdHbDxh/YIQd+AHJLPObIdP6DQCjAdqu0EYDTElUuFp3Adi7FxgTZaTijPpmRmov45WUol4ma2SA+P0tJwhpf66cEAInzXgjevKX78mXrtnllz6mY6qZlwv8gDC23vSGso7ZAOjtByLGDJmlRDuvGWI3zLqik9mJcH26nXsCqMg0so5aRvOuzPWYZo1lD5tp3J6Dp3ILotj00i9+fwlAp+cLb006diHb8fFmz2vOL+hUG3S6FdzRAqRaXDl+4tr8eYnGyMlf+o9C5TCzqqlnvjYpgKEVm7FBACKPHwiE72ht/AA8O48Z6uQ6J5IxQ27bQQ0wmacqOABgDgNhzsSDmt+4gbMwihXX8IVL/eFH50Pk31lhzVy8lKzE3H56TUlrzpwf5C2dZhVxW/+9P0dpFiaw+p/HpjVFi/EDA5qhSF1mcSIwQ70AmN9zEAwAc2x8mKkhWNw49Ef6pduuIlDeOSZr5hmfZSu6oPCArrEzPHtewbeEQrZ9Jx136YAzqG0PLq+zKuLGw3L37mh3P8CxUFdvyJihmpDSgQb08QN5zFAfAPMZaICBYAgcchC8qiHkTxt3lbHS+ZqEPePvz2cZOarwFEdjh334gpsKNieBJyLHX/F2Mc2t+bGLqm0vFjHjgC4/kFK6N4CS/EBeAJnSdB/0HXoQf1k51nHEeQeXG3uKLDTjjIu0CB3dj0Z0hI448vpCghaEl0PHX/5KMSBMGF51RaI96kfy+4Fu3dGcH8D7QH28SDNktCB7NDQYB919d2KxRRyecOnX7poj3PyOOmg19bNnkrBrzFZL47DhJaHdJHSqHUi1g512X9Yftr5Q6Qj0rn3CF9aUUnr+4zXRlr0cNt3RPuOBLgCl+IFuAG5sCBZee79Ec8g1wl1397HQYn4pgiolrJZoiRzzTyW/jstPXxVuakI48APmKKY72o8ZCtK4sYELTQoechDea784WathXA8hqNDRFz7a377TQmDNKBzRVKjHeGArgHHZ3lBuPNAbQNAb6qUFwVxy4QHrIQeR/vMvFgMcK6WVlxRWSoTBa2jhBYNaM+C1p1vAtMy6zEDjgQIAcuUdsSDWrm2wTqqdfXqwHaXAIatmLIS0x8FzoF2zSpcyZgI61Qp0toJTba6cObfvwlC39MIR6zWavayxJIDdAptPUeBhZGAU0oI8GtA9v4HWKQ6pRvCbqxI+/A/1JyBRf/SnSYjDtZuGcjoDCMEqXccBcPsBs1qXiiw47tb+0rBUeCstXPr+YEGYeNwAgQnLZd8BWV8TVAqALm0ZSuGGGpfferTWA/W7a0PWzzuHWQQja7gdwVczOdUK3d4E7twP3XYgFT7yI9+HJQtOGCrXa4ouXPbekMtrOjurzj043hmiFvQANtTCDSU+v7F6nBvh2n5bc82C8wg8LzBLZrNGqh0q2ZzRiLYDUO2NqfDxi77bXxpmejQy55wtQylr97hmwrDr3nRHex0DmaF85Ti0pmnL6nFpQf066lDFvPNZY4H2zfvPHcYnQCebwB1N0G1GI/Yn7ZPPKDyyDpys4ujcs01/p2xHZhtmz2MwAEaGadr8dD2cAd7CqZ85E4LHKPMiukoCySR8pxlob4dy9oPbmvzQvJP2E3uLNfNcAIlgXytRKxF2guWmEOx1mLvu3eF4O9QAGQqAkQKiEjVDaKRNqHeVeyOYPwmYuapCCs4+A2slyTvsIz5VYMp8COUoQ9RDa5p4bfd9UyVVJ7mpc6Et6b8YqC2mErnPqAhgjYzKr9DkjzeVlOEwBy6mDsNchNKTT2/87WwZpl8yo6L02IHebLegL6RZ/7BvMPGTf312shT2SWA1A0ymDObrB43E/LYVbnqZJi9LlZruqAPBO/4Y9ZV7H0CTS61sLny2m/OmPfXU5UTU9VUB3vx0GKGKGKb47USL+uy6cHe8cCK0vhgaHyo0BDXfgWbQz0JTT32wlGmVUQfC3f7SZUR87mAh9IjH8nv2lBOf5cYXK/yktQKkTwfBbEJ0mfEWQTxmTznxBd78cqUfoWuA4GX3Ig961p58klmmLWpDxKgCwbv/XO8rdad5/71IafQbjIk322rCDUrsvYXBU/MFFiRfUqxnEnhsqXkSi7utw459sph4owqEu/O1iyHL+YoZmS1mr0Dgw8UIq/QwlE46+Er11KMGfGly1IDgzZvDqsr7PoDiP0tRuuTKGyOzGr3GGj93wG8/jRoQbuOm4wTTheWV1PCnRkJ0itr11xP1/zXo0QOiecsFxDRsK3nDh4TIg7o9VjOz3w/VjwoQzCz81p3XgdXoMUvdyLIQT4WqJve7gWF0gOh4b7zW0UuCLwuMwkNY/CdKTOrzMk33qowSEHsXamDxKGQQFJk1v2NVjv91f+UfFSC89sZFQtKCUQvC521WZX2/O0lGDQiScgK0eeFSmW9kmHf1gmutSQRfzDD/qGALaa5OvetW1Ah3OGALYDvFa54a9RoxkHCMMweeF9hQLxCPC0yzCLAF9kuBOkFosyxQpwAJkRTSilGcgHTwnwc5DkQ4IiRcCJBnptKFS8GHUATIl4AdQDf/mQHgC5AtfXP2gzcygzdxfXNN5jp4V1iaj61BkYAk8zarZKZddsWYfqff/x9TAO8fN1pnFQAAAABJRU5ErkJggg==' alt="" />}
</div>
<img className={styles.infoSplice} src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAB4CAYAAADYDyODAAAAAXNSR0IArs4c6QAAAYJJREFUOBF9k0tLw1AQRnvT2xKEuBAX4kJUFAURBBFciH+9hD4sLhRcqOBrIxRcCUWKfcVvTkkaeiVZTE9m5n7z6I1rt9tZTU9kxp4K8I1Ggxw/Ho+voMA4Cd6Y15IvgclkQlqo7Ov1OiHvnDuHAuM6nc69eb2eM6BCUDoo+Pl8fgIFxgSf0FH1Y2A6nZL2T4fyz8iJouiIpNy4VqvlCUnnBVCHu8BsxqHlMm1Ai9R8lmW/gIoe4MqNCcaEpPMGSHkbqBDUpD/kjEajfYPisUkTe7Oi74Cm2AR0yn5LHSqEx1b3beTV4R6u3Lher7dBSP18AJprHVAJ0ood+kJQoS9ykiRZ6VAjbxHSbVmMrLc1PKFgcVtU/ZOc4XC4skONvJMffwXUIbfWlmCO0shlwUX1wWCw8i/3+/1DdLSNZ0A6DFlMWoBdUUthdY9QYFyapqfkqPoDEDS2FCx/cXeBFg7X7XYv0NHCb4GK+9xsNjlln3AXCox1eI1OHMcpoGTSisb+AHV6nDyFBiX3AAAAAElFTkSuQmCC' />
</div>
</div>
</Fragment>
}
<div
className={styles.posterImg}
ref={el => (this.posterImgWrap = el)}
/>
</div>
<div className={styles.post_tips}>{info && '长按保存图片或发送给朋友'}</div>
</div>
);
}
}
export default connect(({ poster }) => ({ poster }))(PosterInfo);
ul,li,dl,dt,dd{
list-style:none;
margin:0; padding:0;
}
body{
background:#F5F5F5 !important;
margin:0; padding:0;
}
:global(.am-tabs-default-bar-tab){
font-size: .17rem;
color:#ABABAB;
}
:global(.am-tabs-default-bar-tab-active){
color:#101010;
}
:global(.am-tabs-default-bar-underline){
border: .02rem solid #FF9D5C;
}
.wrapper {
width: 100%;
color:#101010;
}
.tabCon {
font-family: helvetica;
font-size: .17rem;
.splitline{
width: 100%;
height: .1rem;
background:linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
opacity:0.1041;
}
.tags{
display:flex;
font-size: .17rem;
background: white;
padding-left:.05rem;
li{
cursor: pointer;
line-height: .5rem;
margin: 0 .15rem;
}
:global(.on){
color:#FF9D5C;
}
}
.pList {
display:flex;
width: 100%;
flex-wrap: wrap;
padding-left:.06rem;
margin-top: .05rem;
li{
width: 1.24rem;
height: 2.24rem;
background: pink;
margin: .05rem;
img{ width: 100%; }
}
}
}
.sentList{
font-family: helvetica;
font-size: .17rem;
margin-top: .1rem;
background: white;
dl{
display: flex;
padding-top: .1rem;
dt{
width: .8rem; height: .8rem;
border-radius:.05rem;
background: yellowgreen;
margin-left: .1rem;
}
dd{
padding-left: .14rem;
width: 3.1rem;
.tit{
color:#333;
line-height: .24rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.time{
font-size: .14rem;
color:#666;
line-height: .24rem;
margin-top: .04rem;
}
.other{
color:#999;
font-size: .13rem;
margin-top: .01rem;
line-height: .24rem;
display:flex;
.visited{
display:block;
position: relative;
width: .9rem;
padding-left: .24rem;
&:before {
position: absolute;
left:0; top:.04rem;
content:'';
width: .18rem;
height: .14rem;
background: url('../../assets/image/icon_visited.png') no-repeat;
background-size: 100%;
}
}
.forward{
display:block;
position: relative;
width: .8rem;
padding-left:.24rem;
&:before{
position: absolute;
left:0; top: .04rem;
content:''; width: .16rem;
height: .16rem;
background: url('../../assets/image/icon_forward.png') no-repeat;
background-size: 100%;
}
}
}
}
}
}
.posterWrapper {
height: 100%;
box-sizing: border-box;
display: flex;
overflow-y: auto;
flex-flow: column;
.date_section{
position: absolute;
top: .1rem;
z-index: 5;
height: .22rem;
line-height: .22rem;
width: 1.7rem;
left: 50%;
margin-left: -.85rem;
text-align: center;
color:#333333;
font-size: .14rem;
font-family: Arial, Helvetica, sans-serif;
border-radius: .1rem;
background:#fff;
}
.poster{
position: relative;
width: 3.26rem;
height: 5.8rem;
margin: 0 auto;
font-variant: small-caps;
img{
position: relative;
z-index: 1;
width: 100%;
height: 100%;
}
.info{
position: absolute;
display:flex;
left:0; bottom:0;
width: 100%;
z-index: 4;
padding: .12rem;
box-sizing: border-box;
&:before{
position: absolute; left:0; top:0;
width:100%; height: 100%; background:#000;
opacity: .4; z-index: 1;
}
.content{
position: relative;
display:flex;
justify-content:space-between;
width:100%;
height: .9rem;
z-index: 2;
color: white;
align-items: center;
.contentBg {
position: absolute;
left:0; top:0;
width: 100%; height: 100%;
z-index: 1;
}
.infoSplice {
position: absolute;z-index: 3;
width: 1px; height: .6rem; left: .76rem; top: .14rem;
}
.info_name{
position: relative;
display: table-cell;
width:.76rem;
color:#333;
font-size: .2rem;
//padding-top: .3rem;
flex-shrink: 0;
//height: .9rem;
text-align: center;
vertical-align:middle;
z-index: 2;
}
.info_mid{
position: relative;
z-index: 3;
font-size:.15rem;
// padding-left: .12rem;
width:40%;
//padding-top: .22rem;
color:#666;
}
.info_img{
position: relative;
z-index: 4;
width:.78rem;
height: .78rem;
text-align: right;
margin-right:.06rem;
margin-top :.06rem;
.info_bg{
position: relative;
width: 100%; height: 100%;
}
.info_qrcode{
position: absolute;
width: .7rem; height: .7rem;
left: .04rem; top: .04rem;
}
}
}
}
.posterImg {
position: absolute;
left:0; top:0;
width:100%;
opacity: 0;
z-index: 6;
}
}
.post_tips {
color:#999; font-size: .14rem; text-align: center;
line-height: .26rem;
}
.operation{
height: 1.27rem;
width: 100%;
background: white;
flex-shrink:0;
display: flex;
li{
font-size: .15rem;
color:#666;
margin-top: .2rem;
padding-top: .44rem;
text-align: center;
}
.msg {
width: .45rem;
height: .36rem;
background: url('../../assets/image/icon_wechat.png') no-repeat;
background-size: 100%;
margin-left: .44rem;
margin-right: 1rem;
}
.moments {
width: .5rem;
height: .36rem;
background: url('../../assets/image/icon_moments.png') center top no-repeat;
background-size: 79%;
margin-right: 1.05rem;
}
.download {
width: .39rem;
height: .36rem;
background: url('../../assets/image/icon_download.png') no-repeat;
background-size: 100%;
}
}
}
.haveNoData{
position: relative;
top: 0;
left: 0;
margin: 50% 0 0 50%;
transform: translate(-50%,-50%);
img{
width:2rem;
height:2rem;
}
.text{
text-align: center;
font-size: .2rem;
margin-top: .1rem;
color: #9b9b9b;
}
}
\ No newline at end of file \ No newline at end of file
body{
width:100% ;
max-width: 680px;
margin: auto;
}
/*
.box{
height: 100%;
width: 100%;
background-color: white;
}
.logo{
width: 2.57rem;
height: 1.67rem;
margin: 1.12rem auto 0.67rem ;
}
.logo > img{
width: 100%;
height: 100%;
}
*/
.phone{
text-align: center;
height: .8rem;
position: relative;
}
.phone img{
width:3.66rem;
height: .76rem;
}
.phone input{
position: absolute;
left: .5rem;
top:0.55rem;
border: none;
outline:none;
font-size:.18rem;
}
.phone span{
color: #FF9D5C;
position: absolute;
right: .5rem;
top:.55rem;
font-size:.18rem;
}
.verification{
text-align: center;
height: 1.2rem;
position: relative;
}
.verification img{
width:3.66rem;
height: .76rem;
}
.verification input{
position: absolute;
left: .5rem;
top:0.55rem;
border: none;
outline:none;
font-size:.18rem;
}
.approve{
width: 3.5rem;
height: 1.22rem;
margin:.26px auto 0;
}
.approve img{
width: 100%;
}
.bottom{
position: fixed;
bottom: 0;
color: #FF9D5C;
font-size: .15rem;
width: 100%;
max-width: 680px;
}
.bottom>p{
text-align: center;
}
/*认证失败*/
.pop{
position: fixed;
top:0;
left: 0;
width: 100%;
height: 100%;
background-color:rgba(0,0,0, 0.6);
}
.pop .up{
width: 3rem;
height: 1.5rem;
position: fixed;
top:50%;
left: 50%;
margin-left: -1.5rem;
margin-top: -.75rem;
background-color: white;
text-align: center;
border-radius: 7px;
}
.up p:nth-child(1){
color: #333333;
font-size: .18rem;
}
.up p:nth-child(2){
font-size:.15rem;
color: #666666;
}
.button{
position: relative;
font-size: .18rem;
}
.button span:nth-child(1){
position: absolute;
left: 50px;
top:12px;
}
.button span:nth-child(2){
position: absolute;
right: 50px;
top:12px;
}
:global(.ant-table-tbody){
background-color:white ;
}
import React, { Component } from 'react'
import { connect } from 'dva'
import shareHide from "../../utils/shareHide";
import Tabs from "../../components/Tabs"
import {Toast} from "antd-mobile"
class ProspectusList extends Component {
constructor(props){
super(props)
this.state={
navTitle:'计划书',
tab:['所有','我的'],
allPlanList:[],
myPlanList:[],
loadingFlag:true
}
}
getMyPlan=()=>{
console.log(localStorage.getItem("id"));
let that = this;
this.props.dispatch({
type:'home/getMyPlan',
payload:{
cusManager:localStorage.getItem("id"),
pageNo:"0"
},
callback(data){
// data.sort((a,b)=>{
// return Date.parse(b.createTime) - Date.parse(a.createTime)
// })
that.setState({
myPlanList:data
})
},
})
}
getAllPlan =()=>{
let that = this;
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1 启用
"proId":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
callback(data){
Toast.hide();
console.log(data);
that.setState({
allPlanList:data,
loadingFlag:false
})
},
})
}
componentWillMount(){
Toast.loading('loading...',0);
}
componentDidMount(){
let key = sessionStorage.getItem("key");
let tab = this.props.location.query ? this.props.location.query.key : key;
sessionStorage.clear();
sessionStorage.setItem("key",tab);
document.title = '计划书';
let that = this;
/* 计划书接口 */
this.getMyPlan()
this.getAllPlan()
shareHide();
}
componentWillUnmount(){
document.title = '';
}
render() {
console.log(this.props.login);
if(this.state.loadingFlag){
return <div></div>
}
return (
<div style={{height:'100%',backgroundColor:'white'}}>
{/*<HeaderNav title={this.state.navTitle} />*/}
<Tabs title={this.state.tab}
allPlanList = {this.state.allPlanList}
myPlanList = {this.state.myPlanList}
getMyPlan={this.getMyPlan}
style={{paddingTop:0}}/>
</div>
)
}
}
ProspectusList.propsTypes = {}
export default connect(({login})=>({login}))(ProspectusList)
import React, { Component } from 'react'
import { NavBar, Icon } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
/*ReactDOM.render(
<div>
<NavBar
mode="light"
icon={<Icon type="left" />}
onLeftClick={() => console.log('onLeftClick')}
rightContent={[
<Icon key="1" type="ellipsis" />,
]}
>NavBar</NavBar>
</div>
, root);*/
export default class HeaderNav extends Component{
constructor(){
super();
this.state={
select:0
}
}
componentDidMount(){
shareHide();
}
render(){
return (
<div>
<NavBar
mode="light"
icon={<Icon type="left" />}
onLeftClick={() => console.log('onLeftClick')}
rightContent={[
<Icon key="1" type="ellipsis" />,
]}
>NavBar</NavBar>
</div>
)
}
}
body{
width: 100%;
max-width:680px;
margin: auto;
}
.welcome{
width: 4.14rem;
height: 100%;
background: url('../../assets/image/welcome.png') no-repeat center center/100%;
background-size: contain;
background-color: white;
}
/*
.welcome img{
padding-left: .3rem;
width: 92%;
height: 100%;
}
*/
.animated{
position: absolute;
width: 100px;
font-size: 50px;
top: 50px;
left: 50%;
margin-left: -50px;
}
.FadeInFrame{
-webkit-animation-name: fadeIn; /*动画名称*/
-webkit-animation-duration: 2s; /*动画持续时间*/
-webkit-animation-iteration-count: 1; /*动画次数*/
-webkit-animation-delay: 0s; /*延迟时间*/
}
@-webkit-keyframes fadeIn {
from {
opacity: 0; /*初始状态 透明度为0*/
}
to{
opacity: 1; /*结尾状态 透明度为1*/
}
}
\ No newline at end of file \ No newline at end of file
import React, { Component } from 'react'
import { connect } from 'dva'
import shareHide from "../../utils/shareHide";
import {urlGetParams} from "../../utils/dataFilter";
import styles from './Welcome.css'
// import ReactCSSTransitionGroup from "react-addons-css-transition-group";
class Welcome extends Component {
constructor(){
super()
this.state={
phoneNum:urlGetParams(window.location.href).phoneNum ? false : true
}
}
go = ()=> {
let url = window.location.href;
let location = "";
//后台重定向到欢迎页面时,2秒后跳转home页面,并将参数带过去。
if(this.props.location.query){//登录页面过来,携带了phoneNum参数
location = window.location.origin+'/index.html#/home?' + url.split('?')[1] + "&phoneNum="+this.props.location.query.phoneNum;
}else {
location = window.location.origin+'/index.html#/home?' + url.split('?')[1];
}
window.location.href = location;
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
shareHide();
setTimeout(this.go,2000)
}
render() {
let animate = {
textAlign:'center',
position:'absolute',
top:'70%',
fontSize: '.2rem',
width: '100%',
}
return (
<div className={styles.welcome}>
{this.state.phoneNum && <div className={styles.FadeInFrame} style={animate}>
恭喜您成功注册智慧工作平台<br/>
开启智慧工作之旅
</div>}
</div>
)
}
}
Welcome.propsTypes = {}
export default connect()(Welcome)
import { Component } from 'react';
import { Tabs, Toast } from 'antd-mobile';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import MemberList from '../../components/MemberList/MemberList';
import { dataFilter } from '../../utils/dataFilter';
import shareHide from "../../utils/shareHide";
import css from './expertVideo.less';
class ChooseClient extends Component {
constructor(props) {
super(props);
this.state = {
chosenClient:null,
chosenItm: '',
chosenIdx:'',
followList: [],
storeFollowList: [],
commitList: [],
storeCommitList: []
}
}
getFollowClient() {
const _this = this;
Toast.loading('loading...');
this.props.dispatch({
type: 'myUser/getAllUser',
payload: {
id: window.localStorage.getItem('id'),
currentState: 0
},
callback(data) {
if (data.length) {
Toast.hide();
_this.setState({
followList: data,
storeFollowList: data
})
}
}
});
}
getCommitClient() {
const _this = this;
Toast.loading('loading...');
this.props.dispatch({
type: 'myUser/getAllUser',
payload: {
id: window.localStorage.getItem('id')
},
callback(data) {
if (data.length) {
Toast.hide();
_this.setState({
commitList: data,
storeCommitList: data
})
}
}
});
}
componentDidMount() {
document.title = '选择客户'
// 跟进中
this.getFollowClient();
shareHide();
}
componentWillUnmount(){
document.title = ''
}
render() {
return (
<div>
<div className={css.c_wrap}>
<Tabs tabs={[{ title: '跟进中', sub: '1' }, { title: '已提交', sub: '2' }]}
onChange={(t, i) => {
if (i === 0 && this.state.followList.length === 0) {
this.getFollowClient();
} else if (this.state.commitList.length === 0) {
this.getCommitClient();
}
}}
>
<div>
<MemberList
dataList={this.state.followList}
renderType={['name']}
filterData={(keywords) => {
const _this = this;
this.setState({
followList: dataFilter(_this.state.storeFollowList, ['name'], keywords)
})
}}
renderItem={(item,i) => {
return <div className={ this.state.chosenItm===i? css.clientItem+' on': css.clientItem} onClick={() => {
this.setState({
chosenClient: item,
chosenItm: i
})
}}>
<span className="name">{item.name}</span><span className={css.time}>{item.createTime.substr(0,16)}</span>
</div>
}}
pTitle='跟进中客户' />
<div className={css.btn_confirm}><span onClick={
(e) => {
this.props.dispatch(routerRedux.push({
pathname: '/home',
query: {
chosenClient: this.state.chosenClient,
},
}));
}
}>确定</span></div>
</div>
<div>
<MemberList
dataList={this.state.commitList}
renderType={['name']}
filterData={(keywords) => {
const _this = this;
this.setState({
commitList: dataFilter(_this.state.storeCommitList, ['name'], keywords)
})
}}
renderItem={(item,i) => {
return <div className={ this.state.chosenIdx===i? css.clientItem+' on': css.clientItem} onClick={() => {
this.setState({
chosenClient: item,
chosenIdx: i
})
}}>
<span className="name">{item.name}</span><span className={css.time}>{item.createTime.substr(0,16)}</span>
</div>
}}
pTitle='已提交客户' />
<div className={css.btn_confirm}><span onClick={
(e) => {
this.props.dispatch(routerRedux.push({
pathname: '/home',
query: {
idChoose: true,
chosenClient: this.state.chosenClient,
},
}));
}
}>确定</span></div>
</div>
</Tabs>
</div>
</div>
)
}
}
export default connect()(ChooseClient);
ul,dl,li,dt,dd {
margin:0; padding:0; list-style: none;
}
span {
float: none;
}
body{
background: white;
}
.modalWrap{
:global(.am-modal-content){
background: none;
}
}
.splitline {
width: 100%;
height: .1rem;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
opacity: 0.1041;
}
.e_wrap {
background: #fff; overflow: hidden;
.title {
position: relative;
text-align: center;
color:#333;
font-size: .18rem;
line-height: .54rem;
border-bottom:1px solid #F8F8F8;
.btn_chooseClient {
position: absolute; width: .86rem; height: .32rem;
left: .11rem; top: .10rem;
border: 1px solid #FF9D5C;
color:#FF9D5C;
font-size: .15rem;
line-height: .32rem;
border-radius: .04rem;
box-sizing: border-box;
}
.btn_close {
position: absolute;
right: .18rem; top: .2rem;
width: .14rem; height: .14rem;
background: url('../../assets/image/icon_close.png') no-repeat; background-size: 100%;
}
}
.btn_chooseClient1{
width: 3rem; height: .4rem; border: 1px solid #FF9D5C; text-align: center;
line-height: .4rem; margin: .2rem auto; border-radius: .2rem; color:#fff; background:#FF9D5C;
}
.clientInfo {
margin-top: .1rem;
padding: 0 .11rem;
box-sizing: border-box;
color:#101010;
li{
display: flex;
justify-content: space-between;
line-height: .3rem;
padding-bottom: .2rem; font-size: .17rem;
span {
margin-right: 0;
}
.sex{
color: #666;
display:flex;
font-size: .15rem;
i{
display:block;
width: .6rem; height: .3rem;
border: 1px solid #F0F0F1;
text-align: center;
font-style: normal; border-radius: .04rem;
margin-left: .08rem;
box-sizing: border-box;
}
:global(.on){
color:#FF5167;
border-color:#FF5167;
}
}
:global(.am-list-item .am-input-label){
font-size: .17rem;
}
.choose {
width: 1.5rem; height: .3rem;
border: 1px solid #F0F0F1;
font-size: .15rem;
border-radius: .04rem;
text-align: left; padding-left:.1rem;
color:#999; box-sizing: border-box;
span{
float:left; width: 1.1rem; overflow: hidden;
text-overflow: ellipsis; white-space: nowrap;
}
&:after{
float:right;
width: .12rem; height: .1rem;
margin-top: .11rem; margin-right: .1rem;
background: url('../../assets/image/icon_arrowDown.png') no-repeat;
content:''; background-size: 100%;
}
}
}
.e_phoneNum {
width: 100%; padding-left:0;
:global(.am-list-line){
padding-right:0;
justify-content: space-between;
}
:global(.am-input-control){
width: 1.5rem; height: .3rem;
border: 1px solid #F0F0F1;
border-radius: .04rem;
flex-grow: 0;
flex-basis: auto;
input { padding: 0 .1rem; font-size: .15rem;}
}
}
}
.btn_submit {
width: 3.5rem; height: 1.16rem;
background:url('../../assets/image/btn_submit.png') no-repeat; background-size: 100%;
margin: 0 auto;
}
}
.line {
height: .04rem;
background:linear-gradient(133deg, rgba(255, 197, 159, 1) 0%, rgba(255, 157, 91, 1) 100%);
border-radius:5px 5px 0px 0px;
overflow: hidden;
}
.c_wrap{
position: relative;
height: 100%;
background: white;
.listWrap{
position: relative;
height: 100%;
.indexList{
position: absolute;
right: .09rem;
top: .7rem;
li{
color:#666; font-size: .1rem;
line-height: .2rem;
width: .2rem;
height: .2rem;
}
}
.search{
padding: .1rem .17rem;
padding-bottom:0;
input {
box-sizing: border-box;
width: 100%; border: none;
border-radius: .16rem;
background:#F4F4F4;
height: .32rem; line-height: .32rem;
padding:0; padding-left: .42rem;
font-size: .14rem;
}
}
.subTip {
color:#101010; font-size: .15rem; line-height: .48rem;
text-align: left; margin-left: .11rem;
i{
color:#B6B6B6; font-style: normal;
}
}
.scrollListWrap{
height:5.2rem;
overflow-y: auto;
}
@media only screen and (device-width: 414px) and (device-height: 896px) {
.scrollListWrap {
height: 6.8rem;
}
}
@media only screen and (device-width: 375px) and (device-height: 812px) {
.scrollListWrap {
height: 6.6rem;
}
}
.list {
position: relative;
text-align: left;
dt{
background:#F8F8F8;
line-height: .3rem;
padding-left:.11rem;
box-sizing: border-box;
color:#ABABAB; font-size: .13rem;
}
dd{
line-height: .5rem;
padding-left:.11rem;
font-size: .15rem;
background:#fff;
color:#101010;
p{
display:flex;
margin:0;
justify-content: space-between;
}
span{
margin-right: 0;
float:none;
}
&:before{
display:block;
border-top:1px solid #F8F8F8;
content:''; overflow: hidden;
}
.time{
margin-right: .3rem;
}
:global(.name){
position: relative;
padding-left: .3rem;
&:before{
position: absolute;
left:0; top: .15rem;
content:''; width: .2rem; height: .2rem;
background: url('../../assets/image/icon_unChosen.png') no-repeat;
background-size:100%;
}
}
}
:global(.on) {
:global(.name) {
&:before{
background: url('../../assets/image/icon_chosen.png') no-repeat;
background-size:100%;
}
}
}
dd:first-of-type {
&:before{display:none;}
}
}
}
.clientItem {
display: flex;
justify-content: space-between;
padding-left: .1rem;
:global(.name) {
position: relative;
padding-left: .3rem;
&:before {
position: absolute;
left: 0;
top: .15rem;
content: '';
width: .2rem;
height: .2rem;
background: url('../../assets/image/icon_unChosen.png') no-repeat;
background-size: 100%;
}
}
.time {
margin-right: .3rem;
}
}
:global(.on) {
:global(.name) {
&:before {
background: url('../../assets/image/icon_chosen.png') no-repeat;
background-size: 100%;
}
}
}
.btn_confirm {
overflow: hidden;
span {
float: right;
width: .75rem;
height: .4rem;
background: #FF9D5C;
text-align: center;
line-height: .4rem;
border-radius: .04rem;
color: #fff;
margin-top: .09rem;
margin-right: .11rem;
}
}
}
import { Component } from 'react';
import { Modal } from 'antd-mobile';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import css from './expertVideo.less';
class ExpertVideo extends Component {
constructor(props) {
super(props)
this.state = {
e_age: 0,
e_product:0
}
}
handleSubmit() {
}
render() {
const { show, handleClose, handleShowChoosePop,handleNoneClient } = this.props;
return (
<div>
<Modal
popup
animationType="slide-up"
wrapClassName={css.modalWrap}
visible={show}
>
<div className={css.line}></div>
<div className={css.e_wrap}>
<div className={css.title}>
在线专家
<span className={css.btn_close} onClick={handleClose}></span>
</div>
<div className={css.btn_chooseClient1} onClick={handleShowChoosePop}>选择客户</div>
<div className={css.btn_chooseClient1} onClick={handleNoneClient}>无客户</div>
</div>
</Modal>
</div>
)
}
}
export default connect()(ExpertVideo);
.industryWrap{
background: #fff;
overflow: auto; height: 100%;
-webkit-overflow-scrolling: touch;
dl{
display:flex; margin:.1rem; margin-bottom:0; padding-bottom:.1rem;
border-bottom: 1px solid #F8F8F8;
dt{
width:.8rem; height: .8rem; flex-shrink: 0;
img{ width: 100%; height: 100%;}
}
dd{
margin-left: .12rem; margin-bottom: 0; flex: 1;
.tit{
font-size: .17rem; color:#333; line-height: .24rem; height: .48rem; width: 100%; overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
}
.subinfo{
display:flex; justify-content: space-between;line-height: .24rem;font-size: .13rem; color:#B6B6B6; margin-top: .09rem;
}
.viewCount {
position: relative; padding-left: .24rem; display: block;
&:before{
position: absolute; left:0; top:.05rem; width:.18rem; height: .13rem; content:''; background: url(../../assets/image/icon_eye.png) no-repeat; background-size: 100%;
}
}
.time{
}
}
}
}
.noInfo{
background: url(../../assets/image/clientless.png) center center no-repeat; background-size: 40%;
position: relative;
&:after{
position: absolute; left: 0; top: 62%; content: '暂无数据'; color: rgb(102, 102, 102); width: 100%; text-align: center; font-size: .15rem;
}
}
.detailWrap{
padding: .15rem .1rem .5rem; overflow: auto; height: 100%;
background:#fff;
.detailTitle{
font-size: .19rem; color:#101010; line-height: .26rem;
}
.detailInfo{
display:flex; justify-content: space-between; color:#B6B6B6; font-size: .13rem; line-height: .24rem; margin-top: .07rem;
.viewCount {
position: relative; padding-left: .24rem; display: block;
&:before{
position: absolute; left:0; top:.05rem; width:.18rem; height: .13rem; content:''; background: url(../../assets/image/icon_eye.png) no-repeat; background-size: 100%;
}
}
}
:global(.ck-content){
overflow: hidden;
margin-top: .15rem;
img{ max-width: 100%;}
video{
max-width: 100%;
}
}
}
import { Component, Fragment } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import $ from 'jquery';
import share from '../../utils/share';
import shareHide from "../../utils/shareHide";
import {urlGetParams} from '../../utils/dataFilter'
import css from './css.less';
class Detail extends Component{
constructor(props) {
super(props);
this.state = {
data:null
}
}
componentDidMount() {
document.title = '行业动态';
const { search } = this.props.location;
const params = urlGetParams(window.location.href);
const _this = this;
if (params.id) {
let id = search.substr(4)
this.props.dispatch({
type: 'industrynews/getNews',
payload: {
id:params.id,
reqType:0
},
callback(res) {
_this.setState({data:res})
let htm = res.html.replace(/<figure class="image"><img src="http:\/\/zmtoss\.ihxlife\.com\/polysoft\/o2o_industrynews_audit_1561000223813\.png.*?<figcaption>(.+?)<\/figcaption><\/figure>/g, `<div style="clear:both"><video src=$1 controls="controls"></video></div>`);
$('.ck-content').html(htm);
let urlShare = "";
if(params.isShare){//处理多次转发参数问题
urlShare = window.location.href;
}else{
urlShare = window.location.href+`&isShare=t&phoneNum=${localStorage.getItem('number')}`;
}
share({
decodeUrl: window.location.href.split('#')[0],
title: res.title,
desc: $('.ck-content').text().substr(0,100),
shareUrl: urlShare,
thumbnail: res.imgUrl,
record:{
"operCode": res.id,
"operTitle": res.title,
"operFunction": 100110,
"operType": 202,
"phoneNum": params.isShare ? params.phoneNum : ""
}
});
//点击记录一次
_this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": res.id,
"operFunction": 100110,
"operTitle": res.title,
"operType": 201,
"phoneNum": params.isShare ? params.phoneNum : ""
},
callback(data){
console.log('点击分享链接,记录一次')
}
})
}
})
}
shareHide(false);
}
render() {
const { data } = this.state;
return (
<div className={css.detailWrap}>
{
data && <Fragment>
<div className={css.detailTitle}>{data.title}</div>
<div className={css.detailInfo}>
<div className={css.author}>来源:{data.author}</div>
<div className={css.time}>{moment(data.modifyTime).format('YYYY-MM-DD')}</div>
</div>
</Fragment>
}
<div className="ck-content"></div>
<div className={css.detailInfo}>
<div className={css.viewCount}>{data && data.viewCount}</div>
</div>
</div>
)
}
}
export default connect()(Detail);
import React, { Component } from 'react';
import { connect } from 'dva';
import { Toast ,PullToRefresh} from 'antd-mobile';
import moment from 'moment';
import shareHide from "../../utils/shareHide";
import Iscroll from "../../components/Iscroll";
import NoData from "../../components/NoData";
import css from './css.less';
import { message } from 'antd';
class Index extends Component{
constructor(props) {
super(props);
this.state = {
list: [],
isloading: false,
pageNo:1,
pageSize:20,
finish:'',
refreshing:false,
dataEnd:false
}
}
componentDidMount() {
document.title = '行业动态';
const _this = this;
const userId = localStorage.id ? localStorage.id : null;
this.setState({ userId })
shareHide();
Toast.loading('loading...',1000)
this.props.dispatch({
type: 'industrynews/getNewsList',
payload: {
status:1,
pageNo:1,
pageSize:20
},
callback(res) {
_this.setState({ list: res ? res : [], isloading: true })
Toast.hide();
},
error(err) {
message.error(err.message)
}
})
}
getNewsListItem=()=>{
let _this = this;
let pageNo = this.state.pageNo +1;
this.props.dispatch({
type: 'industrynews/getNewsList',
payload: {
status:1,
pageNo:pageNo,
pageSize:20
},
callback(res) {
let list = _this.state.list;
let pageNo = _this.state.pageNo;
let finish = _this.state.finish;
let dataEnd = false;
if(res && res.length>0){
list = list.concat(res);
pageNo = pageNo +1;
finish = "完成刷新";
}else{
finish = "没有更多数据了";
dataEnd = true;
}
_this.setState({
list: list,
isloading: true,
refreshing:false,
pageNo:pageNo,
finish:finish,
dataEnd:dataEnd
})
Toast.hide();
},
error(err) {
message.error(err.message)
}
})
}
render() {
const { list, isloading } = this.state;
return <div className={css.industryWrap + ' ' + ((list.length === 0 && isloading) ? css.noInfo : '' )}>
<Iscroll
id="industrynews"
iscrollOptions={{
preventDefault: true,
}}
onPullUpLoadMore={() => this.getNewsListItem()}
hasUp={true}
hasDown={false}
dataEnd={this.state.dataEnd}
haveBackTop={true}
noUpStr={'已全部加载完毕'}
>
<div>
{
list.length > 0 && list.map(itm => <dl
key={itm.id}
onClick={() => {
this.props.history.push({ pathname: "/industrynews/detail", search: 'id=' + itm.id });
}}
>
<dt><img src={itm.imgUrl} /></dt>
<dd>
<div className={css.tit}>{itm.title}</div>
<div className={css.subinfo}>
<span className={css.viewCount}>{itm.viewCount}</span>
<span className={css.time}>{moment(itm.modifyTime).format('YYYY-MM-DD')}</span>
</div>
</dd>
</dl>)
}
</div>
</Iscroll>
</div>
}
}
export default connect()(Index);
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/* 获取客户经理*/
export async function GetManagerList(params) {
return request('/o2o/customer/getCustimerManger', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 修改客户经理状态*/
export async function UpdateManager(params) {
return request('/o2o/customer/updateManager', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 获取客户经理所属*/
export async function GetOrzList(params) {
return request('/o2o/Organization/getAllOrganization', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 获取省市级联信息*/
export async function GetRegionList(params) {
return request('/o2o/Dictionaries/configQuery', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 获取客户列表*/
export async function GetClientList(params) {
return request('/o2o/customer/getAuditedCustomer', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 修改客户信息*/
export async function UpdateClientInfo(params) {
return request('/o2o/customer/updateCustomer', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
export async function GetInvitationTmpsList(params) {
return request('/o2o/invitation/getinvitationConfigList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function GetMyInvitList(params) {
return request('/o2o/invitation/getMyinvitationTemplateConfigList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function GetInvitListById(params) {
return request('/o2o/invitation/getinvitationTemplateConfigList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function addEdit(params) {
return request('/o2o/invitation/addOrUpdateinvitationTemplate', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
export async function del(params) {
return request('/o2o/invitation/deleteMyinvitationConfig', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/* 获取客户*/
export async function addUser(params) {
return request('/o2o/customer/updateCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 字典查询 */
export async function Dictionaries(params) {
return request('/o2o/Dictionaries/configQuery', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 提交至督训*/
export async function sendMaster(params) {
return request('/o2o/wx/sendMaster', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 投保人手机号是否在跟进中 开始弃用2019-7-1 */
export async function isFollow(params) {
return request('/o2o/customer/getAllCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 投保人手机号是否在跟进中 */
export async function followCustomer(params) {
return request('/o2o/customer/followCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
import { notification } from 'antd';
// 报错提示
export function notifyError(messageInfo, title = 'Error', s) {
const text = messageInfo && messageInfo.split(/\s+/g);
const elements = [];
for (const i in text) {
if (text[i]) {
const element = `<p key=${i}>${text[i]} </p>`;
elements.push(element);
}
}
notification.error({
message: title,
description: messageInfo,
duration: 10,
style: { width: '3.4rem',maxWidth:'580px' },
});
}
// 警告提示
export function notifyWarning(messageInfo, title = 'Warning') {
notification.warning({
message: title,
description: messageInfo,
duration: 0,
});
}
// 信息提示
export function notifyInfo(messageInfo, title = 'Info') {
notification.info({
message: title,
description: messageInfo,
});
}
// 成功提示
export function notifySuccess(messageInfo, title = 'Success') {
notification.success({
message: title,
description: messageInfo,
duration: 1,
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
//获取名片信息
export async function GetBusinessCardInfo(params) {
return request('/o2o/customer/getLoginInfo', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//新增修改名片
export async function UpdateBusinessCardInfo(params) {
return request('/o2o/customer/updateManager', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
//获取背景模板
export async function GetCardBackgroundTmpsList(params) {
return request('/o2o/backgroud/getbackgroundConfigList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//新增修改背景
export async function AddOrUpdateCardBackground(params) {
return request('/o2o/backgroud/addOrUpdatebackgroudConfig', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
//删除名片背景
export async function DeleteCardBackgroud(params) {
return request('/o2o/backgroud/deletebackgroudConfig', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/* 获取资料库列表*/
export async function GetDataBankList(params) {
return request('/o2o/Dictionaries/configQuery', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 获取资料库列表*/
export async function GetDataInfoList(params) {
return request('/o2o/data/getDataConfigList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
//互动社区获取登录的用户消息
export async function getLoginUserInfo(params) {
return request('/o2o/wx/WeChatInfo', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//获取所有问题
export async function getAllQuestionList(params) {
return request('/o2o/interactive/getQuestionList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//查询问题详情数据
export async function getQuestionInfo(params) {
return request('/o2o/interactive/getAnswerInfo', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
//获取回答的回答列表
export async function getAnswerOfAnswerInfo(params) {
return request('/o2o//interactive/getAnswerInfo', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//添加问题
export async function AddQuestion(params) {
return request('/o2o/interactive/insertQuestion', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//回答问题
export async function addAnswer(params) {
return request('/o2o/interactive/insertAnswer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
//问题点击率
export async function updateClickNum(params) {
return request('/o2o/interactive/updBrowseVolume', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
export async function GetAccessToken(params) {
return request('cgi-bin/token?grant_type=client_credential&appid=wx514e0c5719c47c8d&secret=c6bb95eca191951056870babcc24dec9', {
// method: 'get',
headers:headersPost,
// body: JSON.stringify(params),
});
}
export async function GetWXACodeUnlimit(params, token) {
return request('/wxa/getwxacodeunlimit?access_token='+token, {
method: 'post',
headers: headersPost,
body: JSON.stringify(params)
},
'img');
}
/* 获取资料库列表*/
export async function GetCodeUnlimit(params) {
return request('/o2o/wx/token', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params)
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/**/
export async function getBanner(params) {
return request('/o2o/banner/getBannerConfigList', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
export async function getPlanList(params) {
return request('/o2o/MicroPlan/getMicroConfigList', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
export async function getMyPlan(params) {
return request('/o2o/MicroPlan/getProspectusList', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 获取当前登录人的信息 */
export async function getCustomerInfo(params) {
return request('/o2o/customer/getLoginInfo', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/*获取z专家房间列表 */
export async function GetRoomList(params) {
return request('/o2o/weapp/webrtc_room/get_room_list', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/*获取查找的内容 */
export async function getSearchList(params) {
return request('/o2o/home/search', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
/*点击记录存储
operFunction (integer, optional): 操作功能(行业动态-100110; 计划书-100120; 邀请函-100130; 资料库-100100) ,
operType 操作类型(浏览-201; 转发-202) ,
operCode (string, optional): 操作条目对应的主键code ,
*/
export async function setClickRecord(params) {
let userInfo = JSON.parse(localStorage.getItem('userInfo'));
let param = null;
if(params.phoneNum){
param = params;
}else {
param = {...params,
"phoneNum": userInfo.number,
"orgId": userInfo.orgId,
"pointId": userInfo.website,
"proId": userInfo.project,
"userId": userInfo.id
};
}
return request('/o2o/dataStatic/save', {
method: 'post',
headers: headersPost,
body: JSON.stringify(param),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
export async function getNewsList(params) {
return request('/o2o/dynamic/getDynamicList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function getNews(params) {
return request('/o2o/dynamic/getDetail', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
export async function GetInfoList(params) {
return request('/o2o/information/getInformationListfen', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function GetSubInfoList(params) {
return request('/o2o/information/getInformationList', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
//首页消息轮播数据接口
export async function GetInformationsList(params) {
return request('/o2o/information/getInformationListOne', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost,headersGet } from '../utils/Constants';
export async function Sms(params) {
return request('/o2o/code/sms?mobile=13012345678',{
method: 'get',
headers:headersGet,
})
}
/*export async function LoginOut(params) {
return request('/o2o/user/logout', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}*/
export async function Approve(params) {
return request('/o2o/authentication/mobile', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
export async function checkUser(params) {
return request('/o2o/customer/checkUser', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost,headersGet } from '../utils/Constants';
export async function getPerformanceRank(params) {
return request('/o2o/code/sms?mobile=13012345678',{
method: 'get',
headers:headersGet,
})
}
\ No newline at end of file \ No newline at end of file
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/*获取所有客户*/
export async function getAllUser(params) {
return request('/o2o/customer/getCommitCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/*删除客户 */
export async function deleteCustomer(params) {
return request('/o2o/customer/deleteCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
// 个人保单
export async function policyList(params) {
return request('/o2o/achievement/getInsurancePolicy', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
//个人业绩查
export async function performList(params) {
return request('/o2o/achievement/getAchievement',{
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
})
}
//个人排行榜查询
export async function achievementRank(params) {
return request('/o2o/achievement/ranking',{
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
})
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
//计划书条款详情查看
export async function PlanClause(params) {
return request('/o2o/MicroPlan/getProspectusClause', {
method: 'POST',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 计划书编辑页面---买入保险 */
export async function payInsurance(params) {
return request('/o2o/MicroPlan/getPremTril', {
method: 'POST',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 获取附加险 */
export async function getProspectusaAditional(params) {
return request('/o2o/MicroPlan/getProspectusaAditional', {
method: 'POST',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 删除主险,附加险 */
export async function deletePlan(params) {
return request('/o2o/proposalInterest/deletePlan', {
method: 'POST',
headers: headersPost,
body: JSON.stringify(params),
});
}
/* 我的计划书--获取被保人信息 */
export async function getMyPlanMessage(params) {
return request('/o2o/proposalInterest/getProposalInterestBySeriNo', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 缴费期间 ,保险期间*/
export async function PremiumPaymentPeriod(params) {
console.log('getProspectusPeriod----------------------------------------->>>>',params)
return request('/o2o/MicroPlan/getProspectusPeriod', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 缴费期间 ,保险期间*/
export async function addReceiveInfo(params) {
console.log('getProspectusPeriod----------------------------------------->>>>',params)
return request('/o2o/MicroPlan/saveReceivePeopleInfo', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
import request from '../utils/request';
import { headersPost } from '../utils/Constants';
/* 获取海报列表*/
export async function GetPosterList(params) {
return request('/o2o/report/getReportConfigList', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 获取海报信息*/
export async function GetPosterInfo(params) {
return request("/o2o/report/getReportBaseById", {
method: "post",
headers: headersPost,
body: JSON.stringify(params)
});
}
// POST方式的请求头
export const headersPost = {
Accept: 'application/json',
'Content-Type': 'application/json',
'Access-Control-Max-Age': 86400,
// 'Authorization':"bearer "+token,
};
// GET方式的请求头
export const headersGet = {
// 'Authorization':"bearer "+token,
"deviceId": "008",
'Access-Control-Max-Age': 86400,
};
import jwt from 'jsonwebtoken';
const getCookie = (target) => {
// let cookie = document.cookie;
let arr;
const reg = new RegExp(`(^| )${target}=([^;]*)(;|$)`);
if (arr = document.cookie.match(reg)) {
return unescape(arr[2]);
} else {
return null;
}
};
const setCookie = (name, data) => {
document.cookie = `${name}=${data}`;
};
const delCookie = (name) => { // 为了删除指定名称的cookie,可以将其过期时间设定为一个过去的时间
const date = new Date();
date.setTime(date.getTime() - 1);
const cval = getCookie(name);
if (cval != null) { document.cookie = `${name} = ${cval};expires = ${date.toGMTString()}`; }
};
// 生成token
const sign = (payload) => {
return jwt.sign({
exp: Math.floor(Date.now() / 1000) + (60 * 60), // 1h
data: payload,
}, 'moxilogin');
};
// 解析token
const verify = (ck) => {
jwt.verify(getCookie('token'), 'moxilogin', (err, decoded) => {
ck(err, decoded);
});
};
// 判断token是否过期
const ifToken = (ck) => {
let bool = true;
verify((err) => {
if (err) { // cookie 超时了;
// 登出删除token
delCookie('token');
window.location.href = '/';
bool = false;
}
});
return bool;
}
export { getCookie, setCookie, delCookie, sign, verify, ifToken };
var pinyin = require("chinese-to-pinyin");
var moment = require('moment');
/**
* 按拼音第一个字母排序
* @param {需要排序的数据表} arr
* 数据按name字段排序 (需注意)
*/
export function sortArr(arr, renderType) {
if (arr.length) {
let list = [];
for (let i = 0, l = arr.length; i < l; i++) {
let ltr = arr[i][renderType[0]];
let letter = pinyin(ltr, {
noTone: true,
filterChinese: true
}).substr(0, 1).toUpperCase();
if (!/[a-z]/i.test(letter)) letter = '#';
if (!(letter in list)) {
list[letter] = [];
}
list[letter].push(arr[i]);
}
let result = [];
for (var key in list) {
result.push({
letter: key,
list: list[key]
});
}
result.sort(function (x, y) {
return x.letter.charCodeAt(0) - y.letter.charCodeAt(0);
});
if (result.length > 0 && result[0].letter === '#') {
var last_arr = result[0];
result.splice(0, 1);
result.push(last_arr);
}
return result;
} else {
return []
}
}
export function dataFilter(arr, renderType, keywords) {
let ar = [];
for (let i = 0, l = arr.length; i < l; i++) {
let pin = pinyin(arr[i][renderType[0]], {
noTone: true,
filterChinese: true
}).replace(/\s*/g, '');
let key = pinyin(keywords, {
noTone: true,
filterChinese: true
}).replace(/\s*/g, '')
if (pin.toUpperCase().indexOf(key.toUpperCase()) >= 0) {
ar.push(arr[i]);
}
}
return ar;
}
/*
url参数解析,返回一个参数对象
*/
export function urlGetParams(url) {
let json = {};
if(url) {
let url1 = window.decodeURI(url).split('?').pop();
let url2 = url1.split('&');
if(url2.length>0){
for(let i in url2){
let item = url2[i].split('=');
json[item[0]] = item[1];
}
}
}
return json;
}
/*
计算年龄
*/
export function getBirthdayAge (dateString) {
let today = new Date();
// let aDate = dateString.split('-');
// let birthDate = new Date(aDate[0] + '-' + (parseInt(aDate[1]) < 10 ? '0' + aDate[1] : aDate[1]) + (parseInt(aDate[2]) < 10 ? '-0' + aDate[2] : '-'+aDate[2]));
let birthDate = new Date(moment(dateString).format("YYYY-MM-DD"));
let age = Number(today.getFullYear()) - Number(birthDate.getFullYear());
let m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age ;
}
/*
根据key值为value 在计划书中查出对应的计划书
*/
export function getPlanInListWithCode (key,value,list) {
let [minekey,minevalue,AllList]= [key,value,list];
let targetList = {};
for(let i in AllList){
if(String(AllList[i][minekey]) === String(minevalue)){
targetList = AllList[i];
break;
}
}
return targetList ;
}
export let filterDate = {
'YY_MM_DD': ()=> {
// 以YY-MM-DD格式返回当前日期
let date = new Date();
return date.getFullYear() +'-'+ (date.getMonth()+1) +'-'+date.getDate();
},
'FromDateToTarget': (num)=>{
//从当前日期算 距离 num年前 是那一年
let date = new Date();
let date2 = date.getFullYear();
if(num){
return date2-num-1;
}else{
return date2;
}
}
}
/*
判断string1,string2时候同时存在arry数组中
*/
export function isContain(string1,string2,arry){
if(arry.indexOf(string1) > -1 && arry.indexOf(string2) > -1) {
return true
}else{
return false
}
return false
}
export let arrayDeal = {
// 交集
'Intersect': (a,b)=> {
let BB = new Set(b);
return a.filter(x => BB.has(x));
},
// 差集
'Minus': (a,b)=> {
let BB = new Set(b);
return a.filter(x => !BB.has(x));
},
// 补集
'Complement': (a,b)=> {
let AA = new Set(a);
let BB = new Set(b);
return [...a.filter(x => !BB.has(x)), ...b.filter(x => !AA.has(x))];
},
// 并集
'UnionSet': (a,b)=> {
return Array.from(new Set([...a, ...b]));
}
}
export function StandardFormat (str){
//将 ****-*-* 转成标准的 ****-**-**
let string1 = String(str);
if (string1){
let arr1 = string1.split("-");
if (arr1[1].length==1){
arr1[1] = "0"+arr1[1];
}
if (arr1[2].length==1){
arr1[2] = "0"+arr1[2];
}
return arr1.join("-");
}
return string1;
}
//从数组对象中找出特定你的数组
export function getTargetList (param,list){
let key = param;
let AllList = list;
let newList=[];
if(AllList.length>0){
for(let ii in AllList){
if(AllList[ii].riskLabels){
if(AllList[ii].riskLabels.indexOf(key) != -1){
newList.push(AllList[ii]);
}
}
}
}
return newList;
}
//获取职位
export function getCardName(id){
let roleid = String(id);
switch (roleid) {
case "2":
return "客户经理";
break;
case "3":
return "督训";
break;
default:
break;
}
}
//获取字符串的字符长度
export function GetLength(str){
let str1 = String(str);
if(str1 != ""){
return str1.replace(/[\u0391-\uFFE5]/g,"aa").length; //先把中文替换成两个字节的英文,在计算长度
}
return 0;
}
\ No newline at end of file \ No newline at end of file
/* eslint-disable */
let wxUtils = {};
/**
* 是否开启右上角Menu
* @param open
*/
wxUtils.optionMenu = function (open = true) {
if (open) {
openOptionMenu();
} else {
disabledOptionMenu();
}
};
/**
* 是否禁用右上角
*/
function disabledOptionMenu() {
if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(true), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(true));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(true));
}
} else {
onBridgeReady(true);
}
}
/**
* 开启menu
*/
function openOptionMenu() {
if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady(false), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady(false));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(false));
}
} else {
onBridgeReady(false);
}
}
function onBridgeReady(disable = true) {
if (typeof WeixinJSBridge !== "undefined") WeixinJSBridge.call(disable ? 'hideOptionMenu' : 'showOptionMenu');
}
/**
* 隐藏微信网页底部的导航栏
* @param disable
*/
wxUtils.disabledToolbar = function (disable = true) {
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 通过下面这个API隐藏底部导航栏
WeixinJSBridge.call(disable ? 'hideToolbar' : 'showToolbar');
});
};
/**
* 获取网络类型
*/
wxUtils.getNetworkType = function () {
//network_type:wifi wifi网络 2 network_type:edge 非wifi,包含3G/2G 3 network_type:fail 网络断开连接 4 network_type:wwan 2g或者3g
WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
// 在这里拿到e.err_msg,这里面就包含了所有的网络类型
return e;
});
};
export default wxUtils;
\ No newline at end of file \ No newline at end of file
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth < 680 ? docEl.clientWidth : 680;
if (!clientWidth) return;
docEl.style.fontSize = 100 * (clientWidth / 414) + 'px';
};
if (!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
import fetch from 'dva/fetch';
function parseJSON(response) {
return response.json();
}
function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
}
const error = new Error(response.statusText);
error.response = response;
throw error;
}
/**
* Requests a URL, returning a promise.
*
* @param {string} url The URL we want to request
* @param {object} [options] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err"
*/
export default function request(url, options, type) {
let newOptions = {...options}
if(localStorage.getItem('orgId')){
newOptions.headers ={
...newOptions.headers,
orgId :localStorage.getItem('orgId')
}
}
if(localStorage.getItem('project')){
newOptions.headers ={
...newOptions.headers,
proId :localStorage.getItem('project')
}
}
return fetch(url, newOptions)
.then(checkStatus)
.then(type === 'img' ? d => { return d.blob(); } : parseJSON )
.then(data => ({data}))
.catch(err => ({ err }));
}
import $ from 'jquery';
import {setClickRecord} from '../services/home';
/**
* 分享
* @param {*} options
* options:{
* decodeUrl: 根据此url生成签名
* title: 分享标题
* desc: 分享描述
* shareUrl: 分享地址
* thumbnail: 分享缩略图
* }
*/
export default function share (options) {
$.ajax({
type: 'POST',
url: 'https://iwpuat.ihxlife.com/o2o/wx/cover',
data: JSON.stringify({
shareGoal: options.decodeUrl
}),
contentType: 'application/JSON',
success: function (res) {
window.wx.config({
debug: false,
appId: res.data.appId,
timestamp: res.data.timestamp,
nonceStr: res.data.noncestr,
signature: res.data.signature,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage',
]
});
}
});
window.wx.ready(function () {
const url = options.shareUrl.replace('#','?#')
window.wx.onMenuShareAppMessage({
title: options.title,
desc: options.desc,
link: url,
imgUrl: options.thumbnail,
success: function (res) {
// console.log('分享成功')
if(options.record){
setClickRecord({...options.record});//记录转发
}
},
cancel: function (res) {
//alert('已取消');
},
fail: function (res) {
alert(JSON.stringify(res));
}
});
window.wx.onMenuShareTimeline({
title: options.title,
desc: options.desc,
link: url,
imgUrl: options.thumbnail,
success: function (res) {
// console.log('分享成功')
if(options.record){
setClickRecord({...options.record});//记录分享
}
},
cancel: function (res) {
//alert('已取消');
},
fail: function (res) {
alert(JSON.stringify(res));
}
});
});
}
export default function shareHide(disable) {
let common = {};
common.noShare = ()=>{
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady.bind(this,disable), false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', onBridgeReady.bind(this,disable));
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady.bind(this,disable));
}
}else{
onBridgeReady(disable);
}
function onBridgeReady(disable = true) {
if(typeof WeixinJSBridge !=='undefined') window.WeixinJSBridge.call(disable?'hideOptionMenu':'showOptionMenu')
}
}
return common.noShare()
}
//计划书结果页面 保障条款列表
export const ProtectionItem = [
{
img:require('../assets/image/getMoney.png'),
text:'固定领取'
},
{
img:require('../assets/image/health.png'),
text:'健康保障'
},
{
img:require('../assets/image/medical.png'),
text:'医疗保障'
},
{
img:require('../assets/image/safeguard.png'),
text:'身故保障'
},
{
img:require('../assets/image/exempt.png'),
text:'保费豁免'
},
{
img:require('../assets/image/else.png'),
text:'其他保障'
},
];
//所保障的重疾列表
export const SeriousDiseaseList = [
{ value: 0, label: '1、恶性肿瘤' },
{ value: 1, label: '2、急性心肌梗塞' },
{ value: 2, label: '3、脑中风后遗症' },
{ value: 3, label: '4、重大器官移植术或造血干细胞移植术' },
{ value: 4, label: '5、冠状动脉搭桥术' },
{ value: 5, label: '6、终末期肾病' },
{ value: 6, label: '7、多个肢体缺失' },
{ value: 7, label: '8、急性或亚急性重症肝炎' },
{ value: 8, label: '9、良性脑肿瘤' },
{ value: 9, label: '10、慢性肝功能衰竭失代偿期' },
{ value: 10, label: '11、脑炎后遗症或脑膜炎后遗症' },
{ value: 11, label: '12、深度昏迷' },
{ value: 12, label: '13、双耳失聪-三周岁始理赔' },
{ value: 13, label: '14、双目失明-三周岁始理赔' },
{ value: 14, label: '15、瘫痪' },
{ value: 15, label: '16、心脏瓣膜手术' },
{ value: 16, label: '17、严重阿尔茨海默病' },
{ value: 17, label: '18、严重脑损伤' },
{ value: 18, label: '19、严重帕金森病' },
{ value: 19, label: '20、严重III度烧伤' },
{ value: 20, label: '21、严重原发性肺动脉高压' },
{ value: 21, label: '22、严重运动神经元病' },
{ value: 22, label: '23、语言能力丧失-三岁始理赔' },
{ value: 23, label: '24、重型再生障碍性贫血' },
{ value: 24, label: '25、主动脉手术' },
{ value: 25, label: '26、慢性呼吸功能衰竭' },
{ value: 26, label: '27、严重多发性硬化' },
{ value: 27, label: '28、脊髓灰质炎' },
{ value: 28, label: '29、全身性重症肌无力' },
{ value: 29, label: '30、严重冠心病' },
{ value: 30, label: '31、严重心肌病' },
{ value: 31, label: '32、系统性红斑狼疮III型或以上狼疮性肾炎' },
{ value: 32, label: '33、因职业关系导致的人类免疫缺陷病毒HIV感染' },
{ value: 33, label: '34、经输血导致的人类免疫缺陷病毒HIV感染' },
{ value: 34, label: '35、严重克隆病' },
{ value: 35, label: '36、严重溃疡性结肠炎' },
{ value: 36, label: '37、1型糖尿病' },
{ value: 37, label: '38、肺源性心脏病' },
{ value: 38, label: '39、植物人状态' },
{ value: 39, label: '40、严重类风湿性关节炎' },
{ value: 40, label: '41、非阿尔茨海默病所致严重痴呆' },
{ value: 41, label: '42、多处臂丛神经根性撕脱' },
{ value: 42, label: '43、严重川崎病' },
{ value: 43, label: '44、严重的系统性硬皮病' },
{ value: 44, label: '45、丝虫病所致象皮肿' },
{ value: 45, label: '46、胰腺移植' },
{ value: 46, label: '47、急性坏死胰腺炎开腹手术' },
{ value: 47, label: '48、慢性复发性胰腺炎' },
{ value: 48, label: '49、疯牛病' },
{ value: 49, label: '50、肾髓质囊性病' },
{ value: 50, label: '51、肾髓质囊性病' },
{ value: 51, label: '52、严重的原发性硬化性胆管炎' },
{ value: 52, label: '53、特发性慢性肾上腺皮质功能减退' },
{ value: 53, label: '54、溶血性链球菌引起的坏疽' },
{ value: 54, label: '55、颅脑手术' },
{ value: 55, label: '56、严重肌营养不良症' },
{ value: 56, label: '57、严重心肌炎' },
{ value: 57, label: '58、肝豆状核变性' },
{ value: 58, label: '59、侵蚀性葡萄胎' },
{ value: 59, label: '60、破裂脑动脉瘤夹闭手术' },
{ value: 60, label: '61、需手术切除的嗜铬细胞瘤' },
{ value: 61, label: '62、进行性核上性麻痹' },
{ value: 62, label: '63、严重幼年型类风湿性关节炎' },
{ value: 63, label: '64、严重肠道疾病并发症' },
{ value: 64, label: '65、严重瑞氏综合症' },
{ value: 65, label: '66、严重自身免疫性肝炎' },
{ value: 66, label: '67、严重的III度房室传导阻滞' },
{ value: 67, label: '68、细菌性脑脊髓膜炎' },
{ value: 68, label: '69、严重感染性心内膜炎' },
{ value: 69, label: '70、严重的骨髓增生异常综合征' },
{ value: 70, label: '71、严重癫痫' },
{ value: 71, label: '72、自体造血干细胞移植' },
{ value: 72, label: '73、肺淋巴管肌瘤病' },
{ value: 73, label: '74、肺泡蛋白质沉积症' },
{ value: 74, label: '75、小肠移植' },
{ value: 75, label: '76、疾病或外伤所致智力障碍' },
{ value: 76, label: '77、骨生长不全症' },
{ value: 77, label: '78、严重面部烧伤' },
{ value: 78, label: '79、亚急性硬化性全脑炎' },
{ value: 79, label: '80、脊髓小脑变性症' },
{ value: 80, label: '81、进行性多灶性白质脑病' },
{ value: 81, label: '82、弥漫性血管内凝血' },
{ value: 82, label: '83、失去一肢及一眼' },
{ value: 83, label: '84、独立能力丧失' },
{ value: 84, label: '85、器官移植导致的HIV感染' },
{ value: 85, label: '86、婴儿进行性脊肌萎缩症' },
{ value: 86, label: '87、进行性风疹全脑炎' },
{ value: 87, label: '88、埃博拉病毒感染' },
{ value: 88, label: '89、主动脉夹层血肿' },
{ value: 89, label: '90、重症急性坏死性筋膜炎' },
{ value: 90, label: '91、骨髓纤维化' },
{ value: 91, label: '92、严重慢性缩窄性心包炎' },
{ value: 92, label: '93、主动脉夹层瘤' },
{ value: 93, label: '94、肌萎缩脊髓侧索硬化后遗症' },
{ value: 94, label: '95、严重结核性脑膜炎' },
{ value: 95, label: '96、重症手足口病' },
{ value: 96, label: '97、严重甲型及乙型血友病' },
{ value: 97, label: '98、艾森门格综合征' },
{ value: 98, label: '99、湿性年龄相关性黄斑变性' },
{ value: 99, label: '100、脊柱裂' },
];
//所保中症列表
export const MiddleDiseaseList = [
{ value: 0, label: '1、中度帕金森氏病' },
{ value: 1, label: '2、中度严重溃疡性结肠炎' },
{ value: 2, label: '3、中度瘫痪' },
{ value: 3, label: '4、中度重症肌无力' },
{ value: 4, label: '5、中度进行性核上神经麻痹症' },
{ value: 5, label: '6、中度严重脊髓灰质炎' },
{ value: 6, label: '7、中度严重克雅氏病' },
{ value: 7, label: '8、视力严重受损-3周岁起理赔' },
{ value: 8, label: '9、慢性肾功能损害–肾功能衰竭期' },
{ value: 9, label: '10、重症头部外伤' },
{ value: 10, label: '11、较小面积Ⅲ度烧伤(10%)' },
{ value: 11, label: '12、慢性肝功能衰竭' },
{ value: 12, label: '13、植入腔静脉滤器' },
{ value: 13, label: '14、系统性红斑狼疮' },
{ value: 14, label: '15、早期运动神经性疾病' },
{ value: 15, label: '16、中度类风湿性关节炎' },
{ value: 16, label: '17、中度脑风后遗症' },
{ value: 17, label: '18、中度强直性脊柱炎' },
{ value: 18, label: '19、中度脑炎或中度脑膜炎后遗症' },
{ value: 19, label: '20、中度克隆病' },
];
////所保轻度疾病列表
export const GeneralDiseaseList = [
{ value: 0, label: '1、非危及生命的(极早期的)恶性病变' },
{ value: 1, label: '2、冠状动脉介入手术' },
{ value: 2, label: '3、轻微脑中风' },
{ value: 3, label: '4、心脏瓣膜介入手术' },
{ value: 4, label: '5、脑垂体瘤、脑囊肿、脑动脉瘤及脑血管瘤' },
{ value: 5, label: '6、主动脉内介入手术' },
{ value: 6, label: '7、单个肢体缺失' },
{ value: 7, label: '8、单侧肺脏切除' },
{ value: 8, label: '9、肝脏手术' },
{ value: 9, label: '10、人工耳蜗植入术' },
{ value: 10, label: '11、胆道重建手术' },
{ value: 11, label: '12、双侧卵巢或睾丸切除术' },
{ value: 12, label: '13、单侧肾脏切除' },
{ value: 13, label: '14、糖尿病导致脚趾截除' },
{ value: 14, label: '15、单耳失聪' },
{ value: 15, label: '16、微创颅脑手术' },
{ value: 16, label: '17、Ⅲ度房室传导阻滞-已放置心脏起搏器' },
{ value: 17, label: '18、于颈动脉进行血管成形术或内膜切除术' },
{ value: 18, label: '19、心包膜切除术' },
{ value: 19, label: '20、脑炎或脑膜炎' },
{ value: 20, label: '21、硬脑膜下血肿手术' },
{ value: 21, label: '22、严重阻塞性睡眠窒息症' },
{ value: 22, label: '23、因意外毁容而施行的面部整形手术' },
{ value: 23, label: '24、角膜移植' },
{ value: 24, label: '25、可逆性再生障碍性贫血' },
{ value: 25, label: '26、特定周围动脉疾病的血管介入治疗' },
{ value: 26, label: '27、脑室腹腔分流术' },
{ value: 27, label: '28、轻度面部烧伤' },
{ value: 28, label: '29、肾上腺切除术' },
{ value: 29, label: '30、早期象皮病' },
{ value: 30, label: '31、出血性登革热' },
{ value: 31, label: '32、面部重建手术' },
{ value: 32, label: '33、不典型的急性心肌梗塞' },
{ value: 33, label: '34、严重的骨质疏松' },
{ value: 34, label: '35、单眼失明' },
];
//华夏福所保轻度疾病列表
export const GeneralDiseaseList_hxf = [
{ value: 0, label: '1、非危及生命的(极早期的)恶性病变 '},
{ value: 1, label: '2、冠状动脉介入手术 '},
{ value: 2, label: '3、轻微脑中风 '},
{ value: 3, label: '4、心脏瓣膜介入手术 '},
{ value: 4, label: '5、脑垂体瘤、脑囊肿、脑动脉瘤及脑血管瘤'},
{ value: 5, label: '6、视力严重受损-3周岁始理赔 '},
{ value: 6, label: '7、主动脉内介入手术 '},
{ value: 7, label: '8、较小面积III度烧伤(10%) '},
{ value: 8, label: '9、慢性肾功能损害–肾功能衰竭期 '},
{ value: 9, label: '10、重症头部外伤 '},
{ value: 10, label: '11、单个肢体缺失 '},
{ value: 11, label: '12、单侧肺脏切除 '},
{ value: 12, label: '13、肝脏手术 '},
{ value: 13, label: '14、早期运动神经性疾病 '},
{ value: 14, label: '15、人工耳蜗植入术 '},
{ value: 15, label: '16、胆道重建手术 '},
{ value: 16, label: '17、双侧卵巢或睾丸切除术 '},
{ value: 17, label: '18、单侧肾脏切除 '},
{ value: 18, label: '19、肝叶切除 '},
{ value: 19, label: '20、单耳失聪 '},
{ value: 20, label: '21、微创冠状动脉搭桥手术 '},
{ value: 21, label: '22、Ⅲ度房室传导阻滞-已放置心脏起搏器'},
{ value: 22, label: '23、于颈动脉进行血管成形术或内膜切除术'},
{ value: 23, label: '24、心包膜切除术 '},
{ value: 24, label: '25、脑炎或脑膜炎 '},
{ value: 25, label: '26、硬脑膜下血肿手术 '},
{ value: 26, label: '27、严重阻塞性睡眠窒息症 '},
{ value: 27, label: '28、因意外毁容而施行的面部整形手术 '},
{ value: 28, label: '29、角膜移植 '},
{ value: 29, label: '30、单眼失明 '},
{ value: 30, label: '31、可逆性再生障碍性贫血 '},
{ value: 31, label: '32、慢性肝功能衰竭 '},
{ value: 32, label: '33、特定周围动脉疾病的血管介入治疗 '},
{ value: 33, label: '34、脑室腹腔分流术 '},
{ value: 34, label: '35、轻度面部烧伤 '},
{ value: 35, label: '36、植入腔静脉过滤器 '},
{ value: 36, label: '37、肾上腺切除术 '},
{ value: 37, label: '38、早期象皮病 '},
{ value: 38, label: '39、中度严重克雅氏病 '},
{ value: 39, label: '40、中度严重脊髓灰质炎 '},
{ value: 40, label: '41、中度进行性核上神经麻痹症 '},
{ value: 41, label: '42、中度重症肌无力'},
];
//华夏福所保障的重疾列表
export const SeriousDiseaseList_hxf = [
{ value: 0, label: '1、恶性肿瘤 '},
{ value: 1, label: '2、急性心肌梗塞 '},
{ value: 2, label: '3、脑中风后遗症 '},
{ value: 3, label: '4、重大器官移植术或造血干细胞移植术 '},
{ value: 4, label: '5、冠状动脉搭桥术(或称冠状动脉旁路移植术) '},
{ value: 5, label: '6、终末期肾病(或称慢性肾功能衰竭尿毒症期) '},
{ value: 6, label: '7、多个肢体缺失 '},
{ value: 7, label: '8、急性或亚急性重症肝炎 '},
{ value: 8, label: '9、良性脑肿瘤 '},
{ value: 9, label: '10、慢性肝功能衰竭失代偿期 '},
{ value: 10, label:'11、脑炎后遗症或脑膜炎后遗症 '},
{ value: 11, label:'12、深度昏迷 '},
{ value: 12, label:'13、双耳失聪-三周岁始理赔 '},
{ value: 13, label:'14、双目失明-三周岁始理赔 '},
{ value: 14, label:'15、瘫痪 '},
{ value: 15, label:'16、心脏瓣膜手术 '},
{ value: 16, label:'17、严重阿尔茨海默病 '},
{ value: 17, label:'18、严重脑损伤 '},
{ value: 18, label:'19、严重帕金森病 '},
{ value: 19, label:'20、严重Ⅲ度烧伤 '},
{ value: 20, label:'21、严重原发性肺动脉高压 '},
{ value: 21, label:'22、严重运动神经元病 '},
{ value: 22, label:'23、语言能力丧失-三岁始理赔 '},
{ value: 23, label:'24、重型再生障碍性贫血 '},
{ value: 24, label:'25、主动脉手术 '},
{ value: 25, label:'26、慢性呼吸功能衰竭 '},
{ value: 26, label:'27、严重多发性硬化 '},
{ value: 27, label:'28、脊髓灰质炎 '},
{ value: 28, label:'29、全身性重症肌无力 '},
{ value: 29, label:'30、严重冠心病 '},
{ value: 30, label:'31、严重心肌病 '},
{ value: 31, label:'32、系统性红斑狼疮-III型或以上狼疮性肾炎 '},
{ value: 32, label:'33、因职业关系导致的人类免疫缺陷病毒HIV感染 '},
{ value: 33, label:'34、经输血导致的人类免疫缺陷病毒HIV感染 '},
{ value: 34, label:'35、严重克隆病 '},
{ value: 35, label:'36、严重溃疡性结肠炎 '},
{ value: 36, label:'37、1型糖尿病 '},
{ value: 37, label:'38、肺源性心脏病 '},
{ value: 38, label:'39、植物人状态 '},
{ value: 39, label:'40、严重类风湿性关节炎 '},
{ value: 40, label:'41、非阿尔茨海默病所致严重痴呆 '},
{ value: 41, label:'42、多处臂丛神经根性撕脱 '},
{ value: 42, label:'43、严重哮喘(25周岁前理赔) '},
{ value: 43, label:'44、严重川崎病 '},
{ value: 44, label:'45、严重的系统性硬皮病 '},
{ value: 45, label:'46、丝虫病所致象皮肿 '},
{ value: 46, label:'47、胰腺移植 '},
{ value: 47, label:'48、急性坏死胰腺炎开腹手术 '},
{ value: 48, label:'49、慢性复发性胰腺炎 '},
{ value: 49, label:'50、疯牛病 '},
{ value: 50, label:'51、肾髓质囊性病 '},
{ value: 51, label:'52、严重的原发性硬化性胆管炎 '},
{ value: 52, label:'53、特发性慢性肾上腺皮质功能减退 '},
{ value: 53, label:'54、溶血性链球菌引起的坏疽 '},
{ value: 54, label:'55、颅脑手术 '},
{ value: 55, label:'56、严重肌营养不良症 '},
{ value: 56, label:'57、严重心肌炎 '},
{ value: 57, label:'58、肝豆状核变性(Wilson病) '},
{ value: 58, label:'59、侵蚀性葡萄胎(或称恶性葡萄胎) '},
{ value: 59, label:'60、破裂脑动脉瘤夹闭手术 '},
{ value: 60, label:'61、需手术切除的嗜铬细胞瘤 '},
{ value: 61, label:'62、进行性核上性麻痹'},
{ value: 62, label:'63、严重幼年型类风湿性关节炎 '},
{ value: 63, label:'64、严重肠道疾病并发症 '},
{ value: 64, label:'65、严重瑞氏综合症 '},
{ value: 65, label:'66、严重自身免疫性肝炎 '},
{ value: 66, label:'67、严重的III度房室传导阻滞 '},
{ value: 67, label:'68、细菌性脑脊髓膜炎 '},
{ value: 68, label:'69、严重感染性心内膜炎 '},
{ value: 69, label:'70、严重的骨髓增生异常综合征 '},
{ value: 70, label:'71、严重癫痫 '},
{ value: 71, label:'72、自体造血干细胞移植 '},
{ value: 72, label:'73、肺淋巴管肌瘤病 '},
{ value: 73, label:'74、肺泡蛋白质沉积症 '},
{ value: 74, label:'75、小肠移植 '},
{ value: 75, label:'76、疾病或外伤所致智力障碍 '},
{ value: 76, label:'77、骨生长不全症 '},
{ value: 77, label:'78、严重面部烧伤 '},
{ value: 78, label:'79、亚急性硬化性全脑炎 '},
{ value: 79, label:'80、脊髓小脑变性症 '},
{ value: 80, label:'81、进行性多灶性白质脑病 '},
{ value: 81, label:'82、弥漫性血管内凝血'}
];
//华夏福保费豁免所保轻度疾病列表
export const GeneralDiseaseList_hxf_huomian = [
{ value: 0, label: '1、非危及生命的(极早期的)恶性病变 '},
{ value: 1, label: '2、冠状动脉介入手术 '},
{ value: 2, label: '3、轻微脑中风 '},
{ value: 3, label: '4、心脏瓣膜介入手术 '},
{ value: 4, label: '5、脑垂体瘤、脑囊肿、脑动脉瘤及脑血管瘤 '},
{ value: 5, label: '6、视力严重受损 – 三周岁始理赔 '},
{ value: 6, label: '7、主动脉内介入手术 '},
{ value: 7, label: '8、较小面积III度烧伤(10%) '},
{ value: 8, label: '9、慢性肾功能损害 – 肾功能衰竭期 '},
{ value: 9, label: '10、重症头部外伤 '},
{ value: 10, label:'11、单个肢体缺失 '},
{ value: 11, label:'12、单侧肺脏切除 '},
{ value: 12, label:'13、肝脏手术 '},
{ value: 13, label:'14、早期运动神经性疾病 '},
{ value: 14, label:'15、人工耳蜗植入术 '},
{ value: 15, label:'16、胆道重建手术 '},
{ value: 16, label:'17、双侧卵巢或睾丸切除术 '},
{ value: 17, label:'18、单侧肾脏切除 '},
{ value: 18, label:'19、肝叶切除 '},
{ value: 19, label:'20、单耳失聪 '},
{ value: 20, label:'21、微创冠状动脉搭桥手术 '},
{ value: 21, label:'22、Ⅲ度房室传导阻滞-已放置心脏起搏器 '},
{ value: 22, label:'23、于颈动脉进行血管成形术或内膜切除术 '},
{ value: 23, label:'24、心包膜切除术 '},
{ value: 24, label:'25、脑炎或脑膜炎 '},
{ value: 25, label:'26、硬脑膜下血肿手术 '},
{ value: 26, label:'27、严重阻塞性睡眠窒息症 '},
{ value: 27, label:'28、因意外毁容而施行的面部整形手术 '},
{ value: 28, label:'29、角膜移植 '},
{ value: 29, label:'30、单眼失明 '},
{ value: 30, label:'31、可逆性再生障碍性贫血 '},
{ value: 31, label:'32、慢性肝功能衰竭 '},
{ value: 32, label:'33、特定周围动脉疾病的血管介入治疗 '},
];
//华夏福保费豁免所保障的重疾列表
export const SeriousDiseaseList_hxf_huomian = [
{ value: 0, label: '1、恶性肿瘤 '},
{ value: 1, label: '2、急性心肌梗塞 '},
{ value: 2, label: '3、脑中风后遗症 '},
{ value: 3, label: '4、重大器官移植术或造血干细胞移植术 '},
{ value: 4, label: '5、冠状动脉搭桥术 '},
{ value: 5, label: '6、终末期肾病 '},
{ value: 6, label: '7、多个肢体缺失 '},
{ value: 7, label: '8、急性或亚急性重症肝炎 '},
{ value: 8, label: '9、良性脑肿瘤 '},
{ value: 9, label: '10、慢性肝功能衰竭失代偿期 '},
{ value: 10, label:'11、脑炎后遗症或脑膜炎后遗症 '},
{ value: 11, label:'12、深度昏迷 '},
{ value: 12, label:'13、双耳失聪-三周岁始理赔 '},
{ value: 13, label:'14、双目失明-三周岁始理赔 '},
{ value: 14, label:'15、瘫痪 '},
{ value: 15, label:'16、心脏瓣膜手术 '},
{ value: 16, label:'17、严重阿尔茨海默病 '},
{ value: 17, label:'18、严重脑损伤 '},
{ value: 18, label:'19、严重帕金森病 '},
{ value: 19, label:'20、严重III度烧伤 '},
{ value: 20, label:'21、严重原发性肺动脉高压 '},
{ value: 21, label:'22、严重运动神经元病 '},
{ value: 22, label:'23、语言能力丧失-三岁始理赔 '},
{ value: 23, label:'24、重型再生障碍性贫血 '},
{ value: 24, label:'25、主动脉手术 '},
{ value: 25, label:'26、慢性呼吸功能衰竭 '},
{ value: 26, label:'27、严重多发性硬化 '},
{ value: 27, label:'28、脊髓灰质炎 '},
{ value: 28, label:'29、全身性重症肌无力 '},
{ value: 29, label:'30、严重冠心病 '},
{ value: 30, label:'31、严重心肌病 '},
{ value: 31, label:'32、系统性红斑狼疮-III型或以上狼疮性肾炎 '},
{ value: 32, label:'33、因职业关系导致的人类免疫缺陷病毒HIV感染 '},
{ value: 33, label:'34、经输血导致的人类免疫缺陷病毒HIV感染 '},
{ value: 34, label:'35、严重克隆病 '},
{ value: 35, label:'36、严重溃疡性结肠炎 '},
{ value: 36, label:'37、1型糖尿病 '},
{ value: 37, label:'38、肺源性心脏病 '},
{ value: 38, label:'39、植物人状态 '},
{ value: 39, label:'40、严重类风湿性关节炎 '},
{ value: 40, label:'41、非阿尔茨海默病所致严重痴呆 '},
{ value: 41, label:'42、终末期疾病 '},
{ value: 42, label:'43、严重哮喘(25周岁前理赔) '},
{ value: 43, label:'44、严重川崎病 '},
{ value: 44, label:'45、严重的系统性硬皮病 '},
{ value: 45, label:'46、丝虫病所致象皮肿 '},
{ value: 46, label:'47、胰腺移植 '},
{ value: 47, label:'48、急性坏死胰腺炎开腹手术 '},
{ value: 48, label:'49、慢性复发性胰腺炎 '},
{ value: 49, label:'50、疯牛病 '},
{ value: 50, label:'51、肾髓质囊性病 '},
{ value: 51, label:'52、严重的原发性硬化性胆管炎 '},
{ value: 52, label:'53、特发性慢性肾上腺皮质功能减退 '},
{ value: 53, label:'54、溶血性链球菌引起的坏疽 '},
{ value: 54, label:'55、颅脑手术 '},
{ value: 55, label:'56、严重肌营养不良症 '},
{ value: 56, label:'57、严重心肌炎 '},
{ value: 57, label:'58、肝豆状核变性(或称Wilson病) '},
{ value: 58, label:'59、侵蚀性葡萄胎(或称恶性葡萄胎) '},
{ value: 59, label:'60、破裂脑动脉瘤夹闭手术 '},
{ value: 60, label:'61、需手术切除的嗜铬细胞瘤 '},
{ value: 61, label:'62、进行性核上性麻痹 '},
{ value: 62, label:'63、严重幼年型类风湿性关节炎 '},
{ value: 63, label:'64、严重肠道疾病并发症'},
{ value: 64, label:'65、严重瑞氏综合症 '},
{ value: 65, label:'66、严重自身免疫性肝炎 '},
{ value: 66, label:'67、严重的III度房室传导阻滞 '},
{ value: 67, label:'68、细菌性脑脊髓膜炎 '},
{ value: 68, label:'69、严重感染性心内膜炎 '},
{ value: 69, label:'70、严重的骨髓增生异常综合征 '},
{ value: 70, label:'71、严重癫痫 '},
{ value: 71, label:'72、自体造血干细胞移植 '},
{ value: 72, label:'73、肺淋巴管肌瘤病 '},
{ value: 73, label:'74、肺泡蛋白质沉积症 '},
{ value: 74, label:'75、小肠移植 '},
{ value: 75, label:'76、疾病或外伤所致智力障碍 '},
{ value: 76, label:'77、骨生长不全症'}
];
//常青树所保障的重疾列表
export const SeriousDiseaseList_cqs = [
{ value: 0, label: '1、恶性肿瘤 '},
{ value: 1, label: '2、急性心肌梗塞 '},
{ value: 2, label: '3、脑中风后遗症 '},
{ value: 3, label: '4、重大器官移植术或造血干细胞移植术 '},
{ value: 4, label: '5、冠状动脉搭桥术 '},
{ value: 5, label: '6、终末期肾病 '},
{ value: 6, label: '7、多个肢体缺失 '},
{ value: 7, label: '8、急性或亚急性重症肝炎 '},
{ value: 8, label: '9、良性脑肿瘤 '},
{ value: 9, label: '10、慢性肝功能衰竭失代偿期 '},
{ value: 10, label:'11、脑炎后遗症或脑膜炎后遗症 '},
{ value: 11, label:'12、深度昏迷 '},
{ value: 12, label:'13、双耳失聪-三周岁始理赔 '},
{ value: 13, label:'14、双目失明-三周岁始理赔 '},
{ value: 14, label:'15、瘫痪 '},
{ value: 15, label:'16、心脏瓣膜手术 '},
{ value: 16, label:'17、严重阿尔茨海默病 '},
{ value: 17, label:'18、严重脑损伤 '},
{ value: 18, label:'19、严重帕金森病 '},
{ value: 19, label:'20、严重III度烧伤 '},
{ value: 20, label:'21、严重原发性肺动脉高压 '},
{ value: 21, label:'22、严重运动神经元病 '},
{ value: 22, label:'23、语言能力丧失-三岁始理赔 '},
{ value: 23, label:'24、重型再生障碍性贫血 '},
{ value: 24, label:'25、主动脉手术 '},
{ value: 25, label:'26、多发性硬化症 '},
{ value: 26, label:'27、经输血导致的人类免疫缺陷病毒感染 '},
{ value: 27, label:'28、植物人状态 '},
{ value: 28, label:'29、系统性红斑狼疮 '},
{ value: 29, label:'30、胰岛素依赖型糖尿病(I型糖尿病) '},
{ value: 30, label:'31、原发性心肌病 '},
{ value: 31, label:'32、重症肌无力 '},
{ value: 32, label:'33、急性坏死性胰腺炎 '},
{ value: 33, label:'34、坏死性筋膜炎 '},
{ value: 34, label:'35、终末期肺病 '},
{ value: 35, label:'36、严重类风湿性关节炎 '},
{ value: 36, label:'37、非阿尔茨海默病所致严重痴呆 '},
{ value: 37, label:'38、系统性硬化 '},
{ value: 38, label:'39、脊髓灰质炎 '},
{ value: 39, label:'40、严重克隆病 '},
{ value: 40, label:'41、严重溃疡性结肠炎 '},
{ value: 41, label:'42、因职业关系导致的人类免疫缺陷病毒感染 '},
{ value: 42, label:'43、川崎病 '},
{ value: 43, label:'44、慢性肾上腺皮质功能衰竭 '},
{ value: 44, label:'45、埃博拉病毒感染 '},
{ value: 45, label:'46、象皮病 '},
{ value: 46, label:'47、肺源性心脏病 '},
{ value: 47, label:'48、原发性硬化性胆管炎 '},
{ value: 48, label:'49、疯牛病 '},
{ value: 49, label:'50、严重心肌炎 '},
{ value: 50, label:'51、肾髓质囊性病 '},
{ value: 51, label:'52、严重冠心病 '},
{ value: 52, label:'53、严重肌营养不良症 '},
{ value: 53, label:'54、慢性复发性胰腺炎 '},
{ value: 54, label:'55、进行性核上性麻痹 '},
{ value: 55, label:'56、胰腺移植 '},
{ value: 56, label:'57、严重瑞氏综合症 '},
{ value: 57, label:'58、严重自身免疫性肝炎 '},
{ value: 58, label:'59、肌萎缩性(脊髓)侧索硬化症 '},
{ value: 59, label:'60、肝豆状核变性(Wilson病) '},
{ value: 60, label:'61、严重哮喘 '},
];
//常青树所保轻度疾病列表
export const GeneralDiseaseList_cqs = [
{ value: 0, label: '1、非危及生命的(极早期的)恶性病变 '},
{ value: 1, label: '2、冠状动脉介入手术 '},
{ value: 2, label: '3、轻微脑中风 '},
{ value: 3, label: '4、心脏瓣膜介入手术 '},
{ value: 4, label: '5、脑垂体瘤、脑囊肿、脑动脉瘤及脑血管瘤 '},
{ value: 5, label: '6、视力严重受损 – 三周岁始理赔 '},
{ value: 6, label: '7、主动脉内介入手术 '},
{ value: 7, label: '8、较小面积III度烧伤(10%) '},
{ value: 8, label: '9、慢性肾功能损害 – 肾功能衰竭期 '},
{ value: 9, label: '10、重症头部外伤 '},
{ value: 10, label:'11、单个肢体缺失 '},
{ value: 11, label:'12、单侧肺脏切除 '},
{ value: 12, label:'13、肝脏手术 '},
{ value: 13, label:'14、早期运动神经性疾病 '},
{ value: 14, label:'15、人工耳蜗植入术 '},
];
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!