Skip to content

Commit

Permalink
Merge pull request jd-opensource#495 from guoxiao158/next
Browse files Browse the repository at this point in the history
fix: 迁移calander
  • Loading branch information
szg2008 authored Jun 8, 2021
2 parents fd79d3a + b039845 commit c07c206
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
1 change: 0 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

node ./jd/verifymail.js
yarn lint-staged
yarn test
5 changes: 3 additions & 2 deletions src/packages/__VUE/calendaritem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,9 @@ export default create({
requestAniFrame(() => {
if (weeksPanel?.value && monthsPanel?.value) {
const top = weeksPanel?.value.getBoundingClientRect().bottom;
const monthsDoms =
monthsPanel.value.querySelectorAll('.calendar-month');
const monthsDoms = monthsPanel.value.getElementsByClassName(
'.calendar-month'
);
for (let i = 0; i < monthsDoms.length; i++) {
if (
monthsDoms[i].getBoundingClientRect().top <= top &&
Expand Down
32 changes: 22 additions & 10 deletions src/sites/mobile-taro/vue/src/pages/calendar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:show-icon="true"
title="选择日期区间"
:desc="date1 ? `${date1[0]}至${date1[1]}` : '请选择'"
@click="openSwitch('isVisible1')"
@click="openSwitch1('isVisible1')"
>
</nut-cell>
<nut-calendar
Expand All @@ -34,7 +34,7 @@
type="range"
:start-date="`2019-12-22`"
:end-date="`2021-01-08`"
@close="closeSwitch('isVisible1')"
@close="closeSwitch1('isVisible1')"
@choose="setChooseValue1"
>
</nut-calendar>
Expand All @@ -46,12 +46,12 @@
:show-icon="true"
title="选择日期"
:desc="date3 ? date3 : '请选择'"
@click="openSwitch('isVisible3')"
@click="openSwitch3('isVisible3')"
>
</nut-cell>
<nut-calendar
v-model:visible="isVisible3"
@close="closeSwitch('isVisible3')"
@close="closeSwitch3('isVisible3')"
@choose="setChooseValue3"
:default-value="date3"
:start-date="null"
Expand Down Expand Up @@ -104,15 +104,23 @@ export default {
date3: ''
});
const openSwitch = (param: string) => {
state[`${param}`] = true;
//state.isVisible = true;
state.isVisible = true;
};
const openSwitch1 = (param: string) => {
state.isVisible1 = true;
};
const openSwitch3 = (param: string) => {
state.isVisible3 = true;
};
const closeSwitch = (param: string) => {
state[`${param}`] = false;
//state.isVisible = false;
state.isVisible = false;
};
const closeSwitch1 = (param: string) => {
state.isVisible1 = false;
};
const closeSwitch3 = (param: string) => {
state.isVisible3 = false;
};
const setChooseValue = (param: string) => {
state.date = param[3];
state.dateWeek = param[4];
Expand All @@ -134,7 +142,11 @@ export default {
return {
...toRefs(state),
openSwitch,
openSwitch1,
openSwitch3,
closeSwitch,
closeSwitch1,
closeSwitch3,
setChooseValue,
setChooseValue1,
setChooseValue2,
Expand Down

0 comments on commit c07c206

Please sign in to comment.