记录每天自己学到的代码

按规律输入星星
//for(int a = 10; a >= 0; a–)
//{
// for (int j = a; j >= 1; j–)
// {
// Console.Write(" ");
// }

        //    for (int j = a; j <=10; j++)
        //    {
        //        Console.Write("☆");
        //    }
        //    Console.WriteLine();
        //}

        //Console.ReadKey();

//逢七就过
//for (int i = 1; i <= 100; i++)
//{
// if (i % 7 == 0)
// {
// continue;

        //    }
        //    if (i % 10 == 7)
        //    {
        //        continue;
        //    }

        //    if (i > 70 && i < 80)
        //    {
        //        continue;
        //    }
        //    Console.WriteLine(i);
        //}
        //Console.ReadKey();
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的微信小程序制作习计划打卡记录页面的代码示例: ```html <!-- index.wxml --> <view class="container"> <view class="header">习计划打卡记录</view> <view class="content"> <view class="plan"> <view class="plan-title">今日计划</view> <view class="plan-item" wx:for="{{planList}}" wx:key="index"> <checkbox value="{{item.checked}}" bindchange="onPlanChange">{{item.title}}</checkbox> </view> </view> <view class="record"> <view class="record-title">打卡记录</view> <view class="record-item" wx:for="{{recordList}}" wx:key="index"> <checkbox checked="{{item.checked}}" disabled="{{!item.enable}}">{{item.date}}</checkbox> </view> </view> </view> </view> ``` ```css /* index.wxss */ .container { display: flex; flex-direction: column; height: 100%; } .header { background-color: #007aff; color: #fff; font-size: 18px; text-align: center; line-height: 50px; } .content { flex: 1; display: flex; flex-direction: column; padding: 20px; } .plan { margin-bottom: 20px; } .plan-title { font-size: 16px; font-weight: bold; margin-bottom: 10px; } .plan-item { display: flex; align-items: center; margin-bottom: 10px; } .record-title { font-size: 16px; font-weight: bold; margin-bottom: 10px; } .record-item { display: flex; align-items: center; margin-bottom: 10px; } ``` ```javascript // index.js Page({ data: { planList: [ { title: '阅读一篇英文文章', checked: false }, { title: '习一小时编程', checked: false }, { title: '完成一个小项目', checked: false }, ], recordList: [], }, onPlanChange(event) { const { index } = event.currentTarget.dataset; const { value } = event.detail; this.setData({ [`planList[${index}].checked`]: value, }); this.updateRecordList(); }, updateRecordList() { const recordList = []; const today = new Date().toLocaleDateString(); this.data.planList.forEach((plan, index) => { if (plan.checked) { recordList.push({ date: today, checked: true, enable: true, }); } else { const lastRecord = this.data.recordList[index - recordList.length]; if (lastRecord && lastRecord.date === today) { recordList.push(lastRecord); } else { recordList.push({ date: today, checked: false, enable: false, }); } } }); this.setData({ recordList }); }, }); ``` 这个页面包含两个部分:习计划和打卡记录习计划部分使用 `checkbox` 组件表示每日计划,当用户勾选计划后,会更新打卡记录部分的内容。打卡记录部分使用 `checkbox` 组件表示每天的打卡情况,已经打卡过的日期会被禁用。 在 `onPlanChange` 方法中,我们处理计划勾选状态的变化,并且调用 `updateRecordList` 方法更新打卡记录。在 `updateRecordList` 方法中,我们根据计划的勾选状态和之前的打卡记录生成新的打卡记录。这个方法会在页面加载和计划勾选状态变化时被调用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值