Commit b821d1c2 by Chao Sun

填写问卷部分添加城市id

parent 292566e7
...@@ -52,7 +52,9 @@ input[type="number"] { ...@@ -52,7 +52,9 @@ input[type="number"] {
position: fixed; position: fixed;
height: 65px; height: 65px;
bottom: 0; bottom: 0;
width: 100%; min-width: 320px;
max-width: 640px;
width:100%;
} }
.footer .left { .footer .left {
......
...@@ -83,10 +83,16 @@ $(function () { ...@@ -83,10 +83,16 @@ $(function () {
return nowPrice return nowPrice
} }
$(".right").click(function () { $(".right").click(function () {
if (getQueryString('name') && getQueryString('customerId') && getQueryString('mobileNo')) {
$('.modalBox').hide();
goTopay()
} else {
$("#phone").val('') $("#phone").val('')
$("#code").val('') $("#code").val('')
$("#name").val('') $("#name").val('')
$('.modalBox').show(); $('.modalBox').show();
}
}) })
$('.closeModal').click(function () { $('.closeModal').click(function () {
$('.modalBox').hide(); $('.modalBox').hide();
...@@ -98,6 +104,7 @@ $(function () { ...@@ -98,6 +104,7 @@ $(function () {
window.localStorage.setItem('hmci', getQueryString('hmci')) window.localStorage.setItem('hmci', getQueryString('hmci'))
} }
function getQueryString(name) { function getQueryString(name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = decodeURIComponent(gitUrlParam).substr(1).match(reg); const r = decodeURIComponent(gitUrlParam).substr(1).match(reg);
...@@ -286,16 +293,29 @@ $(function () { ...@@ -286,16 +293,29 @@ $(function () {
function getPay() { function getPay() {
$("#pay").click(function () { $("#pay").click(function () {
if (!REG_CODE.test($("#phone").val())) { goTopay()
})
}
function goTopay() {
if (getQueryString('name') && getQueryString('customerId') && getQueryString('mobileNo')) {
param.customerId = getQueryString('customerId');
param.name = getQueryString('name');
param.phone = getQueryString('mobileNo');
param.verificationCodeValider = true;
} else {
param.name = $("#name").val();
param.phone = $("#phone").val();
}
if (!REG_CODE.test(param.phone)) {
layer.open({ layer.open({
content: '请输入正确的手机号码!', content: '请输入正确的手机号码!',
skin: 'msg', skin: 'msg',
time: 3 //2秒后自动关闭 time: 3 //2秒后自动关闭
}); });
return; return;
} else {
param.phone = $("#phone").val()
} }
if (!param.verificationCodeValider) { if (!param.verificationCodeValider) {
layer.open({ layer.open({
content: '请检查您的验证码是否正确', content: '请检查您的验证码是否正确',
...@@ -304,15 +324,13 @@ $(function () { ...@@ -304,15 +324,13 @@ $(function () {
}); });
return; return;
} }
if (!REG_NAME.test($("#name").val())) { if (!REG_NAME.test(param.name)) {
layer.open({ layer.open({
content: '请检查您的姓名是否正确!', content: '请检查您的姓名是否正确!',
skin: 'msg', skin: 'msg',
time: 3 //2秒后自动关闭 time: 3 //2秒后自动关闭
}); });
return; return;
} else {
param.name = $("#name").val()
} }
const startDate = new Date(); const startDate = new Date();
const endDate = new Date(new Date(startDate).setFullYear(new Date(startDate).getFullYear() + 1)); const endDate = new Date(new Date(startDate).setFullYear(new Date(startDate).getFullYear() + 1));
...@@ -368,9 +386,7 @@ $(function () { ...@@ -368,9 +386,7 @@ $(function () {
} }
} }
}) })
})
} }
function dateFormat(e) { function dateFormat(e) {
if (Number(e) < 10) { if (Number(e) < 10) {
return '0' + e; return '0' + e;
......
import {Component, OnInit} from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {CommonService} from '../common.service' import { CommonService } from '../common.service'
import {ActivatedRoute, Router} from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
@Component({ @Component({
selector: 'app-live', selector: 'app-live',
...@@ -46,7 +46,7 @@ export class LiveComponent implements OnInit { ...@@ -46,7 +46,7 @@ export class LiveComponent implements OnInit {
questions: [{ questions: [{
questionId: '', questionId: '',
questionName: '', questionName: '',
options: [{optionId: '', optionName: '', optionOrder: '', selected: ''}] options: [{ optionId: '', optionName: '', optionOrder: '', selected: '' }]
}], }],
}; };
this.loginData = { this.loginData = {
...@@ -61,7 +61,7 @@ export class LiveComponent implements OnInit { ...@@ -61,7 +61,7 @@ export class LiveComponent implements OnInit {
this.tipsFlag = false; this.tipsFlag = false;
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 16).pop(); 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']) { if (res['success']) {
this.provinceList = res['data'].provinceList; this.provinceList = res['data'].provinceList;
} }
...@@ -144,7 +144,8 @@ export class LiveComponent implements OnInit { ...@@ -144,7 +144,8 @@ export class LiveComponent implements OnInit {
this.showAddress = true; this.showAddress = true;
this.strAddress = this.provinceName + e.cityName; this.strAddress = this.provinceName + e.cityName;
this.address = { this.address = {
customerInput: this.provinceName + ',' + e.cityName customerInput: this.provinceName + ',' + e.cityName,
optionId: e.cityId
}; };
this.pageAnswers = { this.pageAnswers = {
pageId: this.curPageData['pageId'], pageId: this.curPageData['pageId'],
...@@ -201,7 +202,7 @@ export class LiveComponent implements OnInit { ...@@ -201,7 +202,7 @@ export class LiveComponent implements OnInit {
this.commonService.before(); this.commonService.before();
} }
// 获取验证码 // 获取验证码
sendCode() { sendCode() {
if (this.sendBtnFlag) { if (this.sendBtnFlag) {
return; return;
...@@ -211,7 +212,7 @@ export class LiveComponent implements OnInit { ...@@ -211,7 +212,7 @@ export class LiveComponent implements OnInit {
this.errorModal('手机号码输入有误'); this.errorModal('手机号码输入有误');
return; return;
} else if (this.loginData.mobileNo) { } else if (this.loginData.mobileNo) {
this.commonService.verificationCode({mobileNo: this.loginData.mobileNo, type: '1'}).then(res => { this.commonService.verificationCode({ mobileNo: this.loginData.mobileNo, type: '1' }).then(res => {
if (res['success']) { if (res['success']) {
this.sendBtnFlag = true; this.sendBtnFlag = true;
this.errorModal('发送成功'); this.errorModal('发送成功');
...@@ -232,7 +233,7 @@ export class LiveComponent implements OnInit { ...@@ -232,7 +233,7 @@ export class LiveComponent implements OnInit {
} }
} }
// 注册 // 注册
loginIn() { loginIn() {
this.commonService.compare({ this.commonService.compare({
'mobileNo': this.loginData.mobileNo, 'mobileNo': this.loginData.mobileNo,
...@@ -241,7 +242,7 @@ export class LiveComponent implements OnInit { ...@@ -241,7 +242,7 @@ export class LiveComponent implements OnInit {
}).then(res => { }).then(res => {
if (res['success']) { if (res['success']) {
// 登录 // 登录
this.commonService.login({'mobileNo': this.loginData.mobileNo}).then(response => { this.commonService.login({ 'mobileNo': this.loginData.mobileNo }).then(response => {
if (response['success']) { if (response['success']) {
// 登录成功 // 登录成功
this.loginModalFlag = false; this.loginModalFlag = false;
...@@ -264,7 +265,7 @@ export class LiveComponent implements OnInit { ...@@ -264,7 +265,7 @@ export class LiveComponent implements OnInit {
}) })
} }
// 判断家庭是否存在疾病 // 判断家庭是否存在疾病
hasDisease(arr) { hasDisease(arr) {
const selfArr = arr.filter(item => item.pageId === 11).pop(); const selfArr = arr.filter(item => item.pageId === 11).pop();
const selfQuestionsArr = selfArr.questions || []; const selfQuestionsArr = selfArr.questions || [];
...@@ -277,7 +278,7 @@ export class LiveComponent implements OnInit { ...@@ -277,7 +278,7 @@ export class LiveComponent implements OnInit {
this.diseaseQuestions(childrenQuestionsArr, 15, 99); this.diseaseQuestions(childrenQuestionsArr, 15, 99);
} }
// 循环疾病选项 // 循环疾病选项
diseaseQuestions(arr, questionId, optionId) { diseaseQuestions(arr, questionId, optionId) {
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
arr.forEach((item, index, arr) => { arr.forEach((item, index, arr) => {
...@@ -295,12 +296,12 @@ export class LiveComponent implements OnInit { ...@@ -295,12 +296,12 @@ export class LiveComponent implements OnInit {
} }
// 不能进行自动评测 // 不能进行自动评测
confirm() { confirm() {
this.autoEvaluationModal = false; this.autoEvaluationModal = false;
} }
// 报错信息弹窗 // 报错信息弹窗
errorModal(errorText) { errorModal(errorText) {
this.tipsFlag = true; this.tipsFlag = true;
this.tipsHtml = errorText; this.tipsHtml = errorText;
......
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