diff --git a/README.md b/README.md index 6e8e73b..c91d2e1 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,9 @@ #### 设计前想好页面架构、页面间数据通信方式、前后端交互方式和时机,页面设计不能只依靠 absolute。 -### 1.3.0: +### 1.3.0: -#### 完全重构数据交互和存储方式 +##### -完全重构数据交互和存储方式 - 以前: - 数据以本地为主,每一定时间(30s)同步到服务器一次。 @@ -49,6 +49,10 @@ - 数据以服务器为主,每次数据的更改都会及时同步到服务器。 - 需要 put / delete / post 的数据分别采用不同的方式,只针对该数据进行更改。 +### 1.3.1 + +##### -修复部分机型标题栏高度过低的问题 + ### 小结 总的来说,此次项目较为简单,但是还有的地方没有处理好(左侧栏在特定情况下位置会偏移),作为上手的第一个项目较为合适。 diff --git a/app.js b/app.js index 5b0531b..69f8f0b 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ App({ globalData: { - url: 'http://297mo66766.imdo.co/' + url: 'https://witime.wizzstudio.com/' }, onLaunch() { // 获取设备相关信息 @@ -18,6 +18,8 @@ App({ this.globalData.windowHeight = res.windowHeight; // 可使用窗口宽度 this.globalData.windowWidth = res.windowWidth; + // 750 / windowWidth + this.globalData.ratio = 750 / res.windowWidth; }, fail(err) { console.error(err); diff --git a/src/components/evaluate/evaluate.wxml b/src/components/evaluate/evaluate.wxml index aaef713..a3409c6 100644 --- a/src/components/evaluate/evaluate.wxml +++ b/src/components/evaluate/evaluate.wxml @@ -12,7 +12,7 @@ 任务感想 diff --git a/src/components/navbar/navbar.js b/src/components/navbar/navbar.js index 760f310..293df1f 100644 --- a/src/components/navbar/navbar.js +++ b/src/components/navbar/navbar.js @@ -1,4 +1,4 @@ -const App = getApp(); +const app = getApp(); Component({ options: { @@ -38,9 +38,10 @@ Component({ lifetimes: { attached: function () { this.setData({ - navHeight: App.globalData.navHeight, - navTop: App.globalData.navTop, - windowWidth: App.globalData.windowWidth + navHeight: app.globalData.navHeight, + navTop: app.globalData.navTop, + windowWidth: app.globalData.windowWidth, + ratio: app.globalData.ratio }) } }, diff --git a/src/components/navbar/navbar.wxml b/src/components/navbar/navbar.wxml index 8fbf2c6..f697707 100644 --- a/src/components/navbar/navbar.wxml +++ b/src/components/navbar/navbar.wxml @@ -1,8 +1,8 @@ - - + + - + {{ pageName }} diff --git a/src/components/navbar/navbar.wxss b/src/components/navbar/navbar.wxss index 7f7f380..6d84875 100644 --- a/src/components/navbar/navbar.wxss +++ b/src/components/navbar/navbar.wxss @@ -62,4 +62,3 @@ .navbar-action-group .last { border-right: none; } - diff --git a/src/pages/add-self-list/add-self-list.wxml b/src/pages/add-self-list/add-self-list.wxml index c80e888..b320c4d 100644 --- a/src/pages/add-self-list/add-self-list.wxml +++ b/src/pages/add-self-list/add-self-list.wxml @@ -1,4 +1,4 @@ - + diff --git a/src/pages/collection/collection.js b/src/pages/collection/collection.js index 6f1ea51..59670cc 100644 --- a/src/pages/collection/collection.js +++ b/src/pages/collection/collection.js @@ -271,32 +271,6 @@ Component({ // 拉取并设置数据 onLoad: async function() { let {token, owner} = await util.getTokenAndOwner(app.globalData.url + 'login/login/'); - // console.log(token, owner); - // util.myRequest({ - // url: app.globalData.url + 'check/check/?owner=' + JSON.stringify(owner), - // header: { Authorization: 'Token ' + token }, - // method: 'POST', - // data: - // {"url":app.globalData.url + 'check/check/?owner=' + JSON.stringify(owner), - // "task_num":761, - // "repeat":0, - // "s_date":"2021-08-09", - // "c_time":"2021-08-09T02:07:20.468192Z", - // "e_time":"2021-08-09T10:05:32Z", - // "text":"UI重做", - // "priority":0, - // "finish":0, - // "fin_date":"2021-08-09T10:05:32Z", - // "star":1, - // "star_text":"default", - // "todo_delete":0, - // "todo_desc":"ui重做", - // "owner": app.globalData.url + 'login/user/' + owner + '/', - // "tag":app.globalData.url + "check/taglist/1/" - // } - // }) - // .then(res => console.log(res)); - // return; // 从后端拉取数据 wx.showLoading({ title: '正在获取数据', @@ -337,9 +311,9 @@ Component({ listsLocal, {owner, token} ); - + // 设置 id - tasksLocal.forEach(item => util.setUniqueId(item.id)); + tasksLocal.forEach(item => item.id = util.getUniqueId()); // 如果存在一个今天会发生的重复任务,则修改该任务为非重复任务,并自动产生一个日期顺延的重复任务 // 如果以前完成了一个重复任务,不管其设置的日期是什么时候,同上处理 @@ -405,17 +379,18 @@ Component({ if(signText.length) signTextLocal = signText[0].signText; else { - signText = '好好学习 天天向上'; + signTextLocal = '好好学习 天天向上'; util.myRequest({ url: app.globalData.url + 'check/sign/?owner=' + JSON.stringify(owner), header: { Authorization: "Token " + token }, method: "POST", data: { - signText: signText, + signText: signTextLocal, owner: app.globalData.url + 'login/user/' + owner + "/" } }); } + wx.setStorageSync('signText', JSON.stringify(signTextLocal)); // 设置机型相关信息 let {navHeight, navTop, windowHeight, windowWidth} = app.globalData; @@ -430,7 +405,7 @@ Component({ windowWidth }) this._saveAllDataToLocal(); - console.log(this.data.tasks); + console.log(this.data); wx.hideLoading({ success: () => { diff --git a/src/pages/collection/collection.wxml b/src/pages/collection/collection.wxml index 6a22f85..0ce1f0f 100644 --- a/src/pages/collection/collection.wxml +++ b/src/pages/collection/collection.wxml @@ -1,16 +1,16 @@ - + - - + - + diff --git a/src/pages/editor/editor.wxml b/src/pages/editor/editor.wxml index ed284fa..17a62c3 100644 --- a/src/pages/editor/editor.wxml +++ b/src/pages/editor/editor.wxml @@ -7,7 +7,7 @@ listRange:可选清单的数组,默认为:["个人清单", "工作清单"] --> - + diff --git a/src/pages/history/history.wxml b/src/pages/history/history.wxml index 1fcd775..96196ab 100644 --- a/src/pages/history/history.wxml +++ b/src/pages/history/history.wxml @@ -1,14 +1,14 @@ - + - diff --git a/src/pages/list/list.js b/src/pages/list/list.js index 4d505a2..5f0b893 100644 --- a/src/pages/list/list.js +++ b/src/pages/list/list.js @@ -51,7 +51,8 @@ Component({ // 各种清单 else res = data.tasks.filter(item => - !item.list.title.localeCompare(data.pageName) + item.date.localeCompare(todayDate) >= 0 + && !item.list.title.localeCompare(data.pageName) && !item.delete ); res.sort((a, b) => a.date.localeCompare(b.date) ); diff --git a/src/pages/list/list.wxml b/src/pages/list/list.wxml index 5a32638..4657b58 100644 --- a/src/pages/list/list.wxml +++ b/src/pages/list/list.wxml @@ -4,7 +4,7 @@ isDelete:该清单是否可以删除 disabled:是否可以编辑 --> - + diff --git a/src/pages/review/review.wxml b/src/pages/review/review.wxml index c168518..07ec411 100644 --- a/src/pages/review/review.wxml +++ b/src/pages/review/review.wxml @@ -1,15 +1,15 @@ - + - - +