123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- Page({
- data: {
- role: "teacher",
- historyList: [
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- {
- image: 'https://img1.baidu.com/it/u=2052658756,3021621759&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
- title: '趣味识字卡片',
- date: '2023-10-15 14:30',
- checked: false
- },
- // 其他列表项...
- ],
- isManaging: false
- },
- onLoad(options) {
- // 页面加载时的初始化操作
- },
- onReachBottom() {
- // 上拉触底事件的处理函数
- this.loadMore();
- },
- loadMore() {
- // 加载更多数据的逻辑
- console.log('加载更多');
- },
- toggleManageMode() {
- const { isManaging, historyList } = this.data;
- if (isManaging) {
- if (historyList && historyList.length > 0) {
- historyList.forEach(item => item.checked = false);
- }
- this.setData({ isManaging: false });
- } else {
- this.setData({ isManaging: true });
- }
- },
- selectAll() {
- const { historyList } = this.data;
- if (historyList && historyList.length > 0) {
- const allChecked = historyList.every(item => item.checked);
- historyList.forEach(item => item.checked = !allChecked);
- this.setData({ historyList });
- }
- },
- deleteItems() {
- const { historyList } = this.data;
- if (historyList && historyList.length > 0) {
- const newList = historyList.filter(item => !item.checked);
- this.setData({ historyList: newList });
- }
- }
- });
|