Commit 96ae1e34 by Sweet Zhang

问卷项目增加自动评测渠道来源判断

parent 99b4a210
......@@ -196,6 +196,10 @@
</div>
<div class="closeIcon">X</div>
</div>
<!--在线客服-->
<!-- WPA start -->
<script id="qd285215237816e393627f08a355200b05ad5cdf0fda" src="https://wp.qiye.qq.com/qidian/2852152378/16e393627f08a355200b05ad5cdf0fda" charset="utf-8" async defer></script>
<!-- WPA end -->
<script src="https://res2.wx.qq.com/open/js/jweixin-1.4.0.js "></script>
<script src="./js/jquery.min.js"></script>
<script src="js/layer.js"></script>
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="JsFlowSettings">
<service-enabled>false</service-enabled>
<exe-path />
<annotation-enable>false</annotation-enable>
<other-services-enabled>false</other-services-enabled>
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
</expanded-state>
<selected-state>
<State>
<id>TypeScript</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/consulting.iml" filepath="$PROJECT_DIR$/.idea/consulting.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="Babel" />
</project>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<title>银盾年终感恩回馈 现金红包抽不停</title>
<link rel="stylesheet" href="./css/style.css"/>
<!--Shortcut icon-->
<link rel="shortcut icon" href="https://www.ydinsurance.cn/wp-content/uploads/2018/04/favicon.gif"/>
</head>
<body>
<!--头部-->
<section id="header">
<img src="./images/banner.jpg" alt="">
<h4>银盾保险送你一份2019民宿主人保障计划</h4>
</section>
<!--头部END-->
<!--手机号注册-->
<section id="registerContent">
<div class="inputGroup">
<input type="tel" placeholder="请输入手机号码" maxlength="11" id="loginPhone">
<div class="verifyCode">
<input type="tel" placeholder="请输入短信验证码" maxlength="4" id="code">
<button id="loginCodeBtn">获取验证码</button>
</div>
</div>
<div class="registerBtn">
<button id="register">立即体验</button>
</div>
</section>
<!--手机号注册END-->
<!--银盾介绍-->
<section id="ydintroContent">
<h4>银盾保险-用户信赖选择</h4>
<ul>
<li>
<div>安心</div>
<div>优选和定制保险产品</div>
</li>
<li>
<div>创新</div>
<div>创新技术和新的渠道模式</div>
</li>
<li>
<div>专业</div>
<div>提供综合风险咨询和服务</div>
</li>
</ul>
</section>
<!--银盾介绍END-->
<!--民宿无忧保介绍-->
<section id="productIntroContent">
<h4>民宿无忧保-专为民宿主人量身打造</h4>
<div>
<img src="https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/12/381-383/381-383_1.jpg"
alt="民宿无忧保-银盾保险">
</div>
</section>
<!--民宿无忧保介绍END-->
<!--注册成功-->
<div id="registerModal">
<div class="registerContent">
<div class="iconBox">
<svg t="1573107665177" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="2053" width="80" height="80">
<path d="M822.811993 824.617989c-83.075838 81.99224-188.546032 124.613757-316.049383 127.86455-122.085362-3.250794-223.943563-45.87231-305.935802-127.86455s-124.613757-184.21164-127.86455-305.935802c3.250794-127.503351 45.87231-232.973545 127.86455-316.049383 81.99224-83.075838 184.21164-126.058554 305.935802-129.309347 127.503351 3.250794 232.973545 46.23351 316.049383 129.309347 83.075838 83.075838 126.058554 188.546032 129.309347 316.049383C949.231746 640.406349 905.887831 742.62575 822.811993 824.617989zM432.716755 684.111464c3.973192 3.973192 8.307584 5.779189 13.364374 6.140388 5.05679 0.361199 9.752381-1.444797 13.364374-5.417989l292.571429-287.514638c3.973192-3.973192 5.779189-8.307584 5.779189-13.364374 0-5.05679-1.805996-9.752381-5.779189-13.364374l1.805996 1.805996c-3.973192-3.973192-8.668783-5.779189-14.086772-6.140388-5.417989-0.361199-10.47478 1.444797-14.809171 5.417989l-264.397884 220.33157c-3.973192 3.250794-8.668783 4.695591-14.447972 4.695591-5.779189 0-10.835979-1.444797-15.53157-3.973192l-94.273016-72.962257c-4.334392-3.250794-9.391182-4.334392-14.447972-3.973192s-9.391182 3.250794-12.641975 7.585185l-2.889594 3.973192c-3.250794 4.334392-4.334392 9.391182-3.973192 14.809171 0.722399 5.417989 2.528395 10.11358 5.779189 14.086772L432.716755 684.111464z"
p-id="2054" fill="#07c160"></path>
</svg>
</div>
<h3>登录成功</h3>
<div style="margin:20px 0;font-weight: bold">银盾保险 赢家后盾</div>
<div class="goBuy">购买即可立即抽奖</div>
</div>
<div class="closeIcon">X</div>
</div>
<!--注册成功END-->
<script src="https://res2.wx.qq.com/open/js/jweixin-1.4.0.js "></script>
<script src="./js/jquery.min.js"></script>
<script src="js/layer.js"></script>
<script src="js/base.js"></script>
<script>
var _hmt = _hmt || [];
(function () {
const host = window.location.host;
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?36b1eb7eec3b5dac9f97d887092b5b27";
if (host == 'www.ydinsurance.cn') {
hm.src = "https://hm.baidu.com/hm.js?73a2215476525c6142927963135662e0";
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
\ No newline at end of file
/*! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+"</h3>":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span yes type="1">'+c.btn[0]+"</span>",2===b&&(a='<span no type="0">'+c.btn[1]+"</span>"+a),'<div class="layui-m-layerbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(c.content||"")+"</p>"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(c.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(c.skin?"layui-m-layer-"+c.skin+" ":"")+(c.className?c.className:"")+" "+(c.anim?"layui-m-anim-"+c.anim:"")+'" '+(c.style?'style="'+c.style+'"':"")+">"+g+'<div class="layui-m-layercont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i++)g.touch(f[i],e);if(a.shade&&a.shadeClose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastIndexOf("/")+1);c.getAttribute("merge")||document.head.appendChild(function(){var a=b.createElement("link");return a.href=e+"need/layer.css?2.0",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}())}()}(window);
\ No newline at end of file
.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}
\ No newline at end of file
......@@ -14,7 +14,9 @@ export class AppComponent implements OnInit {
ngOnInit() {
const customerId = this.commonService.getQueryString('customerId');
const orderId = this.commonService.getQueryString('orderId');
const questionnaireSource = this.commonService.getQueryString('questionnaireSource');
sessionStorage.setItem('customerId', customerId);
sessionStorage.setItem('orderId', orderId);
sessionStorage.setItem('questionnaireSource', questionnaireSource);
}
}
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
import { FormsModule } from '@angular/forms';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
......@@ -46,6 +47,7 @@ import { SpecialMmhComponent } from './special-mmh/special-mmh.component'
],
imports: [
BrowserModule,
FormsModule,
AppRoutingModule
, HttpClientModule
],
......
......@@ -133,6 +133,52 @@ export class CommonService {
}
/**
* 获取验证码
* @param verticalCode
* @returns {Observable<A>}
*/
async verificationCode(verticalCode) {
const url = this.USER_API_URL + '/verificationCode';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http
.post(url, JSON.stringify(verticalCode), this.httpOptions).toPromise().then(response => {
return response;
});
}
/**
* 验证验证码
* @param compareCode
* @returns {Observable<A>}
*/
async compare(compareCode) {
const url = this.USER_API_URL + '/checkVerificationCode';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http
.post(url, JSON.stringify(compareCode), this.httpOptions).toPromise().then(response => {
return response;
});
}
/**
* 登录
* @param login
* @returns {Observable<A>}
*/
async login(mobileNo) {
const url = this.USER_API_URL + '/login';
const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http
.post(url, JSON.stringify(mobileNo), this.httpOptions).toPromise().then(response => {
return response;
});
}
/**
* 删除所有答案
* @returns {Array<any>}
*/
......
.loginInBox, .autoEvaluationContainer {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
margin: 0 auto;
background: rgba(0, 0, 0, 0.8);
z-index: 99;
overflow: hidden;
min-width: 320px;
max-width: 640px;
}
.loginInBox .closeBtn {
position: relative;
top: 25%;
width: 40px;
font-size: 32px;
color: #fff;
border: 1px solid #fff;
border-radius: 50%;
height: 40px;
line-height: 40px;
text-align: center;
left: 50%;
margin-left: -15px;
}
.inputBox, .autoEvaluationContent {
width: 90%;
margin: 0 auto;
position: relative;
top: 18%;
background: #fff;
padding: 20px 10px;
}
.inputControl {
width: 90%;
height: 42px;
border-bottom: 1px solid #dcdcdc;
font-size: 13px;
position: relative;
display: flex;
margin: 5% auto 10%;
}
.inputControl input {
font-size: 16px;
color: #757575;
margin-left: 5%;
padding: 3px 0;
border: none;
}
.inputControl input:focus, button {
border: none;
outline: none;
}
.inputControl input#phone {
width: 58%;
}
.autoGet {
width: 40%;
height: 42px;
position: absolute;
right: 0px;
top: 0px;
}
.getPhoneNumber, #loginIn {
width: 100%;
height: 42px;
color: #125894;
font-size: 16px;
border: none;
background: transparent;
}
#loginIn {
background: #ec2d37;
color: #fff;
border-radius: 3px;
font-size: 18px;
}
.closeModal {
position: absolute;
right: 5px;
top: 5px;
color: #fff;
border: 2px solid #fff;
border-radius: 50%;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
cursor: pointer;
font-size: 22px;
}
.autoEvaluationContent {
border-radius: 6px;
padding: 30px 20px;
}
.autoEvaluationContent > div {
text-align: center;
margin-top: 30px;
}
.autoEvaluationContent button {
width: 90%;
height: 42px;
line-height: 42px;
text-align: center;
background: #ec2d37;
font-size: 18px;
color: #fff;
border-radius: 3px;
}
......@@ -6,7 +6,7 @@
</div>
<ul class="cityContent">
<li *ngFor="let provinces of this.provinceList" [ngClass]="{ selected: provinces['selected'] == true }"
(click)="showToast(); selectProvince(provinces)">
(click)="showToast(); selectProvince(provinces)">
{{ provinces.provinceAbbr }}
</li>
</ul>
......@@ -17,7 +17,7 @@
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
</div>
<div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast();">
......@@ -36,5 +36,42 @@
</div>
<!--提示框-->
<div id="errTips" *ngIf="this.tipsFlag">
提交失败请稍后再试
</div>
\ No newline at end of file
{{tipsHtml}}
</div>
<!--登录查看结果START-->
<div class="loginInBox" *ngIf="loginModalFlag">
<div class='inputBox'>
<!--获取手机号 -->
<div class="mobileNoSection inputControl">
<input type='tel' maxlength="11" name="mobileNo" placeholder="您的手机号" [(ngModel)]="loginData.mobileNo"/>
<div class='autoGet'>
<button class='getPhoneNumber' (click)="sendCode()" [disabled]="sendBtnFlag">
{{timeHtml}}
</button>
</div>
</div>
<!--获取验证码 -->
<div class="codeSection inputControl">
<input type='tel' maxlength="4" name="code" placeholder="短信验证码" [(ngModel)]="loginData.code" />
</div>
<!--姓名-->
<div class="inputControl">
<input type="text" name="name" placeholder="您的姓名">
</div>
<!--登录 -->
<div style="text-align: center;">
<button class='commonBtn' id="loginIn" (click)="loginIn()">获取结果</button>
</div>
</div>
<div class="closeBtn" (click)="loginModalFlag=false">X</div>
</div>
<!--登录查看结果END-->
<!--无法自动评测提示窗口START-->
<div class="autoEvaluationContainer" *ngIf="autoEvaluationModal">
<div class="autoEvaluationContent">
<p>您的家庭情况暂时无法进行自动评测,请购买獴哥一对一服务进行人工咨询。</p>
<div><button (click)="confirm()">确认</button></div>
</div>
</div>
<!--无法自动评测提示窗口END-->
import { Component, OnInit } from '@angular/core';
import { CommonService } from '../common.service'
import { ActivatedRoute, Router } from "@angular/router";
import {Component, OnInit} from '@angular/core';
import {CommonService} from '../common.service'
import {ActivatedRoute, Router} from "@angular/router";
@Component({
selector: 'app-live',
......@@ -25,18 +25,34 @@ export class LiveComponent implements OnInit {
nextBtn: boolean;
lastQuestions: Array<any>;
tipsFlag: boolean;
loginModalFlag: boolean;
timeHtml: string = '获取验证码';
loginData: any;
tipsHtml: any;
timeCount: number = 60;
timer: any;
sendBtnFlag: boolean;
// 是否有疾病
isDisease: boolean = true;
// 不能进行自动评测
autoEvaluationModal: boolean;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
private router: Router,
private route: ActivatedRoute) {
this.type = this.route.snapshot.queryParams['type'];
this.pageAnswers = {
pageId: '',
questions: [{
questionId: '',
questionName: '',
options: [{ optionId: '', optionName: '', optionOrder: '', selected: '' }]
options: [{optionId: '', optionName: '', optionOrder: '', selected: ''}]
}],
};
this.loginData = {
mobileNo: null,
code: null
};
}
ngOnInit() {
......@@ -45,7 +61,7 @@ export class LiveComponent implements OnInit {
this.tipsFlag = false;
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 16).pop();
// 获取省份
this.commonService.provinceqry({ insurerId: 11 }).then(res => {
this.commonService.provinceqry({insurerId: 11}).then(res => {
if (res['success']) {
this.provinceList = res['data'].provinceList;
}
......@@ -155,11 +171,19 @@ export class LiveComponent implements OnInit {
pages: this.commonService.todosCopy
}
};
// questionnaireSource 为 1 表示 自动评测
if (sessionStorage.getItem('questionnaireSource') === '1') {
if (!param || !param.survey.customerId || param.survey.customerId === 'null' || param.survey.customerId === 'undefined') {
this.loginModalFlag = true;
return;
}
}
this.commonService.saveCustomerAnwers(param).then(res => {
if (res['success']) {
this.router.navigate(['/transit3']);
} else {
this.tipsFlag = true;
this.errorModal('提交失败,请稍后重试');
setTimeout(() => {
this.tipsFlag = false;
}, 2000)
......@@ -175,4 +199,112 @@ export class LiveComponent implements OnInit {
before() {
this.commonService.before();
}
// 获取验证码
sendCode() {
if (this.sendBtnFlag) {
return;
}
const MOBILE_REGEXP = /^(1)\d{10}$/;
if (!this.loginData.mobileNo || (this.loginData.mobileNo && !MOBILE_REGEXP.test(this.loginData.mobileNo))) {
this.errorModal('手机号码输入有误');
return;
} else if (this.loginData.mobileNo) {
this.commonService.verificationCode({mobileNo: this.loginData.mobileNo, type: '1'}).then(res => {
if (res['success']) {
this.sendBtnFlag = true;
this.errorModal('发送成功');
this.timer = setInterval(() => {
this.timeCount--;
this.timeHtml = `${this.timeCount}(S)`;
if (this.timeCount <= 0) {
clearInterval(this.timer);
this.timeCount = 60;
this.timeHtml = '重新获取';
this.sendBtnFlag = false;
}
}, 1000)
} else {
this.errorModal(res['message'])
}
})
}
}
// 注册
loginIn() {
this.commonService.compare({
'mobileNo': this.loginData.mobileNo,
'verificationCode': this.loginData.code,
'expireTime': '3600'
}).then(res => {
if (res['success']) {
// 登录
this.commonService.login({'mobileNo': this.loginData.mobileNo}).then(response => {
if (response['success']) {
// 登录成功
this.loginModalFlag = false;
this.hasDisease(this.commonService.todosCopy);
if (this.isDisease) {
this.autoEvaluationModal = true;
} else {
// 跳转到方案详情页面
// window.location.href = `http://localhost:4200/customizedPlanList/3?orderId=14793&customerId=16`;
}
} else {
// 登录失败
this.errorModal(res['message']);
}
});
} else {
// 验证码错误
this.errorModal(res['message']);
}
})
}
// 判断家庭是否存在疾病
hasDisease(arr) {
const selfArr = arr.filter(item => item.pageId === 11).pop();
const selfQuestionsArr = selfArr.questions || [];
const spouseArr = arr.filter(item => item.pageId === 12).pop();
const spouseQuestionsArr = spouseArr ? spouseArr.questions : [];
const childrenArr = arr.filter(item => item.pageId === 13).pop();
const childrenQuestionsArr = childrenArr ? childrenArr.questions : [];
this.diseaseQuestions(selfQuestionsArr, 13, 67);
this.diseaseQuestions(spouseQuestionsArr, 14, 84);
this.diseaseQuestions(childrenQuestionsArr, 15, 99);
}
// 循环疾病选项
diseaseQuestions(arr, questionId, optionId) {
if (arr && arr.length > 0) {
arr.forEach((item, index, arr) => {
item.options.forEach((list, i, array) => {
if (item.questionId === questionId && list.optionId !== optionId) {
this.isDisease = true;
return;
} else {
this.isDisease = false;
return;
}
});
});
}
}
// 不能进行自动评测
confirm() {
this.autoEvaluationModal = false;
}
// 报错信息弹窗
errorModal(errorText) {
this.tipsFlag = true;
this.tipsHtml = errorText;
setTimeout(() => {
this.tipsFlag = false;
}, 2000)
}
}
......@@ -11,7 +11,7 @@ body {
position: relative;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
/* overflow: hidden; */
}
......@@ -75,37 +75,40 @@ ol li {
} */
.content {
overflow: auto;
padding-bottom:60px;
padding-bottom: 60px;
padding-right: 5px;
-webkit-overflow-scrolling: touch;
}
.content.healthContent::-webkit-scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0);
border-left: 1px solid rgba(0, 0, 0, 0);
}
.content.healthContent::-webkit-scrollbar {
.content.healthContent::-webkit-scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0);
border-left: 1px solid rgba(0, 0, 0, 0);
}
.content.healthContent::-webkit-scrollbar {
-webkit-appearance: none;
width: 5px;
height: 13px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.content.healthContent::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.5);
background-clip: padding-box;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
min-height: 28px;
}
.content.healthContent::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.5);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
width: 5px;
height: 13px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.content.healthContent::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.5);
background-clip: padding-box;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
min-height: 28px;
}
.content.healthContent::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.5);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
/* .layout.cityLayout .questionTitle{
margin:0 10px;
......@@ -315,7 +318,7 @@ ol li {
}
/* .toastContent .province span.selected{
border-bottom:2px solid #ff0000;
border-bottom:2px solid #ff0000;
} */
.toastContent ul {
width: 100%;
......@@ -354,6 +357,7 @@ ol li {
height: 35px;
line-height: 35px;
}
.address {
width: 80%;
margin: 15% auto;
......@@ -376,16 +380,18 @@ ol li {
text-align: center;
line-height: 60px;
animation: slowUp .5s ease both;
z-index: 1000;
}
.limbo{
.limbo {
position: relative;
height: 100%;
}
.specialWrapper{
.specialWrapper {
padding: 10px 10px 0 10px;
}
@keyframes slowUp {
0% {
-webkit-transform: translateY(100%);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment