diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.js" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.js" deleted file mode 100644 index a0c6b675..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.js" +++ /dev/null @@ -1,41 +0,0 @@ -//app.js -App({ - onLaunch: function () { - // 展示本地存储能力 - var logs = wx.getStorageSync('logs') || [] - logs.unshift(Date.now()) - wx.setStorageSync('logs', logs) - - // 登录 - wx.login({ - success: res => { - // 发送 res.code 到后台换取 openId, sessionKey, unionId - } - }) - // 获取用户信息 - wx.getSetting({ - success: res => { - if (res.authSetting['scope.userInfo']) { - // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 - wx.getUserInfo({ - success: res => { - // 可以将 res 发送给后台解码出 unionId - this.globalData.userInfo = res.userInfo - - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 - // 所以此处加入 callback 以防止这种情况 - if (this.userInfoReadyCallback) { - this.userInfoReadyCallback(res) - } - } - }) - } - } - }) - }, - - globalData: { - userInfo: null - }, - -}) \ No newline at end of file diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.js" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.js" deleted file mode 100644 index 5e6380c4..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.js" +++ /dev/null @@ -1,131 +0,0 @@ -//index.js -//获取应用实例 -const app = getApp() -var initData = '' -var extraLine = [] -Page({ - data: { - text: initData, - flag:"none", - userInfo: {}, - hasUserInfo: false, - canIUse: wx.canIUse('button.open-type.getUserInfo') - }, - //事件处理函数 - bindViewTap: function() { - wx.navigateTo({ - url: '../logs/logs' - }) - }, - onLoad: function () { - if (app.globalData.userInfo) { - this.setData({ - userInfo: app.globalData.userInfo, - hasUserInfo: true - }) - } else if (this.data.canIUse){ - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 - // 所以此处加入 callback 以防止这种情况 - app.userInfoReadyCallback = res => { - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - } else { - // 在没有 open-type=getUserInfo 版本的兼容处理 - wx.getUserInfo({ - success: res => { - app.globalData.userInfo = res.userInfo - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - } - wx.setNavigationBarTitle({ - title: '记事本' - }) - wx.setNavigationBarColor({ - frontColor: '#ffffff', - backgroundColor: '#3197ed', - animation: { - duration: 400, - timingFunc: 'easeIn' - } - }) - - }, - openConfirm: function () { - - wx.showModal({ - - title: '请输入内容', - - content: getval, - - confirmText: "主操作", - - cancelText: "辅助操作", - - success: function (res) { - - console.log(res); - - if (res.confirm) { - - console.log('用户点击主操作') - - } else { - - console.log('用户点击辅助操作') - - } - - } - - }); - - }, - getUserInfo: function(e) { - console.log(e) - app.globalData.userInfo = e.detail.userInfo - this.setData({ - userInfo: e.detail.userInfo, - hasUserInfo: true - }) - }, - showmask:function(){ - this.setData({ - flag:"block" - }) - }, - add:function(){ - extraLine.push(initData) - this.setData({ - text: extraLine.join('\n') - }) - }, - del:function(){ - if (extraLine.length > 0){ - extraLine.pop() - this.setData({ - text: extraLine.join('\n') - }) - } - }, - getinput:function(e){ - initData = e.detail.value - }, - mask:function(){ - this.setData({ - flag:"none" - }) - }, - prevent:function(){ - - } -}) - - diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxml" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxml" deleted file mode 100644 index 4b1fc581..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxml" +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - -请输入添加的内容 - - - - - - - -{{text}} - - - - - \ No newline at end of file diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxss" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxss" deleted file mode 100644 index 4a074787..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.wxss" +++ /dev/null @@ -1,83 +0,0 @@ -/**index.wxss**/ -.userinfo { - display: flex; - flex-direction: column; - align-items: center; -} - -.userinfo-avatar { - width: 128rpx; - height: 128rpx; - margin: 20rpx; - border-radius: 50%; -} - -.userinfo-nickname { - color: #aaa; -} - -.usermotto { - margin-top: 200px; -} - -.cl{ - clear: both; -} -button{ - overflow: visible; -} -.mini-btn{ - - margin:20px 0 0 20px; - -} -.text{ - margin: 0 0 0 20px; -} - -.mask{ - position: fixed; - top:0; - left:0; - width:100%; - height:100%; - background-color:rgba(0,0,0,0.5); -} -.inputbox{ - width: 80%; - position: fixed; - left: 50%; - margin-left: -40%; - top: 25%; - background-color: #ffffff; - z-index: 1000; -} -.inputtitle{ - background-color: #3197ed; - color: #ffffff; - font-size: 14px; - height: 30px; - line-height: 30px; -} -.getinput{ - border: 1px solid #ccc; - font-size: 14px; - height: 30px; - line-height: 30px; - width:90%; - margin: 10px auto; - border-radius: 4px; -} -.inputbox button{ - position: static; - border-radius: 0; - width:49%; - float: left; - font-size: 14px; - margin-left: 5px; - background-color: #3197ed; - color: #ffffff; -} -.inputbox .firstbtn{ - margin-left: 0; -} \ No newline at end of file diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.js" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.js" deleted file mode 100644 index b2b967d8..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.js" +++ /dev/null @@ -1,15 +0,0 @@ -//logs.js -const util = require('../../utils/util.js') - -Page({ - data: { - logs: [] - }, - onLoad: function () { - this.setData({ - logs: (wx.getStorageSync('logs') || []).map(log => { - return util.formatTime(new Date(log)) - }) - }) - } -}) diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.json" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.json" deleted file mode 100644 index 3ee76c18..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.json" +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "查看启动日志", - "usingComponents": {} -} \ No newline at end of file diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxml" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxml" deleted file mode 100644 index b5a85ac6..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxml" +++ /dev/null @@ -1,6 +0,0 @@ - - - - {{index + 1}}. {{log}} - - diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxss" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxss" deleted file mode 100644 index 94d4b88a..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/logs/logs.wxss" +++ /dev/null @@ -1,8 +0,0 @@ -.log-list { - display: flex; - flex-direction: column; - padding: 40rpx; -} -.log-item { - margin: 10rpx; -} diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.wxml" "b/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.wxml" deleted file mode 100644 index c229e366..00000000 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.wxml" +++ /dev/null @@ -1,2 +0,0 @@ - -都说了这不是踢球游戏 diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.js" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.js" new file mode 100644 index 00000000..f77c22ac --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.js" @@ -0,0 +1,16 @@ +//app.js +App({ + onLaunch: function () { + // 展示本地存储能力 + var logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + + + }, + globalData: { + listtitle : [], + listcontent : [], + time:[] + } +}) \ No newline at end of file diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.json" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.json" similarity index 70% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/app.json" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.json" index 67bdbd9c..804268e8 100644 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.json" +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.json" @@ -1,13 +1,12 @@ { - "pages": [ + "pages":[ "pages/index/index", "pages/logs/logs", "pages/setting/setting" ], - "window": { - "navigationBarTitleText": "记事本", + "window":{ + "navigationBarTitleText": "标签日记", "navigationBarBackgroundColor": "#3197ed" - }, "tabBar": { "color": "#dddddd", @@ -18,19 +17,13 @@ "pagePath": "pages/index/index", "iconPath": "images/zhuye.png", "selectedIconPath": "images/zhuye2.png", - "text": "记事" + "text": "日记" }, { "pagePath": "pages/logs/logs", "iconPath": "images/yunduan.png", "selectedIconPath": "images/yunduan2.png", - "text": "日志" - }, - { - "pagePath" : "pages/setting/setting", - "iconPath": "images/shezhi.png", - "selectedIconPath": "images/shezhi2.png", - "text": "设置" + "text": "记录" } ] }, @@ -42,4 +35,4 @@ "navigateToMiniProgramAppIdList": [ "wxe5f52902cf4de896" ] -} \ No newline at end of file +} diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/app.wxss" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.wxss" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/app.wxss" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/app.wxss" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/shezhi.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/shezhi.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/shezhi.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/shezhi.png" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/shezhi2.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/shezhi2.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/shezhi2.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/shezhi2.png" diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/sousuo.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/sousuo.png" new file mode 100644 index 00000000..9c8803dc Binary files /dev/null and "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/sousuo.png" differ diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/yunduan.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/yunduan.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/yunduan.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/yunduan.png" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/yunduan2.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/yunduan2.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/yunduan2.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/yunduan2.png" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/zhuye.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/zhuye.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/zhuye.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/zhuye.png" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/images/zhuye2.png" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/zhuye2.png" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/images/zhuye2.png" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/images/zhuye2.png" diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.js" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.js" new file mode 100644 index 00000000..f18bbf91 --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.js" @@ -0,0 +1,225 @@ +//index.js +//获取应用实例 +const app = getApp() +var tiplist= [] +Page({ + data: { + list: [{ + tag: "开心", + content: "今天遇到了什么开心的事情:" + }, { + tag: "学习", + content: "今天去哪学习,学了什么:" + }, { + tag: "游戏", + content: "今天战绩如何:" + }, { + tag: "宅家", + content: "今天的你为什么宅在家里呢:" + }, { + tag: "睡觉", + content: "今天睡了多久:" + }, { + tag: "无聊", + content: "分享出你的无聊:" + }, { + tag: "外出", + content: "今天出去哪了:" + }, { + tag: '失落', + content: "今天遇到了什么伤心的事:" + }, { + tag: "愤怒", + content: "今天遇到了什么愤怒的事:" + },{ + tag: "美食", + content:"今天吃了什么好吃的东西:" + },{ + tag: "看剧", + content: "今天看了什么剧:" + },{ + tag: "自定义", + content: "请自定义今天的日记" + }], + title: "请输入标题", + content: '', + taglist: [], + id:'' + }, + //事件处理函数 + bindViewTap: function() { + wx.navigateTo({ + url: '../logs/logs' + }) + }, + onLoad: function () { + if (app.globalData.userInfo) { + this.setData({ + userInfo: app.globalData.userInfo, + hasUserInfo: true + }) + } else if (this.data.canIUse){ + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 + // 所以此处加入 callback 以防止这种情况 + app.userInfoReadyCallback = res => { + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + } else { + // 在没有 open-type=getUserInfo 版本的兼容处理 + wx.getUserInfo({ + success: res => { + app.globalData.userInfo = res.userInfo + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + } + wx.setNavigationBarTitle({ + title: '标签日记' + }) + wx.setNavigationBarColor({ + frontColor: '#ffffff', + backgroundColor: '#3197ed', + animation: { + duration: 400, + timingFunc: 'easeIn' + } + }) + }, + getUserInfo: function(e) { + console.log(e) + app.globalData.userInfo = e.detail.userInfo + this.setData({ + userInfo: e.detail.userInfo, + hasUserInfo: true + }) + }, + title:function(e){ + this.setData({ + title:e.detail.value + }) + + }, + content:function(e){ + this.setData({ + content:e.detail.value, + }) + }, + addtag:function(e){ + var obj = {tip: this.data.list[e.currentTarget.id].content} + var i; + if(this.data.taglist.length<1){ + this.data.taglist.push(obj) + this.setData({ + taglist: this.data.taglist + }) + } + else{ + this.data.taglist = [] + this.data.taglist.push(obj) + this.setData({ + taglist: this.data.taglist + }) + } + }, + shuaxin:function(){ + wx.showModal({ + + content: '数据不足,该功能正在开发', + + showCancel: false, + + success: function (res) { + + if (res.confirm) { + + + } + + } + + }); + }, + openAlert: function () { + if (this.data.title == "请输入标题" || this.data.title == "" || this.data.content == "") { + wx.showModal({ + + content: '标题或内容不能为空', + + showCancel: false, + + success: function (res) { + + if (res.confirm) { + + } + } + }); + return 0 + } + else{ + wx.showModal({ + + content: '提交成功', + + showCancel: false, + + success: function (res) { + + if (res.confirm) { + + wx.switchTab({ + url: '../logs/logs', + }) + + } + + }, + fail: function (res) { + console.log(res) + } + + }); + } + + var id = wx.getStorageSync('id') || [] + var title = wx.getStorageSync('title') || [] + var content = wx.getStorageSync('content') || [] + var time = wx.getStorageSync('time') || [] + var date = new Date + var year = date.getFullYear() + var month = date.getMonth() + 1 + var day = date.getDate() + id.push(wx.getStorageSync('id').length) + time.push(year + '/' + month + '/' + day) + title.push(this.data.title) + content.push(this.data.content) + wx.setStorage({ + key: 'title', + data: title + }), + wx.setStorage({ + key: 'content', + data: content + }), + wx.setStorage({ + key: 'time', + data: time + }), + wx.setStorage({ + key: 'id', + data: id, + }) + this.setData({ + taglist:[], + content:'', + title:'' + }) + + } +}) diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.json" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.json" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.json" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.json" diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxml" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxml" new file mode 100644 index 00000000..c4161694 --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxml" @@ -0,0 +1,22 @@ + + + + + + + + + +Tip:选择标签可以获得日记提示哦! +换一组 + + + + + + \ No newline at end of file diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxss" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxss" new file mode 100644 index 00000000..a22b2363 --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/index/index.wxss" @@ -0,0 +1,79 @@ +/**index.wxss**/ +.cl{ + clear: both; +} +.head{ + text-align: center; + font-size: 14px; + margin-top: 10px; +} +.title{ + margin: 10px auto; + text-align: center; + border: 1px solid #ccc; + width: 280px; + height: 30px; + line-height: 30px; + font-size: 12px; + border-radius: 8px; + color: #666; +} +.btnbox{ + width: 300px; + margin: 0 auto; +} +.btn{ + width: 60px; + float: left; + height: 20px; + line-height: 20px; + text-align: center; + margin: 5px 20px 5px 20px; + overflow: visible; + font-size: 12px; + color: #fff; + background-color: #3197ed; + padding: 0; +} +.tip{ + width: 280px; + margin-left: 30px; + margin-top: 5px; + font-size: 12px; + color: #666; +} +.content{ + margin: 0 auto 15px auto; + border: 1px solid #ccc; + border-radius: 8px; + font-size: 14px; + padding: 5px; + width: 270px; + height: 205px; +} +.tag{ + font-size: 14px; + margin-left: 15px; +} +.sub{ + width: 280px; + height: 30px; + font-size: 14px; + line-height: 30px; + background-color: #3197ed; + color: #fff; + overflow: visible; + +} +.content-input{ + font-size: 12px; + color: #666; + width: 280px; +} +.shuaxin{ + position: relative; + font-size: 12px; + color: #666; + left:235px; + bottom:17px; +} \ No newline at end of file diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.js" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.js" new file mode 100644 index 00000000..8b2ec01f --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.js" @@ -0,0 +1,127 @@ +//logs.js + +Page({ + data: { + diary:[], + num:1000, + keywords:"", + }, + onLoad:function(){ + if (wx.getStorageSync('title').length == 0){ + this.setData({ + diary:[], + }) + } + else if (wx.getStorageSync('title').length != this.data.diary.length){ + for (var i = 0; i < wx.getStorageSync('title').length; i++) { + var obj = { title: wx.getStorageSync('title')[i], content: wx.getStorageSync('content')[i], time: wx.getStorageSync('time')[i], id:wx.getStorageSync('id')[i],flag:"none",isshow:"block"} + this.data.diary.push(obj) + } + this.setData({ + diary: this.data.diary + }) + console.log(this.data.diary) + console.log(wx.getStorageSync('title').length) + } + }, + onShow:function(){ + if (wx.getStorageSync('title').length != this.data.diary.length && wx.getStorageSync('title').length<=1){ + for (var i = 0; i < wx.getStorageSync('title').length; i++) { + var obj = { title: wx.getStorageSync('title')[i], content: wx.getStorageSync('content')[i], time: wx.getStorageSync('time')[i], id: wx.getStorageSync('id')[i], flag: "none", isshow: "block"} + this.data.diary.push(obj) + } + this.setData({ + diary: this.data.diary + }) + } + else if (wx.getStorageSync('title').length != this.data.diary.length && wx.getStorageSync('title').length > 1){ + var last = wx.getStorageSync('title').length-1 + var obj = { title: wx.getStorageSync('title')[last], content: wx.getStorageSync('content')[last], time: wx.getStorageSync('time')[last], id: wx.getStorageSync('id')[last], flag: "none", isshow: "block"} + this.data.diary.push(obj) + this.setData({ + diary: this.data.diary + }) + console.log(this.data.diary) + console.log(wx.getStorageSync('title').length) + } + }, + cl:function(){ + wx.clearStorage() + this.onLoad() + }, + show:function(e){ + let arr = this.data.diary + for(let item of arr){ + if (item.id == e.currentTarget.dataset.id){ + arr[item.id].flag = "block" + } + } + this.setData({ + diary:arr + }) + }, + hide:function(e){ + let arr = this.data.diary + for (let item of arr) { + if (item.id == e.currentTarget.dataset.id) { + arr[item.id].flag = "none" + } + } + this.setData({ + diary: arr + }) + }, + del:function(e){ + let arr = this.data.diary + var id = [] + var title = [] + var content = [] + var time = [] + for(let item of arr){ + if(item.id == e.currentTarget.dataset.id){ + arr = arr.filter(function(val){ + return val.id != item.id + }) + } + + } + console.log(arr) + if(arr.length == 0){ + wx.clearStorage() + } + else{ + for (let i = 0; i < arr.length; i++) { + title.push(arr[i].title) + content.push(arr[i].content) + time.push(arr[i].time) + id.push(i) + } + for (let item of arr) { + wx.setStorageSync('title', title) + wx.setStorageSync('content', content) + wx.setStorageSync('time', time) + wx.setStorageSync('id', id) + } + } + this.setData({ + diary: arr + }) + }, + keyword:function(e){ + this.setData({ + keywords: e.detail.value + }) + let arr = this.data.diary + console.log(arr) + for (let i in arr) { + arr[i].isshow = "block" + if (arr[i].title.indexOf(this.data.keywords) == -1) { + arr[i].isshow = "none" + } + } + console.log(arr) + this.setData({ + diary: arr + }) + } +}) diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.json" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.json" new file mode 100644 index 00000000..561590cf --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.json" @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "查看日记", + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxml" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxml" new file mode 100644 index 00000000..753a5b8a --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxml" @@ -0,0 +1,22 @@ + + + + + + + + + + +{{item.title}} +{{item.content}} + + +{{item.time}} +{{item.content}} + + + + + + diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxss" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxss" new file mode 100644 index 00000000..d970db7a --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/logs/logs.wxss" @@ -0,0 +1,111 @@ +.cl{ + clear: both; +} +.logsbox{ + width: 95%; + height: 120px; + margin: 10px auto; + border: 1px solid #ccc; + position: relative; + box-shadow: 2px 2px 2px 2px #ccc; +} +.title{ + font-size: 12px; + color: #666; + margin: 10px 0 0 10px; +} +.content{ + font-size: 12px; + color: #666; + margin: 10px 0 0 10px; + width: 90%; + white-space:nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.time{ + font-size: 12px; + color: #666; + position: absolute; + bottom: 10px; + right: 10px; +} +.lookall{ + width: 60px; + height: 20px; + line-height: 20px; + text-align: center; + font-size: 12px; + color: #666; + border: 0; + background-color: #fff; + position: absolute; + overflow: visible; + padding: 0 5px 0 5px; + bottom: 35px; + right: 75px; +} +.showall{ + width: 88%; + height: 90%; + position: fixed; + border: 1px solid #ccc; + box-shadow: 2px 2px 2px 2px #ccc; + margin: 0 auto; + font-size: 12px; + top:10px; + z-index: 1000; + background-color: #fff; + padding: 10px; +} +.hideall{ + position: absolute; + bottom: 10px; + width: 100px; + height: 30px; + text-align: center; + line-height: 30px; + overflow: visible; + background-color: #3197ed; + margin-left: -50px; + left: 50%; + color: #fff; + font-size: 14px; +} +.del{ + width: 60px; + height: 20px; + line-height: 20px; + text-align: center; + font-size: 12px; + color: #666; + border: 0; + background-color: #fff; + position: absolute; + overflow: visible; + padding: 0 5px 0 5px; + bottom: 35px; + right: 8px; +} +.keywordinput{ + width: 100%; + height: 30px; + border: 1px solid #ccc; + border-radius: 8px; + font-size: 12px; + color: #666; + float: left; +} +.keywordbox{ + width: 280px; + margin: 10px auto; + position: relative; + text-align: center; +} +.keywordbox image{ + width: 24px; + height: 24px; + position: absolute; + top: 4px; + left: 4px; +} diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.js" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.js" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.js" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.js" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.json" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.json" similarity index 92% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.json" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.json" index a97367de..8835af06 100644 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/index/index.json" +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.json" @@ -1,3 +1,3 @@ { "usingComponents": {} -} +} \ No newline at end of file diff --git "a/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.wxml" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.wxml" new file mode 100644 index 00000000..47eb3218 --- /dev/null +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.wxml" @@ -0,0 +1,2 @@ + +该页面未开发 diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.wxss" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.wxss" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/pages/setting/setting.wxss" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/pages/setting/setting.wxss" diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/project.config.json" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/project.config.json" similarity index 87% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/project.config.json" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/project.config.json" index 39113c27..fe6cb2e8 100644 --- "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/project.config.json" +++ "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/project.config.json" @@ -12,9 +12,9 @@ "autoAudits": false }, "compileType": "miniprogram", - "libVersion": "2.6.2", + "libVersion": "2.6.4", "appid": "wx09c9bc4ad274de3d", - "projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F", + "projectname": "%E6%A0%87%E7%AD%BE%E6%97%A5%E8%AE%B0", "debugOptions": { "hidedInDevtools": [] }, diff --git "a/students/1714080903229/\345\260\217\347\250\213\345\272\217/utils/util.js" "b/students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/utils/util.js" similarity index 100% rename from "students/1714080903229/\345\260\217\347\250\213\345\272\217/utils/util.js" rename to "students/1714080903229/\346\240\207\347\255\276\346\227\245\350\256\260/utils/util.js"