视频中心ui提交

feasure-livedata
lld 2026-03-27 18:00:28 +08:00
parent 96c9855815
commit b9c62d3afd
1 changed files with 32 additions and 10 deletions

View File

@ -75,15 +75,7 @@ import {parseTime} from "@/utils/agri";
export default { export default {
data() { data() {
return { return {
dateList: [ dateList: this.getDateList(),
{ week: '五', day: '20', active: false },
{ week: '六', day: '21', active: false },
{ week: '日', day: '22', active: false },
{ week: '一', day: '23', active: false },
{ week: '二', day: '24', active: false },
{ week: '三', day: '25', active: false },
{ week: '四', day: '今', active: true }
],
activeCategory: 'person', activeCategory: 'person',
categoryList: [ categoryList: [
{ type: 'person', name: '人', imgUrl: "https://picsum.photos/id/1015/400/200" }, { type: 'person', name: '人', imgUrl: "https://picsum.photos/id/1015/400/200" },
@ -127,17 +119,47 @@ export default {
parseTime, parseTime,
handleDateClick(item) { handleDateClick(item) {
this.dateList = this.dateList.map(d => ({ ...d, active: d === item })) this.dateList = this.dateList.map(d => ({ ...d, active: d === item }))
uni.showToast({ title: `切换到${item.day} ${item.week}` })
// todo
// this.videoList = this.getDateList1();
}, },
handleCategoryClick(type) { handleCategoryClick(type) {
if (type === 'filter') { if (type === 'filter') {
this.handleFilterClick(); this.handleFilterClick();
return; return;
} }
// todo
this.activeCategory = type; this.activeCategory = type;
uni.showToast({ title: `切换到${type === 'person' ? '人' : type === 'car' ? '车' : '动物'}分类` }) uni.showToast({ title: `切换到${type === 'person' ? '人' : type === 'car' ? '车' : '动物'}分类` })
}, },
handleFilterClick() { handleFilterClick() {
// todo
uni.showToast({ title: '打开筛选面板' }) uni.showToast({ title: '打开筛选面板' })
},
getDateList() {
const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
const today = new Date();
const list = [];
for (let i = 6; i >= 0; i--) {
const date = new Date(today);
date.setDate(today.getDate() - i);
list.push({
week: weekMap[date.getDay()],
day: i === 0 ? '今' : date.getDate() + '',
active: i === 0
});
}
return list;
},
getDateList1() {
const w = ['日', '一', '二', '三', '四', '五', '六'];
const t = new Date();
return Array.from({length:7}, (_,i)=>{
const d = new Date(t); d.setDate(t.getDate()-6+i);
return { week:w[d.getDay()], day:i===6?'今':d.getDate()+'', active:i===6 }
})
} }
} }
} }
@ -205,7 +227,7 @@ export default {
.category-item { .category-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 8rpx 16rpx; padding: 8rpx 20rpx;
border: 1rpx solid #e0e0e0; border: 1rpx solid #e0e0e0;
border-radius: 20rpx; border-radius: 20rpx;
margin-left: 15rpx; margin-left: 15rpx;