产品修改
Showing
6 changed files
with
66 additions
and
10 deletions
... | @@ -87,11 +87,19 @@ function initQueryConfig() { | ... | @@ -87,11 +87,19 @@ function initQueryConfig() { |
87 | let rsaKey1 = localStorage.getItem("rsaKey"); | 87 | let rsaKey1 = localStorage.getItem("rsaKey"); |
88 | let rsaKeyIndex1 = localStorage.getItem("rsaKeyIndex"); | 88 | let rsaKeyIndex1 = localStorage.getItem("rsaKeyIndex"); |
89 | let vhis1 = localStorage.getItem("vhis"); | 89 | let vhis1 = localStorage.getItem("vhis"); |
90 | let policies = localStorage.getItem("policies"); | ||
91 | |||
92 | try { | ||
93 | policies = policies ? JSON.parse(policies) : null; | ||
94 | } catch (e) { | ||
95 | console.error(e); | ||
96 | } | ||
90 | 97 | ||
91 | window.global = { | 98 | window.global = { |
92 | PK: rsaKey1, | 99 | PK: rsaKey1, |
93 | E: rsaKeyIndex1, | 100 | E: rsaKeyIndex1, |
94 | vhis: vhis1 | 101 | vhis: vhis1, |
102 | policies: policies | ||
95 | }; | 103 | }; |
96 | 104 | ||
97 | httpGet({ | 105 | httpGet({ |
... | @@ -100,6 +108,7 @@ function initQueryConfig() { | ... | @@ -100,6 +108,7 @@ function initQueryConfig() { |
100 | let rsaKey = res.rsaKey; | 108 | let rsaKey = res.rsaKey; |
101 | let rsaKeyIndex = res.rsaKeyIndex; | 109 | let rsaKeyIndex = res.rsaKeyIndex; |
102 | let vhis = res.vhis; | 110 | let vhis = res.vhis; |
111 | let policies = res.policies; | ||
103 | 112 | ||
104 | if (rsaKey) { | 113 | if (rsaKey) { |
105 | window.global.PK = rsaKey; | 114 | window.global.PK = rsaKey; |
... | @@ -115,6 +124,11 @@ function initQueryConfig() { | ... | @@ -115,6 +124,11 @@ function initQueryConfig() { |
115 | window.global.vhis = vhis; | 124 | window.global.vhis = vhis; |
116 | localStorage.setItem("vhis", vhis); | 125 | localStorage.setItem("vhis", vhis); |
117 | } | 126 | } |
127 | |||
128 | if (policies) { | ||
129 | window.global.policies = policies; | ||
130 | localStorage.setItem("policies", JSON.stringify(policies)); | ||
131 | } | ||
118 | }); | 132 | }); |
119 | 133 | ||
120 | } | 134 | } | ... | ... |
... | @@ -8,7 +8,7 @@ import { | ... | @@ -8,7 +8,7 @@ import { |
8 | import Auth from '@components/auth/auth.vue'; | 8 | import Auth from '@components/auth/auth.vue'; |
9 | import PolicyHeadList from "./policy-head-list.vue"; | 9 | import PolicyHeadList from "./policy-head-list.vue"; |
10 | 10 | ||
11 | import { formatMoney, getInsuredPeriod, getBenefitType, getPayPeriod, getPayType, getMoneyName, getPayMode } from "@/utils/biz.js"; | 11 | import { formatMoney, getInsuredPeriod, getBenefitType, getPayPeriod, getPayType, getMoneyName, getPayMode,getPolicyName } from "@/utils/biz.js"; |
12 | 12 | ||
13 | export default { | 13 | export default { |
14 | name: "InsuranceQuery", | 14 | name: "InsuranceQuery", |
... | @@ -120,6 +120,9 @@ export default { | ... | @@ -120,6 +120,9 @@ export default { |
120 | return "Year " + y + " issue " + p; | 120 | return "Year " + y + " issue " + p; |
121 | } | 121 | } |
122 | }, | 122 | }, |
123 | formatPolicyName(c, n) { | ||
124 | return getPolicyName(this.$i18n.locale, c, c); | ||
125 | }, | ||
123 | userLogout() { | 126 | userLogout() { |
124 | this.showForm = false; | 127 | this.showForm = false; |
125 | }, | 128 | }, | ... | ... |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | <div class="data-line"> | 16 | <div class="data-line"> |
17 | <div class="cell1"> | 17 | <div class="cell1"> |
18 | <div class="label">{{$t('customService.insuranceQuery.t2n1')}}</div> | 18 | <div class="label">{{$t('customService.insuranceQuery.t2n1')}}</div> |
19 | <div class="label">{{dataForm.productName}}</div> | 19 | <div class="label">{{formatPolicyName(dataForm.productCode, dataForm.productName)}}</div> |
20 | </div> | 20 | </div> |
21 | <div class="separator-v"></div> | 21 | <div class="separator-v"></div> |
22 | <div class="cell1"> | 22 | <div class="cell1"> | ... | ... |
... | @@ -7,7 +7,7 @@ import { | ... | @@ -7,7 +7,7 @@ import { |
7 | import { | 7 | import { |
8 | mapState | 8 | mapState |
9 | } from 'vuex'; | 9 | } from 'vuex'; |
10 | import { formatMoney, getInsuredPeriod } from "@/utils/biz.js"; | 10 | import { formatMoney, getInsuredPeriod, getPolicyName } from "@/utils/biz.js"; |
11 | 11 | ||
12 | export default { | 12 | export default { |
13 | props: { | 13 | props: { |
... | @@ -200,6 +200,9 @@ export default { | ... | @@ -200,6 +200,9 @@ export default { |
200 | formatInsuredPeriod(t, v) { | 200 | formatInsuredPeriod(t, v) { |
201 | return getInsuredPeriod(this.$i18n.locale, t, v); | 201 | return getInsuredPeriod(this.$i18n.locale, t, v); |
202 | }, | 202 | }, |
203 | formatPolicyName(c, n) { | ||
204 | return getPolicyName(this.$i18n.locale, c, c); | ||
205 | }, | ||
203 | downloadPolicy(policy) { | 206 | downloadPolicy(policy) { |
204 | if (policy) { | 207 | if (policy) { |
205 | httpPost({ url: api.getDownloadPath, sid: true, data: { policyCode: policy.policyCode } }).then(res => { | 208 | httpPost({ url: api.getDownloadPath, sid: true, data: { policyCode: policy.policyCode } }).then(res => { | ... | ... |
... | @@ -38,7 +38,7 @@ | ... | @@ -38,7 +38,7 @@ |
38 | </div> | 38 | </div> |
39 | 39 | ||
40 | <div class="td w2">{{lan == 'en' ? (item.insuredNameEn ? item.insuredNameEn : item.insuredNameCn) : (item.insuredNameCn ? item.insuredNameCn : item.insuredNameEn)}}</div> | 40 | <div class="td w2">{{lan == 'en' ? (item.insuredNameEn ? item.insuredNameEn : item.insuredNameCn) : (item.insuredNameCn ? item.insuredNameCn : item.insuredNameEn)}}</div> |
41 | <div class="td w1">{{item.productName}}</div> | 41 | <div class="td w1">{{formatPolicyName(item.productCode, item.productName)}}</div> |
42 | <div class="td w2">{{item.moneyCode}} {{formatMoney(item.amount,0)}}</div> | 42 | <div class="td w2">{{item.moneyCode}} {{formatMoney(item.amount,0)}}</div> |
43 | <div class="td w2">{{item.expireAt?item.expireAt.split(" ")[0]:""}}</div> | 43 | <div class="td w2">{{item.expireAt?item.expireAt.split(" ")[0]:""}}</div> |
44 | <!-- <div class="td w2">{{item.guaranteeAge?item.guaranteeAge.split(" ")[0]:""}}</div> --> | 44 | <!-- <div class="td w2">{{item.guaranteeAge?item.guaranteeAge.split(" ")[0]:""}}</div> --> | ... | ... |
... | @@ -1069,13 +1069,13 @@ export function getInsuredPeriod(lan, t, v) { | ... | @@ -1069,13 +1069,13 @@ export function getInsuredPeriod(lan, t, v) { |
1069 | value = lan == "zh" ? "保终身" : lan == "tc" ? "保終身" : "Cover whole life"; | 1069 | value = lan == "zh" ? "保终身" : lan == "tc" ? "保終身" : "Cover whole life"; |
1070 | break; | 1070 | break; |
1071 | case "2": | 1071 | case "2": |
1072 | value = lan == "zh" ? "保" + v + "年" : lan == "tc" ? "保" + v + "年" : "Cover " + v + " year"; | 1072 | value = lan == "zh" ? "保" + v + "年" : lan == "tc" ? "保" + v + "年" : "Cover " + v + " " + (v > 1 ? "years" : "year"); |
1073 | break; | 1073 | break; |
1074 | case "3": | 1074 | case "3": |
1075 | value = lan == "zh" ? "至" + v + "岁" : lan == "tc" ? "至" + v + "歲" : "Cover up to " + v + " age"; | 1075 | value = lan == "zh" ? "至" + v + "岁" : lan == "tc" ? "至" + v + "歲" : "Cover up to " + v + " " + (v > 1 ? "years" : "year") + " old"; |
1076 | break; | 1076 | break; |
1077 | case "4": | 1077 | case "4": |
1078 | value = lan == "zh" ? "保" + v + "月" : lan == "tc" ? "保" + v + "月" : "Cover " + v + " month"; | 1078 | value = lan == "zh" ? "保" + v + "月" : lan == "tc" ? "保" + v + "月" : "Cover " + v + " " + (v > 1 ? "months" : "month"); |
1079 | break; | 1079 | break; |
1080 | default: | 1080 | default: |
1081 | value = lan == "zh" ? "无关" : lan == "tc" ? "無關" : "NA"; | 1081 | value = lan == "zh" ? "无关" : lan == "tc" ? "無關" : "NA"; |
... | @@ -1132,10 +1132,10 @@ export function getPayPeriod(lan, t, v) { | ... | @@ -1132,10 +1132,10 @@ export function getPayPeriod(lan, t, v) { |
1132 | value = lan == "zh" ? "趸交" : lan == "tc" ? "躉繳" : "Single"; | 1132 | value = lan == "zh" ? "趸交" : lan == "tc" ? "躉繳" : "Single"; |
1133 | break; | 1133 | break; |
1134 | case "2": | 1134 | case "2": |
1135 | value = lan == "zh" ? "缴" + v + "年" : lan == "tc" ? "繳" + v + "年" : "" + v + " year"; | 1135 | value = lan == "zh" ? "缴" + v + "年" : lan == "tc" ? "繳" + v + "年" : "" + v + " " + (v > 1 ? "years" : "year");; |
1136 | break; | 1136 | break; |
1137 | case "3": | 1137 | case "3": |
1138 | value = lan == "zh" ? "缴至" + v + "岁" : lan == "tc" ? "繳至" + v + "歲" : "Pay to" + v + " year old"; | 1138 | value = lan == "zh" ? "缴至" + v + "岁" : lan == "tc" ? "繳至" + v + "歲" : "Pay to" + v + " " + (v > 1 ? "years" : "year") + " old"; |
1139 | break; | 1139 | break; |
1140 | default: | 1140 | default: |
1141 | value = lan == "zh" ? "缴终身" : lan == "tc" ? "繳終身" : "Whole life"; | 1141 | value = lan == "zh" ? "缴终身" : lan == "tc" ? "繳終身" : "Whole life"; |
... | @@ -1184,3 +1184,39 @@ export function getMoneyName(lan, t) { | ... | @@ -1184,3 +1184,39 @@ export function getMoneyName(lan, t) { |
1184 | } | 1184 | } |
1185 | return value; | 1185 | return value; |
1186 | } | 1186 | } |
1187 | |||
1188 | |||
1189 | /** | ||
1190 | * 通过产品的code并通过语言选择产品名称 | ||
1191 | * @param {*} lan | ||
1192 | * @param {*} code | ||
1193 | * @param {*} name | ||
1194 | */ | ||
1195 | export function getPolicyName(lan, code, name) { | ||
1196 | let policy = null; | ||
1197 | try { | ||
1198 | if (window.global.policies) { | ||
1199 | for (let i = 0; i < window.global.policies.length; i++) { | ||
1200 | let p = window.global.policies[i]; | ||
1201 | if (p.policyCode == code) { | ||
1202 | policy = p; | ||
1203 | break; | ||
1204 | } | ||
1205 | } | ||
1206 | } | ||
1207 | } catch (e) { | ||
1208 | |||
1209 | } | ||
1210 | if (!policy) { | ||
1211 | return name; | ||
1212 | } | ||
1213 | |||
1214 | switch (lan) { | ||
1215 | case "zh": | ||
1216 | return policy.nameCn ? policy.nameCn : name; | ||
1217 | case "en": | ||
1218 | return policy.nameEn ? policy.nameEn : name; | ||
1219 | default: | ||
1220 | return policy.nameTc ? policy.nameTc : name; | ||
1221 | } | ||
1222 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment