Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5999ed00
authored
2020-02-19 14:47:34 +0800
by
joe
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
产品修改
1 parent
64295c86
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
10 deletions
src/main.js
src/pages/custom-service/components/insurance-query.js
src/pages/custom-service/components/insurance-query.vue
src/pages/custom-service/components/policy-head-list.js
src/pages/custom-service/components/policy-head-list.vue
src/utils/biz.js
src/main.js
View file @
5999ed0
...
...
@@ -87,11 +87,19 @@ function initQueryConfig() {
let
rsaKey1
=
localStorage
.
getItem
(
"rsaKey"
);
let
rsaKeyIndex1
=
localStorage
.
getItem
(
"rsaKeyIndex"
);
let
vhis1
=
localStorage
.
getItem
(
"vhis"
);
let
policies
=
localStorage
.
getItem
(
"policies"
);
try
{
policies
=
policies
?
JSON
.
parse
(
policies
)
:
null
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
window
.
global
=
{
PK
:
rsaKey1
,
E
:
rsaKeyIndex1
,
vhis
:
vhis1
vhis
:
vhis1
,
policies
:
policies
};
httpGet
({
...
...
@@ -100,6 +108,7 @@ function initQueryConfig() {
let
rsaKey
=
res
.
rsaKey
;
let
rsaKeyIndex
=
res
.
rsaKeyIndex
;
let
vhis
=
res
.
vhis
;
let
policies
=
res
.
policies
;
if
(
rsaKey
)
{
window
.
global
.
PK
=
rsaKey
;
...
...
@@ -115,6 +124,11 @@ function initQueryConfig() {
window
.
global
.
vhis
=
vhis
;
localStorage
.
setItem
(
"vhis"
,
vhis
);
}
if
(
policies
)
{
window
.
global
.
policies
=
policies
;
localStorage
.
setItem
(
"policies"
,
JSON
.
stringify
(
policies
));
}
});
}
...
...
src/pages/custom-service/components/insurance-query.js
View file @
5999ed0
...
...
@@ -8,7 +8,7 @@ import {
import
Auth
from
'@components/auth/auth.vue'
;
import
PolicyHeadList
from
"./policy-head-list.vue"
;
import
{
formatMoney
,
getInsuredPeriod
,
getBenefitType
,
getPayPeriod
,
getPayType
,
getMoneyName
,
getPayMode
}
from
"@/utils/biz.js"
;
import
{
formatMoney
,
getInsuredPeriod
,
getBenefitType
,
getPayPeriod
,
getPayType
,
getMoneyName
,
getPayMode
,
getPolicyName
}
from
"@/utils/biz.js"
;
export
default
{
name
:
"InsuranceQuery"
,
...
...
@@ -120,6 +120,9 @@ export default {
return
"Year "
+
y
+
" issue "
+
p
;
}
},
formatPolicyName
(
c
,
n
)
{
return
getPolicyName
(
this
.
$i18n
.
locale
,
c
,
c
);
},
userLogout
()
{
this
.
showForm
=
false
;
},
...
...
src/pages/custom-service/components/insurance-query.vue
View file @
5999ed0
...
...
@@ -16,7 +16,7 @@
<div
class=
"data-line"
>
<div
class=
"cell1"
>
<div
class=
"label"
>
{{
$t
(
'customService.insuranceQuery.t2n1'
)
}}
</div>
<div
class=
"label"
>
{{
dataForm
.
productName
}}
</div>
<div
class=
"label"
>
{{
formatPolicyName
(
dataForm
.
productCode
,
dataForm
.
productName
)
}}
</div>
</div>
<div
class=
"separator-v"
></div>
<div
class=
"cell1"
>
...
...
src/pages/custom-service/components/policy-head-list.js
View file @
5999ed0
...
...
@@ -7,7 +7,7 @@ import {
import
{
mapState
}
from
'vuex'
;
import
{
formatMoney
,
getInsuredPeriod
}
from
"@/utils/biz.js"
;
import
{
formatMoney
,
getInsuredPeriod
,
getPolicyName
}
from
"@/utils/biz.js"
;
export
default
{
props
:
{
...
...
@@ -200,6 +200,9 @@ export default {
formatInsuredPeriod
(
t
,
v
)
{
return
getInsuredPeriod
(
this
.
$i18n
.
locale
,
t
,
v
);
},
formatPolicyName
(
c
,
n
)
{
return
getPolicyName
(
this
.
$i18n
.
locale
,
c
,
c
);
},
downloadPolicy
(
policy
)
{
if
(
policy
)
{
httpPost
({
url
:
api
.
getDownloadPath
,
sid
:
true
,
data
:
{
policyCode
:
policy
.
policyCode
}
}).
then
(
res
=>
{
...
...
src/pages/custom-service/components/policy-head-list.vue
View file @
5999ed0
...
...
@@ -38,7 +38,7 @@
</div>
<div
class=
"td w2"
>
{{lan == 'en' ? (item.insuredNameEn ? item.insuredNameEn : item.insuredNameCn) : (item.insuredNameCn ? item.insuredNameCn : item.insuredNameEn)}}
</div>
<div
class=
"td w1"
>
{{
item.productName
}}
</div>
<div
class=
"td w1"
>
{{
formatPolicyName(item.productCode, item.productName)
}}
</div>
<div
class=
"td w2"
>
{{item.moneyCode}} {{formatMoney(item.amount,0)}}
</div>
<div
class=
"td w2"
>
{{item.expireAt?item.expireAt.split(" ")[0]:""}}
</div>
<!-- <div class="td w2">{{item.guaranteeAge?item.guaranteeAge.split(" ")[0]:""}}</div> -->
...
...
src/utils/biz.js
View file @
5999ed0
...
...
@@ -1069,13 +1069,13 @@ export function getInsuredPeriod(lan, t, v) {
value
=
lan
==
"zh"
?
"保终身"
:
lan
==
"tc"
?
"保終身"
:
"Cover whole life"
;
break
;
case
"2"
:
value
=
lan
==
"zh"
?
"保"
+
v
+
"年"
:
lan
==
"tc"
?
"保"
+
v
+
"年"
:
"Cover "
+
v
+
"
year"
;
value
=
lan
==
"zh"
?
"保"
+
v
+
"年"
:
lan
==
"tc"
?
"保"
+
v
+
"年"
:
"Cover "
+
v
+
"
"
+
(
v
>
1
?
"years"
:
"year"
)
;
break
;
case
"3"
:
value
=
lan
==
"zh"
?
"至"
+
v
+
"岁"
:
lan
==
"tc"
?
"至"
+
v
+
"歲"
:
"Cover up to "
+
v
+
"
age
"
;
value
=
lan
==
"zh"
?
"至"
+
v
+
"岁"
:
lan
==
"tc"
?
"至"
+
v
+
"歲"
:
"Cover up to "
+
v
+
"
"
+
(
v
>
1
?
"years"
:
"year"
)
+
" old
"
;
break
;
case
"4"
:
value
=
lan
==
"zh"
?
"保"
+
v
+
"月"
:
lan
==
"tc"
?
"保"
+
v
+
"月"
:
"Cover "
+
v
+
"
month"
;
value
=
lan
==
"zh"
?
"保"
+
v
+
"月"
:
lan
==
"tc"
?
"保"
+
v
+
"月"
:
"Cover "
+
v
+
"
"
+
(
v
>
1
?
"months"
:
"month"
)
;
break
;
default
:
value
=
lan
==
"zh"
?
"无关"
:
lan
==
"tc"
?
"無關"
:
"NA"
;
...
...
@@ -1132,10 +1132,10 @@ export function getPayPeriod(lan, t, v) {
value
=
lan
==
"zh"
?
"趸交"
:
lan
==
"tc"
?
"躉繳"
:
"Single"
;
break
;
case
"2"
:
value
=
lan
==
"zh"
?
"缴"
+
v
+
"年"
:
lan
==
"tc"
?
"繳"
+
v
+
"年"
:
""
+
v
+
"
year"
;
value
=
lan
==
"zh"
?
"缴"
+
v
+
"年"
:
lan
==
"tc"
?
"繳"
+
v
+
"年"
:
""
+
v
+
"
"
+
(
v
>
1
?
"years"
:
"year"
);
;
break
;
case
"3"
:
value
=
lan
==
"zh"
?
"缴至"
+
v
+
"岁"
:
lan
==
"tc"
?
"繳至"
+
v
+
"歲"
:
"Pay to"
+
v
+
"
year
old"
;
value
=
lan
==
"zh"
?
"缴至"
+
v
+
"岁"
:
lan
==
"tc"
?
"繳至"
+
v
+
"歲"
:
"Pay to"
+
v
+
"
"
+
(
v
>
1
?
"years"
:
"year"
)
+
"
old"
;
break
;
default
:
value
=
lan
==
"zh"
?
"缴终身"
:
lan
==
"tc"
?
"繳終身"
:
"Whole life"
;
...
...
@@ -1184,3 +1184,39 @@ export function getMoneyName(lan, t) {
}
return
value
;
}
/**
* 通过产品的code并通过语言选择产品名称
* @param {*} lan
* @param {*} code
* @param {*} name
*/
export
function
getPolicyName
(
lan
,
code
,
name
)
{
let
policy
=
null
;
try
{
if
(
window
.
global
.
policies
)
{
for
(
let
i
=
0
;
i
<
window
.
global
.
policies
.
length
;
i
++
)
{
let
p
=
window
.
global
.
policies
[
i
];
if
(
p
.
policyCode
==
code
)
{
policy
=
p
;
break
;
}
}
}
}
catch
(
e
)
{
}
if
(
!
policy
)
{
return
name
;
}
switch
(
lan
)
{
case
"zh"
:
return
policy
.
nameCn
?
policy
.
nameCn
:
name
;
case
"en"
:
return
policy
.
nameEn
?
policy
.
nameEn
:
name
;
default
:
return
policy
.
nameTc
?
policy
.
nameTc
:
name
;
}
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment