This commit is contained in:
xuli
2025-11-20 17:54:50 +08:00
parent 003d2d0797
commit 4115adbdb0
3 changed files with 35 additions and 5 deletions

View File

@@ -11,7 +11,7 @@
<view class="search">
<view class="search-bg s-b-left" @click="chooseDate">
<img :src="'static/images/polling/icon-search-clock.png'" class="img-icon" />
近3天
{{dateStrName}}
<uni-icons type="down" size="16" color="#C8DCFF" style="margin-left:auto;"></uni-icons>
</view>
<view class="search-bg s-b-right">
@@ -99,7 +99,7 @@ import { onLoad,onHide } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue';
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import searchDate from '@/components/searchDate.vue';
import { parseTime,getDateRange } from '@/utils/datetime.js';
import { parseTime,getDateRange,getDateRangeName } from '@/utils/datetime.js';
import { taskTypeOptions,formatTaskType,formatTaskStatus } from '@/utils/status.js';
import { noticeList } from '@/api/notice.js'
@@ -113,23 +113,27 @@ const chooseDate = ()=>{
const dateClose=()=>{
isShow.value = false;
}
// 选完日期提交回显
const dateConfirm=(dateObj)=>{
console.log(dateObj)
isShow.value = false;
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
dateStrName.value = getDateRangeName(dateObj.lastType)
}
// 类型索引
let taskTypeIndex = ref(0);
let taskTypeArr = ref([]);
let dateStr = ref('');
let dateStrName=ref('');
onLoad(option => {
taskTypeOptions.forEach(item => {
taskTypeArr.value.push(item.label)
});
let dateObj = getDateRange('3days');
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
dateStrName.value="近3天"
})