b7efbc15 by joe

預約服務信息保存到CMS

1 parent e78e6c60
Showing 36 changed files with 439 additions and 88 deletions
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <link rel="stylesheet" href="./css/pure-min.css"> 9 <link rel="stylesheet" href="./css/pure-min.css">
10 <link rel="stylesheet" href="./css/grids-responsive-min.css"> 10 <link rel="stylesheet" href="./css/grids-responsive-min.css">
11 <title>平安人寿保险官网</title> 11 <title>平安人寿保险官网</title>
12 <link href="static/js/0.1573611020412.js" rel="prefetch"><link href="static/js/1.1573611020412.js" rel="prefetch"><link href="static/js/10.1573611020412.js" rel="prefetch"><link href="static/js/11.1573611020412.js" rel="prefetch"><link href="static/js/12.1573611020412.js" rel="prefetch"><link href="static/js/13.1573611020412.js" rel="prefetch"><link href="static/js/14.1573611020412.js" rel="prefetch"><link href="static/js/15.1573611020412.js" rel="prefetch"><link href="static/js/16.1573611020412.js" rel="prefetch"><link href="static/js/2.1573611020412.js" rel="prefetch"><link href="static/js/3.1573611020412.js" rel="prefetch"><link href="static/js/4.1573611020412.js" rel="prefetch"><link href="static/js/5.1573611020412.js" rel="prefetch"><link href="static/js/6.1573611020412.js" rel="prefetch"><link href="static/js/7.1573611020412.js" rel="prefetch"><link href="static/js/8.1573611020412.js" rel="prefetch"><link href="static/js/9.1573611020412.js" rel="prefetch"><link href="static/js/app.1573611020412.js" rel="preload" as="script"></head> 12 <link href="static/js/0.1573652689022.js" rel="prefetch"><link href="static/js/1.1573652689022.js" rel="prefetch"><link href="static/js/10.1573652689022.js" rel="prefetch"><link href="static/js/11.1573652689022.js" rel="prefetch"><link href="static/js/12.1573652689022.js" rel="prefetch"><link href="static/js/13.1573652689022.js" rel="prefetch"><link href="static/js/14.1573652689022.js" rel="prefetch"><link href="static/js/15.1573652689022.js" rel="prefetch"><link href="static/js/16.1573652689022.js" rel="prefetch"><link href="static/js/2.1573652689022.js" rel="prefetch"><link href="static/js/3.1573652689022.js" rel="prefetch"><link href="static/js/4.1573652689022.js" rel="prefetch"><link href="static/js/5.1573652689022.js" rel="prefetch"><link href="static/js/6.1573652689022.js" rel="prefetch"><link href="static/js/7.1573652689022.js" rel="prefetch"><link href="static/js/8.1573652689022.js" rel="prefetch"><link href="static/js/9.1573652689022.js" rel="prefetch"><link href="static/js/app.1573652689022.js" rel="preload" as="script"></head>
13 13
14 <body> 14 <body>
15 <noscript> 15 <noscript>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
19 <div id="app"></div> 19 <div id="app"></div>
20 <!-- built files will be auto injected --> 20 <!-- built files will be auto injected -->
21 <script src="./js/unionrsa.js"></script> 21 <script src="./js/unionrsa.js"></script>
22 <script type="text/javascript" src="static/js/app.1573611020412.js"></script></body> 22 <script type="text/javascript" src="static/js/app.1573652689022.js"></script></body>
23 23
24 </html> 24 </html>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -31,4 +31,13 @@ module.exports = { ...@@ -31,4 +31,13 @@ module.exports = {
31 resetPwd: "/pingan_hklife_webapi/reset/resetPwd", 31 resetPwd: "/pingan_hklife_webapi/reset/resetPwd",
32 // 找回密码:重置密码 32 // 找回密码:重置密码
33 updateInformation: "/pingan_hklife_webapi/user/updateInformation", 33 updateInformation: "/pingan_hklife_webapi/user/updateInformation",
34 // 读取联系方式
35 getContacts: "/pingan_hklife_webapi/customService/contacts/get",
36 // 更新联系方式
37 updateContacts: "/pingan_hklife_webapi/customService/contacts/update",
38 // 保存預約服務
39 saveReservation: "/pingan_hklife_webapi/customService/reservation/save",
40 // 保存投訴建議
41 saveComplain: "/pingan_hklife_webapi/customService/complain/save"
42
34 } 43 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -41,11 +41,11 @@ axios.interceptors.response.use( ...@@ -41,11 +41,11 @@ axios.interceptors.response.use(
41 if (response.data.code === 200) { 41 if (response.data.code === 200) {
42 return Promise.resolve(response); 42 return Promise.resolve(response);
43 } else { 43 } else {
44 Toast(response.data.bizMsg); 44 // Toast(response.data.bizMsg);
45 return Promise.reject(response); 45 return Promise.reject(response.data);
46 } 46 }
47 } else { 47 } else {
48 return Promise.reject(response); 48 return Promise.reject(response.data);
49 } 49 }
50 }, 50 },
51 // 服务器状态码不是200的情况 51 // 服务器状态码不是200的情况
...@@ -126,9 +126,10 @@ export const httpGet = params => { ...@@ -126,9 +126,10 @@ export const httpGet = params => {
126 } = params; 126 } = params;
127 let headers = {}; 127 let headers = {};
128 if (sid) { 128 if (sid) {
129 let sessionId = state.userInfo && state.userInfo.sid ? state.userInfo.sid : "";
129 headers = { 130 headers = {
130 headers : { 131 headers: {
131 sid : state.userInfo.sid 132 sid: sessionId
132 } 133 }
133 } 134 }
134 } 135 }
...@@ -149,16 +150,16 @@ export const httpPost = params => { ...@@ -149,16 +150,16 @@ export const httpPost = params => {
149 } = params; 150 } = params;
150 let headers = {}; 151 let headers = {};
151 if (sid) { 152 if (sid) {
153 let sessionId = state.userInfo && state.userInfo.sid ? state.userInfo.sid : "";
152 headers = { 154 headers = {
153 headers : { 155 headers: {
154 sid : state.userInfo.sid 156 sid: sessionId
155 } 157 }
156 } 158 }
157 } 159 }
158 return axios.post(`${base}${url}`, data, headers).then(res => res.data.content); 160 return axios.post(`${base}${url}`, data, headers).then(res => res.data.content);
159 } 161 }
160 162
161
162 /** 163 /**
163 * 封装post方法 164 * 封装post方法
164 * @param {*} params 165 * @param {*} params
......
...@@ -8,6 +8,9 @@ module.exports = { ...@@ -8,6 +8,9 @@ module.exports = {
8 zh: 'Chinese', 8 zh: 'Chinese',
9 en: 'English' 9 en: 'English'
10 }, 10 },
11 glbalTips : {
12 sessionLost : "为了更好的体验,需要您登录后再进行此操作"
13 },
11 nav: { 14 nav: {
12 loginData: { 15 loginData: {
13 name: "login", 16 name: "login",
...@@ -59,7 +62,7 @@ module.exports = { ...@@ -59,7 +62,7 @@ module.exports = {
59 }, 62 },
60 { 63 {
61 name: "Change policy", 64 name: "Change policy",
62 path: "/custom/service?q=m4" 65 path: "/custom/service?q=m41"
63 }, 66 },
64 { 67 {
65 name: "Claim report", 68 name: "Claim report",
...@@ -282,6 +285,7 @@ module.exports = { ...@@ -282,6 +285,7 @@ module.exports = {
282 value: "W" 285 value: "W"
283 }] 286 }]
284 }, 287 },
288 successMsg : "更新成功",
285 errorTips: { 289 errorTips: {
286 e1: "請填寫姓名信息", 290 e1: "請填寫姓名信息",
287 e2: "請選擇性別", 291 e2: "請選擇性別",
...@@ -289,6 +293,7 @@ module.exports = { ...@@ -289,6 +293,7 @@ module.exports = {
289 e4: "請選擇證件類型", 293 e4: "請選擇證件類型",
290 e5: "請填寫證件號碼", 294 e5: "請填寫證件號碼",
291 e6: "您填寫的證件號碼有誤", 295 e6: "您填寫的證件號碼有誤",
296 e7: "您填寫的信息有誤,請核實後重新提交",
292 } 297 }
293 }, 298 },
294 index: { 299 index: {
...@@ -550,6 +555,11 @@ module.exports = { ...@@ -550,6 +555,11 @@ module.exports = {
550 email: "E-Mail", 555 email: "E-Mail",
551 checkTips: "本人不同意接收宣傳信息", 556 checkTips: "本人不同意接收宣傳信息",
552 submit: "確認修改", 557 submit: "確認修改",
558 errorTips : {
559 e1 : "請填寫正確的聯繫電話",
560 e2 : "請填寫聯繫地址",
561 e3 : "請填寫正確的E-Mail地址"
562 }
553 }, 563 },
554 policyChangeInformation: { 564 policyChangeInformation: {
555 hkClient: "是否平安香港客戶", 565 hkClient: "是否平安香港客戶",
...@@ -656,7 +666,13 @@ module.exports = { ...@@ -656,7 +666,13 @@ module.exports = {
656 t6PaymentAmount: "Payment amount", 666 t6PaymentAmount: "Payment amount",
657 }, 667 },
658 reservation: { 668 reservation: {
659 submitBtn: '確認' 669 submitBtn: '確認',
670 contactMethods : ['電話'],
671 reservationTypes: ['投保咨詢','代辦保單變更'],
672 errorTips : {
673 e1 : "請填寫該項內容",
674 e2 : "請填寫正確的聯繫方式"
675 }
660 } 676 }
661 } 677 }
662 } 678 }
......
...@@ -8,6 +8,9 @@ module.exports = { ...@@ -8,6 +8,9 @@ module.exports = {
8 zh: 'Chinese', 8 zh: 'Chinese',
9 en: 'English' 9 en: 'English'
10 }, 10 },
11 glbalTips : {
12 sessionLost : "為了更好的體驗,需要您登錄後再進行此操作"
13 },
11 nav: { 14 nav: {
12 loginData: { 15 loginData: {
13 name: "登入", 16 name: "登入",
...@@ -59,7 +62,7 @@ module.exports = { ...@@ -59,7 +62,7 @@ module.exports = {
59 }, 62 },
60 { 63 {
61 name: "保單變更", 64 name: "保單變更",
62 path: "/custom/service?q=m4" 65 path: "/custom/service?q=m41"
63 }, 66 },
64 { 67 {
65 name: "理賠申請", 68 name: "理賠申請",
...@@ -280,6 +283,7 @@ module.exports = { ...@@ -280,6 +283,7 @@ module.exports = {
280 value: "W" 283 value: "W"
281 }] 284 }]
282 }, 285 },
286 successMsg : "更新成功",
283 errorTips: { 287 errorTips: {
284 e1: "請填寫姓名信息", 288 e1: "請填寫姓名信息",
285 e2: "請選擇性別", 289 e2: "請選擇性別",
...@@ -287,6 +291,7 @@ module.exports = { ...@@ -287,6 +291,7 @@ module.exports = {
287 e4: "請選擇證件類型", 291 e4: "請選擇證件類型",
288 e5: "請填寫證件號碼", 292 e5: "請填寫證件號碼",
289 e6: "您填寫的證件號碼有誤", 293 e6: "您填寫的證件號碼有誤",
294 e7: "您填寫的信息有誤,請核實後重新提交",
290 } 295 }
291 }, 296 },
292 index: { 297 index: {
...@@ -548,6 +553,11 @@ module.exports = { ...@@ -548,6 +553,11 @@ module.exports = {
548 email: "E-Mail", 553 email: "E-Mail",
549 checkTips: "本人不同意接收宣傳信息", 554 checkTips: "本人不同意接收宣傳信息",
550 submit: "確認修改", 555 submit: "確認修改",
556 errorTips : {
557 e1 : "請填寫正確的聯繫電話",
558 e2 : "請填寫聯繫地址",
559 e3 : "請填寫正確的E-Mail地址"
560 }
551 }, 561 },
552 policyChangeInformation: { 562 policyChangeInformation: {
553 hkClient: "是否平安香港客戶", 563 hkClient: "是否平安香港客戶",
...@@ -654,7 +664,13 @@ module.exports = { ...@@ -654,7 +664,13 @@ module.exports = {
654 t6PaymentAmount: "繳費金額", 664 t6PaymentAmount: "繳費金額",
655 }, 665 },
656 reservation: { 666 reservation: {
657 submitBtn: '確認' 667 submitBtn: '確認',
668 contactMethods : ['電話'],
669 reservationTypes: ['投保咨詢','代辦保單變更'],
670 errorTips : {
671 e1 : "請填寫該項內容",
672 e2 : "請填寫正確的聯繫方式"
673 }
658 } 674 }
659 } 675 }
660 } 676 }
......
...@@ -8,6 +8,9 @@ module.exports = { ...@@ -8,6 +8,9 @@ module.exports = {
8 zh: '中文', 8 zh: '中文',
9 en: '英文' 9 en: '英文'
10 }, 10 },
11 glbalTips : {
12 sessionLost : "为了更好的体验,需要您登录后再进行此操作"
13 },
11 nav: { 14 nav: {
12 loginData: { 15 loginData: {
13 name: "登陆", 16 name: "登陆",
...@@ -59,7 +62,7 @@ module.exports = { ...@@ -59,7 +62,7 @@ module.exports = {
59 }, 62 },
60 { 63 {
61 name: "保单变更", 64 name: "保单变更",
62 path: "/custom/service?q=m4" 65 path: "/custom/service?q=m41"
63 }, 66 },
64 { 67 {
65 name: "理赔申请", 68 name: "理赔申请",
...@@ -280,6 +283,7 @@ module.exports = { ...@@ -280,6 +283,7 @@ module.exports = {
280 value: "W" 283 value: "W"
281 }] 284 }]
282 }, 285 },
286 successMsg : "更新成功",
283 errorTips: { 287 errorTips: {
284 e1: "请填写姓名信息", 288 e1: "请填写姓名信息",
285 e2: "请选择性别", 289 e2: "请选择性别",
...@@ -287,6 +291,7 @@ module.exports = { ...@@ -287,6 +291,7 @@ module.exports = {
287 e4: "请选择证件类型", 291 e4: "请选择证件类型",
288 e5: "请填写证件号码", 292 e5: "请填写证件号码",
289 e6: "您填写的证件号码有误", 293 e6: "您填写的证件号码有误",
294 e7: "您填写的信息有误,请核实后重新提交",
290 } 295 }
291 }, 296 },
292 index: { 297 index: {
...@@ -549,18 +554,12 @@ module.exports = { ...@@ -549,18 +554,12 @@ module.exports = {
549 email: "E-Mail", 554 email: "E-Mail",
550 checkTips: "本人不同意接收宣传信息", 555 checkTips: "本人不同意接收宣传信息",
551 submit: "确认修改", 556 submit: "确认修改",
557 errorTips : {
558 e1 : "請填寫正確的聯繫電話",
559 e2 : "請填寫聯繫地址",
560 e3 : "請填寫正確的E-Mail地址"
561 }
552 }, 562 },
553
554
555
556
557
558
559
560
561
562
563
564 policyChangeInformation: { 563 policyChangeInformation: {
565 hkClient: "是否平安香港客戶", 564 hkClient: "是否平安香港客戶",
566 yes: "是", 565 yes: "是",
...@@ -666,7 +665,13 @@ module.exports = { ...@@ -666,7 +665,13 @@ module.exports = {
666 t6PaymentAmount: "缴费金额", 665 t6PaymentAmount: "缴费金额",
667 }, 666 },
668 reservation: { 667 reservation: {
669 submitBtn: '确认' 668 submitBtn: '确认',
669 contactMethods : ['電話'],
670 reservationTypes: ['投保咨询','代办保单变更'],
671 errorTips : {
672 e1 : "請填寫該項內容",
673 e2 : "請填寫正確的聯繫方式"
674 }
670 } 675 }
671 } 676 }
672 } 677 }
......
...@@ -11,9 +11,24 @@ export default { ...@@ -11,9 +11,24 @@ export default {
11 checked1: false, 11 checked1: false,
12 checked2: false, 12 checked2: false,
13 checked3: false, 13 checked3: false,
14 data: {
15 mobileAreaCode: "",
16 mobile: "",
17 mobileAcceptMessage: 0,
18 email: "",
19 emailAcceptMessage: 0,
20 address: "",
21 addressAcceptMessage: 0
22 },
23 errorTips: {
24 e1: "",
25 e2: "",
26 e3: ""
27 }
14 } 28 }
15 }, 29 },
16 components: {}, 30 components: {
31 },
17 computed: { 32 computed: {
18 locale() { 33 locale() {
19 return this.$i18n.locale || 'tc'; 34 return this.$i18n.locale || 'tc';
...@@ -23,8 +38,112 @@ export default { ...@@ -23,8 +38,112 @@ export default {
23 } 38 }
24 }, 39 },
25 methods: { 40 methods: {
26 initData() {} 41 modalCallback() {
42 this.modalVisiable = false;
43 },
44 sessionLost() {
45 // let message = this.i18n.glbalTips.sessionLost;
46 // alert(message);
47 // let targetPath = "/login?callback=" + this.buildCallbackPath();
48 // this.$router.push({
49 // path: targetPath
50 // });
51 },
52 showSuccess() {
53 alert("更新成功")
54 },
55 updateContactsHandler() {
56 let b1 = this.checkMobile();
57 let b2 = this.checkEmail();
58 let b3 = this.checkAddress();
59 let b = b1 & b2 & b3;
60 if (b) {
61 this.data.mobileAcceptMessage = this.checked1 ? 1 : 0;
62 this.data.addressAcceptMessage = this.checked2 ? 1 : 0;
63 this.data.emailAcceptMessage = this.checked3 ? 1 : 0;
64
65 httpPost({
66 url: api.updateContacts,
67 data: this.data,
68 sid: true
69 }).then(() => {
70 this.showSuccess();
71 }).catch(() => {
72 this.sessionLost();
73 })
74 }
75 },
76 checkMobile() {
77 if (!this.data.mobile) {
78 this.errorTips.e1 = this.i18n.policyChangeContact.errorTips.e1;
79 return false;
80 } else {
81 if (this.data.mobile.length != 8 && this.data.mobile.length != 11) {
82 this.errorTips.e1 = this.i18n.policyChangeContact.errorTips.e1;
83 return false;
84 }
85 }
86 return true;
87 },
88 checkAddress() {
89 if (!this.data.address) {
90 this.errorTips.e2 = this.i18n.policyChangeContact.errorTips.e2;
91 return false;
92 }
93 return true;
94 },
95 checkEmail() {
96 if (!/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(this.data.email)) {
97 this.errorTips.e3 = this.i18n.policyChangeContact.errorTips.e3;
98 return false;
99 }
100 return true;
101 },
102 initData() {
103 httpPost({
104 url: api.getContacts,
105 sid: true
106 }).then(response => {
107 if (response) {
108 this.data.mobile = response.mobile;
109 this.data.mobileAcceptMessage = response.mobileAcceptMessage;
110 this.data.email = response.email;
111 this.data.emailAcceptMessage = response.emailAcceptMessage;
112 this.data.address = response.address;
113 this.data.addressAcceptMessage = response.addressAcceptMessage;
114 }
115 this.checked1 = this.data.mobileAcceptMessage == 1 ? true : false;
116 this.checked2 = this.data.addressAcceptMessage == 1 ? true : false;
117 this.checked3 = this.data.emailAcceptMessage == 1 ? true : false;
118 }).catch(res => {
119 if (res.code == "404") {
120 this.sessionLost();
121 }
122 });
123 },
124 buildCallbackPath() {
125 let path = this.$route.path;
126 let sep = "?"
127 for (let key in this.$route.query) {
128 path += sep + key + "=" + this.$route.query[key];
129 sep = "&";
130 }
131 return path;
132 }
133 },
134 watch: {
135 'data.mobile': function () {
136 this.errorTips.e1 = "";
137 },
138 'data.address': function () {
139 this.errorTips.e2 = "";
140 },
141 'data.email': function () {
142 this.errorTips.e3 = "";
143 }
144 },
145 mounted() {
146 this.initData();
27 }, 147 },
28 mounted() {}, 148 created() { }
29 created() {}
30 } 149 }
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
42 } 42 }
43 43
44 .ipt-wrap { 44 .ipt-wrap {
45 display: flex;
46 align-items: center;
45 position: relative; 47 position: relative;
46 48
47 // input和下拉 49 // input和下拉
...@@ -91,6 +93,21 @@ ...@@ -91,6 +93,21 @@
91 margin-right: .666667rem; 93 margin-right: .666667rem;
92 } 94 }
93 } 95 }
96
97 .validator {
98 color: $cOrange;
99 margin-top: 0.5rem;
100 position: absolute;
101 right: 16rem;
102 display: flex;
103 align-items: center;
104 // bottom: 0;
105
106 img {
107 display: inline-block;
108 margin-right: 0.4rem;
109 }
110 }
94 } 111 }
95 112
96 } 113 }
......
...@@ -6,11 +6,20 @@ ...@@ -6,11 +6,20 @@
6 <div class="label"> 6 <div class="label">
7 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-phone.png"></div>{{$t('policyChangeContact.phone')}} 7 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-phone.png"></div>{{$t('policyChangeContact.phone')}}
8 </div> 8 </div>
9 <div class="ipt-wrap"> 9 <div class="ipt-wrap" >
10 <input placeholder="香港(852)2888 8888" class="ipt mail-ipt" type="text"> 10 <!-- <div> -->
11 <img @click="checked1 = !checked1" v-if="!checked1" class="check-icon pointer" src="@/assets/images/reservation/un-check.png"> 11 <input class="ipt mail-ipt" :class="{err : errorTips.e1.length > 0}" type="text" v-model="data.mobile">
12 <img @click="checked1 = !checked1" v-else class="check-icon pointer" src="@/assets/images/reservation/check.png"> 12
13 <span>{{$t("policyChangeContact.checkTips")}}</span> 13 <!-- </div> -->
14 <div class="pointer" @click="checked1 = !checked1">
15 <img v-if="!checked1" class="check-icon pointer" src="@/assets/images/reservation/un-check.png">
16 <img v-else class="check-icon pointer" src="@/assets/images/reservation/check.png">
17 <span>{{$t("policyChangeContact.checkTips")}}</span>
18 </div>
19
20 </div>
21 <div class="validator" v-if="errorTips.e1.length > 0">
22 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
14 </div> 23 </div>
15 </div> 24 </div>
16 <div class="form-item"> 25 <div class="form-item">
...@@ -18,10 +27,15 @@ ...@@ -18,10 +27,15 @@
18 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-location.png"></div>{{$t('policyChangeContact.address')}} 27 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-location.png"></div>{{$t('policyChangeContact.address')}}
19 </div> 28 </div>
20 <div class="ipt-wrap"> 29 <div class="ipt-wrap">
21 <input placeholder="深圳市益田路5033號" class="ipt mail-ipt" type="text"> 30 <input class="ipt mail-ipt" type="text" :class="{err : errorTips.e2.length > 0}" v-model="data.address">
22 <img @click="checked2 = !checked2" v-if="!checked2" class="check-icon pointer" src="@/assets/images/reservation/un-check.png"> 31 <div class="pointer" @click="checked2 = !checked2">
23 <img @click="checked2 = !checked2" v-else class="check-icon pointer" src="@/assets/images/reservation/check.png"> 32 <img v-if="!checked2" class="check-icon pointer" src="@/assets/images/reservation/un-check.png">
24 <span>{{$t("policyChangeContact.checkTips")}}</span> 33 <img v-else class="check-icon pointer" src="@/assets/images/reservation/check.png">
34 <span>{{$t("policyChangeContact.checkTips")}}</span>
35 </div>
36 </div>
37 <div class="validator" v-if="errorTips.e2.length > 0">
38 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
25 </div> 39 </div>
26 </div> 40 </div>
27 <div class="form-item"> 41 <div class="form-item">
...@@ -29,14 +43,20 @@ ...@@ -29,14 +43,20 @@
29 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-mail.png"></div>{{$t('policyChangeContact.email')}} 43 <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-mail.png"></div>{{$t('policyChangeContact.email')}}
30 </div> 44 </div>
31 <div class="ipt-wrap"> 45 <div class="ipt-wrap">
32 <input placeholder="123@ping.com.cn" class="ipt mail-ipt" type="text"> 46 <input class="ipt mail-ipt" type="text" :class="{err : errorTips.e3.length > 0}" v-model="data.email">
33 <img @click="checked3 = !checked3" v-if="!checked3" class="check-icon pointer" src="@/assets/images/reservation/un-check.png"> 47 <div class="pointer" @click="checked3 = !checked3">
34 <img @click="checked3 = !checked3" v-else class="check-icon pointer" src="@/assets/images/reservation/check.png"> 48 <img v-if="!checked3" class="check-icon pointer" src="@/assets/images/reservation/un-check.png">
35 <span>{{$t("policyChangeContact.checkTips")}}</span> 49 <img v-else class="check-icon pointer" src="@/assets/images/reservation/check.png">
50 <span>{{$t("policyChangeContact.checkTips")}}</span>
51 </div>
52 </div>
53
54 <div class="validator" v-if="errorTips.e3.length > 0">
55 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e3}}
36 </div> 56 </div>
37 </div> 57 </div>
38 </div> 58 </div>
39 <div class="submit-btn"> 59 <div class="submit-btn" @click="updateContactsHandler">
40 {{$t("policyChangeContact.submit")}} 60 {{$t("policyChangeContact.submit")}}
41 </div> 61 </div>
42 </div> 62 </div>
......
...@@ -7,9 +7,28 @@ import { ...@@ -7,9 +7,28 @@ import {
7 export default { 7 export default {
8 data() { 8 data() {
9 return { 9 return {
10 isSubmit: false,
10 key: 'value', 11 key: 'value',
11 isHkCus : true, 12 isHkCus: true,
12 checked : false 13 checked: false,
14 data: {
15 name: "",
16 contactType: "",
17 contactMethod: "",
18 reservationType: "",
19 instruction: "",
20 hkCustomer: "",
21 contactDate: ""
22 },
23 errorTips: {
24 e1: "",
25 e2: "",
26 e3: "",
27 e4: "",
28 e5: "",
29 e6: "",
30 e7: ""
31 }
13 } 32 }
14 }, 33 },
15 components: {}, 34 components: {},
...@@ -19,11 +38,98 @@ export default { ...@@ -19,11 +38,98 @@ export default {
19 }, 38 },
20 i18n() { 39 i18n() {
21 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {}; 40 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
41 },
42 contactMethods() {
43 return this.i18n.customService.reservation.contactMethods;
44 },
45 reservationTypes() {
46 return this.i18n.customService.reservation.reservationTypes;
22 } 47 }
23 }, 48 },
24 methods: { 49 methods: {
25 initData() {} 50 initData() {
51 this.data.contactType = this.contactMethods[0];
52 this.data.reservationType = this.reservationTypes[0];
53 },
54 submitHandler() {
55 if (this.isSubmit) {
56 return;
57 }
58 let b1 = this.checkName();
59 let b2 = this.checkContactMethod();
60 let b3 = this.checkInstruction();
61 let b4 = this.checkContactDate();
62 let b = b1 & b2 & b3 & b4;
63
64 if (b) {
65 this.isSubmit = true;
66 this.data.hkCustomer = this.isHkCus ? 1 : 0;
67 httpPost({
68 url: api.saveReservation,
69 data: this.data
70 }).then(() => {
71 this.showSubmitSuccess();
72 this.isSubmit = false;
73 }).catch(() => {
74 this.isSubmit = false;
75 })
76 }
77 },
78 showSubmitSuccess(){
79 alert("提交成功");
80 this.data.name = "";
81 this.data.contactMethod = "";
82 this.data.instruction = "";
83 },
84 checkName() {
85 if (!this.data.name) {
86 let message = this.i18n.customService.reservation.errorTips.e1;
87 this.errorTips.e1 = message;
88 return false;
89 }
90 return true;
91 },
92 checkContactMethod() {
93 if (!this.data.contactMethod) {
94 let message = this.i18n.customService.reservation.errorTips.e1;
95 this.errorTips.e3 = message;
96 return false;
97 }
98 return true;
99 },
100 checkInstruction() {
101 if (!this.data.instruction) {
102 let message = this.i18n.customService.reservation.errorTips.e1;
103 this.errorTips.e5 = message;
104 return false;
105 }
106 return true;
107 },
108 checkContactDate() {
109 if (!this.data.contactDate) {
110 let message = this.i18n.customService.reservation.errorTips.e1;
111 this.errorTips.e7 = message;
112 return false;
113 }
114 return true;
115 }
116 },
117 watch: {
118 'data.name': function () {
119 this.errorTips.e1 = "";
120 },
121 'data.contactMethod': function () {
122 this.errorTips.e3 = "";
123 },
124 'data.instruction': function () {
125 this.errorTips.e5 = "";
126 },
127 'data.contactDate': function () {
128 this.errorTips.e7 = "";
129 }
130 },
131 mounted() {
132 this.initData();
26 }, 133 },
27 mounted() {}, 134 created() { }
28 created() {}
29 } 135 }
......
...@@ -80,6 +80,21 @@ input { ...@@ -80,6 +80,21 @@ input {
80 } 80 }
81 } 81 }
82 82
83
84 .validator {
85 color: $cOrange;
86 margin-top: 0.5rem;
87 position: absolute;
88 right: 1rem;
89 display: flex;
90 align-items: center;
91 // bottom: 0;
92
93 img {
94 display: inline-block;
95 margin-right: 0.4rem;
96 }
97 }
83 } 98 }
84 99
85 // 不换行 100 // 不换行
...@@ -200,3 +215,8 @@ input { ...@@ -200,3 +215,8 @@ input {
200 background-blend-mode: soft-light, ; 215 background-blend-mode: soft-light, ;
201 background-image: linear-gradient(to top, #000000, #ffffff), linear-gradient(to bottom, #ec6429, #ec6429); 216 background-image: linear-gradient(to top, #000000, #ffffff), linear-gradient(to bottom, #ec6429, #ec6429);
202 } 217 }
218
219 .disabled {
220 background-color: gray !important;
221 background-image:none !important;
222 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
8 <div class="icon"><img src="@/assets/images/reservation/icon-re-name.png"></div> {{$t('reservation.name')}} 8 <div class="icon"><img src="@/assets/images/reservation/icon-re-name.png"></div> {{$t('reservation.name')}}
9 </div> 9 </div>
10 <div class="ipt-wrap"> 10 <div class="ipt-wrap">
11 <input :placeholder="$t('reservation.namePlaceholder')" class="ipt" type="text"> 11 <input :placeholder="$t('reservation.namePlaceholder')" class="ipt" :class="{err : errorTips.e1.length > 0}" type="text" v-model="data.name">
12 </div>
13 <div class="validator" v-if="errorTips.e1.length > 0">
14 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
12 </div> 15 </div>
13 </div> 16 </div>
14 17
...@@ -18,9 +21,8 @@ ...@@ -18,9 +21,8 @@
18 </div> 21 </div>
19 <div class="ipt-wrap"> 22 <div class="ipt-wrap">
20 <div class="down-arrow"></div> 23 <div class="down-arrow"></div>
21 <select class="ipt"> 24 <select class="ipt" v-model="data.contactType">
22 <option v-if="locale !='zh'">電話</option> 25 <option v-for="(item,index) in contactMethods" :key="index" :value="item">{{item}}</option>
23 <option v-else>电话</option>
24 </select> 26 </select>
25 </div> 27 </div>
26 </div> 28 </div>
...@@ -30,7 +32,10 @@ ...@@ -30,7 +32,10 @@
30 <div class="icon"><img src="@/assets/images/reservation/icon-re-phone.png"></div>{{$t('reservation.contact')}} 32 <div class="icon"><img src="@/assets/images/reservation/icon-re-phone.png"></div>{{$t('reservation.contact')}}
31 </div> 33 </div>
32 <div class="ipt-wrap"> 34 <div class="ipt-wrap">
33 <input :placeholder="$t('reservation.contactPlaceholder')" class="ipt" type="text"> 35 <input :placeholder="$t('reservation.contactPlaceholder')" class="ipt" :class="{err : errorTips.e3.length > 0}" type="text" v-model="data.contactMethod">
36 </div>
37 <div class="validator" v-if="errorTips.e3.length > 0">
38 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e3}}
34 </div> 39 </div>
35 </div> 40 </div>
36 41
...@@ -40,15 +45,8 @@ ...@@ -40,15 +45,8 @@
40 </div> 45 </div>
41 <div class="ipt-wrap"> 46 <div class="ipt-wrap">
42 <div class="down-arrow"></div> 47 <div class="down-arrow"></div>
43 <select class="ipt"> 48 <select class="ipt" v-model="data.reservationType">
44 <template v-if="locale =='zh'"> 49 <option v-for="(item,index) in reservationTypes" :key="index" :value="item">{{item}}</option>
45 <option>投保咨询</option>
46 <option>代办保单变更</option>
47 </template>
48 <template v-else>
49 <option>投保咨詢</option>
50 <option>代辦保單變更</option>
51 </template>
52 </select> 50 </select>
53 </div> 51 </div>
54 </div> 52 </div>
...@@ -58,7 +56,10 @@ ...@@ -58,7 +56,10 @@
58 <div class="icon"><img src="@/assets/images/reservation/icon-re-arrow-reservation.png"></div>{{$t('reservation.reservationRemark')}} 56 <div class="icon"><img src="@/assets/images/reservation/icon-re-arrow-reservation.png"></div>{{$t('reservation.reservationRemark')}}
59 </div> 57 </div>
60 <div class="ipt-wrap"> 58 <div class="ipt-wrap">
61 <textarea :placeholder="$t('reservation.reservationRemarkPlaceholder')" class="ipt textarea"></textarea> 59 <textarea :placeholder="$t('reservation.reservationRemarkPlaceholder')" class="ipt textarea" :class="{err : errorTips.e5.length > 0}" v-model="data.instruction"></textarea>
60 </div>
61 <div class="validator" v-if="errorTips.e5.length > 0">
62 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e5}}
62 </div> 63 </div>
63 </div> 64 </div>
64 65
...@@ -79,14 +80,17 @@ ...@@ -79,14 +80,17 @@
79 <div class="icon"><img src="@/assets/images/reservation/icon-re-calendar.png"></div>{{$t('reservation.contactTime')}} 80 <div class="icon"><img src="@/assets/images/reservation/icon-re-calendar.png"></div>{{$t('reservation.contactTime')}}
80 </div> 81 </div>
81 <div class="ipt-wrap"> 82 <div class="ipt-wrap">
82 <input value="2019/10/16" class="ipt" type="text"> 83 <input class="ipt" type="date" v-model="data.contactDate" :class="{err : errorTips.e7.length > 0}">
84 </div>
85 <div class="validator" v-if="errorTips.e7.length > 0">
86 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e7}}
83 </div> 87 </div>
84 <div class="mt8"> 88 <div class="mt8">
85 <div class="label"> 89 <div class="label">
86 </div> 90 </div>
87 <div class="calendar"> 91 <!-- <div class="calendar">
88 <img src="@/assets/images/reservation/re-calendar.png"> 92 <img src="@/assets/images/reservation/re-calendar.png">
89 </div> 93 </div> -->
90 </div> 94 </div>
91 </div> 95 </div>
92 </div> 96 </div>
...@@ -103,7 +107,7 @@ ...@@ -103,7 +107,7 @@
103 </p> 107 </p>
104 </div> 108 </div>
105 109
106 <div class="submit-btn"> 110 <div class="submit-btn" :class="{disabled : !checked}" @click="submitHandler">
107 {{$t('customService.reservation.submitBtn')}} 111 {{$t('customService.reservation.submitBtn')}}
108 </div> 112 </div>
109 </div> 113 </div>
......
...@@ -21,11 +21,11 @@ export default { ...@@ -21,11 +21,11 @@ export default {
21 }, 21 },
22 birthDate: "", 22 birthDate: "",
23 information: { 23 information: {
24 cnName: "joe", 24 cnName: "",
25 sex: "M", 25 sex: "",
26 birthDate: "1990-01-01", 26 birthDate: "",
27 idNo: "111111111234567890", 27 idNo: "",
28 idType: "1" 28 idType: ""
29 }, 29 },
30 errorTips: { 30 errorTips: {
31 e1: "", 31 e1: "",
...@@ -60,6 +60,12 @@ export default { ...@@ -60,6 +60,12 @@ export default {
60 } 60 }
61 }, 61 },
62 methods: { 62 methods: {
63 showModal(content, icon) {
64 icon = !icon || typeof icon === "undefined" ? "succ" : "succ";
65 this.modalIcon = icon;
66 this.modalContent = content;
67 this.modalVisiable = true;
68 },
63 initData() { 69 initData() {
64 }, 70 },
65 onUpdateHandler() { 71 onUpdateHandler() {
...@@ -83,7 +89,23 @@ export default { ...@@ -83,7 +89,23 @@ export default {
83 data: this.information, 89 data: this.information,
84 sid: true 90 sid: true
85 }).then(response => { 91 }).then(response => {
86 console.log(response); 92 let message = "";
93 switch (response.returnCode) {
94 case "GS_MODIFYFIVEKEYS_ERROR_IDNOERROR":
95 message = this.i18n.infomationImprove.errorTips.e6;
96 this.errorTips.e5 = message;
97 break;
98 case "COMMON_ERROR_036":
99 this.showModal(this.i18n.infomationImprove.errorTips.e7, "info");
100 this.errorTips.e5 = message;
101 break;
102 case "0":
103 message = this.i18n.infomationImprove.successMsg;
104 this.showModal(message, "succ");
105 let path = this.$route.query.callback || "/index";
106 this.targetPath = path;
107 break;
108 }
87 }); 109 });
88 }); 110 });
89 } 111 }
...@@ -96,7 +118,6 @@ export default { ...@@ -96,7 +118,6 @@ export default {
96 clientNo: "501381573194155227" 118 clientNo: "501381573194155227"
97 } 119 }
98 }).then(response => { 120 }).then(response => {
99 console.log(response);
100 this.$store.commit("SET_USER_INFO", response.data); 121 this.$store.commit("SET_USER_INFO", response.data);
101 resolve(); 122 resolve();
102 }) 123 })
...@@ -145,13 +166,11 @@ export default { ...@@ -145,13 +166,11 @@ export default {
145 } 166 }
146 message = this.i18n.infomationImprove.errorTips.e6; 167 message = this.i18n.infomationImprove.errorTips.e6;
147 let idNo = this.information.idNo + ""; 168 let idNo = this.information.idNo + "";
148 console.log(idNo);
149 console.log(idNo.length);
150 switch (this.information.idType) { 169 switch (this.information.idType) {
151 case "0": // 外國人永久居留身份證 170 case "0": // 外國人永久居留身份證
152 if (/[a-z][A-Z]{3}[0-9]{12}/.test(idNo)) { 171 // if (/[a-z][A-Z]{3}[0-9]{12}/.test(idNo)) {
153 message = ""; 172 // message = "";
154 } 173 // }
155 message = ""; 174 message = "";
156 break; 175 break;
157 case "1": // 身份證 176 case "1": // 身份證
...@@ -167,14 +186,14 @@ export default { ...@@ -167,14 +186,14 @@ export default {
167 message = idNo.length > 5 && idNo.length < 50 ? "" : message; 186 message = idNo.length > 5 && idNo.length < 50 ? "" : message;
168 break; 187 break;
169 case "V": // 港澳台居民居住證 188 case "V": // 港澳台居民居住證
170 if ((/8[1|2]0000\\d{11}/.text(idNo) && (/\\d{15}/.test(idNo) || /\\d{17}/.test(idNo)))) { 189 // if ((/8[1|2]0000\\d{11}/.text(idNo) && (/\\d{15}/.test(idNo) || /\\d{17}/.test(idNo)))) {
171 message = ""; 190 message = "";
172 } 191 // }
173 break; 192 break;
174 case "W": //台灣居民居住證 193 case "W": //台灣居民居住證
175 if ((/830000\\d{11}/.text(idNo) && (/\\d{15}/.test(idNo) || /\\d{17}/.test(idNo)))) { 194 // if ((/830000\\d{11}/.text(idNo) && (/\\d{15}/.test(idNo) || /\\d{17}/.test(idNo)))) {
176 message = ""; 195 message = "";
177 } 196 // }
178 break; 197 break;
179 default: 198 default:
180 message = ""; 199 message = "";
......
...@@ -166,7 +166,6 @@ ...@@ -166,7 +166,6 @@
166 } 166 }
167 167
168 .ipt-wrap { 168 .ipt-wrap {
169 position: relative;
170 display: flex; 169 display: flex;
171 justify-content: space-between; 170 justify-content: space-between;
172 171
......