|
@@ -116,19 +116,17 @@
|
|
|
v-model:visible="isVisible5"
|
|
v-model:visible="isVisible5"
|
|
|
:default-value="date5"
|
|
:default-value="date5"
|
|
|
type="range"
|
|
type="range"
|
|
|
- :start-date="null"
|
|
|
|
|
- :end-date="null"
|
|
|
|
|
@close="closeSwitch('isVisible5')"
|
|
@close="closeSwitch('isVisible5')"
|
|
|
@choose="setChooseValue5"
|
|
@choose="setChooseValue5"
|
|
|
>
|
|
>
|
|
|
- <template v-slot:btn>
|
|
|
|
|
|
|
+ <template #btn>
|
|
|
<view class="wrapper">
|
|
<view class="wrapper">
|
|
|
- <div class="d_div"> <span class="d_btn" @click="goDate">去某个时间</span></div>
|
|
|
|
|
|
|
+ <view class="d_div"> <span class="d_btn" @click="goDate">去某个时间</span></view>
|
|
|
<view class="d_div"> <span class="d_btn" @click="clickBtn">最近七天</span></view>
|
|
<view class="d_div"> <span class="d_btn" @click="clickBtn">最近七天</span></view>
|
|
|
<view class="d_div"> <span class="d_btn" @click="clickBtn1">当月</span></view>
|
|
<view class="d_div"> <span class="d_btn" @click="clickBtn1">当月</span></view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:day="date">
|
|
|
|
|
|
|
+ <template #day="date">
|
|
|
<span>{{ date.date.day }}</span>
|
|
<span>{{ date.date.day }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</nut-calendar>
|
|
</nut-calendar>
|
|
@@ -147,17 +145,17 @@
|
|
|
type="range"
|
|
type="range"
|
|
|
@close="closeSwitch('isVisible6')"
|
|
@close="closeSwitch('isVisible6')"
|
|
|
@choose="setChooseValue6"
|
|
@choose="setChooseValue6"
|
|
|
- :start-date="`2022-02-01`"
|
|
|
|
|
- :end-date="`2022-3-30`"
|
|
|
|
|
|
|
+ :start-date="`2022-01-01`"
|
|
|
|
|
+ :end-date="`2022-12-31`"
|
|
|
confirm-text="submit"
|
|
confirm-text="submit"
|
|
|
start-text="入店"
|
|
start-text="入店"
|
|
|
end-text="离店"
|
|
end-text="离店"
|
|
|
title="日期选择"
|
|
title="日期选择"
|
|
|
>
|
|
>
|
|
|
- <template v-slot:day="date">
|
|
|
|
|
|
|
+ <template #day="date">
|
|
|
<view>{{ date.date.day <= 9 ? '0' + date.date.day : date.date.day }}</view>
|
|
<view>{{ date.date.day <= 9 ? '0' + date.date.day : date.date.day }}</view>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:bottomInfo="date">
|
|
|
|
|
|
|
+ <template #bottom-info="date">
|
|
|
<view class="info">{{ date.date ? (date.date.day == 10 ? '十' : '') : '' }}</view>
|
|
<view class="info">{{ date.date ? (date.date.day == 10 ? '十' : '') : '' }}</view>
|
|
|
</template>
|
|
</template>
|
|
|
</nut-calendar>
|
|
</nut-calendar>
|
|
@@ -230,7 +228,7 @@ export default {
|
|
|
setup() {
|
|
setup() {
|
|
|
const env = Taro.getEnv();
|
|
const env = Taro.getEnv();
|
|
|
|
|
|
|
|
- const calendarRef = ref(null);
|
|
|
|
|
|
|
+ const calendarRef = ref<any>(null);
|
|
|
const state: TestCalendarState = reactive({
|
|
const state: TestCalendarState = reactive({
|
|
|
isVisible: false,
|
|
isVisible: false,
|
|
|
date: '2022-02-01',
|
|
date: '2022-02-01',
|
|
@@ -299,11 +297,11 @@ export default {
|
|
|
const setChooseValue8 = (param: string) => {
|
|
const setChooseValue8 = (param: string) => {
|
|
|
state.date8 = param[3];
|
|
state.date8 = param[3];
|
|
|
};
|
|
};
|
|
|
- const clickBtn = (param: string) => {
|
|
|
|
|
|
|
+ const clickBtn = () => {
|
|
|
let date = [Utils.date2Str(new Date()), Utils.getDay(6)];
|
|
let date = [Utils.date2Str(new Date()), Utils.getDay(6)];
|
|
|
state.date5 = date;
|
|
state.date5 = date;
|
|
|
};
|
|
};
|
|
|
- const clickBtn1 = (param: string) => {
|
|
|
|
|
|
|
+ const clickBtn1 = () => {
|
|
|
let date = new Date();
|
|
let date = new Date();
|
|
|
let year = date.getFullYear();
|
|
let year = date.getFullYear();
|
|
|
let month: any = date.getMonth() + 1;
|
|
let month: any = date.getMonth() + 1;
|
|
@@ -314,7 +312,9 @@ export default {
|
|
|
};
|
|
};
|
|
|
const goDate = () => {
|
|
const goDate = () => {
|
|
|
if (calendarRef.value) {
|
|
if (calendarRef.value) {
|
|
|
- calendarRef.value.scrollToDate(Utils.date2Str(new Date()));
|
|
|
|
|
|
|
+ var date1 = new Date();
|
|
|
|
|
+ date1.setDate(date1.getDate() + 30);
|
|
|
|
|
+ calendarRef.value.scrollToDate(Utils.date2Str(date1));
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
@@ -351,6 +351,7 @@ export default {
|
|
|
.wrapper {
|
|
.wrapper {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
padding: 0 40px;
|
|
padding: 0 40px;
|
|
|
|
|
+ justify-content: center;
|
|
|
}
|
|
}
|
|
|
.d_div {
|
|
.d_div {
|
|
|
margin: 0px 5px;
|
|
margin: 0px 5px;
|