This commit is contained in:
shijingjing
2022-07-15 10:44:31 +08:00
parent d1d4287c06
commit 936ba62f1c
4 changed files with 573 additions and 239 deletions

View File

@@ -29,23 +29,61 @@ export default {
data() {
return {
date: '',
selected: [{date: '2022-07-12'}],
selected: [],
list: [{
time: '11:00',
info: '晴风小区志愿者活动'
}]
}],
calendarList: {},
year: '',
month: '',
day: '',
}
},
components: {
uniCalendar
},
created() {
this.getNowDay()
this.getData()
},
methods: {
change(val) {
this.date = `${val.year} + '-' + ${val.month} + '-' + ${val.day}`
},
getNowDay() {
const date = new Date()
this.year = date.getFullYear()
this.month = date.getMonth() + 1
},
toGroup() {
uni.navigateTo({url: './groupSendResident'})
}
},
getData() {
this.$http.post(`/app/appmasssendingtask/statisticsCalendar`, null, {
params: {},
})
.then((res) => {
if (res?.data) {
this.calendarList = res.data;
var arr = Object.keys(res.data).map(key => (res.data[key]))
var calList = arr.filter(item=> (item.taskList && item.taskList.length > 0))
this.selected = calList.map(item=> {
if(item.day>=1 && item.day<=9) {
if(this.month>=1 && this.month <=9) {
return this.year + '-' + '0' + this.month + '-' + '0' + item.day
}
} else if(item.day> 9) {
if(this.month > 9) {
return this.year + '-' + this.month + '-' + item.day
}
}
})
console.log(this.selected);
}
});
},
},
onShow() {
document.title = '宣发日历'