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
66761cf1
authored
2020-02-21 16:58:06 +0800
by
joe
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
3f03b9c8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
2 deletions
src/components/date-picker/date-picker.js
src/components/home/m-dropdown/m-dropdown.js
src/pages/custom-service/components/complaint-acceptance.vue
src/pages/index/index.js
src/pages/infomation-improve/infomation-improve.js
src/utils/lunar.js
src/components/date-picker/date-picker.js
View file @
66761cf
...
...
@@ -5,6 +5,7 @@ import {
}
from
'@/api/fetch-api.js'
import
Date
from
'@/utils/date.js'
;
import
{
toSolar
}
from
'@/utils/lunar.js'
;
import
{
ddMMyyyy2yyyyMMdd
...
...
@@ -100,6 +101,16 @@ export default {
// 用户渲染的数据
fortmatMonthData
:
[],
visible
:
false
,
hkHolidayDefine
:
{
// 公历假期,缺少复活节,缺少聖誕節後第一個周日
gl
:
[[
1
,
1
],
[
4
,
10
],
[
4
,
11
],
[
4
,
30
],
[
5
,
1
],
[
7
,
1
],
[
10
,
1
],
[
10
,
2
],
[
12
,
25
]],
// 农历假期,缺少清明节
nl
:
[[
1
,
1
],
[
1
,
2
],
[
1
,
3
],
[
5
,
5
],
[
8
,
15
],
[
9
,
9
]]
},
// 节假日,key是月份,value是日期列表
holiday
:
{
}
}
},
components
:
{},
...
...
@@ -201,6 +212,16 @@ export default {
nowDate
.
setHours
(
0
,
0
,
0
,
0
);
disable
=
buildDate
.
getTime
()
==
nowDate
.
getTime
();
}
if
(
!
disable
&&
this
.
filtModel
.
indexOf
(
"holiday"
)
>=
0
)
{
if
(
isWeekend
)
{
disable
=
true
;
}
else
{
let
holidayCandidates
=
this
.
holiday
[
month
+
""
];
if
(
holidayCandidates
&&
holidayCandidates
.
indexOf
(
d
)
>=
0
)
{
disable
=
true
;
}
}
}
if
(
!
disable
&&
this
.
filtModel
.
indexOf
(
"history"
)
>=
0
)
{
buildDate
.
setHours
(
23
,
59
,
59
,
999
);
disable
=
buildDate
.
getTime
()
<
nowDate
.
getTime
()
...
...
@@ -510,6 +531,70 @@ export default {
},
judgeLastDateValidate
(
val
)
{
},
calculateHolidays
()
{
// 计算新历
let
result
=
{};
let
year
=
this
.
year
;
if
(
!
year
)
{
return
;
}
let
hkHolidayDefine
=
this
.
hkHolidayDefine
;
for
(
let
index
=
0
;
index
<
hkHolidayDefine
.
gl
.
length
;
index
++
)
{
let
m
=
hkHolidayDefine
.
gl
[
index
][
0
];
let
d
=
hkHolidayDefine
.
gl
[
index
][
1
];
// 如果是周六/周日,顺延到下周一
let
date
=
Date
.
parse
(
`
${
year
}
.
${
m
}
.
${
d
}
`
);
if
(
date
.
getDay
()
==
6
)
{
// 周六
date
.
addDays
(
2
);
}
else
if
(
date
.
getDay
()
==
0
)
{
date
.
addDays
(
1
);
}
m
=
date
.
getMonth
()
+
1
;
d
=
date
.
getDate
();
let
list
=
result
[
m
];
if
(
!
list
)
{
result
[
m
]
=
[];
list
=
result
[
m
];
}
list
.
push
(
d
);
}
for
(
let
index
=
0
;
index
<
hkHolidayDefine
.
nl
.
length
;
index
++
)
{
let
m
=
hkHolidayDefine
.
nl
[
index
][
0
];
let
d
=
hkHolidayDefine
.
nl
[
index
][
1
];
let
gl
=
toSolar
(
year
,
m
,
d
);
m
=
gl
[
1
];
d
=
gl
[
2
];
// 如果是周六/周日,顺延到下周一
let
date
=
Date
.
parse
(
`
${
year
}
.
${
m
}
.
${
d
}
`
);
if
(
date
.
getDay
()
==
6
)
{
// 周六
date
.
addDays
(
2
);
}
else
if
(
date
.
getDay
()
==
0
)
{
date
.
addDays
(
1
);
}
m
=
date
.
getMonth
()
+
1
;
d
=
date
.
getDate
();
let
list
=
result
[
m
];
if
(
!
list
)
{
result
[
m
]
=
[];
list
=
result
[
m
];
}
list
.
push
(
d
);
}
this
.
holiday
=
result
;
console
.
log
(
JSON
.
stringify
(
this
.
holiday
));
}
},
mounted
()
{
},
...
...
@@ -524,6 +609,9 @@ export default {
dateValue
(
val
,
oldVal
)
{
this
.
checkDateValue
();
this
.
$emit
(
'input'
,
val
);
},
year
()
{
this
.
calculateHolidays
();
}
}
}
...
...
src/components/home/m-dropdown/m-dropdown.js
View file @
66761cf
...
...
@@ -95,6 +95,7 @@ export default {
}
},
logoutHandler
()
{
this
.
clearCache
();
httpPost
({
url
:
api
.
logout
}).
then
(()
=>
{
...
...
@@ -102,6 +103,12 @@ export default {
this
.
showLogoutTip
();
});
},
clearCache
()
{
for
(
let
index
=
0
;
index
<
sessionStorage
.
length
;
index
++
)
{
let
key
=
sessionStorage
.
key
(
index
);
sessionStorage
.
removeItem
(
key
);
}
},
// 点击item
onChangeHandler
(
evt
)
{
this
.
activeIndex
=
evt
;
...
...
src/pages/custom-service/components/complaint-acceptance.vue
View file @
66761cf
...
...
@@ -84,7 +84,7 @@
</div>
<div
class=
"ipt-wrap ipt-wrap2"
>
<!--
<input
class=
"ipt"
type=
"date"
:class=
"
{err:errorTips.contactDateErr.length>0}" v-model="data.contactDate"> -->
<date-picker
v-model=
"data.contactDate"
:check=
"checkDate
"
></date-picker>
<date-picker
v-model=
"data.contactDate"
:check=
"checkDate"
:filtModel=
"['history','holiday']
"
></date-picker>
</div>
<div
class=
"validator"
v-if=
"errorTips.contactDateErr.length > 0"
>
<img
src=
"@/assets/images/common/icon-notice.png"
alt=
""
>
{{
errorTips
.
contactDateErr
}}
...
...
src/pages/index/index.js
View file @
66761cf
...
...
@@ -233,7 +233,6 @@ export default {
},
created
()
{
}
}
...
...
src/pages/infomation-improve/infomation-improve.js
View file @
66761cf
...
...
@@ -122,6 +122,9 @@ export default {
initData
()
{
httpPost
({
url
:
api
.
profile
,
sid
:
true
}).
then
(
content
=>
{
if
(
content
)
{
if
(
content
.
birthDate
.
indexOf
(
" "
)
>
0
)
{
content
.
birthDate
=
content
.
birthDate
.
split
(
" "
)[
0
];
}
this
.
information
=
content
;
if
(
content
&&
content
.
birthDate
)
{
this
.
birthDate
=
content
.
birthDate
;
...
...
src/utils/lunar.js
0 → 100644
View file @
66761cf
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment