无忧启动论坛

标题: 升级一下,我的本地离线网页TODO记事本,千万不要存放重要账户密码啊! [打印本页]

作者: 879792799    时间: 昨天 22:23
标题: 升级一下,我的本地离线网页TODO记事本,千万不要存放重要账户密码啊!
本帖最后由 879792799 于 2026-1-12 09:46 编辑

=========================================================================
补充一:概述一下








=========================================================================

本人菜鸟升级一下,我的本地离线网页TODO记事本,千万不要存放重要账户密码啊!
祝论坛大佬们及诸位大大们2026新年快乐!!!!!!

感谢原作者:原帖是https://blog.csdn.net/2301_81253 ... ails/140924135-----有点问题我已修复

之前版本介绍详细些:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=447222&extra=

界面与众不同,需要耐心,习惯了就简单,电脑上使用,打开浏览器调试模式把界面调宽一点,不会请百度哈!
升级内容:  现在可以 支持多行, 支持回收站,支持数据下载备份.把代码命名尽量明了一些.







输入匡必须回车键录入,无法输入请重启机器再试一试,
红色按钮是删除,上面回收站绿色按钮[其余绿色按钮是摆设]是恢复到仓库分类下









代码里有注释,我是菜鸟水平一般只能尽力,见谅啊!


  1. <!DOCTYPE html>
  2. <html lang="en">
  3.         <head>
  4.                 <meta charset="UTF-8" />
  5.                 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.                 <title>Document</title>
  7.                 <style>
  8.                   
  9.                      /*   多行显示必须要word-wrap: break-word; ,不然无法数字不分行  */
  10.                

  11.                        /*   分类切换使用tab表示   */
  12.                         /*   未完成使用AAA表示  */
  13.                         /*   已完成使用BBB表示   */
  14.                         /*   回收站使用CCC表示   */
  15.                     /*   各个分类下条目内容使用note表示   */

  16. /*   必须要box-sizing:border-box;不然li会出现许多奇怪不对齐问题   margin  padding的值都会对UL条目产生影响 */
  17.                         * {
  18.                                 margin: 0;
  19.                                 box-sizing:border-box;
  20.                                 
  21.                         }


  22.                         a {
  23.                                 text-decoration: none;
  24.                         }


  25.                         body {
  26.                                 zoom: 56%;
  27.                                 margin-top: 20px;
  28.                                 height: 1000px;
  29.                         }


  30.                         .todo-body {
  31.                                 margin: auto;
  32.                                 width: 600px;
  33.                                 height: 1060px;
  34.                         }


  35.                         /*   回  图标 表示打开隐藏在上方的回收站  */
  36.                         .button {
  37.                                 border-radius: 6px;
  38.                                 color: #505050;
  39.                                 text-align: center;
  40.                                 margin-top: 17px;
  41.                                 width: 44px;
  42.                                 font-size: 30px;
  43.                         }


  44.                         /*   删除样式就出乱了  没办法  */
  45.                         .bunengsan {
  46.                                 height: 39px;
  47.                         }

  48.                         /*   直接回车键完成输入 只能键盘   没有图标可供点击   这样保持界面整洁简约*/
  49.                         .header input {
  50.                                 margin: auto;
  51.                                 text-align: center;
  52.                                 margin-top: 6px;
  53.                                 font-size: 30px;
  54.                                 width: 539px;
  55.                                 height: 69px;
  56.                                 border-radius: 30px;
  57.                                 border: none;
  58.                                 outline: none;
  59.                                 color: #505050;
  60.                                 box-shadow: 5px 5px 15px rgb(219, 218, 218) inset, -5px -5px 10px #999999 inset;
  61.                         }


  62.                         input::placeholder {
  63.                                 color: #505050;
  64.                                 font-size: 29px;
  65.                         }



  66.                         /* 设置CCC区域与tabs区域保持样式相同*/
  67.                         .CCCbody {
  68.                                 margin-left: 30px;
  69.                                 border-bottom: none;
  70.                         }

  71.                         /* tabs 表示中间一排分类 切换按钮  */
  72.                         .tabs {
  73.                                 margin: auto;
  74.                                 margin-top: 53px;
  75.                                 display: flex;
  76.                                 text-align: center;
  77.                                 border-bottom: 2px solid #e7b3b3;
  78.                         }


  79.                         .tabs div {
  80.                                 margin-left: 30px;
  81.                                 background-color: #546171;
  82.                                 border: 2px solid #e7b3b3;
  83.                                 border-top-left-radius: 18px;
  84.                                 border-top-right-radius: 18px;
  85.                                 border-bottom: none;
  86.                                 font-size: 39px;
  87.                                 cursor: pointer;
  88.                                 color: #000000;
  89.                                 box-shadow: 5px 5px 15px rgb(250, 241, 241) inset, -5px -5px 10px #fff inset;
  90.                         }


  91.                         .tabs .active {
  92.                                 background-color: #FD9900;
  93.                         }


  94.                         .content {
  95.                                 padding-top: 0px;
  96.                         }

  97.                         /* note表示每个tab下对应的内容*/
  98.                         .note {
  99.                                 padding-top: 20px;
  100.                                 margin: auto;
  101.                                 width: 600px;
  102.                                 border-radius: 40px;
  103.                         }


  104.                         /* 设置各个tab面背景样式 和文字颜色 包括条目背景色*/
  105.                         .note:nth-child(1) {
  106.                                 background-color: #fffefe;
  107.                         }


  108.                         .note:nth-child(2) {
  109.                                 background-color: #fffefe;
  110.                         }


  111.                         .note:nth-child(2) .AAA-item {
  112.                                 color: #ffffff;
  113.                         }


  114.                         .note:nth-child(3) {
  115.                                 background-color: #fffefe;
  116.                         }


  117.                         .note:nth-child(3) .AAA-item {
  118.                                 color: #ffffff;
  119.                         }


  120.                         .note:nth-child(4) {
  121.                                 background-color: #fffefe;
  122.                         }


  123.                         .note:nth-child(4) .AAA-item {
  124.                                 color: #ffffff;
  125.                         }


  126.                         .note:nth-child(5) {
  127.                                 background-color: #fffefe;
  128.                         }


  129.                         .note:nth-child(5) .AAA-item {
  130.                                 color: #ffffff;
  131.                         }




  132.                         /* 设置完成和未完成的框的大小和样式 */
  133.                         .work-unfinished,
  134.                         .work-finished,
  135.                         .life-unfinished,
  136.                         .life-finished,
  137.                         .study-unfinished,
  138.                         .study-finished,
  139.                         .health-unfinished,
  140.                         .health-finished,
  141.                         .day-unfinished,
  142.                         .day-finished {
  143.                                 margin: auto;
  144.                                 width: 600px;
  145.                                 border-radius: 15px;
  146.                                 border: #ffffff solid 3px;
  147.                         }

  148.                         /* 设置完成和未完成之间的间隔为20px */
  149.                         .work-unfinished,
  150.                         .life-unfinished,
  151.                         .study-unfinished,
  152.                         .health-unfinished,
  153.                         .day-unfinished {
  154.                                 margin-bottom: 100px;
  155.                         }

  156.                         /* 设置完成和未完成的本身字体样式 */
  157.                         .BiaoTi-text {
  158.                                 margin-bottom: 15px;
  159.                                 width: 190px;
  160.                                 height: 50px;
  161.                                 color: #FD9900;
  162.                                 text-align: left;
  163.                                 font-size: 50px;
  164.                                 text-align: left;
  165.                                 font-weight: bold;

  166.                         }


  167.                         /* 完成 未完成本身设置位置 */
  168.                         .work-unfinished .BiaoTi-text,
  169.                         .life-unfinished .BiaoTi-text,
  170.                         .study-unfinished .BiaoTi-text,
  171.                         .health-unfinished .BiaoTi-text,
  172.                         .day-unfinished .BiaoTi-text {
  173.                                 margin-left: 0px;
  174.                                 text-align: left;
  175.                                 font-size: 35px;
  176.                         }


  177.                         /* 完成 已完成本身设置位置 */
  178.                         .work-finished .BiaoTi-text,
  179.                         .life-finished .BiaoTi-text,
  180.                         .study-finished .BiaoTi-text,
  181.                         .health-finished .BiaoTi-text,
  182.                         .day-finished .BiaoTi-text {
  183.                                 margin-left: 0px;
  184.                                 color: #505050;
  185.                                 text-align: left;
  186.                                 font-size: 35px;
  187.                         }





  188.                         /* 隐藏滚动条  */
  189.                         .CCC::-webkit-scrollbar,
  190.                         .AAA::-webkit-scrollbar,
  191.                         .BBB::-webkit-scrollbar {
  192.                                 width: 0;
  193.                         }


  194.                         
  195.                         /* 设置页面内各个  未完成AAA*/
  196.                         .AAA li {
  197.                                 margin-top: 6px;
  198.                                 margin-left: -45px;
  199.                                 border-top-left-radius: 7px;
  200.                                 border-bottom-left-radius: 7px;
  201.                                 border-top-right-radius: 5px;
  202.                                 border-bottom-right-radius: 5px;
  203.                                 display: flex;

  204.                                 width: 600px;

  205.                                 text-align: center;
  206.                                 font-size: 31px;
  207.                                 border-right: 12px solid #7BB01A;
  208.                         }

  209.                         /*   已完成BBB*/
  210.                         .BBB li {
  211.                                 margin-top: 6px;
  212.                                 margin-left: -45px;
  213.                                 border-top-left-radius: 7px;
  214.                                 border-bottom-left-radius: 7px;
  215.                                 border-top-right-radius: 5px;
  216.                                 border-bottom-right-radius: 5px;
  217.                                 display: flex;

  218.                                 width: 600px;

  219.                                 text-align: center;
  220.                                 font-size: 26px;
  221.                                 border-right: 12px solid #7BB01A;
  222.                         }

  223.                         /*   回收站CCC*/
  224.                         .CCC li {
  225.                                 margin-top: 6px;
  226.                                 margin-left: -76px;
  227.                                 border-top-left-radius: 7px;
  228.                                 border-bottom-left-radius: 7px;
  229.                                 border-top-right-radius: 7px;
  230.                                 border-bottom-right-radius: 7px;
  231.                                 display: flex;

  232.                                 width: 608px;

  233.                                 text-align: center;
  234.                                 font-size: 31px;
  235.                         }

  236.         /* 条目宽度必须要设置好   上面的li也必须设置好 一起配合才能正确显示*/
  237.                         .AAA-item,
  238.                         .BBB-item,
  239.                         .CCC-item {
  240.                                 width: 544px;
  241.                                 text-align: left;
  242.                                 margin-left: 10px;
  243.                                 word-wrap: break-word;
  244.                                 color: #ffffff;
  245.                                 padding: 5px;
  246.                         

  247.                         }

  248.                         /*  回收站 恢复 */
  249.                         .CC-iconHuiFu {
  250.                                 border-top-right-radius: 5px;
  251.                                 border-bottom-right-radius: 5px;
  252.                                 border-left: 30px solid #40f136;
  253.                
  254.                         }


  255.                         /*  回收站 删除 */
  256.                         .CC-iconDEL {
  257.                                 border-right: 26px solid #FD0164;
  258.                
  259.                                 border-top-left-radius: 5px;
  260.                                 border-bottom-left-radius: 5px;
  261.                         }


  262.                         /* 设置各个条目图标qian面删除图标  */
  263.                         /*  已完成和 未完成前面的红色图标*/
  264.                         .AABB-iconDEL {
  265.                                 border-left: 12px solid #FD0164;
  266.                                 width: 15px;
  267.                                 border-top-left-radius: 5px;
  268.                                 border-bottom-left-radius: 5px;
  269.                         }
  270.                         


  271.                         /* 设置页面内各个条目的外框  重要  */
  272.                         .CCC li,
  273.                         .work-unfinished .AAA li,
  274.                         .work-finished .BBB li {
  275.                                 box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  276.                                 background-color: #505050;
  277.                         }

  278.                         .life-unfinished .AAA li,
  279.                         .life-finished .BBB li {
  280.                                 box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  281.                                 background-color: #505050;
  282.                         }

  283.                         .study-unfinished .AAA li,
  284.                         .study-finished .BBB li {
  285.                                 box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  286.                                 background-color: #505050;

  287.                         }

  288.                         .health-unfinished .AAA li,
  289.                         .health-finished .BBB li {
  290.                                 box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  291.                                 background-color: #505050;
  292.                         }

  293.                         .day-unfinished .AAA li,
  294.                         .day-finished .BBB li {
  295.                                 box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  296.                                 background-color: #505050;
  297.                         }



  298.                         /* 设置已完成文字样式*/
  299.                         .BBB .BBB-item {
  300.                                 text-decoration: line-through;
  301.                                 color: #AC7F79;
  302.                         }

  303.                         .life-finished .BBB .BBB-item {
  304.                                 text-decoration: line-through;
  305.                                 color: #AC7F79;
  306.                         }

  307.                         .study-finished .BBB .BBB-item {
  308.                                 text-decoration: line-through;
  309.                                 color: #AC7F79;
  310.                         }

  311.                         .health-finished .BBB .BBB-item {
  312.                                 text-decoration: line-through;
  313.                                 color: #AC7F79;
  314.                         }

  315.                         .day-finished .BBB .BBB-item {
  316.                                 text-decoration: line-through;
  317.                                 color: #AC7F79;
  318.                         }


  319.                         




  320.                         /* 设置tab内容不可看 */
  321.                         .note {
  322.                                 display: none;
  323.                         }

  324.                         /* 设置tab内容可看 */
  325.                         .content .active {
  326.                                 display: block;
  327.                         }

  328.                
  329.                         .text {
  330.                                 display: flex;
  331.                         }

  332.                         /* 每天重心开始 */
  333.                         .deleteAll {
  334.                         
  335.                                 width: 100px;
  336.                                 height: 50px;
  337.                                 margin-top: 9px;
  338.                                 margin-right: 10px;
  339.                         }


  340.                         }
  341.                 </style>

  342.                 <script type="text/javascript" src="js/jquery.min.js"></script>
  343.                 <!--使用高版本jquery请调用jquery-migrate-1.2.1.min.js,低版本可不用-->

  344.         </head>


  345.         <body>
  346.                 <!-- 设置便签整体 -->
  347.                 <div class="todo-body">
  348.                         <!-- 设置便签头部 -->
  349.                         <div class="header">


  350.                                 <div class="CCCbody">

  351.                                         <div id="down-buttoon" style="display: none;">
  352.                                                 <button class="button" onclick=exportLocalStorageAsJson()
  353.                                                         style="width: 320px;margin-left: 39px;margin-bottom: 25px;">下载备份所有分类数据</button>
  354.                                                 <ul class="CCC"> </ul>
  355.                                         </div>

  356.                                 </div>

  357.                                 <button class="button" onclick="toggleSection('down-buttoon')" style="float: right;">回</button> <input
  358.                                         id="task" style="float: left; " type="text"
  359.                                         placeholder="         不     负           今     天   ">
  360.                                 <div class="bunengsan"> </div>
  361.                         </div>

  362.                         <!-- 设置中部 -->
  363.                         <div class="middle">
  364.                                 <!-- 设置中间tab栏部分 -->
  365.                                 <div class="tabs">
  366.                                         <!-- 设置4个内容便签tab -->
  367.                                         <div class="work active" data-id="1">紧急</div>
  368.                                         <div class="life" data-id="2">重要</div>
  369.                                         <div class="study" data-id="3">家里</div>
  370.                                         <div class="health" data-id="4">目标</div>
  371.                                         <div class="day" data-id="5">仓库</div>
  372.                                 </div>

  373.                                 <!-- 设置中间内容部分 -->
  374.                                 <div class="content">


  375.                                         <!-- 设置第一个便签内容 -->
  376.                                         <div class="note active">
  377.                                                 <div class="work-unfinished">
  378.                                                         <div class="BiaoTi-text">未完成</div>
  379.                                                         <ul class="AAA"> </ul>
  380.                                                 </div>
  381.                                                 <div class="work-finished">
  382.                                                         <div class="text">
  383.                                                                 <div class="BiaoTi-text">已完成</div>
  384.                                                                 <span class="deleteAll" style="margin-right: 79px;text-align: center;">每天重❤来</span>
  385.                                                         </div>
  386.                                                         <ul class="BBB"> </ul>
  387.                                                 </div>
  388.                                         </div>

  389.                                         <!-- 设置第二个便签内容 -->
  390.                                         <div class="note">
  391.                                                 <div class="life-unfinished">
  392.                                                         <div class="BiaoTi-text">未完成</div>
  393.                                                         <ul class="AAA"> </ul>
  394.                                                 </div>
  395.                                                 <div class="life-finished">
  396.                                                         <div class="text">
  397.                                                                 <div class="BiaoTi-text">已完成</div>
  398.                                                                 <span class="deleteAll" style="margin-right: 79px;text-align: center;">每天重❤来</span>
  399.                                                         </div>
  400.                                                         <ul class="BBB"> </ul>
  401.                                                 </div>
  402.                                         </div>

  403.                                         <!-- 设置第三个便签内容 -->
  404.                                         <div class="note">
  405.                                                 <div class="study-unfinished">
  406.                                                         <div class="BiaoTi-text">未完成</div>
  407.                                                         <ul class="AAA"> </ul>
  408.                                                 </div>
  409.                                                 <div class="study-finished">
  410.                                                         <div class="text">
  411.                                                                 <div class="BiaoTi-text">已完成</div>
  412.                                                                 <span class="deleteAll" style="margin-right: 79px;text-align: center;">每天重❤来</span>
  413.                                                         </div>
  414.                                                         <ul class="BBB"> </ul>
  415.                                                 </div>
  416.                                         </div>

  417.                                         <!-- 设置第四个便签内容 -->
  418.                                         <div class="note">
  419.                                                 <div class="health-unfinished">
  420.                                                         <div class="BiaoTi-text">未完成</div>
  421.                                                         <ul class="AAA"> </ul>
  422.                                                 </div>
  423.                                                 <div class="health-finished">
  424.                                                         <div class="text">
  425.                                                                 <div class="BiaoTi-text">已完成</div>
  426.                                                                 <span class="deleteAll" style="margin-right: 79px;text-align: center;">每天重❤来</span>
  427.                                                         </div>
  428.                                                         <ul class="BBB"> </ul>
  429.                                                 </div>
  430.                                         </div>


  431.                                         <!-- 设置第五个便签内容 -->
  432.                                         <div class="note">
  433.                                                 <div class="day-unfinished">
  434.                                                         <div class="BiaoTi-text">未完成</div>
  435.                                                         <ul class="AAA"> </ul>
  436.                                                 </div>
  437.                                                 <div class="day-finished">
  438.                                                         <div class="text">
  439.                                                                 <div class="BiaoTi-text">已完成</div>
  440.                                                                 <span class="deleteAll" style="margin-right: 79px;text-align: center;">每天重❤来</span>
  441.                                                         </div>
  442.                                                         <ul class="BBB"> </ul>
  443.                                                 </div>
  444.                                         </div>

  445.                                 </div>
  446.                         </div>
  447.                 </div>



  448.                 <script>
  449.                         function exportLocalStorageAsJson() {
  450.                                 var localStoragedate = localStorage.getItem('AAAarry') + localStorage.getItem('BBBarry');
  451.                                 var data = JSON.stringify(localStoragedate); // 转换localStorage为JSON字符串
  452.                                 const blob = new Blob([data], {
  453.                                         type: "text/plain;charset=utf-8"
  454.                                 }); // 创建Blob对象
  455.                                 var url = URL.createObjectURL(blob); // 获取下载链接
  456.                                 var link = document.createElement('a');
  457.                                 link.href = url;
  458.                                 link.download = 'localStorage.json'; // 设置下载文件名
  459.                                 link.style.display = "none";
  460.                                 document.body.appendChild(link);
  461.                                 link.click(); // 触发下载
  462.                                 link.remove(); // 移除元素(可选)

  463.                                 alert(("本地数据已导出"));

  464.                         }



  465.                         function toggleSection(sectionId) {
  466.                                 var section = document.getElementById(sectionId);
  467.                                 section.style.display = section.style.display === 'none' ? 'block' : 'none';
  468.                         }


  469.                         window.addEventListener('load', function() {
  470.                                 // 判断到第几个tab
  471.                                 let dataId = 1

  472.                                 //定义数组
  473.                                 if (!this.localStorage.getItem('AAAarry')) {
  474.                                         localStorage.setItem('AAAarry', "[[], [], [], [],[]]")
  475.                                 } else if (!this.localStorage.getItem('CCCarry')) {
  476.                                         localStorage.setItem('CCCarry', "[[], [], [], [],[]]")
  477.                                 } else if (!this.localStorage.getItem('BBBarry')) {
  478.                                         localStorage.setItem('BBBarry', "[[], [], [], [],[]]")
  479.                                 }

  480.                                 const arrList1 = JSON.parse(localStorage.getItem('AAAarry'))
  481.                                 const arrList2 = JSON.parse(localStorage.getItem('BBBarry'))
  482.                                 const yinList = JSON.parse(localStorage.getItem('CCCarry'))
  483.                                 const yinListzi = [].concat(...yinList);

  484.                                 bindEventListeners()


  485.                                 // 如果按下了回车事件
  486.                                 let inputTask = document.querySelector('#task')
  487.                                 inputTask.addEventListener('keydown', function(e) {
  488.                                         if (e.key === 'Enter') {
  489.                                                 let newTaskText = inputTask.value.trim()
  490.                                                 if (newTaskText !== '') {
  491.                                                         arrList1[dataId - 1].push(newTaskText)
  492.                                                         localStorage.setItem('AAAarry', JSON.stringify(arrList1))
  493.                                                         //更新未完成事件界面
  494.                                                         renderUnfinished()
  495.                                                         //将input设为空
  496.                                                         inputTask.value = ''
  497.                                                 }
  498.                                         }
  499.                                 })





  500.                                 // 点击tabs
  501.                                 var fntab = function(e) {
  502.                                         if (e.target.tagName === 'DIV' && e.target.hasAttribute('data-id')) {
  503.                                                 document.querySelector('.tabs .active').classList.remove('active')
  504.                                                 e.target.classList.add('active')
  505.                                                 dataId = e.target.dataset.id
  506.                                                 document.querySelector('.content .active').classList.remove('active')
  507.                                                 document.querySelector(`.content .note:nth-child(${dataId})`).classList.add('active')
  508.                                                 bindEventListeners()
  509.                                                 event.stopPropagation()
  510.                                         }
  511.                                 };


  512.                                 ///////////////////////自己定义三个函数////////////////////////////////////




  513.                                 //下面是删除隐藏用到的封装函数会直接修改原数组

  514.                                 function removeElement(AAAarry, element) {
  515.                                         for (let i = 0; i < AAAarry.length; i++) {
  516.                                                 for (let j = 0; j < AAAarry[i].length; j++) {
  517.                                                         if (AAAarry[i][j] === element) {
  518.                                                                 AAAarry[i].splice(j, 1); // 删除当前元素并跳出内层循环
  519.                                                                 break;
  520.                                                         }
  521.                                                 }
  522.                                         }
  523.                                         return AAAarry;
  524.                                 }

  525.                                 //下面是恢复隐藏用到的封装函数  依据内容查找行号

  526.                                 function findNestedIndices(array, target) {
  527.                                         for (let i = 0; i < array.length; i++) {
  528.                                                 for (let j = 0; j < array[i].length; j++) {
  529.                                                         if (array[i][j] === target) {
  530.                                                                 return i;
  531.                                                         }
  532.                                                 }
  533.                                         }
  534.                                         return null;
  535.                                 }


  536.                                 //下面是恢复隐藏用到的封装函数  依据二维数组行号插入某内容

  537.                                 function pushToRow(AAAarry, rowIndex, value) {
  538.                                         if (rowIndex >= AAAarry.length) return; // 检查索引是否有效
  539.                                         AAAarry[rowIndex].push(value);
  540.                                 }
  541.                                 //////////////////////////////////////////////////////////






  542.                                 //  nxnx 每天重新开始   把完成加入到未完成

  543.                                 var fnmtcx = function(e) {
  544.                                         if (e.target.tagName === 'SPAN') {
  545.                                                 arrList1[dataId - 1].push(...arrList2[dataId - 1]);
  546.                                                 arrList2[dataId - 1] = [];
  547.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2));
  548.                                                 localStorage.setItem('AAAarry', JSON.stringify(arrList1));
  549.                                                 bindEventListeners()
  550.                                                 event.stopPropagation()
  551.                                         }
  552.                                 }



  553.                                 // 删除未完成           //nxnx   点击未完成变成完成
  554.                                 var fn = function(e) {
  555.                                         if (e.target.classList.contains('delete')) {
  556.                                                 let index = parseInt(e.target.dataset.id)
  557.                                                 //     let dataName = parseInt(e.target.dataset.name);
  558.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //后加
  559.                                                 const yinListzi = [].concat(...yinList); //后加
  560.                                                 yinList[dataId - 1].push(arrList1[dataId - 1][index]);
  561.                                                 arrList1[dataId - 1].splice(index, 1)
  562.                                                 localStorage.setItem('AAAarry', JSON.stringify(arrList1))
  563.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2));
  564.                                                 localStorage.setItem('CCCarry', JSON.stringify(yinList));
  565.                                                 bindEventListeners()
  566.                                                 event.stopPropagation()
  567.                                         }


  568.                                         if (e.target.classList.contains('AAA-item')) {
  569.                                                 let dataName = parseInt(e.target.dataset.name);
  570.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //后加
  571.                                                 const yinListzi = [].concat(...yinList); //后加
  572.                                                 arrList2[dataId - 1].push(arrList1[dataId - 1][dataName]);
  573.                                                 arrList1[dataId - 1].splice(dataName, 1);
  574.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2));
  575.                                                 localStorage.setItem('AAAarry', JSON.stringify(arrList1));
  576.                                                 bindEventListeners()
  577.                                                 event.stopPropagation()
  578.                                         }

  579.                                 };





  580.                                 // 删除已完成                   //   点击已完成按钮任务变成未完成
  581.                                 var fnyi = function(e) {
  582.                                         if (e.target.classList.contains('delete22')) {
  583.                                                 let index = parseInt(e.target.dataset.id)
  584.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //后加
  585.                                                 const yinListzi = [].concat(...yinList); //后加

  586.                                                 yinList[dataId - 1].push(arrList2[dataId - 1][index]);
  587.                                                 arrList2[dataId - 1].splice(index, 1)
  588.                                                 //        alert("标签页码yi==="+(dataId - 1));
  589.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2))
  590.                                                 localStorage.setItem('CCCarry', JSON.stringify(yinList));
  591.                                                 bindEventListeners()
  592.                                                 event.stopPropagation()
  593.                                         }

  594.                                         if (e.target.classList.contains('BBB-item')) {
  595.                                                 let dataName = parseInt(e.target.dataset.name);
  596.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //后加
  597.                                                 const yinListzi = [].concat(...yinList); //后加

  598.                                                 arrList1[dataId - 1].push(arrList2[dataId - 1][dataName]);
  599.                                                 arrList2[dataId - 1].splice(dataName, 1);
  600.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2));
  601.                                                 localStorage.setItem('AAAarry', JSON.stringify(arrList1));
  602.                                                 bindEventListeners()
  603.                                                 event.stopPropagation()
  604.                                         }
  605.                                 };




  606.                                 // 删除隐藏   // 恢复隐藏到未完成

  607.                                 var fyin = function(e) {

  608.                                         if (e.target.classList.contains('detyou')) {
  609.                                                 //手机上无法使用        const yinListzi =yinList.flat()
  610.                                                 let index = parseInt(e.target.dataset.id)

  611.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //必须要加
  612.                                                 const yinListzi = [].concat(...yinList); //必须要加
  613.                                                 const tetyin = yinListzi[index]; //必须要加
  614.                                                 //                        alert("删除隐藏==="+(tetyin));        
  615.                                                 //                       alert("删除隐藏==="+(index));
  616.                                                 removeElement(yinList, tetyin);
  617.                                                 removeElement(yinList, "null");
  618.                                                 //          console.log('removeElement'+yinList);
  619.                                                 yinListzi.splice(index, 1)
  620.                                                 localStorage.setItem('CCCarry', JSON.stringify(yinList));

  621.                                                 bindEventListeners()
  622.                                                 event.stopPropagation()
  623.                                                 $(`.AAA`).unbind("click").bind("click", fn); //未完成 后加
  624.                                         }



  625.                                         if (e.target.classList.contains('detedetezuo')) {
  626.                                                 let index = parseInt(e.target.dataset.id)

  627.                                                 const yinList = JSON.parse(localStorage.getItem('CCCarry')) //必须要加
  628.                                                 const yinListzi = [].concat(...yinList); //必须要加
  629.                                                 const tetyin = yinListzi[index]; //必须要加
  630.                                                 //                alert("恢复隐藏==="+(index));
  631.                                                 const indyinyin = findNestedIndices(yinList, tetyin);
  632.                                                 //                 alert("恢复隐藏的行号==="+(indyinyin));
  633.                                                 //二位数组 行  插入的文字
  634.                                                 pushToRow(arrList1, 4, tetyin); //移动到仓库
  635.                                                 yinListzi.splice(index, 1);
  636.                                                 removeElement(yinList, tetyin);
  637.                                                 removeElement(yinList, "null");
  638.                                                 localStorage.setItem('CCCarry', JSON.stringify(yinList));
  639.                                                 localStorage.setItem('AAAarry', JSON.stringify(arrList1))
  640.                                                 localStorage.setItem('BBBarry', JSON.stringify(arrList2));

  641.                                                 bindEventListeners()
  642.                                                 event.stopPropagation()
  643.                                                 $(`.AAA`).unbind("click").bind("click", fn); //未完成   后加

  644.                                         }
  645.                                         event.stopPropagation()
  646.                                         $(`.AAA`).unbind("click").bind("click", fn); //未完成   后加
  647.                                 };




  648.                                 ///////////////////更新板块////////////////////////        


  649.                                 // 更新隐藏
  650.                                 function renderyincang() {
  651.                                         let yin_ul = document.querySelector(`.CCC`);
  652.                                         const arrList1 = JSON.parse(localStorage.getItem('AAAarry'))
  653.                                         const arrList2 = JSON.parse(localStorage.getItem('BBBarry'))
  654.                                         const yinList = JSON.parse(localStorage.getItem('CCCarry'))
  655.                                         const yinListzi = [].concat(...yinList); //必须有
  656.                                         //                           console.log(yinListzi );
  657.                                         //                           console.log(yinList );

  658.                                         const listItems = yinListzi.map((taskText, index) => {
  659.                                                 return `       <li>
  660.                                                       <div class="detyou CC-iconDEL"  data-id="${index}"  >             </div>   
  661.                                                        <div class="CCC-item"    data-name="${index}" >${taskText}</div>
  662.                 <div class="detedetezuo CC-iconHuiFu"  data-id="${index}"  >             </div>     
  663.                </li>
  664.             `
  665.                                         }).join('')
  666.                                         yin_ul.innerHTML = listItems
  667.                                 }




  668.                                 // 更新未完成
  669.                                 function renderUnfinished() {
  670.                                         let un_ul = document.querySelector(`.note:nth-child(${dataId}) .AAA`);

  671.                                         const arrList1 = JSON.parse(localStorage.getItem('AAAarry'))
  672.                                         const arrList2 = JSON.parse(localStorage.getItem('BBBarry'))
  673.                                         const yinList = JSON.parse(localStorage.getItem('CCCarry'))
  674.                                         const yinListzi = [].concat(...yinList);

  675.                                         const listItems = JSON.parse(localStorage.getItem('AAAarry'))[dataId - 1].map((taskText, index) => {
  676.                                                 return `         <li>
  677.                                        <div class="delete AABB-iconDEL" data-id="${index}"> </div>
  678.                                                     <div class="AAA-item" data-name="${index}">${taskText}</div>
  679.                                 
  680.                         </li>
  681.                         `
  682.                                         }).join('')
  683.                                         un_ul.innerHTML = listItems
  684.                                 }


  685.                                 // 更新已完成
  686.                                 function renderFinished() {
  687.                                         let ul = document.querySelector(`.note:nth-child(${dataId}) .BBB`);

  688.                                         const arrList1 = JSON.parse(localStorage.getItem('AAAarry'))
  689.                                         const arrList2 = JSON.parse(localStorage.getItem('BBBarry'))
  690.                                         const yinList = JSON.parse(localStorage.getItem('CCCarry'))
  691.                                         const yinListzi = [].concat(...yinList);

  692.                                         const listItems = JSON.parse(localStorage.getItem('BBBarry'))[dataId - 1].map((taskText, index) => {
  693.                                                 return `         <li>
  694.                                                 <div class="delete22 AABB-iconDEL" data-id="${index}"> </div>
  695.                                                         <div class="BBB-item" data-name="${index}">${taskText}</div>
  696.                                 
  697.                         </li>
  698.                         `
  699.                                         }).join('')
  700.                                         ul.innerHTML = listItems
  701.                                 }



  702.                                 // 绑定事件监听
  703.                                 function bindEventListeners() {

  704.                                         const arrList1 = JSON.parse(localStorage.getItem('AAAarry'))
  705.                                         const arrList2 = JSON.parse(localStorage.getItem('BBBarry'))
  706.                                         const yinList = JSON.parse(localStorage.getItem('CCCarry'))
  707.                                         const yinListzi = [].concat(...yinList);

  708.                                         renderUnfinished()
  709.                                         renderFinished()
  710.                                         renderyincang()

  711.                                         $(`.AAA`).unbind("click").bind("click", fn); //未完成AAA
  712.                                         $(`.BBB`).unbind("click").bind("click", fnyi); //已完成BBB
  713.                                         $(`.CCC`).unbind("click").bind("click", fyin); //回收站CCC
  714.                                         $(".tabs").unbind("click").bind("click", fntab); //分类标签
  715.                                         $(`.deleteAll`).unbind("click").bind("click", fnmtcx); //每天重新来

  716.                                 };


  717.                                 bindEventListeners()

  718.                         })
  719.                 </script>
  720.         </body>
  721. </html>
复制代码












作者: 879792799    时间: 昨天 22:28
占楼备用
作者: 梅子酒啊    时间: 昨天 22:49
占楼备用
作者: wn168cn@163.com    时间: 昨天 23:08
支持原创
作者: 有点好奇    时间: 13 小时前
已经非常优秀了
作者: gordonhf    时间: 12 小时前
路过看看
作者: l3429900    时间: 5 小时前
支持
作者: a66    时间: 5 小时前
支持~
作者: smile_z    时间: 5 小时前
学习一下
作者: qinxz1414    时间: 5 小时前
感谢分享
作者: win82    时间: 4 小时前
感谢分享
作者: ebaqiang    时间: 4 小时前
感谢热心分享
作者: wang1126    时间: 4 小时前
谢谢楼主分享
作者: yhage    时间: 3 小时前
特别重要的都不会方电子产品里面
作者: hfzym    时间: 2 小时前
存放重要账号密码会怎样?
作者: sunyboy    时间: 1 小时前
重要账户密码会被盗吗
作者: achangge    时间: 半小时前
感谢热心分享,没见下载地址呢?

作者: lckkpp    时间: 半小时前
占个位!




欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) Powered by Discuz! X3.3