每日宣发

This commit is contained in:
shijingjing
2022-07-19 14:41:17 +08:00
parent ee3deef174
commit 8c0021f9db
2 changed files with 45 additions and 100 deletions

View File

@@ -3,22 +3,23 @@
<uni-calendar :insert="true" :selected="selected" :lunar="false" @change="change" @monthSwitch="changeMonth"/>
<div class="dailyMatters">
<div>
<div v-for="(item, index) in list.slice(0,3)" :key="index" :class="{'color1':index%4==0,'color2':index%4==1,'color3':index%4==2,'color4':index%4==3}" class="daily_item">
<div>{{ item.time }}</div>
<div>{{ item.info }}</div>
<div v-if="list && list.length">
<div>
<div v-for="(item, index) in list.slice(0,2)" :key="index" :class="{'color1':index%4==0,'color2':index%4==1,'color3':index%4==2,'color4':index%4==3}" class="daily_item">
<div>{{ item.createTime.substring(10, 16) }}</div>
<div>{{ item.taskTitle }}</div>
</div>
</div>
</div>
<div>
<div v-for="(item, index) in list" :key="index"
:class="{'color1': index % 4 == 0,'color2': index % 4 == 1,'color3': index % 4 == 2,'color4': index % 4 == 3 }"
class="daily_item">
<div>{{ item.time }}</div>
<div>{{ item.info }}</div>
<div v-show="show">
<div v-for="(item, index) in list.slice(0,list.length - 2)" :key="index"
:class="{'color1': index % 4 == 2,'color2': index % 4 == 3,'color3': index % 4 == 0,'color4': index % 4 == 1 }" class="daily_item">
<div>{{ item.createTime.substring(10, 16) }}</div>
<div>{{ item.taskTitle }}</div>
</div>
</div>
<div class="readMore" v-show="!show && list.length > 2" @click="show = true">查看更多</div>
</div>
<div class="readMore" @click="toGroup">查看更多</div>
<AiEmpty description="暂无宣发" v-else></AiEmpty>
</div>
</div>
</template>
@@ -30,10 +31,8 @@ export default {
return {
date: '',
selected: [],
list: [{
time: '11:00',
info: '晴风小区志愿者活动'
}],
list: [],
show: false,
calendarList: {},
year: '',
month: '',
@@ -46,8 +45,7 @@ export default {
},
created() {
this.getNowDay()
this.getData()
this.getData()
},
methods: {
changeMonth(e) {
@@ -59,7 +57,9 @@ export default {
this.getData()
},
change(val) {
this.date = `${val.year} + '-' + ${val.month} + '-' + ${val.day}`
this.date = val.fulldate
this.day = val.date
this.getData()
},
getNowDay() {
const date = new Date()
@@ -79,6 +79,7 @@ export default {
if (res?.data) {
this.calendarList = res.data;
let arr = Object.keys(res.data).map(key => (res.data[key]))
this.list = arr[this.day - 1]?.taskList
let calList = arr.filter(item=> (item.taskList && item.taskList.length > 0))
this.selected = calList.map(item=> {
if(item.day>=1 && item.day<=9) {
@@ -164,14 +165,11 @@ export default {
}
.readMore {
height: 100px;
line-height: 100px;
height: 40px;
line-height: 40px;
text-align: center;
color: #3F8DF5;
}
}
}
</style>