diff --git a/miniprogram/app.json b/miniprogram/app.json index 362db77..343872b 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,14 +1,55 @@ { + "entryPagePath": "pages/Timetable/Timetable", "pages": [ - "pages/index/index", - "pages/logs/logs" + "pages/Timetable/Timetable", + "pages/Information/Information", + "pages/Account/Account" ], + + "darkmode": true, + "themeLocation": "theme.json", "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "Weixin", - "navigationBarTextStyle": "black" + "navigationBarTitleText": "掌上教务处", + "navigationBarBackgroundColor": "@navigationBarBackgroundColor", + "navigationBarTextStyle": "@navigationBarTextStyle", + "backgroundColor": "@backgroundColor", + "backgroundColorTop": "@backgroundColor", + "backgroundColorBottom": "@backgroundColor" }, + + "tabBar": { + "color": "@tabBarColor", + "selectedColor": "#3EA3D8", + "backgroundColor": "@navigationBarBackgroundColor", + "list": [ + { + "pagePath": "pages/Timetable/Timetable", + "text": "课程表", + "iconPath": "@tabBarImage0", + "selectedIconPath": "image/navBar/0_on.png" + }, + { + "text": "综合信息", + "iconPath": "@tabBarImage1", + "pagePath": "pages/Information/Information", + "selectedIconPath": "image/navBar/1_on.png" + }, + { + "text": "设置", + "iconPath": "@tabBarImage2", + "pagePath": "pages/Account/Account", + "selectedIconPath": "image/navBar/2_on.png" + } + ] + }, + + "networkTimeout": { + "request": 10000, + "connectSocket": 10000, + "uploadFile": 10000, + "downloadFile": 10000 + }, + "style": "v2", "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/miniprogram/app.scss b/miniprogram/app.scss index 06c6fc9..e69de29 100644 --- a/miniprogram/app.scss +++ b/miniprogram/app.scss @@ -1,10 +0,0 @@ -/**app.wxss**/ -.container { - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-between; - padding: 200rpx 0; - box-sizing: border-box; -} diff --git a/miniprogram/app.ts b/miniprogram/app.ts index 1af73a8..41a361e 100644 --- a/miniprogram/app.ts +++ b/miniprogram/app.ts @@ -1,18 +1,14 @@ // app.ts App({ - globalData: {}, - onLaunch() { - // 展示本地存储能力 - const logs = wx.getStorageSync('logs') || [] - logs.unshift(Date.now()) - wx.setStorageSync('logs', logs) - // 登录 - wx.login({ - success: res => { - console.log(res.code) - // 发送 res.code 到后台换取 openId, sessionKey, unionId - }, - }) + /** + * 全局数据 + */ + globalData: {}, + + /** + * 小程序加载时 + */ + onLaunch() { }, }) \ No newline at end of file diff --git a/miniprogram/image/navBar/0_dark.png b/miniprogram/image/navBar/0_dark.png new file mode 100644 index 0000000..4f19b5d Binary files /dev/null and b/miniprogram/image/navBar/0_dark.png differ diff --git a/miniprogram/image/navBar/0_light.png b/miniprogram/image/navBar/0_light.png new file mode 100644 index 0000000..fa9164a Binary files /dev/null and b/miniprogram/image/navBar/0_light.png differ diff --git a/miniprogram/image/navBar/0_on.png b/miniprogram/image/navBar/0_on.png new file mode 100644 index 0000000..1d4b92b Binary files /dev/null and b/miniprogram/image/navBar/0_on.png differ diff --git a/miniprogram/image/navBar/1_dark.png b/miniprogram/image/navBar/1_dark.png new file mode 100644 index 0000000..5b580a8 Binary files /dev/null and b/miniprogram/image/navBar/1_dark.png differ diff --git a/miniprogram/image/navBar/1_light.png b/miniprogram/image/navBar/1_light.png new file mode 100644 index 0000000..1318945 Binary files /dev/null and b/miniprogram/image/navBar/1_light.png differ diff --git a/miniprogram/image/navBar/1_on.png b/miniprogram/image/navBar/1_on.png new file mode 100644 index 0000000..28b0c74 Binary files /dev/null and b/miniprogram/image/navBar/1_on.png differ diff --git a/miniprogram/image/navBar/2_dark.png b/miniprogram/image/navBar/2_dark.png new file mode 100644 index 0000000..4e7d1b9 Binary files /dev/null and b/miniprogram/image/navBar/2_dark.png differ diff --git a/miniprogram/image/navBar/2_light.png b/miniprogram/image/navBar/2_light.png new file mode 100644 index 0000000..c13a0da Binary files /dev/null and b/miniprogram/image/navBar/2_light.png differ diff --git a/miniprogram/image/navBar/2_on.png b/miniprogram/image/navBar/2_on.png new file mode 100644 index 0000000..9271bde Binary files /dev/null and b/miniprogram/image/navBar/2_on.png differ diff --git a/miniprogram/pages/index/index.json b/miniprogram/pages/Account/Account.json similarity index 100% rename from miniprogram/pages/index/index.json rename to miniprogram/pages/Account/Account.json diff --git a/miniprogram/pages/Account/Account.scss b/miniprogram/pages/Account/Account.scss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/pages/Account/Account.ts b/miniprogram/pages/Account/Account.ts new file mode 100644 index 0000000..5c5896d --- /dev/null +++ b/miniprogram/pages/Account/Account.ts @@ -0,0 +1,66 @@ +// pages/Account/Account.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/Account/Account.wxml b/miniprogram/pages/Account/Account.wxml new file mode 100644 index 0000000..e2787ea --- /dev/null +++ b/miniprogram/pages/Account/Account.wxml @@ -0,0 +1 @@ +pages/Account/Account.wxml diff --git a/miniprogram/pages/Account/Account.wxss b/miniprogram/pages/Account/Account.wxss new file mode 100644 index 0000000..baf3871 --- /dev/null +++ b/miniprogram/pages/Account/Account.wxss @@ -0,0 +1 @@ +/* pages/Account/Account.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/Information/Information.json b/miniprogram/pages/Information/Information.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram/pages/Information/Information.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/Information/Information.scss b/miniprogram/pages/Information/Information.scss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/pages/Information/Information.ts b/miniprogram/pages/Information/Information.ts new file mode 100644 index 0000000..67b0180 --- /dev/null +++ b/miniprogram/pages/Information/Information.ts @@ -0,0 +1,66 @@ +// pages/Information/Information.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/Information/Information.wxml b/miniprogram/pages/Information/Information.wxml new file mode 100644 index 0000000..6aadf42 --- /dev/null +++ b/miniprogram/pages/Information/Information.wxml @@ -0,0 +1 @@ +pages/Information/Information.wxml diff --git a/miniprogram/pages/Information/Information.wxss b/miniprogram/pages/Information/Information.wxss new file mode 100644 index 0000000..d13379a --- /dev/null +++ b/miniprogram/pages/Information/Information.wxss @@ -0,0 +1 @@ +/* pages/Information/Information.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/Timetable/Timetable.json b/miniprogram/pages/Timetable/Timetable.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram/pages/Timetable/Timetable.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/Timetable/Timetable.ts b/miniprogram/pages/Timetable/Timetable.ts new file mode 100644 index 0000000..af22870 --- /dev/null +++ b/miniprogram/pages/Timetable/Timetable.ts @@ -0,0 +1,66 @@ +// pages/Timetable/Timetable.ts +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/Timetable/Timetable.wxml b/miniprogram/pages/Timetable/Timetable.wxml new file mode 100644 index 0000000..e28110a --- /dev/null +++ b/miniprogram/pages/Timetable/Timetable.wxml @@ -0,0 +1 @@ +pages/Timetable/Timetable.wxml diff --git a/miniprogram/pages/Timetable/Timetable.wxss b/miniprogram/pages/Timetable/Timetable.wxss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/pages/index/index.scss b/miniprogram/pages/index/index.scss deleted file mode 100644 index eb64203..0000000 --- a/miniprogram/pages/index/index.scss +++ /dev/null @@ -1,19 +0,0 @@ -/**index.wxss**/ -.userinfo { - display: flex; - flex-direction: column; - align-items: center; - color: #aaa; -} - -.userinfo-avatar { - overflow: hidden; - width: 128rpx; - height: 128rpx; - margin: 20rpx; - border-radius: 50%; -} - -.usermotto { - margin-top: 200px; -} \ No newline at end of file diff --git a/miniprogram/pages/index/index.ts b/miniprogram/pages/index/index.ts deleted file mode 100644 index 52d84cf..0000000 --- a/miniprogram/pages/index/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -// index.ts -// 获取应用实例 -const app = getApp() - -Page({ - data: { - motto: 'Hello World', - userInfo: {}, - hasUserInfo: false, - canIUse: wx.canIUse('button.open-type.getUserInfo'), - canIUseGetUserProfile: false, - canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false - }, - // 事件处理函数 - bindViewTap() { - wx.navigateTo({ - url: '../logs/logs', - }) - }, - onLoad() { - // @ts-ignore - if (wx.getUserProfile) { - this.setData({ - canIUseGetUserProfile: true - }) - } - }, - getUserProfile() { - // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 - wx.getUserProfile({ - desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - console.log(res) - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - }, - getUserInfo(e: any) { - // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 - console.log(e) - this.setData({ - userInfo: e.detail.userInfo, - hasUserInfo: true - }) - } -}) diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml deleted file mode 100644 index f00d294..0000000 --- a/miniprogram/pages/index/index.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - 请使用1.4.4及以上版本基础库 - - - - {{userInfo.nickName}} - - - - {{motto}} - - diff --git a/miniprogram/pages/logs/logs.json b/miniprogram/pages/logs/logs.json deleted file mode 100644 index 3ee76c1..0000000 --- a/miniprogram/pages/logs/logs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "查看启动日志", - "usingComponents": {} -} \ No newline at end of file diff --git a/miniprogram/pages/logs/logs.scss b/miniprogram/pages/logs/logs.scss deleted file mode 100644 index 94d4b88..0000000 --- a/miniprogram/pages/logs/logs.scss +++ /dev/null @@ -1,8 +0,0 @@ -.log-list { - display: flex; - flex-direction: column; - padding: 40rpx; -} -.log-item { - margin: 10rpx; -} diff --git a/miniprogram/pages/logs/logs.ts b/miniprogram/pages/logs/logs.ts deleted file mode 100644 index 2fcfb22..0000000 --- a/miniprogram/pages/logs/logs.ts +++ /dev/null @@ -1,19 +0,0 @@ -// logs.ts -// const util = require('../../utils/util.js') -import { formatTime } from '../../utils/util' - -Page({ - data: { - logs: [], - }, - onLoad() { - this.setData({ - logs: (wx.getStorageSync('logs') || []).map((log: string) => { - return { - date: formatTime(new Date(log)), - timeStamp: log - } - }), - }) - }, -}) diff --git a/miniprogram/pages/logs/logs.wxml b/miniprogram/pages/logs/logs.wxml deleted file mode 100644 index 0b6b645..0000000 --- a/miniprogram/pages/logs/logs.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - - {{index + 1}}. {{log.date}} - - diff --git a/miniprogram/sitemap.json b/miniprogram/sitemap.json index ca02add..7f60f86 100644 --- a/miniprogram/sitemap.json +++ b/miniprogram/sitemap.json @@ -1,7 +1,15 @@ { - "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", - "rules": [{ - "action": "allow", - "page": "*" - }] + "document": "https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [ + { + "action": "allow", + "page": "pages/Timetable/Timetable" + }, { + "action": "allow", + "page": "pages/Information/Information" + }, { + "action": "allow", + "page": "pages/Account/Account" + } + ] } \ No newline at end of file diff --git a/miniprogram/theme.json b/miniprogram/theme.json new file mode 100644 index 0000000..0a12255 --- /dev/null +++ b/miniprogram/theme.json @@ -0,0 +1,23 @@ +{ + "light": { + "navigationBarBackgroundColor": "#f6f6f6", + "navigationBarTextStyle": "black", + "backgroundColor": "#f4f0f1", + + "tabBarColor": "#bbbbbb", + "tabBarImage0": "image/navBar/0_light.png", + "tabBarImage1": "image/navBar/1_light.png", + "tabBarImage2": "image/navBar/2_light.png" + }, + + "dark": { + "navigationBarBackgroundColor": "#191919", + "navigationBarTextStyle": "white", + "backgroundColor": "#1f1f1f", + + "tabBarColor": "#666666", + "tabBarImage0": "image/navBar/0_dark.png", + "tabBarImage1": "image/navBar/1_dark.png", + "tabBarImage2": "image/navBar/2_dark.png" + } +} \ No newline at end of file diff --git a/miniprogram/utils/util.ts b/miniprogram/utils/util.ts deleted file mode 100644 index 69a2e19..0000000 --- a/miniprogram/utils/util.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const formatTime = (date: Date) => { - const year = date.getFullYear() - const month = date.getMonth() + 1 - const day = date.getDate() - const hour = date.getHours() - const minute = date.getMinutes() - const second = date.getSeconds() - - return ( - [year, month, day].map(formatNumber).join('/') + - ' ' + - [hour, minute, second].map(formatNumber).join(':') - ) -} - -const formatNumber = (n: number) => { - const s = n.toString() - return s[1] ? s : '0' + s -} diff --git a/package.json b/package.json index 5f731b7..bb01947 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "miniprogram-ts-less-quickstart", - "version": "1.0.0", - "description": "", + "name": "mini-dlpu-v3", + "version": "3.0.0", + "description": "Third Generation Mini DLPU", "scripts": { }, "keywords": [], - "author": "", - "license": "", + "author": "MrKBear", + "license": "MIT", "dependencies": { }, "devDependencies": { diff --git a/project.config.json b/project.config.json index 27cb6fa..ad2e2d8 100644 --- a/project.config.json +++ b/project.config.json @@ -5,10 +5,10 @@ }, "miniprogramRoot": "miniprogram/", "compileType": "miniprogram", - "libVersion": "2.15.0", + "libVersion": "2.21.0", "projectname": "mini-dlpu-v3", "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "enhance": true, "postcss": true, @@ -17,10 +17,10 @@ "newFeature": false, "coverView": true, "nodeModules": false, - "autoAudits": false, + "autoAudits": true, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false, - "uglifyFileName": false, + "uglifyFileName": true, "checkInvalidKey": true, "checkSiteMap": true, "uploadWithSourceMap": true, @@ -41,12 +41,12 @@ "packNpmRelationList": [], "minifyWXSS": true, "disableUseStrict": false, + "minifyWXML": true, "showES6CompileOption": false, "useCompilerPlugins": [ "typescript", "sass" - ], - "minifyWXML": true + ] }, "simulatorType": "wechat", "simulatorPluginLibVersion": {}, diff --git a/tsconfig.json b/tsconfig.json index ade784e..42fa8c5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "alwaysStrict": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedParameters": false, "strict": true, "strictPropertyInitialization": true, "lib": ["ES2020"],