Commit d1799b9c by gaoju

h生产代码

1 parent 36b40e1c
Showing 73 changed files with 5963 additions and 4210 deletions
This diff could not be displayed because it is too large.
......@@ -7,7 +7,6 @@
"precommit": "npm run lint"
},
"dependencies": {
"animate.css": "^3.7.0",
"antd": "^3.12.3",
"antd-mobile": "^2.2.9",
"babel-helpers": "^6.24.1",
......@@ -16,14 +15,10 @@
"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"
},
......
......@@ -10,7 +10,6 @@
height: .8rem;
background: url("../../assets/image/home-frame.png") no-repeat center center;
background-size: 100% 100%;
z-index: 10;
}
bottomButton > .module{
......
......@@ -18,8 +18,8 @@ export default class BottomNav extends Component{
text:'在线专家'
},
{
img:require('../../assets/image/userCenter.png'),
text:'个人中心'
img:require('../../assets/image/performance.png'),
text:'业绩'
},
],
......@@ -34,8 +34,8 @@ export default class BottomNav extends Component{
text:'人员管理'
},
{
img:require('../../assets/image/userCenter.png'),
text:'个人中心'
img:require('../../assets/image/performance.png'),
text:'业绩'
},
],
}
......@@ -58,14 +58,11 @@ export default class BottomNav extends Component{
text: '在线专家'
},
{
img: require('../../assets/image/userCenter.png'),
text: '个人中心'
img: require('../../assets/image/performance.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={()=>{
......@@ -79,8 +76,6 @@ export default class BottomNav extends Component{
}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()
......
/*.am-calendar{*/
/*width: .68rem !important;*/
/*}*/
/*.am-calendar>span{*/
/*width: 100%;*/
/*max-width: 680px;*/
/*}*/
/*.am-calendar .content{*/
/*position: fixed;*/
/*display: -ms-flexbox;*/
/*display: flex;*/
/*-ms-flex-direction: column;*/
/*flex-direction: column;*/
/*width: 6.8rem;*/
/*height: 100%;*/
/*top: 0;*/
/*left: 50%;*/
/*margin-left: -3.4rem;*/
/*z-index: 999;*/
/*background: #fff;*/
/*}*/
/*
import React, { Component } from 'react'
import { connect } from 'dva'
import { List, Calendar } from 'antd-mobile';
import enUS from 'antd-mobile/lib/calendar/locale/en_US';
import zhCN from 'antd-mobile/lib/calendar/locale/zh_CN';
import './date.css'
const extra = {
'2017/07/15': { info: 'Disable', disable: true },
};
const now = new window.Date();
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 5)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 6)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 7)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 8)] = { info: 'Disable', disable: true };
console.log(now);
Object.keys(extra).forEach((key) => {
const info = extra[key];
const date = new window.Date(key);
if (!Number.isNaN(+date) && !extra[+date]) {
extra[+date] = info;
}
});
class Date extends Component {
originbodyScrollY = document.getElementsByTagName('body')[0].style.overflowY;
constructor(props) {
super(props);
this.state = {
en: false,
show: false,
config: {},
};
}
showDate=()=>{
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
this.setState({
show: true,
config:{type: 'one',pickTime: false},
});
}
renderBtn(zh, en, config = {}) {
config.locale = this.state.en ? enUS : zhCN;
return (
<List.Item arrow="horizontal"
style={{width:680}}
onClick={
()=>{
this.showDate()
}
}
>
{this.state.en ? en : zh}
</List.Item>
);
}
changeLanguage = () => {
this.setState({
en: !this.state.en,
});
}
onSelectHasDisableDate = (dates) => {
console.warn('onSelectHasDisableDate', dates);
}
onConfirm = (startTime, endTime) => {
document.getElementsByTagName('body')[0].style.overflowY = this.originbodyScrollY;
this.setState({
show: false,
startTime,
endTime,
});
let getMonth = startTime.getMonth()+1
let selectDate = startTime.getFullYear() + '-'+ getMonth +'-'+startTime.getDate()
this.props.handleDate(selectDate);
// this.selectDate();
}
selectDate= ()=>{
}
onCancel = () => {
document.getElementsByTagName('body')[0].style.overflowY = this.originbodyScrollY;
this.setState({
show: false,
startTime: undefined,
endTime: undefined,
});
}
getDateExtra = date => extra[+date];
componentDidMount() {
this.props.onRef(this)
}
render() {
return (
<div style={{ display:'none'}}>
<List className="calendar-list" style={{ backgroundColor: 'white',opacity:0,height:'0'}}>
{/!*<List.Item className="item" extra={<Switch className="right" checked={!this.state.en} onChange={this.changeLanguage} />}>*!/}
{/!*{this.state.en ? 'Chinese' : '中文'}*!/}
{/!*</List.Item>*!/}
{/!*{this.renderBtn('选择日期区间', 'Select Date Range')}*!/}
{/!*{this.renderBtn('选择日期时间区间', 'Select DateTime Range', { pickTime: true })}*!/}
{this.renderBtn('选择日期', 'Select Date',{type: 'one',pickTime: false},)}
{/!*{this.renderBtn('选择日期', 'Select Date',{type: 'one',pickTime: false},)}*!/}
{/!*{this.renderBtn('选择日期时间', 'Select DateTime', { type: 'one', pickTime: true })}*!/}
{/!*{this.renderBtn('选择日期区间(快捷)', 'Select Date Range (Shortcut)', { showShortcut: true })}*!/}
{/!*{this.renderBtn('选择日期时间区间(快捷)', 'Select DateTime Range (Shortcut)', { pickTime: true, showShortcut: true })}*!/}
{/!*{this.renderBtn('大行距', 'XL row size', { rowSize: 'xl' })}*!/}
{/!*{this.renderBtn('不无限滚动', 'infinite: false', { infinite: false })}*!/}
{/!*{this.renderBtn('水平进入', 'Horizontal enter', { enterDirection: 'horizontal' })}*!/}
{/!*{this.renderBtn('默认选择范围', 'Selected Date Range', { defaultValue: [new window.Date(+now - 86400000), new window.Date(+now - 345600000)] })}*!/}
{/!*{this.renderBtn('onSelect API', 'onSelect API', {*!/}
{/!*onSelect: (date, state) => {*!/}
{/!*console.log('onSelect', date, state);*!/}
{/!*return [date, new window.Date(+now - 604800000)];*!/}
{/!*},*!/}
{/!*})}*!/}
{/!*{*!/}
{/!*this.state.startTime &&*!/}
{/!*<List.Item>Time1: {this.state.startTime.toLocaleString()}</List.Item>*!/}
{/!*}*!/}
</List>
<Calendar
// style={{width:'.68rem',height:'100%'}}
{...this.state.config}
visible={this.state.show}
onCancel={this.onCancel}
onConfirm={this.onConfirm}
onSelectHasDisableDate={this.onSelectHasDisableDate}
getDateExtra={this.getDateExtra}
defaultDate={now}
minDate={new window.Date(+now - 5184000000)}
maxDate={new window.Date(+now + 31536000000)}
/>
</div>
);
}
}
export default connect()(Date)
*/
import React, { Component } from 'react'
import { Menu, Icon } from 'antd'
import { connect } from 'dva'
import { List, Switch, Calendar } from 'antd-mobile';
import enUS from 'antd-mobile/lib/calendar/locale/en_US';
import zhCN from 'antd-mobile/lib/calendar/locale/zh_CN';
import './date.css'
import moment from 'moment';
const extra = {
'2017/07/15': { info: 'Disable', disable: true },
};
const now = new window.Date();
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 5)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 6)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 7)] = { info: 'Disable', disable: true };
// extra[+new window.Date(now.getFullYear(), now.getMonth(), now.getDate() + 8)] = { info: 'Disable', disable: true };
console.log(now);
Object.keys(extra).forEach((key) => {
const info = extra[key];
const date = new window.Date(key);
if (!Number.isNaN(+date) && !extra[+date]) {
extra[+date] = info;
}
});
class Date extends Component {
originbodyScrollY = document.getElementsByTagName('body')[0].style.overflowY;
constructor(props) {
super(props);
this.state = {
en: false,
show: false,
config: {},
};
}
// showDate=()=>{
//
//
//
// document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
// this.setState({
// show: true,
// config:{type: 'one',pickTime: false},
// });
//
//
// }
renderBtn(zh, en, config = {}) {
config.locale = this.state.en ? enUS : zhCN;
return (
<List.Item arrow="horizontal"
style={{width:680}}
onClick={
()=>{
this.showDate()
}
}
>
{this.state.en ? en : zh}
</List.Item>
);
}
changeLanguage = () => {
this.setState({
en: !this.state.en,
});
}
onSelectHasDisableDate = (dates) => {
console.warn('onSelectHasDisableDate', dates);
}
onConfirm = (startTime, endTime) => {
document.getElementsByTagName('body')[0].style.overflowY = this.originbodyScrollY;
this.setState({
show: false,
startTime,
endTime,
});
let getMonth = startTime.getMonth()+1
let selectDate = startTime.getFullYear() + '-'+ getMonth +'-'+startTime.getDate()
this.props.handleDate(selectDate);
// this.selectDate();
}
selectDate= ()=>{
}
onCancel = () => {
document.getElementsByTagName('body')[0].style.overflowY = this.originbodyScrollY;
this.setState({
show: false,
startTime: undefined,
endTime: undefined,
});
}
getDateExtra = date => extra[+date];
componentDidMount() {
this.props.onRef(this)
}
render() {
console.log(this.state.startTime);
return (
<div style={{}}>
<List className="calendar-list" style={{ backgroundColor: 'white',opacity:0 ,width:0,display:'none'}}>
{/*<List.Item className="item" extra={<Switch className="right" checked={!this.state.en} onChange={this.changeLanguage} />}>*/}
{/*{this.state.en ? 'Chinese' : '中文'}*/}
{/*</List.Item>*/}
{/*{this.renderBtn('选择日期区间', 'Select Date Range')}*/}
{/*{this.renderBtn('选择日期时间区间', 'Select DateTime Range', { pickTime: true })}*/}
{this.renderBtn('选择日期', 'Select Date',{type: 'one',pickTime: false},)}
{this.renderBtn('选择日期', 'Select Date',{type: 'one',pickTime: false},)}
{/*{this.renderBtn('选择日期时间', 'Select DateTime', { type: 'one', pickTime: true })}*/}
{/*{this.renderBtn('选择日期区间(快捷)', 'Select Date Range (Shortcut)', { showShortcut: true })}*/}
{/*{this.renderBtn('选择日期时间区间(快捷)', 'Select DateTime Range (Shortcut)', { pickTime: true, showShortcut: true })}*/}
{/*{this.renderBtn('大行距', 'XL row size', { rowSize: 'xl' })}*/}
{/*{this.renderBtn('不无限滚动', 'infinite: false', { infinite: false })}*/}
{/*{this.renderBtn('水平进入', 'Horizontal enter', { enterDirection: 'horizontal' })}*/}
{/*{this.renderBtn('默认选择范围', 'Selected Date Range', { defaultValue: [new window.Date(+now - 86400000), new window.Date(+now - 345600000)] })}*/}
{/*{this.renderBtn('onSelect API', 'onSelect API', {*/}
{/*onSelect: (date, state) => {*/}
{/*console.log('onSelect', date, state);*/}
{/*return [date, new window.Date(+now - 604800000)];*/}
{/*},*/}
{/*})}*/}
{/*{*/}
{/*this.state.startTime &&*/}
{/*<List.Item>Time1: {this.state.startTime.toLocaleString()}</List.Item>*/}
{/*}*/}
</List>
<Calendar
style={{width:'.68rem',height:'100%'}}
{...this.state.config}
visible={this.state.show}
onCancel={this.onCancel}
onConfirm={this.onConfirm}
onSelectHasDisableDate={this.onSelectHasDisableDate}
getDateExtra={this.getDateExtra}
defaultDate={now}
minDate={new window.Date(+now - 5184000000)}
maxDate={new window.Date(+now + 31536000000)}
/>
</div>
);
}
}
export default connect()(Date)
......@@ -4,8 +4,8 @@ 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();
const now = new Date(nowTimeStamp);
// GMT is not currently observed in the UK. So use UTC now.
const utcNow = new Date(now.getTime() + (now.getTimezoneOffset() * 60000));
......@@ -49,20 +49,13 @@ class datePicker extends Component {
}
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=()=>{
console.log(555);
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
this.setState({
visible: true,
......@@ -70,6 +63,7 @@ class datePicker extends Component {
}
showDate1=()=> {
console.log(4444444);
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
this.setState({
visible: true,
......@@ -79,9 +73,7 @@ class datePicker extends Component {
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
......@@ -96,28 +88,21 @@ class datePicker extends Component {
title="出生日期"
extra="Optional"
value={this.state.date}
minDate={minDate}
minDate={new Date(1963, 0, 1, 0, 0, 0)}
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 })
console.log(44);
this.setState({ date })
}}
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)
this.setState({ visible:false })
}
}
>
......
......@@ -167,19 +167,3 @@ label标签
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
......@@ -76,22 +76,13 @@ import SwipeActionExample from "../../components/SwipeAction"
<div className={styles.right}>
<div className={styles.top}>
<div className={styles.title}>{item.riskName}</div>
{/**item.riskLabels && item.riskLabels.map((ite,ind)=>{
{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}>
......
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);
......@@ -14,13 +15,12 @@ class MemberList extends React.Component{
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);
......@@ -37,80 +37,70 @@ class MemberList extends React.Component{
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>
})
<div className={css.scrollListWrap} ref={el=>this.nameList=el}>
<div className={css.list}>
{
list.length>0 && list.map((itm, index) => {
return <dl key={index} 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';
}
</dl>
})
}
</div>
</Iscroll>
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>
</div>
{
// 是否有选择操作
showActionSheet && <div className={css.btnAdd} onClick={ showActionSheet }></div>
}
<ul className={css.indexList} style={{height:this.props.height ? this.props.height : '69vh'}}>
<ul className={css.indexList}>
{
// 右侧字母索引
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);
this['nameList'].scrollTop = this['list' + item].offsetTop;
}
}
......@@ -122,4 +112,4 @@ class MemberList extends React.Component{
}
}
export default MemberList;
\ No newline at end of file
export default MemberList;
......@@ -6,9 +6,6 @@
position: absolute;
right: 0;
top: .7rem;
overflow-y: auto;
height: 69vh;
z-index:5;
li {
color: #666;
......@@ -40,7 +37,7 @@
.btnAdd {
position: fixed;
right: .3rem;
bottom: .08rem;
bottom: .1rem;
width: .6rem;
height: .6rem;
background: url(../../assets/image/add-user.png) no-repeat;
......@@ -92,10 +89,8 @@
}
.scrollListWrap {
position:relative;
background: #f8f8f8;
height: 66vh;
//height: calc(100vh - 190px);
height: 70vh;
overflow-y: scroll;
}
......@@ -129,7 +124,6 @@
font-size: .15rem;
background: #fff;
color: #101010;
padding-right: .15rem;
span {
float: none;
......
import React,{Component} from 'react';
import { connect } from 'dva';
import { SwipeAction, List ,Modal} from 'antd-mobile';
import { SwipeAction, List } from 'antd-mobile';
import styles from "./swipeActive.css"
const alert = Modal.alert;
let alert2=null;
class SwipeActionExample extends Component{
constructor(props){
super(props);
......@@ -14,17 +12,20 @@ class SwipeActionExample extends Component{
componentDidMount(){
}
componentWillUnmount(){
//如果弹框没有关闭则关闭
if(alert2){
alert2.close();
}
}
editor=(item)=>{
if(item.seriNo){
// this.props.goPlan(item)
/*this.props.dispatch(routerRedux.push({
pathname: '/planEditor',
query: {
seriNo:item.seriNo,
riskName:item.riskName,
},
}));*/
this.props.go1(item)
}
......@@ -36,19 +37,14 @@ class SwipeActionExample extends Component{
}
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)
}
} },
])
// 通讯录删除
if(this.props.client) {
console.log(this.props.item.id);
this.props.delete(this.props.item.id)
}else{
this.props.go(item)
}
}
history=(item)=>{
......@@ -63,7 +59,7 @@ class SwipeActionExample extends Component{
disabled = {this.props.disabled}
right={[
{
text: '编辑',
text: '修改',
onPress: ()=>{
this.editor(this.props.item)
},
......@@ -105,7 +101,7 @@ class SwipeActionExample extends Component{
<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.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>}
......@@ -119,4 +115,6 @@ class SwipeActionExample extends Component{
)
}
}
// export default withRouter(SwipeActionExample)
export default connect(({home})=>({home}))(SwipeActionExample)
// (Form.create()(History))
......@@ -66,6 +66,4 @@
background: none !important;
}
:global(.am-modal-transparent .am-modal-content){
padding-top: 15px;
}
:global(ul.slider-list){
height:1.4rem !important;
}
:global(.ant-carousel .slick-dots){
position: absolute;
/*bottom: 50px;*/
}
......@@ -22,7 +22,9 @@ import styles from "./Swiper.css"
payload: {
"bannerName":"",
"bannerStatus":1,
"proId":localStorage.getItem("project"),
"pageNo":1,
"pageSize":10,
"project":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
......@@ -40,13 +42,12 @@ import styles from "./Swiper.css"
storage.setItem("calculationMethod",item.bannerLabel)
storage.setItem("selectd",1)
storage.setItem("seriNo",'')
//storage.setItem("recipients",false)
storage.setItem("recipients",false)
storage.setItem("riskIntroduce",'')
// storage.setItem("thumbnail",item.bannerPath)
storage.setItem("thumbnail",item.bannerUrl)
//storage.setItem("recipientsName",'')
storage.setItem("thumbnail",item.bannerPath)
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='
window.location.href= window.location.href.split('#')[0]+ '#/addplaneditor?riskName='+item.bannerName+'&riskCode='+item.bannerCode +'&calculationMethod='+ item.bannerLabel + '&recipients=false&riskIntroduce=&thumbnail='+item.bannerPath+'&recipientsName=&selectd=1&roleId='+ roleId + '&seriNo='
}
render(){
return (
......@@ -74,7 +75,7 @@ import styles from "./Swiper.css"
this.setState({
moveend: 0
})
}} ><img src={item.bannerPath} alt="" style={{ width: '3.92rem',height:'1.8rem', borderRadius: '.12rem', }}
}} ><img src={item.bannerPath} alt="" style={{ width: '3.92rem', borderRadius: '.12rem', }}
/> </div>)
})}
</Carousel>
......
......@@ -13,6 +13,103 @@ const EditableRow = ({ form, index, ...props }) => (
</EditableContext.Provider>
);
const EditableFormRow = Form.create()(EditableRow);
class EditableCell extends React.Component {
state = {
editing: false,
}
componentDidMount() {
if (this.props.editable) {
document.addEventListener('click', this.handleClickOutside, true);
}
}
/* componentWillUnmount() {
if (this.props.editable) {
document.removeEventListener('click', this.handleClickOutside, true);
}
}*/
toggleEdit = () => {
const editing = !this.state.editing;
this.setState({ editing }, () => {
if (editing) {
this.input.focus();
}
});
}
handleClickOutside = (e) => {
const { editing } = this.state;
if (editing && this.cell !== e.target && !this.cell.contains(e.target)) {
this.save();
}
}
save = () => {
const { record, handleSave } = this.props;
this.form.validateFields((error, values) => {
if (error) {
return;
}
this.toggleEdit();
handleSave({ ...record, ...values });
});
}
render() {
const { editing } = this.state;
const {
// editable,
// dataIndex,
// title,
// record,
// index,
// handleSave,
...restProps
} = this.props;
return (
<td ref={node => (this.cell = node)} {...restProps}>
{/*{editable ? (*/}
{/*<EditableContext.Consumer>*/}
{/*{(form) => {*/}
{/*this.form = form;*/}
{/*return (*/}
{/*editing ? (*/}
{/*<FormItem style={{ margin: 0 }}>*/}
{/*{form.getFieldDecorator(dataIndex, {*/}
{/*rules: [{*/}
{/*required: true,*/}
{/*message: `${title} is required.`,*/}
{/*}],*/}
{/*initialValue: record[dataIndex],*/}
{/*})(*/}
{/*<Input*/}
{/*ref={node => (this.input = node)}*/}
{/*onPressEnter={this.save}*/}
{/*/>*/}
{/*)}*/}
{/*</FormItem>*/}
{/*) : (*/}
{/*<div*/}
{/*className="editable-cell-value-wrap"*/}
{/*style={{ paddingRight: 24 }}*/}
{/*onClick={this.toggleEdit}*/}
{/*>*/}
{/*{restProps.children}*/}
{/*</div>*/}
{/*)*/}
{/*);*/}
{/*}}*/}
{/*</EditableContext.Consumer>*/}
{/*) : restProps.children}*/}
</td>
);
}
}
export default class EditableTable extends React.Component {
constructor(props) {
super(props);
......@@ -45,12 +142,7 @@ export default class EditableTable extends React.Component {
count: 2,
};
}
componentWillReceiveProps(nextProps){
this.setState({
dataSource:nextProps.listTable,
columns:nextProps.listTitle,
})
}
componentDidMount(){
this.setState({
dataSource:this.props.listTable,
......
......@@ -45,8 +45,6 @@
/* 我的客户 --- 无*/
.clientless{
/*margin: auto;*/
position: absolute;
height: 100%;
}
.clientless> .client{
width: 1.51rem;
......@@ -60,11 +58,9 @@
margin-bottom: .02rem;
}
.add{
position: absolute;
bottom: .32rem;
width: 3.5rem;
height: 1.22rem;
margin: 0 .32rem 0;
margin: 1.8rem .32rem 0;
}
......@@ -196,16 +192,26 @@ SwipeActionExample{
list-style: none;
}
.btn_confirm{
position: relative;
height: .7rem;
top: .05rem;
/*width: 100%;*/
/*height: 1rem;*/
}
.btn_confirm>img{
width: .6rem;
height: .6rem;
position: relative;
/* margin: auto; */
position: absolute;
right: .2rem;
float: right;
bottom: .1rem;
}
.btn_confirm1>img{
width: .6rem;
height: .6rem;
/* margin: auto; */
position: absolute;
right: -4rem;
bottom: .1rem;
}
......@@ -238,9 +244,5 @@ SwipeActionExample{
justify-content: center;
background-color: #fff;
overflow: hidden;
min-height: 100%;
}
/*:global(.am-list-line){*/
/*padding-left: 15px;*/
/*}*/
......@@ -7,7 +7,7 @@ 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);
......@@ -19,11 +19,14 @@ class Tab extends Component{
chosenItm: '',
inputValue:'',
name:'',
nameListLength:0,
currentStatus:'',
managerList:[],
managerList1:[],
firstName:[],
nameList:props.nameList,
nameList1:props.nameList1,
checkTab:0,
// nameList1:[],
}
}
onSearch = (val) => {
......@@ -31,34 +34,79 @@ class Tab extends Component{
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,
// })
// }
// })
that.props.dispatch({
type:'myUser/getAllUser',
payload:{
"id":localStorage.getItem("id"),
"currentState":0,
},
callback(data){
that.setState({
list:data,
nameList:data,
managerList:data,
nameListLength:data.length,
})
}
})
this.props.dispatch({
type:'myUser/getAllUser',
payload:{
"id":localStorage.getItem("id"),
},
callback(data){
that.setState({
list:data,
nameList1:data,
managerList1:data,
nameListLength:data.length,
})
}
})
}
/* 客户列表接口 */
getUaer = (index)=>{
let that = this;
if(index==0){
// that.props.dispatch({
// type:'myUser/getAllUser',
// payload:{
// "id":localStorage.getItem("id"),
// "currentState":0,
// },
// callback(data){
// that.setState({
// list:data,
// nameList:data,
// managerList:data,
// nameListLength:data.length,
// })
// }
// })
}else if(index == 1){
// that.props.dispatch({
// type:'myUser/getAllUser',
// payload:{
// "id":localStorage.getItem("id"),
// },
// callback(data){
// that.setState({
// list:data,
// nameList1:data,
// managerList1:data,
// nameListLength:data.length,
// })
// }
// })
}
}
/* 删除客户 */
delete = (id)=>{
let that = this;
......@@ -70,40 +118,51 @@ class Tab extends Component{
callback(){
// this.getUaer()
}
})
}
history=()=>{
this.props.history()
}
go1=(item)=>{
console.log(item);
// this.props.dispatch(routerRedux.push({
// pathname: '/planEditor',}));
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("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
//storage.setItem("recipientsName",'')
//storage.setItem("recipientsSex",true)
//storage.setItem("recipients",false)
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;
window.location.href= window.location.href.split('#')[0]+ '#/planEditor?riskName='+item.riskName+'&riskCode='+item.riskCode +'&calculationMethod='+ item.calculationMethod + '&recipients=false&riskIntroduce='+item.riskIntroduce+ '&thumbnail='+item.thumbnail+'&recipientsName=&selectd=1&roleId='+ roleId + '&seriNo='+item.seriNo
}
goPlanResult=(item)=>{
// this.props.dispatch(routerRedux.push({
// pathname: '/planResult',}));
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;
window.location.href= window.location.href.split('#')[0]+ '#/planResult?seriNo='+item.seriNo+'&riskName='+item.riskName +'&riskCode='+ item.riskCode +'&thumbnail='+item.thumbnail
}
go=(item)=>{
this.props.dispatch({
type:'planEditor/getMyPlanMessage',
type:'home/getMyPlanMessage',
payload:{
"seriNo":item.seriNo,
"interestRate":"0.03"
......@@ -111,10 +170,14 @@ go=(item)=>{
callback(data){
}
})
this.props.BrowserRouter.push({pathname:'/planEditor',query:{id:1}})
}
dispatch=(item)=>{
let that = this;
if(item.seriNo){
}else{
this.props.dispatch({
type: 'myUser/getAllUser',
......@@ -127,43 +190,45 @@ go=(item)=>{
}
})
}
}
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("recipients",false)
storage.setItem("riskIntroduce",item.riskIntroduce)
storage.setItem("thumbnail",item.thumbnail)
//storage.setItem("recipientsName",'')
//storage.setItem("recipientsSex",true)
//storage.setItem("recipients",false)
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='
window.location.href= window.location.href.split('#')[0]+ '#/addPlanEditor?riskName='+item.riskName+'&riskCode='+item.riskCode +'&calculationMethod='+ item.calculationMethod + '&recipients=false&riskIntroduce='+item.riskIntroduce+ '&thumbnail='+item.thumbnail+'&recipientsName=&selectd=1&roleId='+ roleId + '&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;
let showClient = this.state.nameList?this.state.nameList.length==0:false &&this.props.user;
let showClient1 = this.state.nameList1?this.state.nameList1.length==0:false &&this.props.user;
const { dataFilterToProp } = this.props;
return (
<div style={{height:'100%',backgroundColor:'white'}}>
<div style={{height:'100%'}}>
<Tabs tabs={this.state.tabs}
initialPage={checkTab}
initialPage={0}
swipeable={false}
onChange={(tab, index) => {
let checkTab = tab.title.props.children;
sessionStorage.setItem( "key", checkTab);
}}
onTabClick={(tab, index) => {
this.props.user ? this.getUaer(index):this.props.getMyPlan(index)
}}
tabBarTextStyle={{fontSize:'.15rem',height:'.435rem'}}
>
<div className={!showClient||!showClient1?styles.tabs1:styles.tabs}>
......@@ -175,9 +240,11 @@ go=(item)=>{
<div><img src={require('../../assets/image/no-more.png')} alt=""/>
<span>没有更多啦</span>
</div>
{/*<div className={styles.line}></div>*/}
</div>
</div>
}
{/* 我的客户---无客户跟进中*/}
{ !this.props.myPlanList&& showClient && <div className={styles.clientless}>
<img src={require('../../assets/image/clientless.png')} alt="" className={styles.client}/>
......@@ -189,7 +256,7 @@ go=(item)=>{
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}>
......@@ -201,74 +268,56 @@ go=(item)=>{
<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>}
{this.props.hasClient[0] &&<div> <MemberList
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}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.createTime.substr(0, 16)}</span>
</div>
</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'}}>
<div style={{ display: 'flex', height:'100%', justifyContent: 'center',backgroundColor: '#fff',marginBottom:'.3rem' ,overflowX:'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>
{this.props.myPlanList && <div>
<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 className={styles.line}></div>*/}
</div>
</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>
}
</div>}
{/*我的客户---有客户已提交 */}
{!this.props.myPlanList&& !showClient1 && <div className={styles.less} style={{width:'100%'}}>
{!this.props.hasClient[1] && <div className={styles.clientless}>
......@@ -280,76 +329,72 @@ go=(item)=>{
<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:
</div>}
{ this.props.hasClient[1] && <div><MemberList
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'
}
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();
}} />
}}>
<span className={css.name}>{item.name}</span>
<span className={css.time}>{item.createTime.substr(0, 16)}</span>
<span className={css.status}>{status}</span>
</div>
</div>
}
</div>
}
}}
handleAction={item => {
console.log(44);
this.props.delete(item.id)
}}
pTitle='客户' />
<div className={styles.btn_confirm1} >
<img src={require('../../assets/image/add-user.png')} alt="" onClick={() => {
this.props.addUser();
}} />
</div>
</div>}
</div>}
</div>
</Tabs>
<WhiteSpace />
......@@ -358,4 +403,4 @@ go=(item)=>{
}
}
Tab.propsTypes = {}
export default connect(({myUser})=>({myUser}))(Form.create()(Tab))
\ No newline at end of file
export default connect(({myUser})=>({myUser}))(Form.create()(Tab))
import React from "react";
export default class Select extends React.Component {
constructor(props) {
super(props);
this.state = {
projects: [],
value: 1
};
}
componentDidMount() {
console.log(this.props.list);
this.setState({
projects: this.props.list,
value: 1
});
}
handleClick() {
this.setState({
projects: [
{ id: 4, name: "水果" },
{ id: 5, name: "西瓜" },
{ id: 6, name: "哈哈哈" }
],
value: 4
});
}
handleChange = e => {
this.setState({
value: e.target.value
});
this.props.changeValue(e.target.value)
console.log(e.target.value);
};
render() {
let projects = this.state.projects;
return (
<div>
<select
value={this.state.value}
onChange={this.handleChange}
>
{projects.length > 0 &&
projects.map((item, i) => {
return (
<option key={i} value={item.name}>
{item.name}
</option>
);
})}
</select>
</div>
);
}
}
......@@ -3,19 +3,17 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<title>&nbsp;</title>
<title>华夏O2O</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>
......@@ -19,17 +19,12 @@ 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);
app.model(require('./models/Performance').default)
// 4. Router
app.router(require('./router').default);
// 5. Start
app.start('#root');
......
import {policyList,performList,achievementRank} from '../services/performance';
import { notifyError } from '../services/app.js';
import {policyList,performList} from '../services/performance';
import {Toast} from "antd-mobile"
export default {
namespace: 'Performance',
......@@ -12,6 +13,7 @@ export default {
if (callback) callback(data.data);
} else {
error && error(data)
// notifyError(data.message);
}
},
*performList({ payload, callback, error}, { call, put }) {
......@@ -22,14 +24,6 @@ export default {
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 }) {
......
import { notifyError } from '../services/app.js';
import { addUser,Dictionaries,sendMaster,isFollow,followCustomer} from '../services/addUser';
import { addUser,Dictionaries,PremiumPaymentPeriod ,sendMaster,isFollow} from '../services/addUser';
......@@ -19,7 +19,6 @@ export default {
} else {
// if (error) callback(error);
if (error) error(data);
}
},
*Dictionaries({ payload, callback }, { call, put }) {
......@@ -31,21 +30,20 @@ export default {
notifyError(data.message);
}
},
*sendMaster({ payload, callback,error }, { call, put }) {
*PremiumPaymentPeriod({ payload, callback }, { call, put }) {
console.log(payload);
const { data } = yield call(sendMaster, payload);
const { data } = yield call(PremiumPaymentPeriod, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
notifyError(data.message);
}
},
*isFollow({ payload, callback,error }, { call, put }) {
*sendMaster({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(isFollow, payload);
const { data } = yield call(sendMaster, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
......@@ -54,15 +52,16 @@ export default {
}
},
*followCustomer({ payload, callback,error }, { call, put }) {
*isFollow({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(followCustomer, payload);
const { data } = yield call(isFollow, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
}
}
},
......
import { notifyError } from '../services/app.js';
import { getBanner,getPlanList,getMyPlan,getCustomerInfo,GetRoomList,getSearchList,setClickRecord} from '../services/home';
import { getBanner,getPlanList,getMyPlan,getMyPlanMessage,getCustomerInfo} from '../services/home';
export default {
namespace: 'home',
state: {
PersonalDetail:{},
AllPlanList:[],
MyPlanList:[],
searchList:[]
},
effects: {
*getBanner({ payload, callback }, { call, put }) {
......@@ -24,7 +25,6 @@ export default {
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('退出失败!');
}
......@@ -38,51 +38,33 @@ export default {
// 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) {
*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);
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);
}
}
*getCustomerInfo({ payload, callback }, { call, put }) {
const { data } = yield call(getCustomerInfo, payload);
if (callback) callback(data);
},
},
reducers: {
savePersonalDetail(state, { payload }) {
return { ...state, PersonalDetail: payload.microPlanInfo };
},
updatePlanList(state, { payload }){
return {
...state,
AllPlanList: payload.planList };
},
updateSearchList(state, { payload }){
return {
...state,
...payload };
}
},
subscriptions: {
......
......@@ -21,7 +21,7 @@ export default {
if (data.status === true) {
if (callback) callback(data);
} else {
notifyError(data.message);
// notifyError(data.message);
}
},
*Approve({ payload, callback }, { call, put }) {
......
import { notifyError } from '../services/app.js';
import { getAllUser,deleteCustomer } from '../services/myUser';
import { getAllUser,deleteCustomer,GetRoomList } from '../services/myUser';
......@@ -16,14 +16,13 @@ export default {
*getAllUser({ payload, callback }, { call, put }) {
const { data } = yield call(getAllUser, payload);
if (data.status === true) {
if(data.data && data.data.length===1){
if(data.data.length===1){
yield put({
type: 'saveUser',
payload: data.data,
});
}
let dataList = data.data || [];
if (callback) callback(dataList);
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
......@@ -36,6 +35,18 @@ export default {
notifyError(data.message);
}
},
*getRoomList({ payload, callback }, { call, put }) {
const { data } = yield call(GetRoomList, payload);
if (data.code === 0) {
if (callback) callback(data);
} else {
notifyError(data.message);
}
},
},
reducers: {
......
import { getMyPlanMessage,PlanClause,payInsurance,getProspectusaAditional,deletePlan,PremiumPaymentPeriod,addReceiveInfo} from '../services/planEditor';
import { notifyError } from '../services/app.js';
import { PlanClause,payInsurance,getProspectusaAditional,deletePlan} from '../services/planEditor';
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 {
// notifyError(data.message);
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);
// notifyErrorfyError(data.message);
}
},
......@@ -51,9 +38,9 @@ export default {
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);
// notifyError(data.message);
}
},
......@@ -68,34 +55,8 @@ export default {
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";
import { GetPosterList } from '../services/poster';
export default {
namespace: "poster",
namespace: 'poster',
state: {
// item: {},
},
effects: {
*getPosterList({ payload, callback }, { call, put }) {
const { data } = yield call(GetPosterList, payload);
callback && callback(data);
// 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('!');
// }
},
*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: {
},
subscriptions: {}
};
......@@ -15,10 +15,7 @@ function RouterConfig({ history, app }) {
app,
component: () => import('./routes/Home')
})
const Search = dynamic({
app,
component: () => import('./routes/Home/search')
})
const Welcome = dynamic({
app,
component: () => import('./routes/Welcome')
......@@ -40,6 +37,10 @@ function RouterConfig({ history, app }) {
app,
component: () => import('./routes/ProspectusList')
})
const PlanEditor = dynamic({
app,
component: () => import('./routes/PlanEditor')
})
const AddPlanEditor = dynamic({
app,
component: () => import('./routes/AddPlanEditor')
......@@ -54,7 +55,7 @@ function RouterConfig({ history, app }) {
})
const MyUser = dynamic({
app,
component: () => import('./routes/MyUser/index')
component: () => import('./routes/MyUser')
})
const AddUser = dynamic({
app,
......@@ -104,77 +105,17 @@ function RouterConfig({ history, app }) {
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="/planEditor" exact component={PlanEditor} />
<Route path="/addPlanEditor" exact component={AddPlanEditor} />
<Route path="/cover" exact component={Cover} />
<Route path="/planResult" exact component={PlanResult} />
......@@ -190,22 +131,7 @@ function RouterConfig({ history, app }) {
<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="/home/performance" exact component={Performance}/>
<Route path="*" render={() => <Redirect to="/" />} />
</Switch>
</ConnectedRouter>
......
......@@ -105,7 +105,7 @@ body{
width: .22rem;
height: .2rem;
position: absolute;
top: .14rem;
top: .1rem;
right: 0;
}
......@@ -282,9 +282,6 @@ body{
border-radius: 10px;
color: white;
}
.chakantiaokuan{
min-height: 20px
}
.choose>span{
color: rgb(153, 153, 153);
......@@ -343,26 +340,6 @@ body{
}
: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;
}
/*:global(.am-list-item .am-input-control input:disabled ){
color:black !important;
}*/
......@@ -6,19 +6,27 @@ 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 { createForm } from 'rc-form';
// import Date from "../../components/Date";
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 showAlert = () => {
let alertInstance = alert('Delete', 'Are you sure???', [
{text: 'Cancel', onPress: () => console.log('cancel'), style: 'default'},
{text: 'OK', onPress: () => console.log('ok')},
]);
setTimeout(() => {
// 可以调用close方法以在外部close
alertInstance.close();
}, 500000);
}
let isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps = '';
if (isIPhone) {
......@@ -27,160 +35,229 @@ if (isIPhone) {
};
}
function closest(el, selector) {
let matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
while (el) {
if (matchesSelector.call(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
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",
this.state={
selectd:0,
isShowTips:false,
comfirm:'',
selectRecognizeeSex:true, // 投保人性别
recipientsSex:true, //收件人性别
recipientsName:'', //收件人姓名
recipients:false,
color:false,
date:'2018-02-03',
value1: moment('2017-01-25'),
selectedValue: moment('2017-01-25'),
modal1: false,
modal2: false,
modal3: false,
modal4: false,
visible: false,
initInsurance: true,
insuranceValue: 0, //医保通 的 社保标志
insuranceLabel: "医保通", //医保通
insurance1: true,
riskName: "",
riskCode: "",
termList: [],
mainInsuranceTitle: [
modal5: false,
visible:false,
message:'' ,
submit:{},
slectValue:'',
type: 'money',
initInsurance:true,
insuranceNumber:'',
insuranceValue:0,
insuranceLabel:'医保通', //医保通
insurance1:true,
riskName:'',
riskCode:'',
// termList:['华夏多倍版','华夏附加同祥保费豁免定期寿险(A款)','华夏附加豁免保险重大疾病保险'] ,//条款列表
text:'',
termList:[
{
key:0,
title:'华夏多倍版',
text:'华夏多倍版',
},
{
title: "险种",
dataIndex: "0",
width: "25%",
align: "center"
key:1,
title:'华夏附加同祥保费豁免定期寿险(A款)',
text:'华夏附加同祥保费豁免定期寿险(A款)',
},
{
title: "保额",
dataIndex: "1",
width: "25%",
align: "center"
key:2,
title:'华夏附加豁免保险重大疾病保险',
text:'华夏附加豁免保险重大疾病保险',
}
],
mainInsuranceTitle:[ {
title: '险种',
dataIndex: '0',
width: '25%',
align:'center',
},
{
title: '保额',
dataIndex: '1',
width: '25%',
align:'center',
},
{
title: "保费",
dataIndex: "2",
width: "25%",
align: "center"
title: '保费',
dataIndex: '2',
width: '25%',
align:'center',
},
{
title: "缴费期限",
dataIndex: "3",
width: "25%",
align: "center"
title: '缴费期限',
dataIndex: '3',
width: '25%',
align:'center',
}
],
mainInsurance: false,//主险
mainInsuranceTable: [{}],//主险表格列表
fjTable: [],
clauseUrlList: [], //条款列表详情
roleId: "", //角色id
mainInsurance:false,
mainInsuranceTable:[{}],
fjTable:[],
clauseUrlList:[],//条款列表详情
coverageList:[
{ id: 1, name: "花生" },
{ id: 2, name: "苹果" },
{ id: 3, name: "杨桃" }
],
selectCoverage:'花生',
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使用
protectTime:'', //后端保额传值
microPlanInfo:{}, //获取的主险信息
paymentList:[], //缴费期间
coverage:'', //缴费期间
insuranceDurationList:[], //保险期间
payTime:'', //保险期间后端传值
insuranceDuration:'' ,//保险期间
protectTime:'',
inputValue:'', //保额
inputValue1:'', //保费
copies:'', //份数
seriNo:'',
mainRiskCode:'', //主险riskCode
saveMain:false,
editorNum:0, //编辑:0,修改>0
minAmnt:'10000', //最低保额
minPrem:'10000', //最低保费
/* 附加险 */
fjInsuranceList: [], //附加险列表
defaultfjInsuranceList: [], //默认附加险列表
social: "有", //有无社保
social_mid: "有", //有无社保,作为中间值,当点击确定的时候赋值给social
addProtectTime: "100", //附加险保险期间序号
addInsuranceDuration: "趸缴", //附加险保险期间值
fjRiskCode: "", //附加险code值
fjRiskName: "", //附加险名称
addCoverage: "", //附加险缴费期间值
addPayTime: "", // 附加险缴费期间的序号
fjAmount: 5000, // 附加险保额
fjPrem: 0, // 附加险保费
totalPrem: "0", //首年保费(总)
fjRiskCodeList: [],//已添加的附加险code列表
buyFjList: [],
fjParam: [], //附加险入参集合
fjInsuranceList:[], //附加险列表
social:'有', //有无社保
newBill:'是', //是否为新单
addProtectTime:'100', //附加险保险期间序号
addInsuranceDuration:'趸缴', //附加险保险期间值
fjRiskCode:'' , //附加险code值
fjRiskName:'' , //附加险名称
addCoverage:'', //附加险缴费期间值
addPayTime:'', // 附加险缴费期间的序号
fjAmount:5000, // 附加险保额
fjPrem:0, // 附加险保费
totalPrem:'0' , //首年保费(总)
fjRiskCodeList:[],
buyFjCount:0,
buyFjList:[],
fjParam:[], //附加险入参集合
/* 被保人信息 */
insName: "",
insSex: true,
insPhone: "",
insBirthday: (new Date().getFullYear() - 30) + "-01-01",
insBirthday: "1989-1-1",
/* 投保人信息 */
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条
};
appBirthday: "1989-1-1",
calculationMethod:'0', //0:保额算保费 , 1:保费算保额 , 2:份数算保费
calculation0:true,
calculation1:false,
calculation2:false,
thumbnail: ''
}
}
getAge = (dateString)=> {
// var birthDate = new Date(dateString);
let aDate = dateString.split('-');
var birthDate = new Date(aDate[0] + '-' + (parseInt(aDate[1]) < 10 ? '0' + aDate[1] : aDate[1]) + (parseInt(aDate[2]) < 10 ? '-0' + aDate[2] : '-'+aDate[2]));
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age ;
}
showToast=(val)=>{
Toast.info(val,);
}
/* 获取当前已生成得计划书列表*/
getMyAllPlanList = (date) => {
handleDate = (val)=>{
let that = this;
this.setState({insBirthday : val});
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,val)
}
},0)
}
handleDate1 = (val)=>{
this.setState({appBirthday : val});
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
})
},
})
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,0,0,0,0,0,0,val)
}
},0)
}
/* 投保人出生日期*/
getDate = (date) => {
let date_value = moment(date).format('YYYY-MM-DD');
getDate=(date)=>{
let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.setState({
appBirthday:date_value,
})
......@@ -191,10 +268,9 @@ class AddPlanEditor extends Component {
that.getInsurance(0,date)
}
},0)
}
/* 被保人出生日期*/
}
getDate1=(date)=>{
let date_value = moment(date).format("YYYY-MM-DD");
let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.setState({
insBirthday :date_value,
})
......@@ -212,54 +288,30 @@ class AddPlanEditor extends Component {
componentWillMount(){
Toast.loading('loading...',0);
//roleId
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 : ""
}
});
const matchs = decodeURI(url).match(/riskName=(.*)&riskCode=(.*)&calculationMethod=(.*)&recipients=(.*)&riskIntroduce=(.*)&thumbnail=(.*)&recipientsName=(.*)&selectd=(.*)&roleId=(.*)&seriNo=(.*)/i);
const isShareMatches = decodeURI(url).match(/isShare=(.*)/i);
let isShare = isShareMatches ? isShareMatches[1] : '';
let riskName = matchs[1];
let riskCode = matchs[2];
let calculationMethod =Number(matchs[3]);
let recipients = matchs[4];
let riskIntroduce = matchs[5]
let thumbnail = matchs[6]
let recipientsName = matchs[7]
let selectd = matchs[8]
let roleId = matchs[9]
let seriNo = isShare !== 't' ? localStorage.getItem("seriNo") : '';
this.setState({
calculationMethod:Number(calculationMethod),
riskName:riskName,
riskCode:riskCode,
seriNo:isShare!=='t'?seriNo:'',
selectd:selectd,
seriNo,
recipientsName: localStorage.getItem("recipientsName"),
recipientsSex:localStorage.getItem("recipientsSex"),
recipients: localStorage.getItem("recipients"),
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,
......@@ -268,56 +320,67 @@ class AddPlanEditor extends Component {
that.getMessage()
that.getProspectusaAditional(0)
},)
}else{
share({
decodeUrl: window.location.href.split('#')[0],
title: riskName,
desc: '您的专属保险计划书,请您查收!',
shareUrl: window.location.href+'&isShare=t',
thumbnail: thumbnail
});
}
this.props.dispatch({
type:"home/setClickRecord",
payload: {
"operCode": riskCode,
"operFunction": 100120,
"operTitle": riskName,
"operType": 201,
"phoneNum": isShare ? params.phoneNum : ""
},
callback(data){
console.log('点击分享链接,记录一次')
}
let that = this;
this.setState({
calculationMethod:Number(calculationMethod),
calculation0:calculationMethod == 0?true:false,
calculation1:calculationMethod == 1?true:false,
calculation2:calculationMethod == 2?true:false,
riskName:riskName,
riskCode:riskCode,
seriNo:isShare!=='t'?seriNo:'',
recipientsName:isShare!=='t'?localStorage.getItem("recipientsName"):'',
recipientsSex: isShare !== 't' ? (localStorage.getItem("recipientsSex")=='false'?false:true): true,
recipients: isShare !== 't' ?(localStorage.getItem("recipients")=='false'?false:true): false,
selectd:selectd,
roleId:roleId,
thumbnail: thumbnail
})
}
componentDidMount(){
document.title= this.state.riskName
shareHide(false)
this.getRiskMaxAge();//获取险种投保人最大年龄
this.getProspectusaAditional3();//主险的捆绑险种
this.getProspectusaAditional(0);//查一次附加险
this.getMyAllPlanList();//查询目前已有多少条计划书
this.getPayMoney()
}
componentWillUnmount(){
document.title= ''
}
shouldComponentUpdate(nextProps, nextState){
// if (this.state.info !== nextState.info) {
// return true;
// }
return true;
}
/* 获取附加险 */
getProspectusaAditional=(value)=>{
let age = getBirthdayAge(this.state.insBirthday);
let that = this;
let age = this.getAge(this.state.insBirthday)
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode":this.state.riskCode,
// "mainCode":localStorage.getItem("riskCode"),
"mainCode":that.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,
})
if(age < data.data[i].maxAge+1){
fjInsuranceList.push({ value: i, label:data.data[i].riskName, riskCode:data.data[i].riskCode,fjcalculationMethod:data.data[i].calculationMethod})
}
}
let arr = [];
......@@ -327,16 +390,18 @@ class AddPlanEditor extends Component {
}
}
if(arr.length){
that.onChangeFJ(arr[0]);
that.onChange(arr[0].value, arr[0].label,arr[0].riskCode, arr[0].fjcalculationMethod);
}else{
that.setState({
insuranceValue:-1,
})
}
that.setState({
fjInsuranceList:fjInsuranceList,
modal1:value===0?false:true,
defaultfjInsuranceList:data.data,
})
},
......@@ -346,13 +411,16 @@ class AddPlanEditor extends Component {
})
}
/* 获取条款列表 */
getProspectusaAditiona2=()=>{
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
"mainCode": this.state.riskCode,
// "mainCode": localStorage.getItem("riskCode"),
"mainCode": that.state.riskCode,
"riskType": "" //0:主险 ,1:附加险 ,''所有
},
callback(data){
......@@ -376,74 +444,21 @@ class AddPlanEditor extends Component {
}
})
}
/*获取险种的投保最大年龄*/
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;
}
let riskName= localStorage.getItem("riskName")
// let riskName= localStorage.getItem("seriNo")
this.props.dispatch({
type:'planEditor/getMyPlanMessage',
type:'home/getMyPlanMessage',
payload:{
"seriNo":this.state.seriNo || '',
"seriNo":this.state.seriNo,
// "seriNo":35,
"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,
......@@ -451,22 +466,9 @@ class AddPlanEditor extends Component {
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 = [];
......@@ -475,63 +477,51 @@ class AddPlanEditor extends Component {
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)
}
fjTable.push({
key:i,
0:microPlanFJInfo[i].riskName||'-',
1:Number(microPlanFJInfo[i].amnt)||'-',
2:Number(microPlanFJInfo[i].prem)||'-',
3:microPlanFJInfo[i].payTimeName||'-',
})
fjInsuranceList.push({
value:microPlanFJInfo[i].riskCode == '111703'?0:1,
label:microPlanFJInfo[i].riskName,
riskCode:microPlanFJInfo[i].riskCode,
fjcalculationMethod:microPlanFJInfo[i].calculationMethod,
})
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,
})
"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,
})
totalPrem += Number(microPlanFJInfo[i].prem)
fjRiskCodeList.push(microPlanFJInfo[i].riskCode)
}
}
that.setState({
fjParam:fjParam,
buyFjList:fjParam,
microPlanInfo:microPlanInfo,
selectRecognizeeSex:microPlanInfo.appSex=='M'?true:false,
selectRecognizeeSex:microPlanInfo.appSex==='M'?true:false,
fjInsuranceList:fjInsuranceList,
insName:microPlanInfo.insName,
insSex: microPlanInfo.insSex=='M'?true:false,
insSex: microPlanInfo.insSex==='M'?true:false,
insPhone:microPlanInfo.insPhone,
insBirthday:microPlanInfo.insBirthday,
appBirthday:microPlanInfo.appBirthday,
//
appName: microPlanInfo.appName,
appSex: microPlanInfo.appSex=='M'?true:false,
appSex: microPlanInfo.appSex==='M'?true:false,
appPhone: microPlanInfo.appPhone,
appBirthday: microPlanInfo.appBirthday,
// mainTable:'',
totalPrem:totalPrem, //首年保费(总)
payTime:microPlanInfo.payTime,
protectTime:microPlanInfo.protectTime,
......@@ -542,15 +532,10 @@ class AddPlanEditor extends Component {
copies:microPlanInfo.copies,
mainInsuranceTable:mainTable, //主险集合
initInsurance:mainTable.length>0 ? false : true,//主险有数据就不展示
mainInsurance:true,
fjTable:fjTable, //附加险集合
mainRiskCode:microPlanInfo.riskCode, //主险riskCode
mainRiskCode:data.microPlanInfo.riskCode, //主险riskCode
fjRiskCodeList:fjRiskCodeList,
fjhuomianAmount:fjhuomianAmount,// 附加投保人豁免保费重大疾病险种 的保额
recipientsName:microPlanInfo.receiveName || '',
recipientsSex: microPlanInfo.receiveSex == '0' ? true : false,
recipients: microPlanInfo.receiveName ? true : false,
})
},
......@@ -561,111 +546,60 @@ class AddPlanEditor extends Component {
})
}
showModal = (key,index,item) => (e) => {
e.preventDefault(); // 修复 Android 上点击穿透
if(key == 'modal2'){
//修改主险
this.getPayMoney(key,'editor')
this.getPayMoney()
}else if(key == 'modal3'){
let items = getPlanInListWithCode('riskCode',item.riskCode,this.state.fjInsuranceList) || {};
this.onChangeFJ(item)
this.onChange(item.value,item.label,item.riskCode,item.fjcalculationMethod)
this.getPayMoney1(index,key)
}
e.preventDefault(); // 修复 Android 上点击穿透
this.setState({
[key]: true,
});
}
hideModalConfirm=(v)=>{
this.setState({
visible:false,
})
}
hideModalSubmit = (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();
});
}
this.setState({
[key]: false,
seriNo:this.state.seriNo,
});
// 买入 主险保险
this.payInsurance(this.state.buyFjList)
}
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,
})
buy1 = (key,fj) => (e) => {
e.preventDefault();
this.setState({
[key]: false,
});
// 买入 附加险保险
this.payFjInsurance(fj)
})
};
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);
......@@ -676,7 +610,7 @@ class AddPlanEditor extends Component {
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid,
"cusManager":localStorage.getItem("id"),
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
......@@ -698,46 +632,72 @@ class AddPlanEditor extends Component {
"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 !=''?this.state.protectTime:this.state.microPlanInfo.protectTime //保险期间 ----
"protectTime":this.state.protectTime,
"riskFlag": this.state.mainRiskFlag || '',
},
"additionalMicroPlan":fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
that.setState({
if(that.state.saveMain===true){
that.setState({
mainInsurance:false,
initInsurance:false,
seriNo:data.data.seriNo,
saveMain:false
})
}else{
that.setState({
mainInsurance:false,
initInsurance:false,
seriNo:data.data.seriNo,
})
}
that.getMessage();
},
error(data){
that.setState({
mainInsurance:false,
initInsurance:false,
})
if(data.status !=false){
that.getMessage();
}else{
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 riskCode = localStorage.getItem("riskCode")
let seriNo = localStorage.getItem("seriNo")
let that = this;
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid,
"cusManager":localStorage.getItem("id"),
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
......@@ -758,17 +718,20 @@ class AddPlanEditor extends Component {
"prem":this.state.microPlanInfo.prem, // 保费 -----
"copies":this.state.copies, //份数
"payTime":this.state.payTime, //缴费期间
"protectTime":this.state.protectTime, //保险期间 ----
"riskFlag":this.state.mainRiskFlag || '', //险种标志 (新加) ----
"protectTime":this.state.protectTime //保险期间 ----
},
"additionalMicroPlan": fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
let buyFjList = that.state.buyFjList;
let fjInsuranceList = that.state.fjInsuranceList;
that.setState({
mainInsurance:false,
initInsurance:false,
/* 添加附加险成功*/
})
that.getMessage();
......@@ -785,16 +748,23 @@ class AddPlanEditor extends Component {
}
})
}
//选择投保人和被保人日期时,调用主险算费接口
getInsurance=(insSex,insBirthday,appName,insName,appPhone,insPhone,appSex,appBirthday,selectd)=>{
Toast.loading('loading...', 88);
// let riskCode = localStorage.getItem("riskCode")
// let seriNo = localStorage.getItem("seriNo")
let riskCode = this.state.riskCode;
let that = this;
this.setState({
// mainInsurance:false,
})
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id") || this.state.userid, //客户经理id
"cusManager":localStorage.getItem("id"), //客户经理id
"seriNo":this.state.seriNo, //流水号
"appInsFlag":this.state.selectd == 1 ?1:0, //投被保人是否相同 0:相同,1:不同
"applicant":{
......@@ -815,11 +785,10 @@ class AddPlanEditor extends Component {
"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 || '',
"protectTime":this.state.protectTime||this.state.microPlanInfo.protectTime //保险期间 ----
},
"additionalMicroPlan": this.state.fjParam, //fjTable
"isSecurity":this.state.social=='有'?0:1 //是否有社保0:有,1:无
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
......@@ -828,17 +797,13 @@ class AddPlanEditor extends Component {
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);
......@@ -856,6 +821,8 @@ class AddPlanEditor extends Component {
}
},10)
if(value){
if(this.state.mainInsurance){
if(this.state.selectd == 1){
......@@ -876,6 +843,7 @@ class AddPlanEditor extends Component {
if(this.state.selectd ==1){
this.getInsurance(0,0,0,0,phone)
}else{
this.getInsurance(0,0,0,0,0,phone)
}
}
......@@ -883,6 +851,31 @@ class AddPlanEditor extends Component {
}
handleChange = (e)=>{
this.setState({
selectValue:e.target.value
})
}
setInput = (e)=>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
inputValue1 :value
})
}
setInput1 = (e)=>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
inputValue :value
})
}
fjAmount = (e) =>{
let value = e.target.value
value = value.substring(0,10)
......@@ -898,6 +891,14 @@ class AddPlanEditor extends Component {
})
}
editer =(key) =>(e)=>{
e.preventDefault();
// this.setState({
// [key]:true,
// })
}
delete =(seriNo,deleteType,riskCode)=>{
let that = this;
this.props.dispatch({
......@@ -909,29 +910,35 @@ class AddPlanEditor extends Component {
},
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,
})
}
if(buyFjList[i].riskCode == riskCode){
buyFjList.splice(i,1)
let fjInsuranceList = that.state.fjInsuranceList;
fjInsuranceList.splice(i,1)
that.setState({
fjInsuranceList
})
}else{
that.setState({
insuranceValue:buyFjList[i].value,
insuranceLabel:buyFjList[i].label,
})
}
}
that.setState({
buyFjList:buyFjList,
fjInsuranceList:fjInsuranceList
buyFjList:buyFjList
})
}
that.setState({
totalPrem:0,
saveMain:false,
editorNum:that.state.editorNum+1,
})
if(deleteType ==0){
......@@ -941,10 +948,12 @@ class AddPlanEditor extends Component {
seriNo:'',
buyFjList:[],
fjInsuranceList:[],
// insuranceValue:0,
// insuranceLabel:that.state.fjInsuranceList[0].riskName,
});
let storage = window.localStorage;
sessionStorage.setItem("seriNo",'');
storage.setItem("seriNo",'')
}else{
......@@ -959,20 +968,25 @@ class AddPlanEditor extends Component {
})
}
onChangeFJ = (item) => {
addInsurance =key => (e)=>{
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'
});
[key]: true,
});
}
onChange = (value,label,riskCode,calculationMethod) => {
this.setState({
insuranceValue:value,
insuranceLabel:label,
fjRiskCode:riskCode,
fjRiskName:label,
fjcalculationMethod:calculationMethod
});
};
}
closeInsurance = ()=>{
this.setState({
......@@ -983,6 +997,7 @@ class AddPlanEditor extends Component {
}
handleOk=()=>{
let that = this;
if(this.state.comfirm ==0){
......@@ -992,10 +1007,11 @@ class AddPlanEditor extends Component {
payload: {
"number":this.state.appPhone,
"currentState":0,
"cusManager":localStorage.getItem('id') || this.state.userid,
"cusManager":localStorage.getItem('id'),
"name":this.state.appName||'',
"sex": this.state.appSex == true ? '0' : '1',
"age":this.state.appBirthday||"",
// "phone":this.state.appPhone||'',
},
callback(data){
that.setState({
......@@ -1014,55 +1030,30 @@ class AddPlanEditor extends Component {
}
goCover = ()=>{
// let seriNo = localStorage.getItem("seriNo")
// let riskName = localStorage.getItem("riskName")
// let riskCode = localStorage.getItem("riskCode")
// let thumbnail = localStorage.getItem("thumbnail")
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)
}
})
window.location.href = window.location.href.split('#')[0]+'#/planResult?seriNo='+seriNo+'&riskName='+riskName +'&riskCode='+riskCode+'&thumbnail='+thumbnail
}
/*附加险 查询 缴费期间,*/
/*附加险 缴费期间,*/
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',
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":fjRiskCode,
"riskCode":this.state.fjRiskCodeList[index] ?this.state.fjRiskCodeList[index]: this.state.fjRiskCode,
// "riskCode":this.state.fjRiskCodeList[index],
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1,
"mainCode": this.state.riskCode
"pageNo":1
},
callback(data){
if (data.length == 0) {
that.setState({
paymentList:[],
insuranceDurationList:[],
[key]:true,
fjRiskFlag:''
})
return
}
let insuranceDurationList = [],
paymentList=[];
let data1 = []
......@@ -1079,40 +1070,22 @@ class AddPlanEditor extends Component {
}
}
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, //保险期间
})
}
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({
addCoverage:that.state.addCoverage?that.state.addCoverage:paymentList[paymentList.length-1].label, //缴费期间
addPayTime :that.state.addPayTime?that.state.addPayTime:paymentList[paymentList.length-1].payTime,
minPrem:paymentList[paymentList.length-1].minPrem,
})
}
that.setState({
paymentList:paymentList,
insuranceDurationList:result,
[key]:true,
fjRiskFlag:data[0].riskFlag || '',
})
},
......@@ -1123,28 +1096,21 @@ class AddPlanEditor extends Component {
})
}
/* 获取保额,保费列表*/
getPayMoney=(key,param)=>{
getPayMoney=()=>{
let that = this;
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1,
"mainCode": this.state.riskCode
"pageNo":1
},
callback(data){
Toast.hide();
if(data.length==0){
that.setState({
paymentList:[],
insuranceDurationList:[],
loadingFlag:false,
})
return;
}
let insuranceDurationList = [],
paymentList=[];
let data1 = []
......@@ -1163,8 +1129,6 @@ class AddPlanEditor extends Component {
that.setState({
paymentList:paymentList,
insuranceDurationList:result,
loadingFlag:false,
mainRiskFlag:data.length>0 ? data[0].riskFlag : '',//主险的riskFlag
})
......@@ -1174,58 +1138,11 @@ class AddPlanEditor extends Component {
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,
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,
minPrem:paymentList[paymentList.length-1].minPrem,
})
}
},
......@@ -1235,39 +1152,21 @@ class AddPlanEditor extends Component {
})
}
//选择缴费期间时 从组件中带回来的值
handleSelectChange=(item)=>{
console.log('-----handleSelectChange--------->>>>>',item)
change= ( value )=>{
this.setState({
selectChange1:item,
minAmnt1: item.minAmnt, //最低保额 placeholder使用
minPrem1: item.minPrem, //最低保费placeholder使用
});
selectCoverage:value,
})
}
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 matchs = decodeURI(url).match(/isShare=(.*)/i);
let {fjRiskCodeList,insSex,appSex,paymentList,recipients,mainInsuranceTable} = 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>
}
let isShare = matchs ? matchs[1] : '';
return (
<div className={styles.box}>
{/*被保人信息*/}
......@@ -1374,6 +1273,16 @@ class AddPlanEditor extends Component {
this.setState({
appName:e.target.value,
})
// if(this.state.mainInsurance){
// if(this.state.selectd == 1){
// // 投保人姓名
// this.getInsurance(0,0,e.target.value)
// }else {
// //被保人姓名
// this.getInsurance(0,0,0,e.target.value)
// }
// }
}} />
</div>
......@@ -1391,6 +1300,7 @@ class AddPlanEditor extends Component {
this.setState({
appPhone:value,
})
}
}/>
</div>
......@@ -1402,7 +1312,7 @@ class AddPlanEditor extends Component {
</div>
<div className={styles.right}>
<span className={appSex==false?styles.boy:styles.selectBoy} onClick={()=>{
<span className={appSex===false?styles.boy:styles.selectBoy} onClick={()=>{
this.setState({appSex:true})
if(this.state.mainInsurance){
......@@ -1411,7 +1321,7 @@ class AddPlanEditor extends Component {
}}>
男
</span>
<span className={appSex==false?styles.selectGirl:styles.girl} onClick={()=>{
<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')
......@@ -1443,29 +1353,17 @@ class AddPlanEditor extends Component {
</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.props.location.query.riskName}*/}
{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')
}
<img src={require('../../assets/image/editor.png')} alt="" className={styles.editor} onClick={ this.showModal('modal2')
} />
</div>
......@@ -1476,7 +1374,7 @@ class AddPlanEditor extends Component {
{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>
{this.state.riskName} <span style={{marginLeft:'.2rem'}}>首年保费 {this.state.mainInsuranceTable[0][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('modal2')
......@@ -1498,11 +1396,11 @@ class AddPlanEditor extends Component {
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>
{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])
this.showModal('modal3',index,this.state.fjInsuranceList[index])
}
style={{position:'initial'}}/>
<img src={require('../../assets/image/delete.png')} alt="" className={styles.editor} onClick={
......@@ -1525,19 +1423,13 @@ class AddPlanEditor extends Component {
}
<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>
<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>
......@@ -1565,6 +1457,8 @@ class AddPlanEditor extends Component {
</div>
</div>
</div>
<div className={styles.detail}>
......@@ -1611,41 +1505,70 @@ class AddPlanEditor extends Component {
</div>
</div>
{/*<Date onRef = {(ref)=>{*/}
{/*this.child = ref;*/}
{/*}} handleDate = {this.handleDate} >*/}
{/*</Date>*/}
{/*<Date onRef = {(ref)=>{*/}
{/*this.child1 = ref;*/}
{/*}} handleDate = {this.handleDate1} >*/}
{/*</Date>*/}
{/*底部首年保费*/}
{/*<Table></Table>*/}
<div className={styles.bottom}>
<div className={styles.left}>
<p>首年保费</p>
<p className={styles.num}>{this.state.totalPrem}<span>.00元</span></p>
<p onClick={() =>
{
}
}>首年保费</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)
storage.setItem("recipientsName",this.state.recipientsName)
storage.setItem("recipientsSex",this.state.recipientsSex)
storage.setItem("recipients",this.state.recipients)
storage.setItem("seriNo",this.state.seriNo)
storage.setItem("selectd",this.state.selectd)
// // 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 that = this;
if (isShare != 't') {
if (isShare !== 't') {
if(this.state.roleId ==3){
this.goCover()
}
else if(this.state.appPhone){
this.props.dispatch({
type: 'addUser/followCustomer',
type: 'addUser/isFollow',
payload: {
"number":this.state.appPhone,
"roleId":this.state.roleId,
"id":this.state.userid
},
callback(data){
if(data != ""){
if(data.length){
// 有数据生成计划,
that.goCover();
}else{
......@@ -1655,14 +1578,18 @@ class AddPlanEditor extends Component {
isShowTips:true,
})
}
}
})
}else{
this.goCover();
}
} else {
this.goCover();
}
}else{
this.showToast('请先选择险种信息!')
}
......@@ -1678,7 +1605,17 @@ class AddPlanEditor extends Component {
visible={this.state.modal2}
onClose={this.onClose('modal2')}
animationType="slide-up"
className={styles.modal}
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
backgroundColor:'white',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<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'}}/>
......@@ -1697,6 +1634,7 @@ class AddPlanEditor extends Component {
{/* 有多个值 */}
{this.state.insuranceDurationList.length != 1 && <List.Item>保险期间
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<Picker
data={this.state.insuranceDurationList}
cols={1}
......@@ -1721,45 +1659,64 @@ class AddPlanEditor extends Component {
</List.Item>
}
{/* 一个值*/}
{this.state.paymentList && paymentList.length ==1 && <List.Item>缴费期间
{/* 一个值*/}
{this.state.paymentList && this.state.coverage.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>
{this.state.coverage}
</div>
</List.Item>}
{/*多个值*/}
{this.state.paymentList && this.state.coverage.length>1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<Picker
data={this.state.paymentList}
cols={1}
onChange={
v => {
this.setState({
coverage:this.state.paymentList[v[0]].label,
payTime:this.state.paymentList[v[0]].payTime,
minAmnt:this.state.paymentList[v[0]].minAmnt,
minPrem:this.state.paymentList[v[0]].minPrem,
})
}
}
>
<div className={styles.choose} ><span>{this.state.coverage!=='' ? this.state.coverage : '3年缴'}</span></div>
</Picker>
</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}
/>
<input style={{width:'1.5rem',border:'1px solid #ddd',paddingLeft:'.1rem',height:'.3rem',fontSize:'.15rem'}}
placeholder={'最低保额'+this.state.minAmnt}
id="pp" type="number" pattern="[0-9]*" name="password" onBlur={::this.blur} value={this.state.inputValue} onChange={this.setInput1}/>
</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 == 1 && <List.Item >保费
<div style={{float:'right',}}>
<input className={styles.input} style={{width:'1.5rem',border:'1px solid #f0f0f1',paddingLeft:'.1rem',height:'.3rem',fontSize:'.15rem',borderRadius:'4px'}}
placeholder={'最低保费'+ this.state.minPrem}
value={ this.state.inputValue1}
id="pp" type="number" pattern="[0-9]*" name="password" onBlur={::this.blur} onChange={this.setInput}/>
{/* <InputItem
className={styles.e_phoneNum}
type='number'
placeholder="最低为10000元"
// error={this.state.hasError}
// onErrorClick={this.onErrorClick}
// onChange={this.onChange}
// value={this.state.value}
/>*/}
</div>
</List.Item>
}
{
......@@ -1769,23 +1726,10 @@ class AddPlanEditor extends Component {
</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>
......@@ -1797,9 +1741,26 @@ class AddPlanEditor extends Component {
visible={this.state.modal1}
onClose={this.onClose('modal1')}
animationType="slide-up"
className={styles.modal}
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>添加主/附加险 <span style={{float:'right',}}>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>添加主/附加险 <span style={{float:'right',}} onClick={
()=>{
// this.setState({
// modal1:false,
// modal3:true,
// })
// this.getPayMoney1()
}
}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}} onClick={()=>{
this.setState({
modal1:false,
......@@ -1809,50 +1770,21 @@ class AddPlanEditor extends Component {
{/*确定*/}
</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>
)
})
}
return(
<RadioItem key={i.value}
checked={this.state.insuranceValue===i.value}
disabled={fjRiskCodeList.indexOf(i.riskCode)>-1?true:false}
onChange={() => this.onChange(i.value,i.label,i.riskCode,i.fjcalculationMethod)}>
{i.label}
</RadioItem>
)
})}
</List>
......@@ -1860,15 +1792,6 @@ class AddPlanEditor extends Component {
<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,
......@@ -1885,7 +1808,16 @@ class AddPlanEditor extends Component {
visible={this.state.modal3}
onClose={this.onClose('modal3')}
animationType="slide-up"
className={styles.modal}
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>{this.state.insuranceLabel} <span style={{float:'right',}} onClick={
()=>{
......@@ -1912,16 +1844,18 @@ class AddPlanEditor extends Component {
</List.Item> }
{this.state.insuranceDurationList.length>1 &&<List.Item>保险期间
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<Picker
data={this.state.insuranceDurationList}
cols={1}
disabled={this.state.insuranceDurationList.length==1?true:false}
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){
if(i === s){
this.setState({
addProtectTime:insuranceDurationList[i].protectTime,
addInsuranceDuration:insuranceDurationList[i].label,
......@@ -1940,12 +1874,14 @@ class AddPlanEditor extends Component {
</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 style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}> {this.state.addCoverage}</div>
</div>
</List.Item>
......@@ -1955,6 +1891,7 @@ class AddPlanEditor extends Component {
{
this.state.paymentList && paymentList.length > 1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<Picker
data={this.state.paymentList}
cols={1}
......@@ -1988,20 +1925,18 @@ class AddPlanEditor extends Component {
{
this.state.fjcalculationMethod == 0 && this.state.fjRiskCode === '121705' && <List.Item >保额
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<Picker
data={fjRiskCodeList.indexOf('111703')>-1 ? this.state.dataList2014_1 : this.state.dataList2014}
data={[{value:'0',label:5000},{value:'1',label:10000},{value:'2',label:15000},{value:'3',label:20000}]}
cols={1}
value={[this.state.fjAmountValue]}
onChange={
v => {
let paymentList = fjRiskCodeList.indexOf('111703')>-1 ? this.state.dataList2014_1 : this.state.dataList2014;
let paymentList = [{value:'0',label:5000},{value:'1',label:10000},{value:'2',label:15000},{value:'3',label:20000}];
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
fjAmount:paymentList[i].label,
fjAmountValue:paymentList[i].value
fjAmount:paymentList[i].label
})
}
......@@ -2021,10 +1956,8 @@ class AddPlanEditor extends Component {
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}
placeholder={'最低保额'+this.state.minAmnt}
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>
......@@ -2035,7 +1968,7 @@ class AddPlanEditor extends Component {
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}
placeholder={'最低保费'+this.state.minPrem}
onBlur={::this.blur}
id="pp" type="number" pattern="[0-9]*" name="password" value={this.state.fjPrem} onChange={this.fjPrem}/>
</div>
......@@ -2053,8 +1986,9 @@ class AddPlanEditor extends Component {
{
this.state.fjRiskCode == '111703' && <List.Item>有无社保
this.state.insuranceValue == 0 && <List.Item>有无社保
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}></Select>*/}
<Picker
data={[{value:'0',label:'有'},{value:'1',label:'无'}]}
cols={1}
......@@ -2064,14 +1998,14 @@ class AddPlanEditor extends Component {
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
social_mid:paymentList[i].label,
social:paymentList[i].label,
})
}
}
}
}
>
<div className={styles.choose} ><span>{this.state.social_mid !=='' ? this.state.social_mid : '请选择'}</span></div>
<div className={styles.choose} ><span>{this.state.social !=='' ? this.state.social : '请选择'}</span></div>
</Picker>
......@@ -2082,12 +2016,6 @@ class AddPlanEditor extends Component {
<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,
......@@ -2096,15 +2024,13 @@ class AddPlanEditor extends Component {
"copies": this.state.fjcalculationMethod == 2 ? 1 : "",
"payTime": this.state.addPayTime,
"protectTime": this.state.addProtectTime,
"riskFlag": this.state.fjRiskFlag,
})
let that = this;
// this.buy1('modal3', buyFjList)
this.payFjInsurance(buyFjList)
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>
......@@ -2116,7 +2042,16 @@ class AddPlanEditor extends Component {
visible={this.state.modal4}
onClose={this.onClose('modal4')}
animationType="slide-up"
className={styles.modal}
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<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')}/>
......@@ -2135,13 +2070,14 @@ class AddPlanEditor extends Component {
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={()=>{
<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,
// riskCode:item.configCode,
})
/* 条款列表详情接口 */
......@@ -2165,20 +2101,10 @@ class AddPlanEditor extends Component {
{
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>
<span style={{color:'#888',fontSize:'.14rem' }}>条款预览</span>
<span className={styles.deta} onClick={()=>{
window.location.href = item.clauseUrl
}}> 查看详情</span>
{this.state.clauseUrlList.map((item,index)=>{
return(
<div key={index}>
......@@ -2197,27 +2123,58 @@ class AddPlanEditor extends Component {
</List>
</Modal>
<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',
maxHeight:'6rem',
}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>hauxia<span style={{float:'right',}} onClick={this.closeInsurance}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}} onClick={this.onClose('modal5')}/>
</span></div>} className="popup-list">
</List>
<List>
<List.Item style={{left:'.1rem'}} >
{this.state.text}
</List.Item>
</List>
</Modal>
</WingBlank>
<LocalizedModal visible={this.state.visible} hideModal={this.hideModalConfirm} onClick={this.state.submit} message={this.state.message}
/>
{/*<DatePicker />*/}
{/* <Date onRef = {(ref)=>{
this.child = ref;
}} handleDate = {this.handleDate} >
</Date>*/}
<DatePicker onRef = {(ref)=>{
this.child = ref;
}}
birthday = {moment(this.state.appBirthday).format("YYYY-MM-DD")}
getDate = {(date)=>{
this.getDate(date)
}}
//minYear={filterDate.FromDateToTarget(60)}
>
this.child = ref;
}} getDate = {(date)=>{
this.getDate(date)
}}
>
</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)}
>
this.child1 = ref;
}} getDate = {(date)=>{
this.getDate1(date)
}} >
</DatePicker>
<ConfirmPop show={this.state.isShowTips} title="提示" handleOK={this.handleOk}
......@@ -2240,6 +2197,6 @@ class AddPlanEditor extends Component {
AddPlanEditor.propsTypes = {}
export default connect(({planEditor,home})=>({planEditor,home}))(AddPlanEditor)
export default connect(({home})=>({home}))(AddPlanEditor)
......@@ -8,7 +8,7 @@ body{
position: relative;
width: 100%;
height: 100%;
/* padding-bottom: 1rem; */
padding-bottom: 1rem;
overflow-y: scroll;
}
/* 列表 */
......@@ -133,6 +133,7 @@ input:disabled{
.label{
padding: 0 0 0 0.12rem;
/* position: absolute; */
}
.label>img{
......@@ -195,7 +196,6 @@ input:disabled{
position: fixed;
bottom: 0;
padding-left: .11rem;
z-index: 5;
}
.bottom>.right{
width: 100%;
......@@ -230,10 +230,3 @@ input:disabled{
.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;
}
......@@ -7,20 +7,134 @@ 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 = {
isShowTips:false,
baseList: [
{
start: true,
name: '姓名',
placeholder: '请输入客户姓名',
select: false,
value:'',
},
{
start: false,
name: '性别',
placeholder: '请选择性别',
select: '性别',
value:'',
},
{
start: false,
name: '年龄',
placeholder: '请选择年龄',
select: '年龄',
value:'',
},
{
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:'',
},
{
start: false,
name: '年收入(万元)',
placeholder: '请选择年收入',
select: '年收入',
value:'',
},
],
addressList: [
{
start: false,
name: '所在省市',
placeholder: '请选择所在省市',
select: '所在省市',
value:'',
},
{
start: false,
name: '详细地址',
placeholder: '请输入详细地址',
select: false,
value:'',
},
],
insuranceList: [
{
start: false,
name: '希望购买产品',
placeholder: '请选择产品',
select: '产品',
value:'',
},
{
start: false,
name: '缴费期间',
placeholder: '请选择缴费期间',
value:'',
},
{
start: false,
name: '缴费频次',
placeholder: '请选择缴费频次',
select: '缴费频次',
value:'55',
},
{
start: false,
name: '保额',
placeholder: '请选择保额',
select: false,
value:'',
},
],
color:false,
message:'',//提交至督训,确定
labelList: ['医疗', '健康', '少儿', '意外', '温和', '严肃', '孝顺', '富有', '小康', '拮据'],
addLabel:[],
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:'',
provinceCitys:[],
disabled:false,
visible:false,
......@@ -49,7 +163,6 @@ class AddUser extends Component {
regionData: [],
reverseData:[],
regionVal: '',
asyncValue:[],
product:[],
productSelect:'',
productCode:'',
......@@ -58,7 +171,6 @@ class AddUser extends Component {
frequency:"",
insuredAmount:"",
birthday:'',
loadingFlag:true,
}
}
blur =()=>{
......@@ -83,16 +195,15 @@ class AddUser extends Component {
this.setState({
visible:false,
})
// const isShare = localStorage.getItem('clientNeededInfoIsShare');
const isShare = urlGetParams(window.location.href).isShare === '1' ? false : true;
const isShare = localStorage.getItem('clientNeededInfoIsShare');
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;
const matchs = decodeURI(address).match(/id=(.*)/i);
if (matchs) {
cusManager = matchs;
cusManager = matchs[1];
}
/* 确定 */
this.props.dispatch({
......@@ -116,7 +227,7 @@ class AddUser extends Component {
"frequency":this.state.frequency||'',
"insuredAmount":this.state.insuredAmount||"",
'label': aLabel, //添加的label标签。
"currentState":'0',//未提交状态
"currentState":'0',
"cusManager": cusManager==='' ? localStorage.getItem('id'):cusManager, //当前登录的经理id
},
callback() {
......@@ -138,7 +249,11 @@ class AddUser extends Component {
})
let that = this;
if (v === 'ok') {
// let aLabel = '';
let aLabel = this.state.addLabel.toString();
// this.state.addLabel.forEach(element => {
// aLabel+=element.text
// });
/*提交至督训 */
this.props.dispatch({
type:'addUser/addUser',
......@@ -160,7 +275,7 @@ class AddUser extends Component {
"frequency":this.state.frequency||'',
"insuredAmount":this.state.insuredAmount||"",
'label': aLabel, //添加的label标签。
"currentState":'3',//已提交状态
"currentState":'1',
"cusManager":localStorage.getItem('id'),
},
callback(){
......@@ -182,29 +297,6 @@ class AddUser extends Component {
}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({
......@@ -227,31 +319,34 @@ class AddUser extends Component {
callback(data){
if(params.configType ==='jobType' ){
let ary = []
for (let i = 0; i < data.length; i++) {
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configName,label:data[i].configName})
that.setState({
occupational:ary,
// modal9:true,
})
}
}else if(params.configType ==='yearMoney'){
let ary = []
for (let i = 0; i < data.length; i++) {
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configName,label:data[i].configName})
that.setState({
annualIncome:ary,
// modal10:true,
})
}
}else if(params.configType ==='provinces'){
let ary = []
for (let i = 0; i < data.length; i++) {
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 (let i = 0; i < data.length; i++) {
for (var i = 0; i < data.length; i++) {
ary.push({value:data[i].configCode,label:data[i].configName})
that.setState({
provinceCitys:ary,
......@@ -272,63 +367,55 @@ class AddUser extends Component {
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
const matchs1 = decodeURI(address).match(/id=(.*)/i)
// console.log(matchs1);
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'
});
shareHide(false)
share({
decodeUrl: window.location.href.split('#')[0],
title: '我是'+ localStorage.getItem('name')+',您的保障待领取',
desc: '您与保障之间的距离只差一步',
shareUrl: window.location.href,
thumbnail: 'https://zmt.ihxlife.com/customer1.png'
});
}else {
shareHide()
const storeItem = JSON.parse(localStorage.getItem('clientNeededInfo'));
if (storeItem) {
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||'' ,
// "productCode": storeItem.product? storeItem.product=='511403'?'福临门(智慧版)':'长春藤(多倍版)':'' ,
"productCode": storeItem.product?storeItem.product=='长春藤(多倍版)'?'511501':'511403':'' ,
"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({
"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"),
disabled:true,
})
if(storeItem.disabled1){
_this.setState({
disabled:true,
})
}
}
}
}
let ageAry = []
for (var i = 0; i < 101; i++) {
ageAry.push({value:i,label:i})
......@@ -338,7 +425,7 @@ class AddUser extends Component {
matchs1:matchs1,
})
// 省市级联初始化
let clientInfo = JSON.parse(localStorage.getItem("clientNeededInfo"));
let clientInfo = null;
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
......@@ -346,7 +433,6 @@ class AddUser extends Component {
oyhers: 0
},
callback: (res) => {
Toast.hide();
if (res.status) {
let { data } = res, arr = [];
for (let i = 0, l = data.length; i < l; i++) {
......@@ -357,17 +443,13 @@ class AddUser extends Component {
})
}
this.setState({
regionData: arr,
loadingFlag:false
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;//匹配到了有数据
console.log("6666666666666666666----->>>>",element)
if (element.label===namearr[0]) {
_this.fillSecData(element.value, i, (list) => {
if (namearr[1]) {
list && list.forEach(el => {
......@@ -387,9 +469,6 @@ class AddUser extends Component {
})
}
});
if(!havedata){//没有匹配到
_this.fillSecData(data[0].configCode, 0)
}
}
} else {
_this.fillSecData(data[0].configCode, 0)
......@@ -400,8 +479,7 @@ class AddUser extends Component {
});
}
getDate=(date)=>{
// let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
let date_value = moment(date).format("YYYY-MM-DD");
let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.setState({
birthday :date_value,
})
......@@ -460,17 +538,9 @@ class AddUser extends Component {
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]])
cb && cb(data);
_this.setState({
reverseData: list,
// regionVal:_this.state.regionVal,
asyncValue: asyncValue
},function(){
cb && cb(data);
reverseData: list
})
})
}
......@@ -479,44 +549,34 @@ class AddUser extends Component {
}
}
render() {
// const isShare = localStorage.getItem('clientNeededInfoIsShare');
const isShare = urlGetParams(window.location.href).isShare === '1' ? false : true;
const isShare = localStorage.getItem('clientNeededInfoIsShare');
const storeItem = JSON.parse(localStorage.getItem('clientNeededInfo'));
const frequency = [
//趸交、月交、季交、半年交、年交
{value:'趸交',label:'趸交'},
{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'}}>
<div className={styles.box}>
<div style={{position:'relative'}}>
<DatePicker onRef = {(ref)=>{
this.child = ref;
}} getDate = {(date)=>{
this.getDate(date)
}}
birthday = {this.state.birthday ? moment(this.state.birthday).format("YYYY-MM-DD"):null}
>
this.child = ref;
}} getDate = {(date)=>{
this.getDate(date)
}} >
</DatePicker>
<div className={css.ac_wrap}>
<div id="scrollSection">
<div className={styles.base}>
<div className={css.ac_wrap}>
<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}
// disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v => {
......@@ -538,7 +598,6 @@ class AddUser extends Component {
]}
cols={1}
value={[0]}
disabled={this.state.disabled}
onChange={
s => {
this.setState({sex:s[0]})
......@@ -547,7 +606,7 @@ class AddUser extends Component {
>
<div className={css.choose}><span className={styles.black}>{this.state.sex == 0 ? '男' : '女'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<div className={css.icon_arrow}></div>
</li>
<li >
<span className={css.label}>出生日期</span>
......@@ -561,24 +620,18 @@ class AddUser extends Component {
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>}
<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}
// disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v => {
if(!this.state.disabled){
this.setState({
phone: v.replace(/\s*/g, ''),
})
}
this.setState({
phone: v.replace(/\s*/g, ''),
})
}}
placeholder = "请输入手机号码"
......@@ -594,14 +647,14 @@ class AddUser extends Component {
]}
cols={1}
value={[this.state.maritalStatus]}
disabled={this.state.disabled}
// 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>}
<div className={css.icon_arrow}></div>
</li>
<li>
<span className={css.label}>学历</span>
......@@ -615,7 +668,7 @@ class AddUser extends Component {
{ label: '博士', value: '博士' },
{ label: '其他', value: '其他' }
]}
disabled={this.state.disabled}
// disabled={this.state.disabled}
cols={1}
value={['本科']}
onChange={
......@@ -624,7 +677,7 @@ class AddUser extends Component {
>
<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>}
<div className={css.icon_arrow}></div>
</li>
</ul>
<ul className={css.aclist_wrap}>
......@@ -633,7 +686,7 @@ class AddUser extends Component {
<Picker
data={this.state.occupational}
cols={1}
disabled={this.state.disabled}
// disabled={this.state.disabled}
onChange={
s =>{
this.setState({occupationalSelect:s[0]})
......@@ -642,14 +695,14 @@ class AddUser extends Component {
>
<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>}
<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}
// disabled={this.state.disabled}
onChange={
s =>{
this.setState({annualIncomeSelect:s[0]})
......@@ -658,7 +711,7 @@ class AddUser extends Component {
>
<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>}
<div className={css.icon_arrow}></div>
</li>
</ul>
<ul className={css.aclist_wrap}>
......@@ -667,18 +720,17 @@ class AddUser extends Component {
<Picker
data={this.state.regionData}
cols={2}
disabled={this.state.disabled}
// 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 asyncValue = [...v];
const { reverseData } = this.state;
let label = '';
label = asyncValue.length > 1 ? reverseData[asyncValue[0]].label + ',' + reverseData[asyncValue[0]].children[asyncValue[1]] : reverseData[asyncValue[0]].label;
label = v.length > 1 ? reverseData[v[0]].label + ',' + reverseData[v[0]].children[v[1]] : reverseData[v[0]].label;
this.setState({
regionVal: label,
asyncValue:asyncValue
asyncValue
})
}}
>
......@@ -686,14 +738,14 @@ class AddUser extends Component {
<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>}
<div className={css.icon_arrow}></div>
</li>
<li>
<InputItem
className={css.e_phoneNum}
type="text"
value={this.state.address}
disabled={this.state.disabled}
// disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v=>this.setState({address:v})}
placeholder = {this.state.disabled?'':"请输入详细地址"}
......@@ -701,46 +753,56 @@ class AddUser extends Component {
</li>
</ul>
<ul className={css.aclist_wrap}>
<li>
<li onClick={()=>{
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,
})
}
},
})
}}>
<span className={css.label}>希望购买的产品</span>
<Picker
data={this.state.product}
cols={1}
disabled={this.state.disabled}
// 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:"",
productSelect:s[0] == '511501'?'长春藤(多倍版)':'福临门(智慧版)',
productCode:s[0],
})
}
}
>
<div className={css.choose}>
<span className={this.state.productSelect?styles.black:''}>{this.state.disabled?this.state.productSelect : this.state.productSelect == '' ? "请选择产品": this.state.productSelect}</span>
<span className={this.state.productSelect?styles.black:''}>{this.state.disabled?this.state.productSelect==''?this.state.productSelect:this.state.productSelect=='长春藤(多倍版)'?'长春藤(多倍版)' : '福临门(智慧版)':this.state.productSelect == '' ? "请选择产品": this.state.productSelect=='长春藤(多倍版)'?'长春藤(多倍版)' : '福临门(智慧版)'}</span>
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<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',
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.productCode,
// "maxAge":this.state.,
"birthday": this.state.productCode=='511404' ? nowDate : '1981-02-23',
"pageNo":1,
"mainCode": this.state.productCode
"birthday":'1981-02-23',
"pageNo":1
},
callback(data){
let paymentList = [];
......@@ -748,11 +810,13 @@ class AddUser extends Component {
paymentList.push({value:data[i].payTime,label:data[i].payTimeName,})
}
that.setState({
// modal13:true,
paymentList:paymentList,
})
}
})
}else{
// this.setState({disabled:true})
Toast.info('请选择产品!',)
return false;
}
......@@ -761,42 +825,39 @@ class AddUser extends Component {
<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}
disabled={this.state.productCode==''?true:false}
onChange={
s =>{
this.setState({payment:s[0]===0?'趸交':s[0]+'年交'})
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>}
<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]})
}
<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>
}
}
>
<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>
<div className={css.icon_arrow}></div>
</li>
<li>
<InputItem
className={css.e_phoneNum}
type="phone"
value={this.state.insuredAmount}
disabled={this.state.disabled}
// disabled={this.state.disabled}
onBlur={::this.blur}
onChange={v => {
this.setState({
......@@ -807,176 +868,166 @@ class AddUser extends Component {
>保额</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>
}
</div>
</div>
{
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.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>
)
})
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;
}
</ul>
<img src={require('../../assets/image/confirmAdd.png')} alt="" onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})
}
} />
</div>
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>
)
})
}
</div>
</ul>
<img src={require('../../assets/image/confirmAdd.png')} alt="" onClick={()=>{
this.setState({
showLabelList:!this.state.showLabelList,
})
}
} />
</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: '取消',
}
{!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;
}
})
}}>提交</span>
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;
}
</div>
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');
}
<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>
}}
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>
)
}
}
......
......@@ -756,12 +756,11 @@ let that = this;
this.props.dispatch({
type:'planEditor/PremiumPaymentPeriod',
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"maxAge":this.state.age,
"pageNo":1,
"mainCode": this.state.riskCode
"pageNo":1
},
callback(){
......
......@@ -10,14 +10,10 @@ class Cover extends Component {
}
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")
let seriNo = localStorage.getItem("seriNo")
let riskName = localStorage.getItem("riskName")
let riskCode = localStorage.getItem("riskCode")
let thumbnail = localStorage.getItem("thumbnail")
window.location.href = window.location.href.split('#')[0]+'#/planResult?seriNo='+seriNo+'&riskName='+riskName +'&riskCode='+riskCode+'&thumbnail='+thumbnail
}
......
......@@ -9,7 +9,7 @@ ul,li,dl,dt,dd{
.pList {
height: 100%; overflow-y: auto;
height: 100%; overflow-y: auto;
dl{
display:flex; margin-top:.1rem; margin-left: .11rem;
dt{
......
......@@ -15,7 +15,6 @@ class DataBank extends Component {
}
componentDidMount() {
sessionStorage.clear();
document.title = '资料库'
const _this = this;
shareHide();
......@@ -23,7 +22,7 @@ class DataBank extends Component {
this.props.dispatch({
type: 'databank/getDataBankList',
payload: {
"configType": "prospectus",
configType: 'prospectus'
},
callback(res) {
if (res.status && res.data.length > 0) {
......@@ -47,7 +46,7 @@ componentWillUnmount(){
{
dataList.map((el, i) => {
return <NavLink key={i} to={{
pathname: "/databank/infolist",
pathname: "/databank/infolist",
search: 'riskCode=' + el.configCode + '&riskName=' + el.configName,
}}><dl>
<dt><img src={el.configInfo} alt='' /></dt>
......
......@@ -21,7 +21,6 @@ class InfoList extends Component {
const { search } = this.props.location;
const _this = this;
let key = Number(sessionStorage.getItem('key'));
shareHide();
Toast.loading('loading...');
if (search) {
......@@ -44,7 +43,7 @@ class InfoList extends Component {
type: 'databank/getDataInfoList',
payload: {
productId: riskCode,
dataType: data[key].configCode,
dataType: data[0].configCode,
orgId: window.localStorage.getItem('orgId'),
proId: window.localStorage.getItem('project')
},
......@@ -87,10 +86,6 @@ class InfoList extends Component {
render() {
let chooseIdx = 0;
if(sessionStorage.getItem("key")){
chooseIdx = Number(sessionStorage.getItem("key"))
}
const { dataList } = this.state;
return (
<Fragment>
......@@ -98,12 +93,11 @@ class InfoList extends Component {
<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.state.filter.length > 0 && this.state.filter.map((el, i) => <li key={i} className={this.state.chooseIdx === i ? 'on' : ''} onClick={() => {
this.filterData(el.configCode)
this.setState({
chooseIdx: i
})
sessionStorage.setItem( "key", i);
}}>{el.configName}</li>)
}
</ul>
......@@ -129,19 +123,6 @@ class InfoList extends Component {
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)) {
......
......@@ -8,13 +8,7 @@ class Preview extends Component {
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 = '';
......@@ -34,9 +28,7 @@ class Preview extends Component {
// </iframe>
}
{
(fileType==='mp4') && (
<video width="100%" style={{background:'black'}} ref={(node) =>{this.videoElement = node}} src={state.url} controls ></video>
)
(fileType==='mp4') && <video width="100%" autoPlay src={state.url}></video>
}
</div>
)
......
......@@ -7,7 +7,6 @@ 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);
......@@ -23,12 +22,10 @@ class Audit extends Component{
}
}
componentDidMount() {
document.title = '我的客户';
componentDidMount() {
shareHide();
// Toast.loading('loading...', 88);
Toast.loading('loading...', 88);
this.getClientUnpassList();
// this.getClientPassedList();
}
getClientPassedList() {
......@@ -60,7 +57,7 @@ class Audit extends Component{
type: 'governortraining/getClientList',
payload: {
id: window.localStorage.getItem("id"),
// auditedState: 0
auditedState: 0
},
callback(res) {
if (res.status) {
......@@ -78,52 +75,106 @@ class Audit extends Component{
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'})
this.props.dispatch(routerRedux.push({
pathname: '/governortraining/auditinfo'
}));
}
render() {
return <div className={css.auditWrap}>
<div>
<Tabs
tabs={[{ title: '未审核', sub: '1' }, { title: '已审核', sub: '2' }]}
// page={1}
onChange={(t, i) => {
if (i === 0 && this.state.clientList.length === 0) { this.getClientUnpassList(); } else if (this.state.cientListed.length === 0){
this.getClientPassedList();
}
}}
>
<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 && < 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}
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>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.createTime.substr(0,16)}</span>
</div>
}}
chooseClient={this.chooseClient.bind(this,false)}
pTitle='客户' />}
</div>
pTitle='未审核客户' />}
</div>
<div>
{
this.state.cientListed.length === 0 && this.state.show && < div >
<div className={css.splitline}></div>
<div className={css.noData}>
<div className={css.img}></div>
您当前没有已审核客户
</div>
</div>
}
{this.state.cientListed.length>0 && this.state.show && <MemberList
dataList={this.state.storecientListed}
renderType={['name']}
chooseClient={this.chooseClient.bind(this,true)}
filterData={(keywords) => {
this.setState({
storecientListed: dataFilter(this.state.cientListed, ['name'], keywords)
})
}}
renderItem={item => {
let status = '';
switch (item.currentState) {
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}>
<span className={css.name}>{item.name}</span>
<span className={css.time}>{item.createTime.substr(0, 16)}</span>
<span className={css.status}>{status}</span>
</div>
}}
pTitle='已审核客户' />}
</div>
</Tabs>
</div>
}
}
}
export default connect()(Audit);
export default connect()(Audit);
\ No newline at end of file
......@@ -4,14 +4,13 @@ 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,
age: -1,
sex: [0],
idcard: '',
maritalStatus: '未婚',
......@@ -35,8 +34,7 @@ class AddClient extends Component {
netReverseList: [],
netVal: '',
isShowTips: false,
dataTypes: [false,false,false,false,false,false],
disabled:false,
dataTypes: [false,false,false,false,false,false]
}
this.onRegionPickerChange = this.onRegionPickerChange.bind(this);
......@@ -55,16 +53,14 @@ class AddClient extends Component {
}
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',
configType: 'provinces',
oyhers: 0
},
callback: (res) => {
......@@ -83,10 +79,8 @@ class AddClient extends Component {
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 => {
......@@ -108,9 +102,6 @@ class AddClient extends Component {
})
}
});
if(!havedata){//没有匹配到
_this.fillSecData(data[0].configCode, 0)
}
}
} else {
......@@ -122,60 +113,35 @@ class AddClient extends Component {
}
});
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) => {
_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,
asyncOrz: [clientInfo.orgId],
orgVal: reverseList[clientInfo.orgId].label,
orgReverseList: reverseList
}, () => {
_this.getOrzList(userInfo.orgId, (list) => {
_this.getOrzList(clientInfo.orgId, (list) => {
const projarr = _this.genArr(list);
const projreverseList = _this.reverseData(projarr);
_this.setState({
projList: projarr,
projReverseList: projreverseList,
}, () => {
_this.getOrzList(userInfo.project, (list) => {
_this.getOrzList(clientInfo.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);
const netreverseList = _this.reverseData(netarr);
_this.setState({
netList: netarr_2,
netList: netarr,
netReverseList: netreverseList,
asyncProj: [userInfo.project],
projVal: projreverseList[userInfo.project].label
asyncProj: [clientInfo.project],
projVal: projreverseList[clientInfo.project].label
}, () => {
if(clientInfo){
_this.setState({
asyncNet: [clientInfo.website],
netVal: netreverseList[clientInfo.website] ? netreverseList[clientInfo.website].label : '',
})
}
_this.setState({
asyncNet: [clientInfo.website],
netVal: netreverseList[clientInfo.website].label,
})
})
});
})
......@@ -183,6 +149,35 @@ class AddClient extends Component {
})
});
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
})
} else {
this.getOrzList(0, (list) => {
const data = [...list];
let arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].orgName,
value: data[i].orgId
})
}
const reverseList = this.reverseData(arr);
this.setState({
orgList: arr,
orgReverseList: reverseList
})
});
}
}
setAgeRange() {
......@@ -214,7 +209,7 @@ class AddClient extends Component {
this.props.dispatch({
type: "governortraining/getRegionList",
payload: {
configType: 'newprovinces',
configType: 'provinces',
oyhers: v
},
callback(res) {
......@@ -230,18 +225,11 @@ class AddClient extends Component {
_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);
})
const list = _this.reverseData(_this.state.regionData);
cb && cb(data);
_this.setState({
reverseData: list
})
})
}
}
......@@ -308,34 +296,33 @@ class AddClient extends Component {
})
_this.props.history.replace('/governortraining/gtclientlist');
} else {
Toast.info(res.message,);
alert(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'){
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
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
result = 'ios'
}else if(/(Android)/i.test(navigator.userAgent)) { //判断Android
} else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
result = 'android'
}
if( result = 'ios' ){
if (result = 'ios') {
document.querySelector('body').scrollIntoView();
}
clearTimeout(timer)
},10)
}, 10)
}
render() {
let clientInfo = JSON.parse(window.localStorage.getItem('governortrainingClient'));
return (
......@@ -346,9 +333,8 @@ class AddClient extends Component {
<InputItem
className={css.e_phoneNum}
type="text"
disabled={this.state.disabled}
value={this.state.name}
onBlur={::this.blur}
value={this.state.name}
onBlur={this.blur.bind(this)}
onChange={v => {
let { dataTypes } = this.state;
dataTypes[0] = (v.trim() !== '');
......@@ -357,17 +343,16 @@ class AddClient extends Component {
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入客户经理姓名"}
placeholder = "请输入客户经理姓名"
>姓名</InputItem>
</li>
<li className={css.require}>
<li>
<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})
......@@ -375,31 +360,29 @@ class AddClient extends Component {
>
<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>}
<div className={css.icon_arrow}></div>
</li>
<li className={css.require}>
<li>
<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>
<div className={css.choose}><span style={{color: this.state.age>=0?'#101010':'#999'}}>{ this.state.age < 0 ? '请选择年龄': this.state.age +'岁' }</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<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}
onBlur={this.blur.bind(this)}
value={this.state.idcard}
onChange={v => {
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);
......@@ -408,16 +391,15 @@ class AddClient extends Component {
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入身份证号码"}
placeholder = "请输入身份证号码"
>身份证号码</InputItem>
</li>
<li className={css.require}>
<InputItem
className={css.e_phoneNum}
type="phone"
disabled={this.state.disabled}
onBlur={this.blur.bind(this)}
value={this.state.number}
onBlur={::this.blur}
onChange={v => {
let { dataTypes } = this.state;
dataTypes[2] = v.replace(/\s/g, '').length > 10
......@@ -426,7 +408,7 @@ class AddClient extends Component {
dataTypes
})
}}
placeholder = {this.state.disabled ? "" : "请输入手机号码"}
placeholder = "请输入手机号码"
>手机号码</InputItem>
</li>
<li>
......@@ -438,16 +420,14 @@ class AddClient extends Component {
{ label: '离异', value: '离异' }
]}
cols={1}
disabled={this.state.disabled}
value={this.state.maritalStatus ? [this.state.maritalStatus]:['未婚']}
onOk={
onChange={
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>
<div className={css.choose} style={{color:'#101010'}}><span>{this.state.maritalStatus}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<div className={css.icon_arrow}></div>
</li>
<li>
<span className={css.label}>学历</span>
......@@ -462,27 +442,89 @@ class AddClient extends Component {
{ label: '其他', value: '其他' }
]}
cols={1}
disabled={this.state.disabled}
value={this.state.education ? [this.state.education]:['本科']}
onOk={
value={['本科']}
onChange={
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>
<div className={css.choose} style={{color:'#101010'}}><span>{this.state.education}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<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>*/}
<Picker
data={this.state.orgList}
cols={1}
value={this.state.asyncOrz}
onOk={v => {
const asyncOrz = [...v];
this.setState({
asyncOrz,
orgVal: this.state.orgReverseList[v[0]].label
});
this.getOrzList(v[0], (list) => {
const data = [...list];
let arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].orgName,
value: data[i].orgId
})
}
const reverseList = this.reverseData(arr);
this.setState({
projList: arr,
projReverseList: reverseList,
asyncProj: [],
projVal: '',
asyncNet: [],
netVal: ''
})
});
}}
>
<div className={css.choose}><span style={{color:this.state.orgVal!==''? '#101010':'#999'}}>{this.state.orgVal!=='' ? this.state.orgVal : '请选择所属机构'}</span></div>
</Picker>
<div className={css.icon_arrow}></div>
</li>
<li className={css.require}>
<span className={css.label}>合作项目</span>
<div className={css.choose}><span style={{color:'#101010'}}>{this.state.projVal}</span></div>
{/*</Picker>*/}
<Picker
data={this.state.projList}
value={this.state.asyncProj}
cols={1}
onOk={(v) => {
const asyncProj = [...v];
this.setState({
asyncProj,
projVal: this.state.projReverseList[v[0]].label
});
this.getOrzList(v[0], (list) => {
const data = [...list];
let arr = [];
for (let i = 0, l = data.length; i < l; i++) {
arr.push({
label: data[i].orgName,
value: data[i].orgId
})
}
const reverseList = this.reverseData(arr);
this.setState({
netList: arr,
netReverseList: reverseList,
asyncNet: [],
netVal: ''
})
});
}}
>
<div className={css.choose}><span style={{color:this.state.projVal!==''? '#101010':'#999'}}>{this.state.projVal!=='' ? this.state.projVal : '请选择合作项目'}</span></div>
</Picker>
<div className={css.icon_arrow}></div>
</li>
<li className={css.require}>
<span className={css.label}>所属网点</span>
......@@ -490,7 +532,6 @@ class AddClient extends Component {
data={this.state.netList}
value={this.state.asyncNet}
cols={1}
disabled={this.state.disabled}
onOk={v=>{
const asyncNet = [...v];
this.setState({
......@@ -499,11 +540,9 @@ class AddClient extends Component {
});
}}
>
<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>
<div className={css.choose}><span style={{color:this.state.netVal!==''? '#101010':'#999'}}>{this.state.netVal!=='' ? this.state.netVal : '请选择所属网点'}</span></div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<div className={css.icon_arrow}></div>
</li>
</ul>
<ul className={css.aclist_wrap}>
......@@ -512,47 +551,39 @@ class AddClient extends Component {
<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 asyncValue = [...v];
const { reverseData } = this.state;
let label = '';
label = asyncValue.length > 1 ? reverseData[asyncValue[0]].label + ',' + reverseData[asyncValue[0]].children[asyncValue[1]] : reverseData[asyncValue[0]].label;
label = v.length > 1 ? reverseData[v[0]].label + ',' + reverseData[v[0]].children[v[1]] : reverseData[v[0]].label;
this.setState({
regionVal: label,
asyncValue: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)}
{this.state.regionVal === '' ? '请选择所在省市' : this.state.regionVal}
</div>
</Picker>
{!this.state.disabled && <div className={css.icon_arrow}></div>}
<div className={css.icon_arrow}></div>
</li>
<li>
<InputItem
className={css.e_phoneNum}
type="text"
disabled={this.state.disabled}
onBlur={this.blur.bind(this)}
value={this.state.address}
onBlur={::this.blur}
onChange={v=>this.setState({address:v})}
placeholder = {this.state.disabled ? "" : "请输入详细地址"}
placeholder = "请输入详细地址"
>详细地址</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;
......
......@@ -3,21 +3,14 @@ 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,
dataList: [],
isShowTips: false,
tit: '',
isPass: false,
......@@ -26,13 +19,14 @@ class ClientInfo extends Component {
}
componentDidMount() {
document.title = '客户信息';
const auditInfo = JSON.parse(localStorage.getItem('auditClientInfo'));
shareHide();
if (auditInfo) {
this.setState({
dataList: auditInfo
})
} else {
// this.props.dispatch(routerRedux.push('/governortraining/audit'));
}
}
handlePass(item) {
......@@ -68,35 +62,122 @@ class ClientInfo extends Component {
render(){
let labels = [];
const { dataList } = this.state;
if(!dataList){
return <div/>
if (dataList.label && dataList.label !== '') {
labels = dataList.label.split(',');
}
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>
{
dataList && <div>
<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.age}</span>
</li>
<li>
<span className={css.label}>手机号码</span>
<span className={css.value}>{dataList.number}</span>
</li>
<li>
<span className={css.label}>婚姻状况</span>
<span className={css.value}>{dataList.maritalStatus}</span>
</li>
<li>
<span className={css.label}>学历</span>
<span className={css.value}>{dataList.education}</span>
</li>
</ul>
<ul className={css.itemBox}>
<li>
<span className={css.label}>职业类型</span>
<span className={css.value}>{dataList.occupational}</span>
</li>
<li>
<span className={css.label}>年收入(万元)</span>
<span className={css.value}>{dataList.annualIncome}</span>
</li>
</ul>
<ul className={css.itemBox}>
<li>
<span className={css.label}>所在省市</span>
<span className={css.value}>{dataList.province}</span>
</li>
<li>
<span className={css.label}>详细地址</span>
<span className={css.value}>{dataList.address}</span>
</li>
</ul>
<ul className={css.itemBox}>
<li>
<span className={css.label}>希望购买产品</span>
<span className={css.value}>{dataList.product}</span>
</li>
<li>
<span className={css.label}>缴费期间</span>
<span className={css.value}>{dataList.payment}</span>
</li>
<li>
<span className={css.label}>缴费频次</span>
<span className={css.value}>{dataList.frequency}</span>
</li>
<li>
<span className={css.label}>保额</span>
<span className={css.value}>{dataList.insuredAmount}</span>
</li>
</ul>
{labels.length>0 && <div className={css.clientLabels}>
<div className={css.tit}><span>客户标签</span></div>
<p className={css.labels}>
{labels.map((el, i) => <span key={i}>{el}</span>)}
</p>
</div>}
</div>
}
{!dataList.isShowPassedInfo && <div className={css.footer}>
<div className={css.btn_reject} onClick={() => {
this.setState({
tit: '您是否确定驳回该客户信息?',
isShowTips: true,
isPass: false,
confirmTit:'驳回'
});
}}>驳回</div>
<div className={css.btn_passed} onClick={() => {
this.setState({
tit: '您是否确定通过该客户信息?',
isShowTips: true,
isPass: true,
confirmTit:'通过'
})
}}>通过</div>
</div>}
{dataList.isShowPassedInfo && <div className={css.footer}>
<div className={css.btn_passed} onClick={() => {
this.props.history.replace('/governortraining/audit');
}}>确定</div>
</div>}
<ConfirmPop show={this.state.isShowTips} title={this.state.confirmTit} handleOK={() => {
this.state.isPass ? this.handlePass(dataList) : this.handleReject(dataList);
this.setState({
isShowTips: false
})
}} handleCancel={() => {
this.setState({
isShowTips: false
})
}} >
<p>{this.state.tit}</p>
</ConfirmPop>
</div>
)
}
......
......@@ -69,14 +69,10 @@ class ClientList extends Component {
}
componentDidMount() {
document.title = '我的客户经理';
shareHide();
Toast.loading('loading...', 99);
this.getManagerList();
}
componentWillUnmount(){
ActionSheet.close();
}
render() {
const _this = this;
return (
......@@ -87,27 +83,22 @@ class ClientList extends Component {
您当前并无客户经理
</p>
<p>点击下方按钮添加</p>
<img src={require('../../assets/image/addUsers2.png')} alt="" className={css.add} onClick={() => {
<img src={require('../../assets/image/addUsers.png')} alt="" className={css.add} onClick={() => {
this.showActionSheet()
}} />
</div>}
{
(this.state.managerList.length > 0) && this.state.show && < MemberList
height="74vh"
dataList={this.state.storeManagerList}
dataList={this.state.managerList}
renderType={['name']}
filterData={(keywords) => {
this.setState({
storeManagerList: dataFilter(this.state.managerList, ['name'], keywords)
managerList: dataFilter(this.state.storeManagerList, ['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'));
}}>
return <div className={css.managerItem}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.number}</span>
</div>
}}
......
......@@ -14,14 +14,11 @@ span {
.clientless {
height: 100%;
overflow: hidden;
.add{
position: absolute;
bottom: 1rem;
.add {
width: 3.5rem;
//height: .7rem;
margin: 0 .32rem 0;
height: 1.22rem;
margin: 1.8rem .32rem;
}
}
.splitline {
width: 100%;
......@@ -44,12 +41,10 @@ span {
.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;}
......@@ -162,13 +157,7 @@ span {
}
}
.clientInfoBox {
position: fixed;
width: 100%;
height:100%;
overflow: hidden;
background: #fff;
left:0;
top:0;
padding-bottom:.8rem; overflow-y: auto; height: 100%;
.itemBox{
margin-top:.1rem; background:#fff;
li{
......@@ -178,7 +167,7 @@ span {
width:1.23rem; position: relative;
}
.value{
color:#000; line-height: .21rem; margin: .15rem 0 .14rem;
color:#666; line-height: .21rem; margin: .15rem 0 .14rem;
}
&.require{
position: relative;
......@@ -252,9 +241,3 @@ span {
.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
......@@ -18,34 +18,29 @@ body{
}
.search{
width: 3.8rem;
height: .32rem;
background-color: #F4F4F4;
border-radius: 25.6px;
margin: 0px auto 9.6px;
position: relative;
width: 100%;
padding: .1rem .17rem;
z-index: 10;
top: 0;
}
.search::before {
.search img{
position: absolute;
margin:.09rem .15rem;
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%;
position: absolute;
border: none;
border-radius: .16rem;
background: #F4F4F4;
height: .32rem;
line-height: .32rem;
padding: 0;
padding-left: .42rem;
outline:none;
left: .4rem;
top: 0.08rem;
background-color: #F4F4F4;
font-size: .14rem;
color: #999;
width:3.25rem ;
}
/*content*/
......@@ -53,7 +48,7 @@ body{
position: relative;
width: 100%;
background-color: #F8F8F8;
/* padding-top: 16px; */
padding-top: 16px;
padding-bottom: .9rem;
......@@ -66,14 +61,6 @@ body{
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倍*/
......@@ -81,15 +68,12 @@ body{
.nav{
display: flex;
font-size: 0.18rem;
margin: .2rem 0;
flex-wrap: wrap;
margin: .32rem 0;
}
.module{
text-align: center;
/* flex: 1; */
width: 25%;
margin-bottom: 0.15rem;
flex: 1;
}
.module>img{
width: .5rem;
......@@ -105,8 +89,8 @@ body{
.planList{
width: 3.92rem;
background-color: white;
/* border-radius: 16px; */
margin: 0 auto .4rem ;
border-radius: 16px;
margin: 0 auto .8rem ;
}
.planList > div >p {
......@@ -128,7 +112,7 @@ body{
height: 100%;
}
.right{
width: 2.9rem;
width: 2.8rem;
height: .8rem;
float: right;
position: relative;
......@@ -157,22 +141,6 @@ body{
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;
......@@ -181,7 +149,7 @@ body{
top: 0;
right: 0;
}
.planList span{
span{
margin-right: .1rem;
float: right;
}
......@@ -243,7 +211,7 @@ body{
.codeWrap{
/* background:#FF9D5C; */
}
:global(.codeWrap .am-modal-transparent .am-modal-content){
:global(.am-modal-transparent .am-modal-content){
padding:0;
}
:global(.am-modal-close){
......@@ -255,140 +223,3 @@ body{
: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
import React, { Component } from 'react'
import { connect } from 'dva'
import { Modal, Toast, NoticeBar, WhiteSpace,Carousel } from 'antd-mobile';
import {Icon } from 'antd';
import { Modal, Toast } from 'antd-mobile';
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)
......@@ -20,76 +16,38 @@ class Home extends Component {
moduleList:[
{
img:require('../../assets/image/myUser.png'),
text:'我的客户',
url:'myUser'
text:'我的客户'
},
{
img:require('../../assets/image/projectPlan.png'),
text:'计划书',
url:'prospectusList'
text:'计划书'
},
{
img:require('../../assets/image/poster.png'),
text:'海报',
url:'poster'
text:'海报'
},
{
img:require('../../assets/image/dataBank.png'),
text:'资料库',
url:'databank'
text:'资料库'
},
{
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'
text:'计划书'
},
{
img:require('../../assets/image/poster.png'),
text:'海报',
url:'poster'
text:'海报'
},
{
img:require('../../assets/image/myUser.png'),
text:'我的客户',
url:'governortraining/audit',
img:require('../../assets/image/audit.png'),
text:'审核'
},
{
img:require('../../assets/image/dataBank.png'),
text:'资料库',
url:'databank'
text:'资料库'
},
{
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智慧工作平台",
......@@ -102,32 +60,41 @@ class Home extends Component {
swiperList: [], //轮播图
roleId: '',
hasRoom: false,
isCodeShow: false,
infolist:null,//系统消息
loadingFlag:true,
isCodeShow: false
}
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);
history = (index)=>{
if(index == 0 && localStorage.getItem("roleId") == 3){
this.props.history.push("/prospectusList")
}else if( index == 0 && localStorage.getItem("roleId") == 2){
this.props.history.push("/myUser")
}
else if(index == 1 && localStorage.getItem("roleId") == 2){
this.props.history.push("/prospectusList")
}else if(index === 2 && localStorage.getItem("roleId") == 2){
this.props.history.push("/poster")
}else if(index === 1 && localStorage.getItem("roleId") == 3){
this.props.history.push("/poster")
}else if(index === 3 && localStorage.getItem("roleId") == 2){
this.props.history.push("/databank")
}else if(index === 3 && localStorage.getItem("roleId") == 3){
this.props.history.push("/databank")
}else if(index === 2 && localStorage.getItem("roleId") == 3){
//审核
this.props.history.push("/governortraining/audit")
}
}
goGtclientlist=()=>{
this.props.history.push("/governortraining/gtclientlist")
}
goPerformance =()=>{
this.props.history.push('/home/myCenter')
this.props.history.push('/home/performance')
}
handleClose() {
this.setState({
......@@ -151,36 +118,34 @@ class Home extends Component {
}
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("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='
storage.setItem("recipientsName",'')
window.location.href = window.location.href.split('#')[0] + '#/addplaneditor?riskName=' + item.riskName + '&riskCode=' + item.riskCode + '&calculationMethod=' + item.calculationMethod + '&recipients=false&riskIntroduce=' + item.riskIntroduce + '&thumbnail=' + item.thumbnail +'&recipientsName=&selectd=1&roleId='+localStorage.getItem("roleId")+'&seriNo='
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
sessionStorage.clear();
shareHide();
if(!this.props.location.query){
Toast.loading('loading...',0);
}
componentWillMount() {
// this.props.history.go(0)
const that = this;
let url = window.location.href;
const params = urlGetParams(window.location.href);
const matchs = decodeURI(url).match(/userOpenId=(.*)&publicOpenId=(.*)&phoneNum=(.*)/i);
let userOpenId = ''
let publicOpenId = '';
let phoneNum = '';
if (params.userOpenId) {
userOpenId = params.userOpenId;
publicOpenId = params.publicOpenId;
phoneNum = params.phoneNum;
if (matchs) {
userOpenId = matchs[1];
publicOpenId = matchs[2];
phoneNum = matchs[3];
this.setState({
userOpenId, //微信号
publicOpenId, //公众号
......@@ -188,13 +153,6 @@ class Home extends Component {
})
}
//在缓存中查找一边,解决从其他页面返回此页面时,发接口事件过长,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")},
......@@ -204,7 +162,7 @@ class Home extends Component {
that.setState({
roleId: userInfo.roleId
})
if (userInfo.roleId != '2') {//如果不是客户经理 就显示督训的页面
if (userInfo.roleId == '3') {
that.setState({
moduleList: that.state.moduleList1,
})
......@@ -219,33 +177,19 @@ class Home extends Component {
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);
}
})
/*shareHide({
decodeUrl: window.location.href.split('#')[0],
})*/
shareHide()
}
getOtherData(userInfo) {
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
const _this = this;
this.props.dispatch({
type: 'home/getRoomList',
type: 'myUser/getRoomList',
payload: {
index: 0
},
......@@ -256,10 +200,13 @@ class Home extends Component {
}
})
// 选取的客户
if (this.props.location.query) {
const { query: { chosenClient } } = this.props.location;
const id = userInfo.id || null;
const id = window.localStorage.getItem('id');
let clientNum = '';
Toast.loading('loading...');
if (chosenClient) {
......@@ -283,162 +230,116 @@ class Home extends Component {
}
});
}
let that = this;
/* 计划书接口 */
this.props.dispatch({
type:'home/getPlanList',
payload:{
riskName:"",
riskStatus:1, //1启用
"proId":userInfo.project || null,
"website":userInfo.website || null,
"orgId":userInfo.orgId || null,
"project":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
callback(data){
_this.setState({
planList:data,
loadingFlag:false,
that.setState({
planList:data
})
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
{/*<HeaderNav title={this.state.navTitle}*/}
{/*history={this.props.history}*/}
{/*></HeaderNav>*/}
<div className={styles.header} onClick={()=>{
// this.props.history.push("/myUser")
/* this.props.dispatch(routerRedux.push({
pathname: '/myUser',
query: {
data:1,
},
}));*/
}}>
{/*<div className={styles.search}>
<img src={require('../../assets/image/search.png')} alt=""/>
<input type="text" placeholder="请输入关键字" />
</div>*/}
</div>
<div className={styles.content}>
<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)
}}>
<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>
)
})
}
<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.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>
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 === '新品'?styles.orangeSpan:styles.redSpan}>
{ ite =='新品' ?<img src={require("../../assets/image/label-hot.png")} alt=""/>:<img src={require("../../assets/image/label-newProduct.png")} alt=""/> }
</span>
)
})}
</div>
)
})
}
<div className={styles.noMore}>
<div><img src={require('../../assets/image/no-more.png')} alt=""/>
<span>没有更多啦</span>
<div className={styles.buttom}>
{item.riskIntroduce}
</div>
</div>
</div>
{/*<div className={styles.line}></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>
</Iscroll>
}
</div>
<BottomNav handleShowExpert={this.handleShowExpert} hasRoom={this.state.hasRoom} roleId={this.state.roleId} goGtclientlist = {this.goGtclientlist} goPerformance = {this.goPerformance}/>
<ExpertVideo
......
......@@ -4,9 +4,6 @@ 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)
......@@ -38,7 +35,7 @@ class Login extends Component {
$.ajax({
//几个参数需要注意一下
type: "POST",//方法类型
url: "https://iwpuat.ihxlife.com/o2o/authentication/mobile" ,//url
url: "https://zmt.ihxlife.com/o2o/authentication/mobile" ,//url
contentType: "application/x-www-form-urlencoded",
headers: {
'deviceId':this.state.userOpenId, //微信号 userOpenId
......@@ -59,16 +56,7 @@ class Login extends Component {
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('该用户无权限,请联系管理员。')
}
that.props.history.push('/welcome');
},
error : function(result) {
// console.log(result.responseJSON.content);
......@@ -81,12 +69,9 @@ class Login extends Component {
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();
......@@ -101,10 +86,10 @@ class Login extends Component {
storage.setItem("weixin_id",'') //微信号
storage.setItem("superiorid",'') //角色
let url = window.location.href;
const matchs = urlGetParams(url);
const matchs = decodeURI(url).match(/userOpenId=(.*)&publicOpenId=(.*)/i);
if(matchs){
let userOpenId = matchs.userOpenId;
let publicOpenId = matchs.publicOpenId;
let userOpenId = matchs[1];
let publicOpenId = matchs[2];
this.setState({
userOpenId,
publicOpenId
......@@ -119,7 +104,7 @@ class Login extends Component {
</div>
<div className={styles.phone}>
<img src={require('../../assets/image/home-shadow.png')} alt=""/>
<input type="number" pattern="[0-9]*" placeholder="输入手机号码"
<input type="number" placeholder="输入手机号码"
value={this.state.mobile}
onChange={
(e)=>{
......@@ -138,16 +123,13 @@ class Login extends Component {
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,
$.ajax({url:"https://zmt.ihxlife.com/o2o/code/sms?mobile="+ mobile,
type : "get",
headers:{"deviceId": that.state.userOpenId},
success:function(result){
......@@ -155,16 +137,16 @@ class Login extends Component {
that.setState({
send:true,
})
t1 = window.setInterval(function () {
let t1 = window.setInterval(function () {
that.setState({
second:that.state.second-1
})
if(that.state.second ===0 ){
window.clearInterval(t1);
that.setState({
send:false,
second:60
})
window.clearInterval(t1);//删除定时器
}
},1000)
}});
......@@ -180,7 +162,7 @@ class Login extends Component {
}}>获取验证码</span>
}
{
this.state.send &&<span>{this.state.second}秒</span>
this.state.send &&<span >{this.state.second}秒</span>
}
</div>
<div className={styles.verification}>
......
......@@ -22,7 +22,6 @@ class MyUser extends Component {
storeNameList1:[],
nameList1:[],
show:false,
loadingFlag:true
}
}
addUser = ()=>{
......@@ -36,15 +35,16 @@ class MyUser extends Component {
this.props.history.push('/amendClient')
}
componentWillMount(){
Toast.loading('loading...',0);
this.getUser();
}
componentDidMount(){
document.title = '我的客户';
shareHide();
this.getUser();
this.getUser1();
}
componentWillUnmount(){
document.title = '';
......@@ -58,16 +58,16 @@ class MyUser extends Component {
"currentState":0,
},
callback(data) {
Toast.hide();
let { hasClient } = that.state;
hasClient[0] = data.length > 0;
that.setState({
nameList: data,
// nameList: [],
storeNameList: data,
hasClient,
show:true,
//loadingFlag:false
})
// that.props.amentClient();
}
})
}
......@@ -80,15 +80,14 @@ class MyUser extends Component {
"id":localStorage.getItem("id"),
},
callback(data){
Toast.hide();
let { hasClient } = that.state;
hasClient[1] = data.length > 0;
that.setState({
nameList1: data,
// nameList1: [],
hasClient,
storeNameList1: data,
show:true,
loadingFlag:false
})
}
......@@ -130,27 +129,10 @@ class MyUser extends Component {
}
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} />
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} goAddUser = {this.goAddUser} content={'修改'} dataFilterToProp= {this.dataFilterToProp.bind(this)} hasClient={this.state.hasClient} />
}
</div>
)
......
......@@ -200,6 +200,19 @@ body{
margin-right: .1rem;
}
.ulilast .spanPad{
position: relative;
display:flex;
justify-content: flex-start;
padding-left: .15rem;
}
.ulilast .spanPad i{
position: absolute;
font-style: normal;
width: .4rem;
top:0; right: 0;
}
.policyList>p{
font-size: .14rem;
color: #101010;
......@@ -216,14 +229,6 @@ body{
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;
}
......
......@@ -9,6 +9,7 @@ import 'echarts/lib/component/title';
import {Toast, Picker} from 'antd-mobile';
import perform from './Performance.css'
import shareHide from "../../utils/shareHide"
import moment from 'moment';
class Performance extends Component {
constructor(props) {
super(props)
......@@ -26,11 +27,15 @@ class Performance extends Component {
Xdata:[],
getseriesData:[],
getXdata:[],
roleId:"",
intervalDate:'',
amount:0.00,
amount: 0.00,
fakedata:null
}
this.setCurrentIndex = this.setCurrentIndex.bind(this)
}
// 改变index显示高亮
setCurrentIndex(index) {
let _this = this
......@@ -42,25 +47,163 @@ class Performance extends Component {
getIndex = () =>{
switch (this.state.currentIndex) {
case 0:this.setState({perData:'D'},()=>{
this.performace()
// this.performace()
this.getFakeList(0)
});
break;
case 1:this.setState({perData:'M'},()=>{
this.performace()
// this.performace()
this.getFakeList(1)
});
break;
case 2:this.setState({perData:'Q'},()=>{
this.performace()
// this.performace()
this.getFakeList(2)
});
break;
case 3:this.setState({perData:'Y'},()=>{
this.performace()
// this.performace()
this.getFakeList(3)
});
break;
}
}
getFakeData = () => {
let data = { achievements: [], amount: 0 };
let sum = 0;
const nowDate = new Date();
const nowYear = nowDate.getFullYear();
for (let i = 0; i < 12; i++) {
let m = new Date();
m.setMonth(i);
m.setDate(0);
let l = m.getDate();
for (let g = 1; g <= l; g++) {
if (nowDate.getMonth() >= i) {
if (nowDate.getDate() >= g) {
let money = parseFloat(Math.random() * (4000 - 300 + 1) + 300, 10).toFixed(2);
money = (Math.random() < 0.6 ? 0 : 1) * money;
data.achievements.push({
statisticaldate: moment(new Date(nowYear, i, g)).format('YYYY-MM-DD'),
totalprem: money
})
sum += parseFloat(money);
}
} else {
data.achievements.push({
statisticaldate: moment(new Date(nowYear, i, g)).format('YYYY-MM-DD'),
totalprem: 0
})
}
}
}
data.amount = sum;
this.setState({ fakedata: data })
}
getFakeList = (flag) => {
const { fakedata } = this.state;
const now = new Date();
if (flag === 0) {
const now = moment(new Date()).format('YYYY-MM-DD');
fakedata && fakedata.achievements.map(itm => {
if (itm.statisticaldate == now) {
this.setState({
performArr: {
achievements: [itm],
amount: itm.totalprem
}
})
}
})
}
if (flag === 1) {
let m = new Date();
m.setDate(0);
let l = m.getDate(), sum = 0;
let data = { achievements: [], amount: 0 };
for (let i = 0; i < l; i++){
fakedata && fakedata.achievements.map(itm => {
if (itm.statisticaldate == moment(new Date().setDate(i)).format('YYYY-MM-DD')) {
data.achievements.push(itm)
sum += parseFloat(itm.totalprem);
}
})
}
data.amount = sum;
this.setState({performArr: data})
}
if (flag === 2) {
let quarterStartMonth = 0, nowMonth=new Date().getMonth();
if (nowMonth < 3) {
quarterStartMonth = 0;
}
if (2 < nowMonth && nowMonth < 6) {
quarterStartMonth = 3;
}
if (5 < nowMonth && nowMonth < 9) {
quarterStartMonth = 6;
}
if (nowMonth > 8) {
quarterStartMonth = 9;
}
let data = { achievements: [], amount: 0 };
let sum = 0;
for (let i = quarterStartMonth; i < quarterStartMonth+3; i++) {
let m = new Date();
m.setMonth(i);
m.setDate(0);
let l = m.getDate();
for (let g = 1; g <= l; g++) {
fakedata && fakedata.achievements.map(itm => {
if (itm.statisticaldate == moment(new Date(m.getFullYear(),i,g)).format('YYYY-MM-DD')) {
data.achievements.push(itm)
sum += parseFloat(itm.totalprem);
}
})
}
}
data.amount = sum;
this.setState({ performArr: data })
}
if (flag === 3) {
let data = { achievements: [], amount: 0 };
let sum = 0;
const nowYear = new Date().getFullYear();
for (let i = 0; i < 12; i++){
if (i <= new Date().getMonth()) {
let money = parseFloat(Math.random() * (60000 - 20000 + 1) + 20000, 10).toFixed(2);
data.achievements.push({
statisticaldate: moment(new Date(nowYear, i, 1)).format('YYYY-MM'),
totalprem: money
})
sum += parseFloat(money);
} else {
data.achievements.push({
statisticaldate: moment(new Date(nowYear, i, 1)).format('YYYY-MM'),
totalprem: 0
})
}
}
data.amount = sum;
console.log(data)
this.setState({ performArr: data })
}
}
performace =()=>{
this.performaceServer()
let that = this;
if(localStorage.getItem("roleId")==3){
this.setState({roleId:1},()=>{
that.performaceServer()
})
}else{
this.setState({roleId:0},()=>{
that.performaceServer()
})
}
}
//个人业绩接口
performaceServer(){
......@@ -71,14 +214,13 @@ class Performance extends Component {
payload: {
"daySize": this.state.perData,
"managerId": localStorage.getItem("id"),
"roleId": localStorage.getItem("roleId"),
"superFlag": this.state.roleId,
},
callback(data){
Toast.hide();
that.setState({
performArr:data
})
that.getEchares();//建立新的图表
},
error(data){
Toast.info(data.message)
......@@ -86,48 +228,76 @@ class Performance extends Component {
})
}
//保单请求接口
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
filterData = () => {
if (this.state.getMonth - 1 <= new Date().getMonth()) {
Toast.loading('loading...', 2)
let data = [
{ "phone": "13733060808", "contno": "2019000662365088", "planname": "华夏逍遥行两全保险", "insuretime": "2019-06-22", "firstprem": "5970.44", "appntname": "孙雄飞" },
{ "phone": "15251536018", "contno": "2018000658656088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-21", "firstprem": "532.08", "appntname": "苏六" },
{ "phone": "15251536018", "contno": "2018000658681088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-22", "firstprem": "532.08", "appntname": "苏七" },
{ "phone": "15251536018", "contno": "2018000658735088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-22", "firstprem": "532.08", "appntname": "艾二" },
{ "phone": "15251536018", "contno": "2018000658649088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-22", "firstprem": "532.08", "appntname": "艾一" },
{ "phone": "15251536018", "contno": "2018000658661088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-22", "firstprem": "532.08", "appntname": "苏二" },
{ "phone": "15251536018", "contno": "2018000658669088", "planname": "华夏常青树重大疾病保险(2015)", "insuretime": "2019-06-22", "firstprem": "532.08", "appntname": "王晟七" },
{ "phone": "17895457038", "contno": "2018000659351088", "planname": "华夏逍遥行两全保险", "insuretime": "2019-06-22", "firstprem": "5334.32", "appntname": "李向军" },
{ "phone": "18335760786", "contno": "2019000661172088", "planname": "华夏常青藤老年防癌疾病保险", "insuretime": "2019-06-22", "firstprem": "953", "appntname": "说说" },
{ "phone": "15887108090", "contno": "2019000665488088", "planname": "华夏常青藤老年防癌疾病保险", "insuretime": "2019-06-22", "firstprem": "2207.9", "appntname": "防癌险" }
];
setTimeout(() => {
data.map(itm => {
itm.insuretime = moment(new Date(this.state.getFullYear, this.state.getMonth - 1, parseInt(Math.random() * (28 - 1 + 1) + 1, 10))).format('YYYY-MM-DD');
itm.contno = `${this.state.getFullYear}000${parseInt(Math.random() * (658669088 - 100000000 + 1) + 100000000, 10)}`;
itm.firstprem = parseFloat(Math.random() * (3000 - 500 + 1) + 500, 10).toFixed(2);
})
},
error(data){
Toast.info(data.message)
}
})
this.setState({ arr: data })
}, 2000);
} else {
this.setState({ arr: [] })
}
// let that = this;
// if(localStorage.getItem("roleId")==3){
// this.setState({roleId:1})
// }else{
// this.setState({roleId:0})
// }
// Toast.loading('loading...');
// this.props.dispatch({
// type: 'Performance/policyList',
// payload: {
// "daySize": "M",
// "customSetDay":this.state.getFullYear+"-"+this.state.getMonth,
// "managerId": localStorage.getItem("id"),
// "superFlag": this.state.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);
this.state.Xdata = performArr.achievements;
this.state.getXdata = [];
this.state.getseriesData = [];
this.state.intervalDate=Math.ceil((performArr.achievements)&&(performArr.achievements).length/5)
this.state.Xdata && this.state.Xdata.map((item)=>{
this.state.getXdata.push(item.statisticaldate.substr(5));
this.state.getseriesData.push(item.totalprem);
})
// console.log(getXdata,intervalDate,getseriesData)
//此处需要在setOption之前处理dom显隐。否则样式会出问题,setOption是根据父元素的宽高来渲染图标大小
this.dealDay();
myChart.setOption({
xAxis: {
type: 'category',
data: getXdata,
data: this.state.getXdata,
axisLine:{
show:true,
onZero:true,
......@@ -138,7 +308,7 @@ class Performance extends Component {
}
},
axisLabel: {
interval:intervalDate,
interval:this.state.intervalDate,
}
},
yAxis: {
......@@ -159,21 +329,8 @@ class Performance extends Component {
},
},
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: { //线条样式
// }
// }
data: this.state.getseriesData,
type: 'line'
}],
color: {
colorStops: [{
......@@ -221,38 +378,28 @@ class Performance extends Component {
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)
document.title = '业绩'
this.setState({
getFullYear: yearAry,
getMonth: monthAry
getFullYear: new Date().getFullYear(),
getMonth: new Date().getMonth()+1
},()=>{
this.filterData()
})
this.performace()
// this.performace()
this.getFakeData();
}
componentWillUnmount(){
document.title = ''
}
render() {
let {itemList,arr,performArr} = this.state;
let amount = performArr.amount?parseFloat(performArr.amount).toFixed(2):'0.00';
let amount = performArr.amount?parseFloat(performArr.amount).toFixed(2):'0.00';
return (
<div className={perform.performWrap}>
......@@ -284,12 +431,11 @@ class Performance extends Component {
<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>
<li className={perform.litext}>{performArr && amount} <span style={{fontSize:'.2rem'}}>元</span> </li>
<li className={perform.lispan}>业绩走势</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>}
<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>
......@@ -298,7 +444,7 @@ class Performance extends Component {
<Picker
data={this.getYear()}
cols={1}
value={this.state.getFullYear}
value={[this.state.getFullYear]}
onChange={v => {
const _this = this;
this.setState({ getFullYear: v },()=>{
......@@ -313,7 +459,7 @@ class Performance extends Component {
<Picker
data={this.getDate()}
cols={1}
value={this.state.getMonth}
value={[this.state.getMonth]}
onChange={s => {
const _this = this;
this.setState({ getMonth: s },()=>{
......@@ -334,7 +480,7 @@ class Performance extends Component {
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>
<li className={perform.ulilast}><span>{item.planname}</span><span className={perform.spanPad}><b>{item.firstprem}元</b><i>首期保费</i></span></li>
</ul>
<p>客户:{item.appntname}</p>
</div>
......@@ -347,6 +493,9 @@ class Performance extends Component {
);
}
componentDidUpdate (){
this.getEchares()
}
}
Performance.propsTypes = {}
......
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: .1rem;
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;
line-height: .3rem;
}
.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;
}
.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
}
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 Date from "../../components/Date";
import DatePicker from "../../components/DatePicker";
import ConfirmPop from '../../components/Modal/confirmPop';
import moment from 'moment';
import { Toast } from 'antd-mobile';
import shareHide from "../../utils/shareHide";
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
let RadioItem = Radio.RadioItem;
let alert = Modal.alert;
let showAlert = () => {
let alertInstance = alert('Delete', 'Are you sure???', [
{text: 'Cancel', onPress: () => console.log('cancel'), style: 'default'},
{text: 'OK', onPress: () => console.log('ok')},
]);
setTimeout(() => {
// 可以调用close方法以在外部close
alertInstance.close();
}, 500000);
}
let isIPhone = new RegExp('\\biPhone\\b|\\biPod\\b', 'i').test(window.navigator.userAgent);
let moneyKeyboardWrapProps = '';
if (isIPhone) {
moneyKeyboardWrapProps = {
onTouchStart: e => e.preventDefault(),
};
}
function closest(el, selector) {
let matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
while (el) {
if (matchesSelector.call(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
let today = new Date()
class AddPlanEditor extends Component {
constructor(props){
super(props)
this.state={
selectd:0,
isShowTips:false,
comfirm:'',
selectRecognizeeSex:true, // 投保人性别
recipientsSex:true, //收件人性别
recipientsName:'', //收件人姓名
recipients:false,
color:false,
date:'2018-02-03',
value1: moment('2017-01-25'),
selectedValue: moment('2017-01-25'),
modal1: false,
modal2: false,
modal3: false,
modal4: false,
modal5: false,
visible:false,
message:'' ,
submit:{},
slectValue:'',
type: 'money',
initInsurance:true,
insuranceNumber:'',
insuranceValue:0,
insuranceLabel:'医保通', //医保通
insurance1:true,
riskName:'',
riskCode:'',
// termList:['华夏多倍版','华夏附加同祥保费豁免定期寿险(A款)','华夏附加豁免保险重大疾病保险'] ,//条款列表
text:'',
termList:[
{
key:0,
title:'华夏多倍版',
text:'华夏多倍版',
},
{
key:1,
title:'华夏附加同祥保费豁免定期寿险(A款)',
text:'华夏附加同祥保费豁免定期寿险(A款)',
},
{
key:2,
title:'华夏附加豁免保险重大疾病保险',
text:'华夏附加豁免保险重大疾病保险',
}
],
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:[],//条款列表详情
coverageList:[
{ id: 1, name: "花生" },
{ id: 2, name: "苹果" },
{ id: 3, name: "杨桃" }
],
selectCoverage:'花生',
roleId:'',
/*主险*/
protectTime:'', //后端保额传值
microPlanInfo:{}, //获取的主险信息
paymentList:[], //缴费期间
coverage:'', //缴费期间
insuranceDurationList:[], //保险期间
payTime:'', //保险期间后端传值
insuranceDuration:'' ,//保险期间
protectTime:'',
inputValue:'', //保额
inputValue1:'', //保费
copies:'', //份数
seriNo:'',
mainRiskCode:'', //主险riskCode
saveMain:false,
editorNum:0, //编辑:0,修改>0
minAmnt:'10000', //最低保额
minPrem:'10000', //最低保费
/* 附加险 */
fjInsuranceList:[], //附加险列表
social:'有', //有无社保
newBill:'是', //是否为新单
addProtectTime:'100', //附加险保险期间序号
addInsuranceDuration:'趸缴', //附加险保险期间值
fjRiskCode:'' , //附加险code值
fjRiskName:'' , //附加险名称
addCoverage:'', //附加险缴费期间值
addPayTime:'', // 附加险缴费期间的序号
fjAmount:5000, // 附加险保额
fjPrem:0, // 附加险保费
totalPrem:'0' , //首年保费(总)
fjRiskCodeList:[],
buyFjCount:0,
buyFjList:[],
fjParam:[], //附加险入参集合
/* 被保人信息 */
insName: "",
insSex: true,
insPhone: "",
insBirthday: "1989-1-1",
/* 投保人信息 */
appName: "",
appSex: true,
appPhone: "",
appBirthday: "1989-1-1",
calculationMethod:'0', //0:保额算保费 , 1:保费算保额 , 2:份数算保费
calculation0:true,
calculation1:false,
calculation2:false,
thumbnail: ''
}
}
getAge = (dateString)=> {
let aDate = dateString.split('-');
var birthDate = new Date(aDate[0] + '-' + (parseInt(aDate[1]) < 10 ? '0' + aDate[1] : aDate[1]) + (parseInt(aDate[2]) < 10 ? '-0' + aDate[2] : '-'+aDate[2]));
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
return age ;
}
showToast=(val)=>{
Toast.info(val,);
}
handleDate = (val)=>{
let that = this;
this.setState({insBirthday : val});
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,val)
}
},0)
}
handleDate1 = (val)=>{
this.setState({appBirthday : val});
let that = this;
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,0,0,0,0,0,0,val)
}
},0)
}
getDate=(date)=>{
let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.setState({
appBirthday:date_value,
})
let that = this;
setTimeout(function () {
if(that.state.mainInsurance){
that.getInsurance(0,date)
}
},0)
}
getDate1=(date)=>{
let date_value=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
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(){
/*
let url = window.location.href;
const matchs = decodeURI(url).match(/riskName=(.*)&riskCode=(.*)&calculationMethod=(.*)&recipients=(.*)&riskIntroduce=(.*)&thumbnail=(.*)&recipientsName=(.*)&selectd=(.*)&seriNo=(.*)/i)
let riskName = matchs[1];
let riskCode = matchs[2];
let calculationMethod =Number(matchs[3]);
let recipients = matchs[4];
let riskIntroduce = matchs[5]
let thumbnail = matchs[6]
let recipientsName = matchs[7]
let selectd = matchs[8]
let seriNo = matchs[9]
share({
decodeUrl: window.location.href.split('#')[0],
title: riskName,
desc: '您的专属保险计划书,请您查收!',
shareUrl: window.location.href,
thumbnail: thumbnail
});
let that = this;
this.setState({
calculationMethod:Number(calculationMethod),
calculation0:calculationMethod == 0?true:false,
calculation1:calculationMethod == 1?true:false,
calculation2:calculationMethod == 2?true:false,
riskName:riskName,
riskCode:riskCode,
seriNo:seriNo,
recipientsName:localStorage.getItem("recipientsName"),
recipientsSex:localStorage.getItem("recipientsSex")=='false'?false:true,
recipients:localStorage.getItem("recipients")=='false'?false:true,
selectd:localStorage.getItem("selectd")?localStorage.getItem("selectd"):selectd,
})
if(localStorage.getItem("seriNo")){
console.log(666666);
this.setState({
initInsurance:false,
})
setTimeout(function () {
that.getMessage()
that.getProspectusaAditional(0)
},0)
}
*/
let url = window.location.href;
/* const matchs = decodeURI(url).match(/riskName=(.*)&riskCode=(.*)&calculationMethod=(.*)&thumbnail=(.*)&recipientsName=(.*)&selectd=( .*)&seriNo=(.*)/i)
let riskName = matchs[1];
let riskCode = matchs[2];
let calculationMethod =Number(matchs[3]);
let thumbnail = matchs[4]
let recipientsName = matchs[5]
let selectd = matchs[6]
let seriNo = matchs[7]*/
const matchs = decodeURI(url).match(/riskName=(.*)&riskCode=(.*)&calculationMethod=(.*)&recipients=(.*)&riskIntroduce=(.*)&thumbnail=(.*)&recipientsName=(.*)&selectd=(.*)&roleId=(.*)&seriNo=(.*)/i)
let riskName = matchs[1];
let riskCode = matchs[2];
let calculationMethod =Number(matchs[3]);
let recipients = matchs[4];
let riskIntroduce = matchs[5]
let thumbnail = matchs[6]
let recipientsName = matchs[7]
let selectd = matchs[8]
let roleId = matchs[9]
let seriNo = matchs[10]
let ary = url.split('&');
ary.pop()
share({
decodeUrl: window.location.href.split('#')[0],
title: riskName,
desc: '您的专属保险计划书,请您查收!',
shareUrl: ary.join('&')+'&seriNo=',
thumbnail: thumbnail
});
let that = this;
this.setState({
calculationMethod:calculationMethod,
calculation0:calculationMethod === 0?true:false,
calculation1:calculationMethod === 1?true:false,
calculation2:calculationMethod === 2?true:false,
riskName:riskName,
riskCode:riskCode,
seriNo:seriNo,
recipientsName:localStorage.getItem("recipientsName"),
recipientsSex:localStorage.getItem("recipientsSex")==='false'?false:true,
recipients:localStorage.getItem("recipients")==='false'?false:true,
selectd:selectd,
roleId:roleId,
thumbnail: thumbnail
})
if(seriNo){
this.setState({
initInsurance:false,
})
setTimeout(function () {
that.getMessage()
that.getProspectusaAditional(0)
},0)
}
}
componentDidMount() {
document.title= this.state.riskName
shareHide(false);
this.getPayMoney()
}
componentWillUnmount(){
document.title= ''
}
/* 获取附加险 */
getProspectusaAditional=(value)=>{
let age = this.getAge(this.state.insBirthday)
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
// "mainCode":localStorage.getItem("riskCode"),
"mainCode":that.state.riskCode,
"riskType":"1" //0:主险 1:附加险
},
callback(data){
let fjInsuranceList = [];
for (var i = 0; i < data.data.length; i++) {
if(age< data.data[i].maxAge+1){
fjInsuranceList.push({ value: i, label:data.data[i].riskName, riskCode:data.data[i].riskCode,fjcalculationMethod:data.data[i].calculationMethod})
}
}
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.onChange(arr[0].value, arr[0].label,arr[0].riskCode, arr[0].fjcalculationMethod);
}else{
that.setState({
insuranceValue:-1,
})
}
that.setState({
fjInsuranceList:fjInsuranceList,
modal1:value===0?false:true,
})
},
error(data){
this.showToast(data.message)
}
})
}
/* 获取条款列表 */
getProspectusaAditiona2=()=>{
let that = this;
this.props.dispatch({
type: 'planEditor/getProspectusaAditional',
payload: {
// "mainCode": localStorage.getItem("riskCode"),
"mainCode":that.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)
}
})
}
getMessage=()=>{
let that = this;
let riskName= localStorage.getItem("riskName")
// let riskName= localStorage.getItem("seriNo")
this.props.dispatch({
type:'home/getMyPlanMessage',
payload:{
"seriNo":this.state.seriNo,
// "seriNo":35,
"interestRate":"0.03"
},
callback(data){
let microPlanInfo = data.microPlanInfo
let microPlanFJInfo = data.microPlanFJInfo
let totalPrem = 0;
let mainTable = [
{
key:0,
0:microPlanInfo.riskName,
1:Number(microPlanInfo.amnt)||'-',
2:Number(microPlanInfo.prem)||'-',
3:microPlanInfo.payTimeName||'-',
}
]
totalPrem += Number(microPlanInfo.prem)
let fjTable = [];
let fjParam = [];
let fjRiskCodeList=[];
let fjInsuranceList=[];
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:microPlanFJInfo[i].payTimeName||'-',
})
fjInsuranceList.push({
value:microPlanFJInfo[i].riskCode == '111703'?0:1,
label:microPlanFJInfo[i].riskName,
riskCode:microPlanFJInfo[i].riskCode,
fjcalculationMethod:microPlanFJInfo[i].calculationMethod,
})
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,
})
totalPrem += Number(microPlanFJInfo[i].prem)
fjRiskCodeList.push(microPlanFJInfo[i].riskCode)
}
}
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,
//
appName: microPlanInfo.appName,
appSex: microPlanInfo.appSex==='M'?true:false,
appPhone: microPlanInfo.appPhone,
appBirthday: microPlanInfo.appBirthday,
// mainTable:'',
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, //主险集合
mainInsurance:true,
initInsurance:false,
fjTable:fjTable, //附加险集合
mainRiskCode:data.microPlanInfo.riskCode, //主险riskCode
fjRiskCodeList:fjRiskCodeList,
})
},
error(data){
this.showToast(data.message)
}
})
}
showModal = (key,index,item) => (e) => {
if(key == 'modal2'){
this.getPayMoney()
}else if(key == 'modal3'){
this.onChange(item.value,item.label,item.riskCode,item.fjcalculationMethod)
this.getPayMoney1(index,key)
}
e.preventDefault(); // 修复 Android 上点击穿透
this.setState({
[key]: true,
});
}
hideModalConfirm=(v)=>{
this.setState({
visible:false,
})
}
hideModalSubmit = (v)=> {
this.setState({
visible: false,
})
}
onClose = key => (e) => {
e.preventDefault();
this.setState({
[key]: false,
});
}
buy = (key) => (e) => {
e.preventDefault();
this.setState({
[key]: false,
seriNo:this.state.seriNo,
});
// 买入 主险保险
this.payInsurance(this.state.buyFjList)
}
buy1 = (key,fj) => (e) => {
e.preventDefault();
this.setState({
[key]: false,
});
// 买入 附加险保险
this.payFjInsurance(fj)
}
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"),
"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 !=''?this.state.protectTime:this.state.microPlanInfo.protectTime //保险期间 ----
"protectTime":this.state.protectTime,
},
"additionalMicroPlan":fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
Toast.hide()
if(that.state.saveMain===true){
that.setState({
mainInsurance:false,
initInsurance:false,
seriNo:data.data.seriNo,
saveMain:false
})
}else{
that.setState({
mainInsurance:false,
initInsurance:false,
seriNo:data.data.seriNo,
})
}
that.getMessage();
},
error(data){
that.getMessage()
that.showToast(data.message)
}
})
}
payFjInsurance=(fj)=>{
let riskCode = localStorage.getItem("riskCode")
let seriNo = localStorage.getItem("seriNo")
let that = this;
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id"),
"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 //保险期间 ----
},
"additionalMicroPlan": fj,
"isSecurity":this.state.social==='有'?0:1 //是否有社保0:有,1:无
},
callback(data){
let buyFjList = that.state.buyFjList;
let fjInsuranceList = that.state.fjInsuranceList;
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 = localStorage.getItem("riskCode")
// let seriNo = localStorage.getItem("seriNo")
let riskCode = this.state.riskCode;
let that = this;
this.setState({
// mainInsurance:false,
})
this.props.dispatch({
type:'planEditor/payInsurance',
payload:{
"cusManager":localStorage.getItem("id"), //客户经理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 //保险期间 ----
},
"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,
initInsurance:true,
buyFjList:[]
})
that.showToast(data.message)
}
})
}
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)
}
}
}
}
handleChange = (e)=>{
this.setState({
selectValue:e.target.value
})
}
setInput = (e)=>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
inputValue1 :value
})
}
setInput1 = (e)=>{
let value = e.target.value
value = value.substring(0,10)
this.setState({
inputValue :value
})
}
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
})
}
editer =(key) =>(e)=>{
e.preventDefault();
// this.setState({
// [key]:true,
// })
}
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;
if(deleteType== 1){
//附加险删除
for (var i = 0; i < buyFjList.length; i++) {
if(buyFjList[i].riskCode == riskCode){
buyFjList.splice(i,1)
let fjInsuranceList = that.state.fjInsuranceList;
fjInsuranceList.splice(i,1)
that.setState({
fjInsuranceList
})
}else{
that.setState({
insuranceValue:buyFjList[i].value,
insuranceLabel:buyFjList[i].label,
})
}
}
that.setState({
buyFjList:buyFjList
})
}
that.setState({
totalPrem:0,
saveMain:false,
editorNum:that.state.editorNum+1,
})
if(deleteType ==0){
that.setState({
initInsurance:true,
mainInsurance:false,
seriNo:'',
buyFjList:[],
fjInsuranceList:[],
// insuranceValue:0,
// insuranceLabel:that.state.fjInsuranceList[0].riskName,
});
let storage = window.localStorage;
storage.setItem("seriNo",'')
}else{
that.getMessage()
}
},
error(data){
that.showToast(data.message)
}
})
}
addInsurance =key => (e)=>{
this.setState({
[key]: true,
});
};
onChange = (value,label,riskCode,calculationMethod) => {
this.setState({
insuranceValue:value,
insuranceLabel:label,
fjRiskCode:riskCode,
fjRiskName:label,
fjcalculationMethod:calculationMethod
});
};
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'),
"name":this.state.appName||'',
"sex": this.state.appSex == true ? '0' : '1',
"age":this.state.appBirthday||"",
},
callback(data){
that.setState({
isShowTips:false,
})
that.goCover()
}
})
}
}
goCover = ()=>{
// let seriNo = localStorage.getItem("seriNo")
// let riskName = localStorage.getItem("riskName")
// let riskCode = localStorage.getItem("riskCode")
// let thumbnail = localStorage.getItem("thumbnail")
let seriNo = this.state.seriNo;
let riskName = this.state.riskName;
let riskCode = this.state.riskCode;
let thumbnail = this.state.thumbnail;
window.location.href = window.location.href.split('#')[0]+'#/planResult?seriNo='+seriNo+'&riskName='+riskName +'&riskCode='+riskCode+'&thumbnail='+thumbnail
}
closeInsurance = ()=>{
this.setState({
modal1: false,
modal3: false,
insurance1:true,
});
}
/*附加险 缴费期间,*/
getPayMoney1=(index,key)=>{
let that = this;
this.props.dispatch({
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.fjRiskCodeList[index] ?this.state.fjRiskCodeList[index]: this.state.fjRiskCode,
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1
},
callback(data){
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){
that.setState({
addProtectTime:result[0].protectTime, //保险期间后端传值
addInsuranceDuration:result[0].label, //保险期间
})
}
if(paymentList.length>0){
that.setState({
addCoverage:that.state.addCoverage?that.state.addCoverage:paymentList[paymentList.length-1].label, //缴费期间
addPayTime :that.state.addPayTime?that.state.addPayTime:paymentList[paymentList.length-1].payTime,
minPrem:paymentList[paymentList.length-1].minPrem,
})
}
that.setState({
paymentList:paymentList,
insuranceDurationList:result
})
},
error(data){
this.showToast(data.message)
}
})
}
/* 获取保额,保费列表*/
getPayMoney=()=>{
let that = this;
this.props.dispatch({
type:'addUser/PremiumPaymentPeriod',
payload:{
"riskCode":this.state.riskCode,
"maxAge":"",
"birthday":this.state.insBirthday,
"pageNo":1
},
callback(data){
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,
})
if(result.length>0){
that.setState({
protectTime:result[0].protectTime, //保险期间后端传值
insuranceDuration:result[0].label, //保险期间
})
}
if(paymentList.length>0){
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,
minPrem:paymentList[paymentList.length-1].minPrem,
}) }
},
error(data){
this.showToast(data.message)
}
})
}
change= ( value )=>{
this.setState({
selectCoverage:value,
})
}
render() {
let {fjRiskCodeList,insSex,appSex,paymentList,recipients,mainInsuranceTable} = this.state
const value = this.state;
let microPlanInfo = this.state.microPlanInfo;
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,
})
// if(this.state.mainInsurance){
// if(this.state.selectd == 1){
// // 投保人姓名
// this.getInsurance(0,0,e.target.value)
// }else {
// //被保人姓名
// this.getInsurance(0,0,0,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.props.location.query.riskName}*/}
{this.state.riskName}
</div>
<div className={styles.right}>
<img src={require('../../assets/image/editor.png')} alt="" className={styles.editor} onClick={ this.showModal('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'}}>首年保费 {this.state.mainInsuranceTable[0][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('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.fjInsuranceList[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'}}>
<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>
{/*<Date onRef = {(ref)=>{
this.child = ref;
}} handleDate = {this.handleDate} >
</Date>
<Date onRef = {(ref)=>{
this.child1 = ref;
}} handleDate = {this.handleDate1} >
</Date>*/}
{/*底部首年保费*/}
{/*<Table></Table>*/}
<div className={styles.bottom}>
<div className={styles.left}>
<p onClick={() =>
{
}
}>首年保费</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;
storage.setItem("recipientsName",this.state.recipientsName)
storage.setItem("recipientsSex",this.state.recipientsSex)
storage.setItem("recipients",this.state.recipients)
storage.setItem("seriNo",this.state.seriNo)
storage.setItem("selectd",this.state.selectd)
// // 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 that = this;
if(this.state.roleId == 3){
this.goCover()
}
else if(this.state.appPhone){
this.props.dispatch({
type: 'addUser/isFollow',
payload: {
"number":this.state.appPhone,
},
callback(data){
if(data.length){
// return false;
// 有数据生成计划,
that.goCover();
}else{
//提示是否添加到跟进中,
that.setState({
comfirm:0, //跟进中
isShowTips:true,
})
}
}
})
}
else{
this.goCover()
}
}else{
this.showToast('请先选择险种信息!')
}
// this.goCover()
}}>生成计划书</span>
</div>
</div>
<WingBlank>
<WhiteSpace />
<Modal
popup
visible={this.state.modal2}
onClose={this.onClose('modal2')}
animationType="slide-up"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
backgroundColor:'white',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<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'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<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 && this.state.coverage.length ==1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
{this.state.coverage}
</div>
</List.Item>}
{/*多个值*/}
{this.state.paymentList && this.state.coverage.length>1 && <List.Item>缴费期间
<div style={{float:'right',position:'relative'}} >
<Picker
data={this.state.paymentList}
cols={1}
onChange={
v => {
let paymentList = this.state.paymentList;
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
coverage:paymentList[i].label,
payTime:paymentList[i].payTime,
minAmnt:paymentList[i].minAmnt,
minPrem:paymentList[i].minPrem,
})
}
}
}
}
>
<div className={styles.choose} ><span>{this.state.coverage!=='' ? this.state.coverage : '3年缴'}</span></div>
</Picker>
</div>
</List.Item>}
{
this.state.calculationMethod == 0 && <List.Item >保额
<div style={{float:'right'}}>
<input style={{width:'1.5rem',border:'1px solid #ddd',paddingLeft:'.1rem',height:'.3rem',fontSize:'.15rem'}}
placeholder={'最低保额'+this.state.minAmnt}
id="pp" type="number" pattern="[0-9]*" name="password" onBlur={::this.blur} value={this.state.inputValue} onChange={this.setInput1}/>
</div>
</List.Item>
}
{this.state.calculationMethod == 1 && <List.Item >保费
<div style={{float:'right',}}>
<input className={styles.input} style={{width:'1.5rem',border:'1px solid #f0f0f1',paddingLeft:'.1rem',height:'.3rem',fontSize:'.15rem',borderRadius:'4px'}}
placeholder={'最低保费'+ this.state.minPrem}
value={ this.state.inputValue1}
id="pp" type="number" pattern="[0-9]*" name="password" onBlur={::this.blur} onChange={this.setInput}/>
{/* <InputItem
className={styles.e_phoneNum}
type='number'
placeholder="最低为10000元"
// error={this.state.hasError}
// onErrorClick={this.onErrorClick}
// onChange={this.onChange}
// value={this.state.value}
/>*/}
</div>
</List.Item>
}
{
this.state.calculationMethod == 2 && <List.Item >份数
<div style={{float:'right'}}>
<div style={{width:'1.5rem', fontSize: '.15rem', color:'#000',textIndent:'.1rem'}}> 1</div>
</div>
</List.Item>
}
<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"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>添加主/附加险 <span style={{float:'right',}} onClick={
()=>{
// this.setState({
// modal1:false,
// modal3:true,
// })
// this.getPayMoney1()
}
}>
<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) => {
return(
<RadioItem key={i.value}
checked={this.state.insuranceValue===i.value}
//fjRiskCodeList.indexOf(i.riskCode)>-1?false:true
//this.state.insuranceValue == i.value
disabled={fjRiskCodeList.indexOf(i.riskCode)>-1?true:false}
onChange={() => this.onChange(i.value,i.label,i.riskCode,i.fjcalculationMethod)}>
{i.label}
</RadioItem>
)
})}
{}
</List>
<List.Item>
<Button onClick={()=>{
if(this.state.fjRiskCodeList.length==this.state.fjInsuranceList.length){
}else{
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"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<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'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<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'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<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'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}/>*/}
<Picker
data={[{value:'0',label:5000},{value:'1',label:10000},{value:'2',label:15000},{value:'3',label:20000}]}
cols={1}
onChange={
v => {
let paymentList = [{value:'0',label:5000},{value:'1',label:10000},{value:'2',label:15000},{value:'3',label:20000}];
for (var i = 0; i < paymentList.length; i++) {
if(i == v){
this.setState({
fjAmount:paymentList[i].label
})
}
}
}
}
>
<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.minAmnt}
onBlur={::this.blur}
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.minPrem}
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.insuranceValue == 0 && <List.Item>有无社保
<div style={{float:'right',position:'relative'}} >
{/*<Select list={this.state.coverageList} changeValue={this.change}></Select>*/}
<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:paymentList[i].label,
})
}
}
}
}
>
<div className={styles.choose} ><span>{this.state.social !=='' ? this.state.social : '请选择'}</span></div>
</Picker>
</div>
</List.Item>
}
<List.Item>
<Button onClick={()=>{
let buyFjList = this.state.buyFjList;
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,
})
// this.buy1('modal3', buyFjList)
this.payFjInsurance(buyFjList)
this.setState({
modal3:false,
buyFjList: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"
// afterClose={() => { alert('afterClose'); }}
style={{position: 'fixed',
marginLeft: '-2.07rem',
left: '50%',
width: '4.14rem',
maxWidth: '680px',
maxHeight:'6rem',
overflowY:'scroll'
}}
>
<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,
// riskCode:item.configCode,
})
/* 条款列表详情接口 */
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>
<span style={{color:'#888',fontSize:'.14rem' }}>条款预览</span>
<span className={styles.deta} onClick={()=>{
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>
<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',
maxHeight:'6rem',
}}
>
<List renderHeader={() => <div style={{fontSize:'.18rem',color:'#000'}}>hauxia<span style={{float:'right',}} onClick={this.closeInsurance}>
<img src={require('../../assets/image/close.png')} alt="" style={{width:'.14rem',height:'.14rem'}} onClick={this.onClose('modal5')}/>
</span></div>} className="popup-list">
</List>
<List>
<List.Item style={{left:'.1rem'}} >
{this.state.text}
</List.Item>
</List>
</Modal>
</WingBlank>
<LocalizedModal visible={this.state.visible} hideModal={this.hideModalConfirm} onClick={this.state.submit} message={this.state.message}
/>
<DatePicker onRef = {(ref)=>{
this.child = ref;
}} getDate = {(date)=>{
this.getDate(date)
}} >
</DatePicker>
<DatePicker onRef = {(ref)=>{
this.child1 = ref;
}} getDate = {(date)=>{
this.getDate1(date)
}}>
</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(({home})=>({home}))(AddPlanEditor)
......@@ -70,17 +70,12 @@ body{
}
.life>p{
/* color: #FF9D5C;
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;
margin-left: -.25rem;
}
.insureMessage{
......@@ -238,18 +233,6 @@ body{
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;
}
/* 保单利益*/
......@@ -291,9 +274,9 @@ body{
}
/** { touch-action: pan-y; }*/
span{float: none}
/*:global(.am-list-item){
:global(.am-list-item){
padding-left: 0;
}*/
}
.list{
padding-left: .11rem;
/* margin-left: .2rem; */
......@@ -342,25 +325,16 @@ span{float: none}
background: #FFF7F1;
}
.welcome p.btn {
left: 50%;
bottom: 66px;
width: 1rem;
height: 1rem;
margin-left: -.43rem;
margin-bottom: 0;
text-align: center;
.welcome p.p {
text-align: center;
position: absolute;
top: 50%;
color: #FF9D5C;
font-size: .2rem;
left:0; width: 100%;
line-height: .26rem;
margin-top: 2rem;
}
.welcome p span {
display: block;
}
......@@ -399,14 +373,3 @@ span{float: none}
.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
}
This diff could not be displayed because it is too large.
......@@ -2,8 +2,6 @@ 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';
......@@ -14,31 +12,20 @@ class Poster extends Component {
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('鸡汤');
}
this.filter('鸡汤');
}
componentWillUnmount(){
document.title = ''
}
filter(type) {
Toast.loading('loading...',0)
const _this = this;
this.props.dispatch({
type: 'poster/getPosterList',
......@@ -48,16 +35,13 @@ class Poster extends Component {
agentCode2: window.localStorage.getItem('project')
},
callback(res) {
Toast.hide();
if (typeof res.data === 'object') {
_this.setState({
posterList: res.data,
loadingFlag:false
posterList: res.data
})
} else {
_this.setState({
posterList: [],
loadingFlag:false
posterList: []
})
}
}
......@@ -66,14 +50,15 @@ class Poster extends Component {
render() {
let selIdx = 0;
if(sessionStorage.getItem("key")){
selIdx = Number(sessionStorage.getItem("key"))
}
const { posterList } = this.state;
if(this.state.loadingFlag){
return <div></div>
const roleId = window.localStorage.getItem('roleId');
let position = '';
switch (roleId) {
case '2':
position = '客户经理';
break;
default:
position = '督训';
}
return (
<div className={styles.wrapper}>
......@@ -81,12 +66,11 @@ class Poster extends Component {
<div className={styles.splitline}></div><ul className={styles.tags}>
{
this.state.filterType.map((el, i) => {
return <li className={selIdx ===i?'on':''} key={i} onClick={() => {
return <li className={this.state.selIdx===i?'on':''} key={i} onClick={() => {
this.filter(el);
this.setState({
selIdx:i
})
sessionStorage.setItem( "key", i);
}}>{el}</li>
})
}
......@@ -94,17 +78,14 @@ class Poster extends Component {
<ul className={styles.pList}>
{
posterList.length>0 ? posterList.map((el, i) => {
posterList.map((el, i) => {
return <li key={i}>
<Link to={{
pathname: "/poster/info",
state: {
id: el.reportCode,
reportImage: el.reportImage
}
search: '?imgpath=' + el.reportImage + '&position=' + position + '&name=' + window.localStorage.getItem('name') + '&phone=' + window.localStorage.getItem('number'),
}}><img alt="" src={el.reportImage} /></Link>
</li>
}): <NoData />
})
}
</ul>
</div>
......
import React,{ Component, Fragment } from 'react';
import { connect } from "dva";
import React,{ Component } from 'react';
import html2canvas from 'html2canvas';
import share from '../../utils/share';
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
info: {}
}
}
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);
}
});
shareHide(false);
html2canvas(this.poster).then(function (canvas) {
var image = new Image();
image.src = canvas.toDataURL("image/png");
posterImgWrap.appendChild(image);
});
let info = {};
if (this.props.location.search !== '') {
const {
search
} = this.props.location;
const matchs = decodeURI(search).match(/imgpath=(.*)&position=(.*)&name=(.*)&phone=(.*)/i);
info.img = matchs[1];
info.position = matchs[2];
info.name = matchs[3];
info.phone = matchs[4];
}
// 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);
share({
decodeUrl: window.location.href.split('#')[0],
title: '我是'+info.name + ',您身边的保险管家',
desc: '用我的专业为万千家庭带来保障',
shareUrl: window.location.href,
thumbnail: info.img
});
this.setState({
info
});
}
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 className={styles.poster} ref={el => this.poster = el}>
<img src={info.img} alt="" />
<ul className={styles.info}>
<li>{info.position}</li>
<li>{info.name}</li>
<li>{info.phone}</li>
</ul>
<div className={styles.posterImg} ref={el=>this.posterImgWrap=el}></div>
</div>
<div className={styles.post_tips}>{info && '长按保存图片或发送给朋友'}</div>
{/* <ul className={styles.operation}>
<li className={styles.msg}>消息</li>
<li className={styles.moments}>朋友圈</li>
<li className={styles.download}>下载</li>
</ul> */}
</div>
);
)
}
}
export default connect(({ poster }) => ({ poster }))(PosterInfo);
export default PosterInfo;
......@@ -7,7 +7,7 @@ body{
margin:0; padding:0;
}
:global(.am-tabs-default-bar-tab){
font-size: .17rem;
font-size: .17rem;
color:#ABABAB;
}
:global(.am-tabs-default-bar-tab-active){
......@@ -50,7 +50,7 @@ body{
flex-wrap: wrap;
padding-left:.06rem;
margin-top: .05rem;
li{
li{
width: 1.24rem;
height: 2.24rem;
background: pink;
......@@ -65,7 +65,7 @@ body{
margin-top: .1rem;
background: white;
dl{
display: flex;
display: flex;
padding-top: .1rem;
dt{
width: .8rem; height: .8rem;
......@@ -74,7 +74,7 @@ body{
margin-left: .1rem;
}
dd{
padding-left: .14rem;
padding-left: .14rem;
width: 3.1rem;
.tit{
color:#333;
......@@ -135,106 +135,34 @@ body{
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;
}
justify-content: space-between;
.poster{
position: relative;
width: 3.26rem;
height: 5.8rem;
margin: 0 auto;
font-variant: small-caps;
width: 3.54rem;
height: 6.4rem;
margin: .2rem auto;
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;
padding: .13rem 0 .12rem .2rem;
box-sizing: border-box;
&:before{
position: absolute; left:0; top:0;
width:100%; height: 100%; background:#000;
opacity: .4; z-index: 1;
opacity: .4; content:''; 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;
}
}
li{
position: relative; z-index: 4;
color:rgb(236, 232, 232);
font-size: .18rem;
line-height: .25rem;
}
}
.posterImg {
......@@ -245,10 +173,6 @@ body{
z-index: 6;
}
}
.post_tips {
color:#999; font-size: .14rem; text-align: center;
line-height: .26rem;
}
.operation{
height: 1.27rem;
width: 100%;
......@@ -284,22 +208,4 @@ body{
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
......@@ -3,7 +3,6 @@ import { connect } from 'dva'
import shareHide from "../../utils/shareHide";
import Tabs from "../../components/Tabs"
import {Toast} from "antd-mobile"
......@@ -15,7 +14,6 @@ class ProspectusList extends Component {
tab:['所有','我的'],
allPlanList:[],
myPlanList:[],
loadingFlag:true
}
}
......@@ -29,9 +27,9 @@ class ProspectusList extends Component {
pageNo:"0"
},
callback(data){
// data.sort((a,b)=>{
// return Date.parse(b.createTime) - Date.parse(a.createTime)
// })
data.sort((a,b)=>{
return Date.parse(b.createTime) - Date.parse(a.createTime)
})
that.setState({
myPlanList:data
})
......@@ -46,28 +44,19 @@ class ProspectusList extends Component {
payload:{
riskName:"",
riskStatus:1, //1 启用
"proId":localStorage.getItem("project"),
"project":localStorage.getItem("project"),
"website":localStorage.getItem("website"),
"orgId":localStorage.getItem("orgId"),
},
callback(data){
Toast.hide();
console.log(data);
that.setState({
allPlanList:data,
loadingFlag:false
allPlanList:data
})
},
})
}
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;
/* 计划书接口 */
......@@ -81,17 +70,10 @@ class ProspectusList extends Component {
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}}/>
<Tabs title={this.state.tab} allPlanList = {this.state.allPlanList} myPlanList = {this.state.myPlanList} getMyPlan={this.getMyPlan} style={{paddingTop:0}}/>
</div>
)
}
......
......@@ -6,9 +6,7 @@ body{
.welcome{
width: 4.14rem;
height: 100%;
background: url('../../assets/image/welcome.png') no-repeat center center/100%;
background-size: contain;
background-color: white;
background: url('../../assets/image/welcome.png')no-repeat center center/100%;
}
/*
.welcome img{
......@@ -17,26 +15,3 @@ body{
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
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;
this.props.history.push('/home');
}
componentDidMount() {
document.title = '华夏O2O智慧工作平台';
shareHide();
setTimeout(this.go,2000)
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>}
{/*<img src={require('../../assets/image/welcome.png')} alt=""/>*/}
</div>
)
}
......
......@@ -7,12 +7,8 @@ span {
body{
background: white;
}
.modalWrap{
:global(.am-modal-content){
background: none;
}
:global(.am-modal-content){
background: none;
}
.splitline {
width: 100%;
......@@ -40,14 +36,14 @@ body{
box-sizing: border-box;
}
.btn_close {
position: absolute;
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;
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 {
......@@ -121,7 +117,7 @@ body{
}
}
.btn_submit {
width: 3.5rem; height: 1.16rem;
width: 3.5rem; height: 1.16rem;
background:url('../../assets/image/btn_submit.png') no-repeat; background-size: 100%;
margin: 0 auto;
}
......@@ -140,7 +136,7 @@ body{
height: 100%;
background: white;
.listWrap{
position: relative;
position: relative;
height: 100%;
.indexList{
position: absolute;
......@@ -157,9 +153,9 @@ body{
.search{
padding: .1rem .17rem;
padding-bottom:0;
input {
input {
box-sizing: border-box;
width: 100%; border: none;
width: 100%; border: none;
border-radius: .16rem;
background:#F4F4F4;
height: .32rem; line-height: .32rem;
......@@ -220,10 +216,10 @@ body{
border-top:1px solid #F8F8F8;
content:''; overflow: hidden;
}
.time{
.time{
margin-right: .3rem;
}
:global(.name){
position: relative;
padding-left: .3rem;
......@@ -242,7 +238,7 @@ body{
background: url('../../assets/image/icon_chosen.png') no-repeat;
background-size:100%;
}
}
}
dd:first-of-type {
......@@ -297,4 +293,4 @@ body{
margin-right: .11rem;
}
}
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ class ExpertVideo extends Component {
}
}
handleSubmit() {
}
render() {
const { show, handleClose, handleShowChoosePop,handleNoneClient } = this.props;
......@@ -23,19 +23,18 @@ class ExpertVideo extends Component {
<Modal
popup
animationType="slide-up"
wrapClassName={css.modalWrap}
visible={show}
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>
......
......@@ -23,9 +23,10 @@ export async function Dictionaries(params) {
}
/* 提交至督训*/
export async function sendMaster(params) {
return request('/o2o/wx/sendMaster', {
/* 缴费期间 ,保险期间*/
export async function PremiumPaymentPeriod(params) {
return request('/o2o/MicroPlan/getProspectusPeriod', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
......@@ -33,18 +34,20 @@ export async function sendMaster(params) {
}
/* 投保人手机号是否在跟进中 开始弃用2019-7-1 */
export async function isFollow(params) {
return request('/o2o/customer/getAllCustomer', {
/* 提交至督训*/
export async function sendMaster(params) {
return request('/o2o/wx/sendMaster', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
});
}
/* 投保人手机号是否在跟进中 */
export async function followCustomer(params) {
return request('/o2o/customer/followCustomer', {
export async function isFollow(params) {
return request('/o2o/customer/getAllCustomer', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
......
......@@ -35,9 +35,10 @@ export async function getMyPlan(params) {
}
/* 获取当前登录人的信息 */
export async function getCustomerInfo(params) {
return request('/o2o/customer/getLoginInfo', {
/* 我的计划书--获取被保人信息 */
export async function getMyPlanMessage(params) {
return request('/o2o/proposalInterest/getProposalInterestBySeriNo', {
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
......@@ -45,50 +46,16 @@ export async function getCustomerInfo(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', {
/* 获取当前登录人的信息 */
export async function getCustomerInfo(params) {
return request('/o2o/customer/getLoginInfo', {
method: 'post',
headers: headersPost,
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),
});
}
......@@ -24,5 +24,14 @@ export async function deleteCustomer(params) {
});
}
/*获取房间列表 */
export async function GetRoomList(params) {
return request('/o2o/weapp/webrtc_room/get_room_list', {
method: 'post',
headers: headersPost,
body: JSON.stringify(params),
});
}
......@@ -16,11 +16,3 @@ export async function performList(params) {
body: JSON.stringify(params),
})
}
//个人排行榜查询
export async function achievementRank(params) {
return request('/o2o/achievement/ranking',{
method: 'post',
headers:headersPost,
body: JSON.stringify(params),
})
}
......@@ -51,37 +51,3 @@ export async function deletePlan(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',
......@@ -10,15 +10,6 @@ export async function GetPosterList(params) {
});
}
/* 获取海报信息*/
export async function GetPosterInfo(params) {
return request("/o2o/report/getReportBaseById", {
method: "post",
headers: headersPost,
body: JSON.stringify(params)
});
}
var pinyin = require("chinese-to-pinyin");
var moment = require('moment');
/**
* 按拼音第一个字母排序
* @param {需要排序的数据表} arr
* @param {需要排序的数据表} arr
* 数据按name字段排序 (需注意)
*/
export function sortArr(arr, renderType) {
......@@ -36,7 +35,7 @@ export function sortArr(arr, renderType) {
result.splice(0, 1);
result.push(last_arr);
}
return result;
} else {
return []
......@@ -58,163 +57,7 @@ export function dataFilter(arr, renderType, keywords) {
}
}
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
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -22,20 +22,7 @@ function checkStatus(response) {
* @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)
return fetch(url, options)
.then(checkStatus)
.then(type === 'img' ? d => { return d.blob(); } : parseJSON )
.then(data => ({data}))
......
import $ from 'jquery';
import {setClickRecord} from '../services/home';
/**
* 分享
* @param {*} options
......@@ -14,7 +13,7 @@ import {setClickRecord} from '../services/home';
export default function share (options) {
$.ajax({
type: 'POST',
url: 'https://iwpuat.ihxlife.com/o2o/wx/cover',
url: 'https://zmt.ihxlife.com/o2o/wx/cover',
data: JSON.stringify({
shareGoal: options.decodeUrl
}),
......@@ -43,9 +42,6 @@ export default function share (options) {
imgUrl: options.thumbnail,
success: function (res) {
// console.log('分享成功')
if(options.record){
setClickRecord({...options.record});//记录转发
}
},
cancel: function (res) {
//alert('已取消');
......@@ -61,9 +57,6 @@ export default function share (options) {
imgUrl: options.thumbnail,
success: function (res) {
// console.log('分享成功')
if(options.record){
setClickRecord({...options.record});//记录分享
}
},
cancel: function (res) {
//alert('已取消');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!