diff --git a/app.js b/app.js index dc53c84..e4bc428 100644 --- a/app.js +++ b/app.js @@ -2,20 +2,9 @@ import api from './utils/api.js'; App({ onLaunch() { - // 展示本地存储能力 - const logs = wx.getStorageSync('logs') || [] - logs.unshift(Date.now()) - wx.setStorageSync('logs', logs) - - // 登录 - wx.login({ - success: res => { - // 发送 res.code 到后台换取 openId, sessionKey, unionId - } - }) }, + globalData: { - userInfo: null }, $api: api, }) diff --git a/app.json b/app.json index 5b11991..205eca1 100644 --- a/app.json +++ b/app.json @@ -2,10 +2,9 @@ "pages": [ "pages/task/index", "pages/task/taskView/index", - "pages/logs/logs", "pages/myself/index", "pages/message/index", - "pages/taskDetail/index", + "pages/task/taskDetail/index", "pages/anniversary/index", "pages/anniversary/create/index", "pages/myself/notify/index", diff --git a/components/scroll/index.js b/components/scroll/index.js index 0cd9e7f..b5f2cdf 100644 --- a/components/scroll/index.js +++ b/components/scroll/index.js @@ -168,9 +168,9 @@ Component({ successTran: false, move: this.data.scrollHeight1 }); - }, 350) - }, 1500) - }, 600) + }, 100) + }, 500) + }, 200) } else { if (this.data.refreshStatus !== 3) { this.setData({ diff --git a/pages/foot-tab/foot-tab.js b/pages/foot-tab/foot-tab.js index d51a36f..8f742ed 100644 --- a/pages/foot-tab/foot-tab.js +++ b/pages/foot-tab/foot-tab.js @@ -10,6 +10,18 @@ Component({ } }, + lifetimes: { + created() { + + }, + attached: function () { + // 在组件实例进入页面节点树时执行 + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + }, + /** * 组件的初始数据 */ @@ -65,8 +77,8 @@ Component({ checkLogin(){ let userInfo = wx.getStorageSync('userInfo'); let token = wx.getStorageSync('userToken'); - console.log('userInfo===' + userInfo); - console.log('token===' + token); + console.log('components userInfo===' + userInfo); + console.log('components token===' + token); if (userInfo && token){ return true; }else { diff --git a/pages/login/index.js b/pages/login/index.js index e034c23..26cba58 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -7,6 +7,9 @@ Page({ code:'' } }, + onShow() { + wx.hideHomeButton(); + }, // 输入框输入时 inputChange(event) { let key = event.currentTarget.dataset.type; diff --git a/pages/logs/logs.js b/pages/logs/logs.js deleted file mode 100644 index 85f6aac..0000000 --- a/pages/logs/logs.js +++ /dev/null @@ -1,18 +0,0 @@ -// logs.js -const util = require('../../utils/util.js') - -Page({ - data: { - logs: [] - }, - onLoad() { - this.setData({ - logs: (wx.getStorageSync('logs') || []).map(log => { - return { - date: util.formatTime(new Date(log)), - timeStamp: log - } - }) - }) - } -}) diff --git a/pages/logs/logs.json b/pages/logs/logs.json deleted file mode 100644 index 3ee76c1..0000000 --- a/pages/logs/logs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "查看启动日志", - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/logs/logs.wxml b/pages/logs/logs.wxml deleted file mode 100644 index 0b6b645..0000000 --- a/pages/logs/logs.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - - {{index + 1}}. {{log.date}} - - diff --git a/pages/logs/logs.wxss b/pages/logs/logs.wxss deleted file mode 100644 index 94d4b88..0000000 --- a/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/pages/myself/account/index.js b/pages/myself/account/index.js index c1b5191..932f654 100644 --- a/pages/myself/account/index.js +++ b/pages/myself/account/index.js @@ -22,7 +22,7 @@ Page({ exitLogin(){ wx.clearStorageSync(); - wx.redirectTo({url:"/pages/login/index"}) + wx.reLaunch({url:"/pages/login/index"}) } }); diff --git a/pages/register/index.js b/pages/register/index.js index 747407b..c74112d 100644 --- a/pages/register/index.js +++ b/pages/register/index.js @@ -47,7 +47,9 @@ Page({ {"id":40,"userName":"浙A88FU7","checked":false} ], }, - + onShow() { + wx.hideHomeButton(); + }, checkName() { this.closeDialog(); wx.redirectTo({url:"/pages/register/password/index?name=" + this.data.checkedName}) diff --git a/pages/register/ok/index.js b/pages/register/ok/index.js index 02bb565..5c7aa3e 100644 --- a/pages/register/ok/index.js +++ b/pages/register/ok/index.js @@ -7,6 +7,9 @@ Page({ userName:options.name }) }, + onShow() { + wx.hideHomeButton(); + }, toLongin(){ wx.redirectTo({url:"/pages/login/index"}); } diff --git a/pages/register/password/index.js b/pages/register/password/index.js index 7eadab4..fab9dc9 100644 --- a/pages/register/password/index.js +++ b/pages/register/password/index.js @@ -7,7 +7,9 @@ Page({ userName:options.name }) }, - + onShow() { + wx.hideHomeButton(); + }, toRegister(){ wx.redirectTo({url:"/pages/register/ok/index?name=" + this.data.userName}) } diff --git a/pages/task/index.js b/pages/task/index.js index d965fcc..dc9c4bb 100644 --- a/pages/task/index.js +++ b/pages/task/index.js @@ -27,7 +27,7 @@ Page({ {'taskId':'13','title':'我去哦额陪娃欧美大片请我们','note':'2022-11-11','complete':true,'notification':true}, {'taskId':'14','title':'请问哦气雾剂群殴','note':'2022-11-11','complete':true,'notification':true} ], - duration: 300, // swiper-item 切换过渡时间 + duration: 100, // swiper-item 切换过渡时间 categoryCur: 0, // 当前数据列索引 categoryMenu: ['任务清单','收藏任务','延期任务'], // 分类菜单数据, 字符串数组格式 categoryData: [], // 所有数据列 @@ -86,7 +86,7 @@ Page({ // 页面滑动切换事件 animationFinish(e) { this.setData({ - duration: 300 + duration: 100 }); setTimeout(() => { this.setData({ @@ -178,6 +178,14 @@ Page({ this.data.tapCheckHandle.close(); }, onLoad() { + let userInfo = wx.getStorageSync('userInfo'); + let token = wx.getStorageSync('userToken'); + console.log('userInfo===' + userInfo); + console.log('token===' + token); + if (!userInfo || !token){ + wx.redirectTo({url:"/pages/login/index"}); + return; + } let categoryData = []; this.data.categoryMenu.forEach(index =>{ categoryData.push({ @@ -195,12 +203,12 @@ Page({ // 第一次加载延迟 350 毫秒 防止第一次动画效果不能完全体验 setTimeout(() => { this.refresh(); - }, 350); + }, 100); }, handleClick(){ wx.navigateTo({ - url: '/pages/taskDetail/index' + url: '/pages/task/taskDetail/index' }); } }) diff --git a/pages/taskDetail/index.js b/pages/taskDetail/index.js deleted file mode 100644 index 77524a5..0000000 --- a/pages/taskDetail/index.js +++ /dev/null @@ -1,73 +0,0 @@ -let taskId = ''; -Page({ - data: { - mode: '', - alertVisible: false, - completeVisible: false, - repeatVisible: false, - repeatKey: [ - { label: '每1天', value: '1' }, - { label: '工作日', value: '2' }, - { label: '每1周', value: '3' }, - { label: '每1月', value: '4' }, - { label: '每1年', value: '5' }, - ], - date: new Date('2021-12-23').getTime(), // 支持时间戳传入 - alertText: '', - completeText: '', - repeatText: '', - repeatValue: '', - // 指定选择区间起始值 - start: '2008-01-01 00:00:00', - end: '2040-12-31 23:59:59', - }, - onLoad: function (options) { - taskId = options.id; - }, - - showPicker(e) { - const { mode } = e?.currentTarget?.dataset; - this.setData({ - mode, - [`${mode}Visible`]: true, - }); - }, - hidePicker() { - const { mode } = this.data; - this.setData({ - [`${mode}Visible`]: false, - }); - }, - onConfirm(e) { - const { value } = e?.detail; - const { mode } = this.data; - - console.log('confim', value); - - this.setData({ - [mode]: value, - [`${mode}Text`]: value, - }); - - this.hidePicker(); - }, - - onPickerConfirm(e) { - const { label,value } = e?.detail; - this.setData({ - repeatText : label, - repeatValue: value - }); - this.hidePicker(); - }, - - submitTask() { - //TODO 新增或者修改 - console.log('保存成功') - wx.redirectTo({ - url: '../task/index' - }) - } - - -}); diff --git a/pages/taskDetail/index.json b/pages/taskDetail/index.json deleted file mode 100644 index d0e8daf..0000000 --- a/pages/taskDetail/index.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "usingComponents": { - "t-date-time-picker": "/components/date-time-picker/date-time-picker", - "t-picker": "/components/picker/picker", - "t-picker-item": "/components/picker/picker-item", - "t-switch": "/components/switch/switch", - "t-button": "/components/button/button" - } -} diff --git a/pages/taskDetail/index.wxml b/pages/taskDetail/index.wxml deleted file mode 100644 index 4376f0d..0000000 --- a/pages/taskDetail/index.wxml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - -保存 - - - - - - diff --git a/pages/taskDetail/index.wxss b/pages/taskDetail/index.wxss deleted file mode 100644 index c7c7789..0000000 --- a/pages/taskDetail/index.wxss +++ /dev/null @@ -1,17 +0,0 @@ -.pannel-item { - font-size: 32rpx; -} - -.pannel-item::after { - border: 0; -} - -.sub-text { - color: #000; - opacity: 0.9; -} - -.empty { - color: #000; - opacity: 0.32; -} diff --git a/project.config.json b/project.config.json index 8eede76..0cce3eb 100644 --- a/project.config.json +++ b/project.config.json @@ -1,51 +1,51 @@ { - "description": "项目配置文件", - "packOptions": { - "ignore": [], - "include": [] - }, - "setting": { - "bundle": false, - "userConfirmedBundleSwitch": false, - "urlCheck": true, - "scopeDataCheck": false, - "coverView": true, - "es6": true, - "postcss": true, - "compileHotReLoad": false, - "lazyloadPlaceholderEnable": false, - "preloadBackgroundData": false, - "minified": true, - "autoAudits": false, - "newFeature": false, - "uglifyFileName": false, - "uploadWithSourceMap": true, - "useIsolateContext": true, - "nodeModules": false, - "enhance": true, - "useMultiFrameRuntime": true, - "useApiHook": true, - "useApiHostProcess": true, - "showShadowRootInWxmlPanel": true, - "packNpmManually": false, - "enableEngineNative": false, - "packNpmRelationList": [], - "minifyWXSS": true, - "showES6CompileOption": false, - "minifyWXML": true, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - } - }, - "compileType": "miniprogram", - "libVersion": "2.19.4", - "appid": "wxb1f499f0a173865b", - "projectname": "quinn-task", - "condition": {}, - "editorSetting": { - "tabIndent": "insertSpaces", - "tabSize": 4 + "description": "项目配置文件", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "bundle": false, + "userConfirmedBundleSwitch": false, + "urlCheck": true, + "scopeDataCheck": false, + "coverView": true, + "es6": true, + "postcss": true, + "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, + "preloadBackgroundData": false, + "minified": true, + "autoAudits": false, + "newFeature": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "useIsolateContext": true, + "nodeModules": false, + "enhance": true, + "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": true, + "showShadowRootInWxmlPanel": true, + "packNpmManually": false, + "enableEngineNative": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "showES6CompileOption": false, + "minifyWXML": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" } + }, + "compileType": "miniprogram", + "libVersion": "2.28.1", + "appid": "wxb1f499f0a173865b", + "projectname": "quinn-task", + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 4 + }, + "condition": {} } \ No newline at end of file