From 7a5d43281b46e1862e99f09d8619d5b7c265e496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Mon, 17 Jan 2022 22:52:51 +0800 Subject: [PATCH 01/16] Add Schedule Api file --- miniprogram/api/Schedule.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 miniprogram/api/Schedule.ts diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts new file mode 100644 index 0000000..e69de29 From 87f4d220e53269c5fb18a88eb26c55c415f397e4 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Thu, 20 Jan 2022 11:52:10 +0800 Subject: [PATCH 02/16] (#45) Optimize Modular loading performance --- miniprogram/core/Module.ts | 21 +++++++++++++++++++++ miniprogram/pages/Account/Account.ts | 18 ++++++++++++++++-- miniprogram/pages/Timetable/TestCore.ts | 12 ++++++------ miniprogram/pages/Timetable/Timetable.ts | 14 ++++++++++++-- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/miniprogram/core/Module.ts b/miniprogram/core/Module.ts index 5a5c559..f3ea5d4 100644 --- a/miniprogram/core/Module.ts +++ b/miniprogram/core/Module.ts @@ -491,6 +491,27 @@ class Manager { }) } + /** + * 异步页面加载 + * + * *注意* + * 页面模块加载后,必须手动执行 loadAllModule + * loadAllModule Modular 才会真正的被加载 + * 模块加载后可以处理逻辑绑定 + */ + public static async PageAsync(): Promise<{ + manager: Manager, + query: Record + }> { + return new Promise((solve) => { + Page({ + async onLoad(query) { + let manager = new Manager(this); + await solve({ manager, query }); + } + }) + }); + } } export { Manager, Modular, AnyWXContext, WXContext, ILifetime} \ No newline at end of file diff --git a/miniprogram/pages/Account/Account.ts b/miniprogram/pages/Account/Account.ts index 8c36bd4..8fd3723 100644 --- a/miniprogram/pages/Account/Account.ts +++ b/miniprogram/pages/Account/Account.ts @@ -4,9 +4,23 @@ import { MainFunction } from "./MainFunction"; import { FunctionList } from "./FunctionList"; import { Mask } from "../../modular/Mask/Mask"; -Manager.Page((manager) => { +(async () => { + + // 初始化页面 + const { manager, query } = await Manager.PageAsync(); + + // 添加蒙版 Modular const mask = manager.addModule(Mask, "mask"); + + // 添加 UserCard Modular manager.addModule(UserCard, "userCard", { mask }); + + // 添加 MainFunction Modular manager.addModule(MainFunction, "mainFunction"); + + // 添加 FunctionList Modular manager.addModule(FunctionList, "functionList"); -}); \ No newline at end of file + + // 初始化全部 Modular + await manager.loadAllModule(query); +})(); \ No newline at end of file diff --git a/miniprogram/pages/Timetable/TestCore.ts b/miniprogram/pages/Timetable/TestCore.ts index 6a81997..b5ae9d5 100644 --- a/miniprogram/pages/Timetable/TestCore.ts +++ b/miniprogram/pages/Timetable/TestCore.ts @@ -28,12 +28,12 @@ implements Partial { s.set("be", 12); }, 1000) - new Login().param({studentId: "1806240113", password: "qazxsw123"}) - .request().wait({ - ok: (w) => {console.log("ok", w)}, - no: (w) => {console.log("no", w)}, - done: (w) => {console.log("done", w)} - }); + // new Login().param({studentId: "1806240113", password: ""}) + // .request().wait({ + // ok: (w) => {console.log("ok", w)}, + // no: (w) => {console.log("no", w)}, + // done: (w) => {console.log("done", w)} + // }); } } diff --git a/miniprogram/pages/Timetable/Timetable.ts b/miniprogram/pages/Timetable/Timetable.ts index 05c0898..44eb192 100644 --- a/miniprogram/pages/Timetable/Timetable.ts +++ b/miniprogram/pages/Timetable/Timetable.ts @@ -6,7 +6,17 @@ import { TestCore } from "./TestCore"; * 此页面使用 Manager 进行模块化管理 * 若要添加先功能请先定义 Modular 并添加至 Manager */ -Manager.Page((manager)=>{ +(async () => { + + // 初始化页面 + const { manager, query } = await Manager.PageAsync(); + + // 添加 StatusBar Modular manager.addModule(StatusBar, "statusBar"); + + // 添加 TestCore Modular manager.addModule(TestCore, "testCore"); -}) \ No newline at end of file + + // 初始化全部 Modular + await manager.loadAllModule(query); +})() \ No newline at end of file From 63300f68f8f13ec93a1c4618a414ca05ea34004f Mon Sep 17 00:00:00 2001 From: MrKBear Date: Thu, 20 Jan 2022 13:26:24 +0800 Subject: [PATCH 03/16] (#37) Optimize Account page --- miniprogram/pages/Account/Account.wxml | 45 ++++++++--------------- miniprogram/pages/Account/FunctionList.ts | 21 ++--------- miniprogram/pages/Account/MainFunction.ts | 24 ++++++++++++ 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/miniprogram/pages/Account/Account.wxml b/miniprogram/pages/Account/Account.wxml index 7194d13..ecf8bb9 100644 --- a/miniprogram/pages/Account/Account.wxml +++ b/miniprogram/pages/Account/Account.wxml @@ -44,42 +44,27 @@ - - - - - 账号信息 - - - - - - - 课表缓存 - - - - - - - 功能定制 - - - - - - - 更多设置 + + + + + + + + + {{ item.displayName }} - - - - {{item.displayName}} + + + + + + {{ item.displayName }} diff --git a/miniprogram/pages/Account/FunctionList.ts b/miniprogram/pages/Account/FunctionList.ts index 4d78b56..b9aa672 100644 --- a/miniprogram/pages/Account/FunctionList.ts +++ b/miniprogram/pages/Account/FunctionList.ts @@ -2,11 +2,6 @@ import { Modular, Manager } from "../../core/Module"; interface IFunctionListItem { - /** - * id - */ - id?: number - /** * 显示名称 */ @@ -18,10 +13,6 @@ interface IFunctionListItem { iconUrl: string; } -interface IFunctionListData { - functionList?: IFunctionListItem[]; -}; - class FunctionList extends Modular { public static readonly functionList: IFunctionListItem[] = [ @@ -32,18 +23,12 @@ class FunctionList extends Modular { { displayName: "联系客服", iconUrl: "Support" } ]; - public data: IFunctionListData = { - functionList: undefined + public data = { + functionList: FunctionList.functionList }; public override onLoad() { - console.log(FunctionList.functionList) - this.setData({ - functionList: FunctionList.functionList.map((value, index) => { - value.id = index; - return value; - }) - }) + // Do something } } diff --git a/miniprogram/pages/Account/MainFunction.ts b/miniprogram/pages/Account/MainFunction.ts index 9b69d4c..5fc3eb1 100644 --- a/miniprogram/pages/Account/MainFunction.ts +++ b/miniprogram/pages/Account/MainFunction.ts @@ -1,6 +1,30 @@ import { Modular, Manager } from "../../core/Module"; +interface IMainFunctionItem { + + /** + * 显示名称 + */ + displayName: string; + + /** + * 图标路径 + */ + iconUrl: string; +} + class MainFunction extends Modular { + + public static readonly MainFunctionList: IMainFunctionItem[] = [ + { displayName: "账号信息", iconUrl: "UserInfo" }, + { displayName: "课表缓存", iconUrl: "DateList" }, + { displayName: "功能定制", iconUrl: "Customer" }, + { displayName: "更多设置", iconUrl: "Settings" } + ]; + + public data? = { + mainFunctionList: MainFunction.MainFunctionList + } public override onLoad() { // Do something From 14d0c9c123abba7564e1d96114e44ed80c2a8deb Mon Sep 17 00:00:00 2001 From: MrKBear Date: Thu, 20 Jan 2022 16:10:55 +0800 Subject: [PATCH 04/16] (#48) Core Api baseUrl param can be overridden --- miniprogram/core/Api.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/miniprogram/core/Api.ts b/miniprogram/core/Api.ts index 21dda78..7c772f1 100644 --- a/miniprogram/core/Api.ts +++ b/miniprogram/core/Api.ts @@ -168,16 +168,17 @@ class API< > { /** - * 基础 URL - * TODO: 这里可能涉及负载均衡 + * 默认调试标签 */ - public static get baseUrl():string { - return "https://jwc.nogg.cn"; - } - public static defaultLogLabel:LogLabel = new LogLabel( `API:API`, colorRadio(200, 120, 222) ); + + /** + * 基础 URL + * TODO: 这里可能涉及负载均衡 + */ + public baseUrl: string = "https://jwc.nogg.cn"; /** * Logger 使用的标签 @@ -319,7 +320,7 @@ class API< // 重置请求数据 const requestData:IWxRequestOption = this.requestData = { - url: API.baseUrl + this.url, + url: this.baseUrl + this.url, data: {}, header: {}, timeout: this.timeout, method: this.method, From 6bef08f12ea005efbbe6fd7e9ae6583d75d7c192 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Thu, 20 Jan 2022 17:18:44 +0800 Subject: [PATCH 05/16] (#35) Add mask show hide motion --- miniprogram/modular/Mask/Mask.scss | 37 ++++++++++++++++++++++++++ miniprogram/modular/Mask/Mask.ts | 25 +++++++++++++++-- miniprogram/pages/Account/Account.wxml | 3 ++- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/miniprogram/modular/Mask/Mask.scss b/miniprogram/modular/Mask/Mask.scss index b1c0b50..326c031 100644 --- a/miniprogram/modular/Mask/Mask.scss +++ b/miniprogram/modular/Mask/Mask.scss @@ -1,3 +1,4 @@ +@import "../../app.scss"; view.mask { position: fixed; @@ -5,4 +6,40 @@ view.mask { height: 100%; background-color: rgba($color: #000000, $alpha: .2); z-index: 1; +} + +view.mask.block { + display: block; +} + +view.mask.none { + display: none; +} + +view.mask.show { + animation: show .1s cubic-bezier(0, 0, 1, 1) both; + opacity: 1; +} + +view.mask.hide { + animation: hide .1s cubic-bezier(0, 0, 1, 1) both; + opacity: 0; +} + +@keyframes show{ + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes hide{ + from { + opacity: 1; + } + to { + opacity: 0; + } } \ No newline at end of file diff --git a/miniprogram/modular/Mask/Mask.ts b/miniprogram/modular/Mask/Mask.ts index eeaaa33..b457453 100644 --- a/miniprogram/modular/Mask/Mask.ts +++ b/miniprogram/modular/Mask/Mask.ts @@ -2,6 +2,11 @@ import { Modular, Manager } from "../../core/Module"; class Mask extends Modular { + /** + * 动画运行时间 + */ + public static readonly animateTime: number = 100; + public data? = { /** @@ -9,6 +14,11 @@ class Mask extends Modular { */ zIndex: 1, + /** + * 蒙版是否显示 + */ + isDisplay: false, + /** * 蒙版是否显示 */ @@ -21,14 +31,25 @@ class Mask extends Modular { * 显示蒙版 */ public showMask() { - this.setData({ isShow: true }); + this.setData({ + isShow: true, + isDisplay: true + }); } /** * 隐藏蒙版 */ public hideMask() { - this.setData({ isShow: false }); + this.setData({ + isShow: false + }); + + this.disappearTimer = setTimeout(() => { + this.setData({ + isDisplay: false + }); + }, Mask.animateTime); } public override onLoad() { diff --git a/miniprogram/pages/Account/Account.wxml b/miniprogram/pages/Account/Account.wxml index ecf8bb9..3b2b252 100644 --- a/miniprogram/pages/Account/Account.wxml +++ b/miniprogram/pages/Account/Account.wxml @@ -1,5 +1,6 @@ - + From 75adb97abb3acce4d396678f62e5c02a241903c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Thu, 20 Jan 2022 20:17:32 +0800 Subject: [PATCH 06/16] (#28)Add a api frame (incomplete file) --- miniprogram/api/Schedule.ts | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 miniprogram/api/Schedule.ts diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts new file mode 100644 index 0000000..29d10b4 --- /dev/null +++ b/miniprogram/api/Schedule.ts @@ -0,0 +1,75 @@ +import { API, HTTPMethod, IParamSetting, GeneralCallbackResult} from "../core/Api"; + +interface IScheduleInput { + + /** + * session + */ + cookie: string; + + /** + * 学期 + */ + semester: string; +} + +interface IScheduleOutput { + +} + +interface IScheduleEvent { + /** + * session 过期 + */ + expire: GeneralCallbackResult; + + /** + * 登录失败 + */ + unauthorized: GeneralCallbackResult; + + /** + * 未知的问题 + */ + error: GeneralCallbackResult; + + /** + * 数据损坏或丢失 + */ + badData: GeneralCallbackResult; +} + + +/** + * Schedule API + * 需要session与semester + * 此 API 用来向教务处发起获取课程表的请求 + * 请求成功后将获得教务处返回的课程表JSON文件 + */ +class Schedlue extends API { + + public override baseUrl: string = "jwc.2333.pub/course_timetable"; + + public override url = "?semester=" + IScheduleInput.semester; + + public override method: HTTPMethod = HTTPMethod.GET; + + public override params: IParamSetting = { + + cookie: { + mapKey: "cookie", + isHeader: true + }, + + semester: { + mapKey: "semester", + } + }; + + public constructor() { + super(); + this.initDebugLabel("Schedule"); + + this.addFailedCallBack(); + } +} \ No newline at end of file From 443f82ea75e8d3b3e29d59b357ae612bd8027733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Thu, 20 Jan 2022 20:30:36 +0800 Subject: [PATCH 07/16] (#28)Add a api frame (incomplete file) --- miniprogram/api/Schedule.ts | 4 +- miniprogram/pages/Account/Account.js | 66 ++++++++++++++++++++ miniprogram/pages/Information/Information.js | 66 ++++++++++++++++++++ miniprogram/pages/Timetable/TestCore.ts | 12 ++-- miniprogram/pages/Timetable/Timetable.js | 66 ++++++++++++++++++++ project.config.json | 13 ++-- 6 files changed, 210 insertions(+), 17 deletions(-) create mode 100644 miniprogram/pages/Account/Account.js create mode 100644 miniprogram/pages/Information/Information.js create mode 100644 miniprogram/pages/Timetable/Timetable.js diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts index 29d10b4..6c56199 100644 --- a/miniprogram/api/Schedule.ts +++ b/miniprogram/api/Schedule.ts @@ -48,9 +48,9 @@ interface IScheduleEvent { */ class Schedlue extends API { - public override baseUrl: string = "jwc.2333.pub/course_timetable"; + public override baseUrl: string = "jwc.2333.pub"; - public override url = "?semester=" + IScheduleInput.semester; + public override url = "/course_timetable"; public override method: HTTPMethod = HTTPMethod.GET; diff --git a/miniprogram/pages/Account/Account.js b/miniprogram/pages/Account/Account.js new file mode 100644 index 0000000..68dbb96 --- /dev/null +++ b/miniprogram/pages/Account/Account.js @@ -0,0 +1,66 @@ +// pages/Account/Account.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/Information/Information.js b/miniprogram/pages/Information/Information.js new file mode 100644 index 0000000..1e62a27 --- /dev/null +++ b/miniprogram/pages/Information/Information.js @@ -0,0 +1,66 @@ +// pages/Information/Information.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/Timetable/TestCore.ts b/miniprogram/pages/Timetable/TestCore.ts index b5ae9d5..22044f0 100644 --- a/miniprogram/pages/Timetable/TestCore.ts +++ b/miniprogram/pages/Timetable/TestCore.ts @@ -28,12 +28,12 @@ implements Partial { s.set("be", 12); }, 1000) - // new Login().param({studentId: "1806240113", password: ""}) - // .request().wait({ - // ok: (w) => {console.log("ok", w)}, - // no: (w) => {console.log("no", w)}, - // done: (w) => {console.log("done", w)} - // }); + new Login().param({studentId: "2017060129", password: "hch2000210%"}) + .request().wait({ + ok: (w) => {console.log("ok", w)}, + no: (w) => {console.log("no", w)}, + done: (w) => {console.log("done", w)} + }); } } diff --git a/miniprogram/pages/Timetable/Timetable.js b/miniprogram/pages/Timetable/Timetable.js new file mode 100644 index 0000000..dd50a45 --- /dev/null +++ b/miniprogram/pages/Timetable/Timetable.js @@ -0,0 +1,66 @@ +// pages/Timetable/Timetable.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/project.config.json b/project.config.json index ec8c334..896e718 100644 --- a/project.config.json +++ b/project.config.json @@ -25,7 +25,6 @@ "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, - "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, "useApiHook": true, "useApiHostProcess": true, @@ -35,18 +34,14 @@ "outputPath": "" }, "enableEngineNative": false, + "bundle": false, "useIsolateContext": false, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], - "minifyWXSS": true, - "disableUseStrict": false, - "minifyWXML": true, - "showES6CompileOption": false, - "useCompilerPlugins": [ - "typescript", - "sass" - ] + "minifyWXSS": true }, "simulatorType": "wechat", "simulatorPluginLibVersion": {}, From d9825d6d68680d842a3bd898bd94f8a2c3a998aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Thu, 20 Jan 2022 20:38:57 +0800 Subject: [PATCH 08/16] (#28)Add a api frame (incomplete file) --- miniprogram/pages/Account/Account.js | 66 -------------------- miniprogram/pages/Information/Information.js | 66 -------------------- miniprogram/pages/Timetable/Timetable.js | 66 -------------------- project.config.json | 13 ++-- 4 files changed, 9 insertions(+), 202 deletions(-) delete mode 100644 miniprogram/pages/Account/Account.js delete mode 100644 miniprogram/pages/Information/Information.js delete mode 100644 miniprogram/pages/Timetable/Timetable.js diff --git a/miniprogram/pages/Account/Account.js b/miniprogram/pages/Account/Account.js deleted file mode 100644 index 68dbb96..0000000 --- a/miniprogram/pages/Account/Account.js +++ /dev/null @@ -1,66 +0,0 @@ -// pages/Account/Account.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/miniprogram/pages/Information/Information.js b/miniprogram/pages/Information/Information.js deleted file mode 100644 index 1e62a27..0000000 --- a/miniprogram/pages/Information/Information.js +++ /dev/null @@ -1,66 +0,0 @@ -// pages/Information/Information.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/miniprogram/pages/Timetable/Timetable.js b/miniprogram/pages/Timetable/Timetable.js deleted file mode 100644 index dd50a45..0000000 --- a/miniprogram/pages/Timetable/Timetable.js +++ /dev/null @@ -1,66 +0,0 @@ -// pages/Timetable/Timetable.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/project.config.json b/project.config.json index 896e718..ec8c334 100644 --- a/project.config.json +++ b/project.config.json @@ -25,6 +25,7 @@ "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, "useApiHook": true, "useApiHostProcess": true, @@ -34,14 +35,18 @@ "outputPath": "" }, "enableEngineNative": false, - "bundle": false, "useIsolateContext": false, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], - "minifyWXSS": true + "minifyWXSS": true, + "disableUseStrict": false, + "minifyWXML": true, + "showES6CompileOption": false, + "useCompilerPlugins": [ + "typescript", + "sass" + ] }, "simulatorType": "wechat", "simulatorPluginLibVersion": {}, From a8e16f5972a2d8f3ef54144cda3faa6425098a9a Mon Sep 17 00:00:00 2001 From: mrkbear Date: Thu, 20 Jan 2022 20:57:41 +0800 Subject: [PATCH 09/16] (#28) Add output data mod --- miniprogram/api/Schedule.ts | 47 ++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts index 6c56199..4ba75ce 100644 --- a/miniprogram/api/Schedule.ts +++ b/miniprogram/api/Schedule.ts @@ -13,30 +13,62 @@ interface IScheduleInput { semester: string; } +interface IClassData { + + /** + * 课程名字 + */ + name: string; + + /** + * 上课地点 + */ + room?: string; + + /** + * 课程老师 + */ + teacher?: string; + + /** + * 周数 + */ + week: string; +} + interface IScheduleOutput { -} + /** + * 课程列表 + */ + classList: IClassData[]; + + /** + * 稀疏矩阵编号 + */ + index: number; +}[]; interface IScheduleEvent { /** * session 过期 */ - expire: GeneralCallbackResult; + expire: GeneralCallbackResult; /** * 登录失败 */ - unauthorized: GeneralCallbackResult; + unauthorized: GeneralCallbackResult; /** * 未知的问题 */ - error: GeneralCallbackResult; + error: GeneralCallbackResult; /** * 数据损坏或丢失 */ - badData: GeneralCallbackResult; + badData: GeneralCallbackResult; } @@ -72,4 +104,7 @@ class Schedlue extends API { this.addFailedCallBack(); } -} \ No newline at end of file +} + +export { Schedlue }; +export default Schedlue; \ No newline at end of file From 4158887d2e5acc593cb24d3bea700d69be1a5160 Mon Sep 17 00:00:00 2001 From: mrkbear Date: Thu, 20 Jan 2022 21:42:44 +0800 Subject: [PATCH 10/16] (#52) Add EduBase API --- miniprogram/api/EduBase.ts | 95 ++++++++++++++++++++++++++++++++++++++ miniprogram/api/Login.ts | 86 ++++------------------------------ miniprogram/core/Api.ts | 2 +- 3 files changed, 106 insertions(+), 77 deletions(-) create mode 100644 miniprogram/api/EduBase.ts diff --git a/miniprogram/api/EduBase.ts b/miniprogram/api/EduBase.ts new file mode 100644 index 0000000..041fbb5 --- /dev/null +++ b/miniprogram/api/EduBase.ts @@ -0,0 +1,95 @@ +import { API, IAnyData, GeneralCallbackResult } from "../core/Api"; +import { EventType } from "../core/Emitter"; + +interface ILoginEvent { + + /** + * session 过期 + */ + expire: GeneralCallbackResult; + + /** + * 登录失败 + */ + unauthorized: GeneralCallbackResult; + + /** + * 未知的问题 + */ + error: GeneralCallbackResult; + + /** + * 数据损坏或丢失 + */ + badData: GeneralCallbackResult; +} + +/** + * 教务处基础 API + * @template I API 输入数据 + * @template O API 输出数据 + * @template E API 中的事件 + * @template U 用户自定义的输出数据 + */ +abstract class EduBase< + I extends IAnyData = IAnyData, + O extends IAnyData = IAnyData, + E extends Record = {} +> extends API { + + protected useEduCallback( + parseFunction: (data: any) => O + ): void { + + this.addFailedCallBack(); + + this.on("success", (data) => { + + let isSuccess = true; + let errMsg = ""; + let res: O | undefined; + const info: any = data.data; + + // 数据缺失检测 + if(!info) { + isSuccess = false; + errMsg = "Bad Data"; + this.emit("badData", { errMsg }); + } + + if (isSuccess) switch (info.code) { + case (1): + res = parseFunction(info.data); + errMsg = info.err_msg ?? "Success"; + this.emit("ok", res!); + break; + + case (2): + isSuccess = false; + errMsg = info.err_msg ?? "Session Expire"; + this.emit("expire", { errMsg }); + break; + + case (3): + isSuccess = false; + errMsg = info.err_msg ?? "Unauthorized"; + this.emit("unauthorized", { errMsg }); + break; + + case (4): + isSuccess = false; + errMsg = info.err_msg ?? "Error"; + this.emit("error", { errMsg }); + break; + } + + if (!isSuccess) this.emit("no", { errMsg }); + this.emit("done", { errMsg, data: res }); + }); + } +} + +export { EduBase }; +export default EduBase; \ No newline at end of file diff --git a/miniprogram/api/Login.ts b/miniprogram/api/Login.ts index 47b3caf..d44b376 100644 --- a/miniprogram/api/Login.ts +++ b/miniprogram/api/Login.ts @@ -1,4 +1,5 @@ -import { API, HTTPMethod, IParamSetting, GeneralCallbackResult } from "../core/Api"; +import { HTTPMethod, IParamSetting } from "../core/Api"; +import { EduBase } from "./EduBase"; interface ILoginInput { @@ -42,35 +43,12 @@ interface ILoginOutput { eduSession: string; } -interface ILoginEvent { - - /** - * session 过期 - */ - expire: GeneralCallbackResult; - - /** - * 登录失败 - */ - unauthorized: GeneralCallbackResult; - - /** - * 未知的问题 - */ - error: GeneralCallbackResult; - - /** - * 数据损坏或丢失 - */ - badData: GeneralCallbackResult; -} - /** * Login API * 此 API 用来向教务处发起登录请求 * 请求成功后将获得教务处返回的 session */ -class Login extends API { +class Login extends EduBase { public override url: string = "/login"; @@ -92,57 +70,13 @@ class Login extends API { super(); this.initDebugLabel("Login"); - this.addFailedCallBack(); - - this.on("success", (data) => { - - let isSuccess = true; - let errMsg = ""; - let res: ILoginOutput | undefined; - const info: any = data.data; - - // 数据缺失检测 - if(!info) { - isSuccess = false; - errMsg = "Bad Data"; - this.emit("badData", { errMsg }); - } - - if (isSuccess) switch (info.code) { - case (1): - res = { - idCardLast6: info.data.idCard, - eduService: info.data.ip, - actualName: info.data.name, - isSubscribeWxAccount: info.data.official, - eduSession: info.data.session - }; - errMsg = info.err_msg ?? "Success"; - this.emit("ok", res); - break; - - case (2): - isSuccess = false; - errMsg = info.err_msg ?? "Session Expire"; - this.emit("expire", { errMsg }); - break; - - case (3): - isSuccess = false; - errMsg = info.err_msg ?? "Unauthorized"; - this.emit("unauthorized", { errMsg }); - break; - - case (4): - isSuccess = false; - errMsg = info.err_msg ?? "Error"; - this.emit("error", { errMsg }); - break; - } - - if (!isSuccess) this.emit("no", { errMsg }); - this.emit("done", { errMsg, data: res }); - }); + this.useEduCallback((data) => ({ + idCardLast6: data.idCard, + eduService: data.ip, + actualName: data.name, + isSubscribeWxAccount: data.official, + eduSession: data.session + })); } } diff --git a/miniprogram/core/Api.ts b/miniprogram/core/Api.ts index 7c772f1..b83e58c 100644 --- a/miniprogram/core/Api.ts +++ b/miniprogram/core/Api.ts @@ -698,4 +698,4 @@ enum HTTPMethod { } export default API; -export { API, IParamSetting, IAppAPIParam, ICallBack, HTTPMethod, RequestPolicy, GeneralCallbackResult } \ No newline at end of file +export { API, IParamSetting, IAppAPIParam, IAnyData, ICallBack, HTTPMethod, RequestPolicy, GeneralCallbackResult } \ No newline at end of file From 4da257c2e2f674a112f6ee13373c07b22309c3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Thu, 20 Jan 2022 22:19:10 +0800 Subject: [PATCH 11/16] (#28)Add Schedule API --- miniprogram/api/Schedule.ts | 58 +++++++++++++------------ miniprogram/pages/Timetable/TestCore.ts | 15 ++++--- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts index 4ba75ce..042a9bf 100644 --- a/miniprogram/api/Schedule.ts +++ b/miniprogram/api/Schedule.ts @@ -1,4 +1,5 @@ -import { API, HTTPMethod, IParamSetting, GeneralCallbackResult} from "../core/Api"; +import { HTTPMethod, IParamSetting } from "../core/Api"; +import { EduBase } from "./EduBase"; interface IScheduleInput { @@ -36,7 +37,7 @@ interface IClassData { week: string; } -interface IScheduleOutput { +type IScheduleOutput = { /** * 课程列表 @@ -49,38 +50,15 @@ interface IScheduleOutput { index: number; }[]; -interface IScheduleEvent { - /** - * session 过期 - */ - expire: GeneralCallbackResult; - - /** - * 登录失败 - */ - unauthorized: GeneralCallbackResult; - - /** - * 未知的问题 - */ - error: GeneralCallbackResult; - - /** - * 数据损坏或丢失 - */ - badData: GeneralCallbackResult; -} - - /** * Schedule API * 需要session与semester * 此 API 用来向教务处发起获取课程表的请求 * 请求成功后将获得教务处返回的课程表JSON文件 */ -class Schedlue extends API { +class Schedlue extends EduBase { - public override baseUrl: string = "jwc.2333.pub"; + public override baseUrl: string = "https://jwc.2333.pub"; public override url = "/course_timetable"; @@ -102,7 +80,31 @@ class Schedlue extends API { super(); this.initDebugLabel("Schedule"); - this.addFailedCallBack(); + this.useEduCallback((data) => { + const res: IScheduleOutput = []; + + for( let i = 0; i < data.length; i++ ) { + const classList: IClassData[] = []; + const CTTDetails = data[i].CTTDetails ?? []; + + for( let j = 0; j < CTTDetails.length; j++ ) { + + classList.push({ + name: CTTDetails[j].Name, + room: CTTDetails[j].Room, + teacher: CTTDetails[j].Teacher, + week: CTTDetails[j].Week, + }) + } + + res.push({ + classList, + index: data[i].Id + }) + } + return res; + + }); } } diff --git a/miniprogram/pages/Timetable/TestCore.ts b/miniprogram/pages/Timetable/TestCore.ts index 22044f0..b2a4e38 100644 --- a/miniprogram/pages/Timetable/TestCore.ts +++ b/miniprogram/pages/Timetable/TestCore.ts @@ -1,5 +1,6 @@ import { Modular, Manager, ILifetime } from "../../core/Module"; import { Login } from "../../api/Login"; +import { Schedlue } from "../../api/Schedule" import { Storage } from "../../core/Storage"; /** @@ -28,12 +29,14 @@ implements Partial { s.set("be", 12); }, 1000) - new Login().param({studentId: "2017060129", password: "hch2000210%"}) - .request().wait({ - ok: (w) => {console.log("ok", w)}, - no: (w) => {console.log("no", w)}, - done: (w) => {console.log("done", w)} - }); + // new Login().param({studentId: "2017060129", password: ""}) + // .request().wait({ + // ok: (w) => {console.log("ok", w)}, + // no: (w) => {console.log("no", w)}, + // done: (w) => {console.log("done", w)} + // }); + // new Schedlue().param({cookie:"C729D1AB1B17077485ACCD9279135C22",semester:"2020-2021-2"}) + // .request() } } From 529011b0dda2a219f34b6f3c508f7beb979ac550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AD=90?= Date: Thu, 20 Jan 2022 23:47:02 +0800 Subject: [PATCH 12/16] (#28)Add Schedule API --- miniprogram/api/Schedule.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/miniprogram/api/Schedule.ts b/miniprogram/api/Schedule.ts index 042a9bf..5926916 100644 --- a/miniprogram/api/Schedule.ts +++ b/miniprogram/api/Schedule.ts @@ -57,8 +57,6 @@ type IScheduleOutput = { * 请求成功后将获得教务处返回的课程表JSON文件 */ class Schedlue extends EduBase { - - public override baseUrl: string = "https://jwc.2333.pub"; public override url = "/course_timetable"; From 58d8d741586b999892d49e01373f74cd4b01bd1a Mon Sep 17 00:00:00 2001 From: MrKBear Date: Fri, 21 Jan 2022 10:37:40 +0800 Subject: [PATCH 13/16] (#35)Add mask modular event. --- miniprogram/modular/Mask/Mask.ts | 69 +++++++++++++++++++++++---- miniprogram/pages/Account/UserCard.ts | 13 ++++- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/miniprogram/modular/Mask/Mask.ts b/miniprogram/modular/Mask/Mask.ts index b457453..692cac0 100644 --- a/miniprogram/modular/Mask/Mask.ts +++ b/miniprogram/modular/Mask/Mask.ts @@ -1,6 +1,35 @@ import { Modular, Manager } from "../../core/Module"; -class Mask extends Modular { +/** + * 蒙版事件 + */ +type IMaskEvent = { + + /** + * 蒙版显示事件 + */ + show: void; + + /** + * 蒙版隐藏事件 + */ + hide: void; + + /** + * 蒙版状态改变事件 + */ + change: boolean; + + /** + * 蒙版点击事件 + */ + click: void; +} + +/** + * 蒙版 Modular + */ +class Mask extends Modular { /** * 动画运行时间 @@ -25,22 +54,41 @@ class Mask extends Modular { isShow: false }; + /** + * 当点击时是否自动关闭蒙版 + */ + public autoCloseOnClick: boolean = true; + + /** + * 消失动画计时器 + */ private disappearTimer?: number; + + public override onLoad() { + this.setFunc(this.handleClickMask, "handleClickMask"); + this.on("show", this.showMask); + this.on("hide", this.hideMask); + } /** * 显示蒙版 */ - public showMask() { + private showMask = () => { + + this.disappearTimer && clearTimeout(this.disappearTimer); + this.setData({ isShow: true, isDisplay: true }); + + this.emit("change", true); } /** * 隐藏蒙版 */ - public hideMask() { + private hideMask = () => { this.setData({ isShow: false }); @@ -50,15 +98,16 @@ class Mask extends Modular { isDisplay: false }); }, Mask.animateTime); - } - - public override onLoad() { - this.setFunc(this.handleClickMask, "handleClickMask"); - // Do something - } + this.emit("change", false); + } + + /** + * 处理蒙版点击事件 + */ private handleClickMask() { - this.hideMask(); + if (this.autoCloseOnClick) this.emit("hide", void 0); + this.emit("click", void 0); } } diff --git a/miniprogram/pages/Account/UserCard.ts b/miniprogram/pages/Account/UserCard.ts index 70aa8d1..aa67f22 100644 --- a/miniprogram/pages/Account/UserCard.ts +++ b/miniprogram/pages/Account/UserCard.ts @@ -5,7 +5,15 @@ type IUserCardDependent = { mask: Mask } -class UserCard extends Modular> { +type IUserCardEvent = { + + /** + * 主题更换按钮点击事件 + */ + clickChangeTheme: void; +} + +class UserCard extends Modular, IUserCardEvent> { public override onLoad() { this.setFunc(this.handleChangeTheme, "changeTheme") @@ -15,7 +23,8 @@ class UserCard extends Modular> { * 处理主题更换 */ private handleChangeTheme() { - this.depends?.mask.showMask(); + this.depends?.mask.emit("show", void 0); + this.emit("clickChangeTheme", void 0); } } From ec635b9ae6de85b30781dbdc56daa6126bdfb9b1 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Fri, 21 Jan 2022 17:30:08 +0800 Subject: [PATCH 14/16] (#56) Add Core Data. --- miniprogram/core/Data.ts | 250 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 miniprogram/core/Data.ts diff --git a/miniprogram/core/Data.ts b/miniprogram/core/Data.ts new file mode 100644 index 0000000..40a5f24 --- /dev/null +++ b/miniprogram/core/Data.ts @@ -0,0 +1,250 @@ + +/** + * 数据层键值设置 + */ +interface IDataParamSettingItem { + + /** + * 类型 + */ + type: any; + + /** + * 键值是否可以获取 + */ + isGet: boolean; + + /** + * 键值是否可以设置 + */ + isSet: boolean; + + /** + * 是否仅为异步获取 + */ + isGetAsync?: boolean; + + /** + * 是否仅为异步设置 + */ + isSetAsync?: boolean; +} + +/** + * 数据层参数类型 + */ +interface IDataParamSetting { + [x: string]: IDataParamSettingItem +} + +type IGet = () => T; +type IGetAsync = () => Promise; +type ISet = (data: T) => INone; +type ISetAsync = (data: T) => Promise; + +type INone = undefined | void | unknown; + +/** + * 注册表结构 + */ +type IRegistryItem = { + + /** + * 获取方法 + */ + get: S["isGetAsync"] extends true ? INone : S["isGet"] extends true ? IGet : INone; + + /** + * 异步获取方法 + */ + getAsync: S["isGet"] extends true ? IGetAsync : INone; + + /** + * 设置方法 + */ + set: S["isSetAsync"] extends true ? INone : S["isSet"] extends true ? ISet : INone; + + /** + * 异步设置方法 + */ + setAsync: S["isSet"] extends true ? ISetAsync : INone; +} + +/** + * 注册表参数类型 + */ +type IRegistry = { + [P in keyof D]: IRegistryItem; +} + +type IRegistryPartial = { + [P in keyof D]?: Partial>; +} + + +type IAutoSelect = IF extends true ? A : B; + +/** + * Core 数据层架构 + * + * 使用示例: + * ```typescript + * class TestData extends Data<{ + * test: { + * type: number, + * isGet: true, + * isSet: true, + * isGetAsync: true + * } + * }> { + * public onLoad() { + * let dataObject = {key: 1} + * this.getter("test", () => 1); + * this.registerKeyFromObject("test", "key", dataObject); + * } + * } + * ``` + */ +class Data { + + /** + * getter setter 注册表 + */ + private registryList: IRegistryPartial = {}; + + /** + * 加载函数 + */ + public onLoad(): any {}; + + /** + * 注册一个 Setter 到键值上 + * @param key 注册的键值 + * @param setter 注册的 Setter + * @param isAsync 是否为异步函数 + */ + protected setter (key: KEY, setter: IRegistryItem["set"]): this + protected setter (key: KEY, setter: IRegistryItem["setAsync"], isAsync: true): this + protected setter< + KEY extends keyof D, + ASYNC extends boolean + > ( + key: KEY, + setter: IAutoSelect["setAsync"], IRegistryItem["set"]>, + isAsync?: ASYNC + ): this { + + // 如果此键值不存在,新建 + if (!this.registryList[key]) this.registryList[key] = {}; + + // 设置异步 setter + if (isAsync) this.registryList[key]!.setAsync = setter as IRegistryItem["setAsync"]; + + // 设置同步 setter + else this.registryList[key]!.set = setter as IRegistryItem["set"]; + + return this; + } + + /** + * 注册一个 Getter 到键值上 + * @param key 注册的键值 + * @param getter 注册的 Getter + * @param isAsync 是否为异步函数 + */ + protected getter (key: KEY, getter: IRegistryItem["get"]): this + protected getter (key: KEY, getter: IRegistryItem["getAsync"], isAsync: true): this + protected getter< + KEY extends keyof D, + ASYNC extends boolean + > ( + key: KEY, + getter: IAutoSelect["getAsync"], IRegistryItem["get"]>, + isAsync?: ASYNC + ): this { + + // 如果此键值不存在,新建 + if (!this.registryList[key]) this.registryList[key] = {}; + + // 设置异步 getter + if (isAsync) this.registryList[key]!.getAsync = getter as IRegistryItem["getAsync"]; + + // 设置同步 getter + else this.registryList[key]!.get = getter as IRegistryItem["get"]; + + return this; + } + + /** + * 将对象的键值关联到 Data 层中 + * @param key Data 层键值 + * @param keyFromObject 对象源键值 + * @param object 关联对象 + */ + protected registerKeyFromObject< + KEY extends keyof D, + F extends keyof O, + O extends {[K in F]: D[KEY]["type"]} + > (key: KEY, keyFromObject: F, object: O) { + + // 注册同步获取 + this.getter(key, () => { + return object[keyFromObject] + }); + + // 注册同步设置 + this.setter(key, (data: any) => { + object[keyFromObject] = data + }) + } + + /** + * 导出数据对象 + * @returns 数据对象 + */ + public export(): IRegistry { + this.autoFillFunction(); + return this.registryList as IRegistry; + } + + /** + * 自动填充缺失的异步函数 + * 在注册表中搜索全部的同步函数 + * 并自动填充对应的异步函数 + * 此函数会在 export 前静默执行 + */ + protected autoFillFunction(): void { + + // 填充函数 + const fillFunction = (key: KEY): void => { + + const item = this.registryList[key] as IRegistryItem; + if (!item) return; + + // 检验 getter + if (item.get && !item.getAsync) { + item.getAsync = this.syncFn2AsyncFn(item.get as IGet); + } + + // 检验 setter + if (item.set && !item.setAsync) { + item.setAsync = this.syncFn2AsyncFn(item.set as ISet); + } + } + + // 在注册表中查找 + for (const key in this.registryList) fillFunction(key); + } + + /** + * 将同步函数转换为异步函数 + * @param fn 同步函数 + */ + protected syncFn2AsyncFn | ISet)> (fn: H): + IAutoSelect ? true : false, IGetAsync, ISetAsync> { + const asyncFn = async (...param: [D]) => { + return fn(...param); + }; + return asyncFn as any; + } +} \ No newline at end of file From 1f2a2ad6bda51958ff06de2244ac54dfd28ae90f Mon Sep 17 00:00:00 2001 From: MrKBear Date: Fri, 21 Jan 2022 17:36:16 +0800 Subject: [PATCH 15/16] (#22) Add StudentInfo file --- miniprogram/data/StudentInfo.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 miniprogram/data/StudentInfo.ts diff --git a/miniprogram/data/StudentInfo.ts b/miniprogram/data/StudentInfo.ts new file mode 100644 index 0000000..e69de29 From 660f6921de1d44d7ced5b0d433be509d28389fc3 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Fri, 21 Jan 2022 17:38:41 +0800 Subject: [PATCH 16/16] (#21) Mixin IAnyData in app --- miniprogram/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniprogram/app.ts b/miniprogram/app.ts index c05849f..90b8431 100644 --- a/miniprogram/app.ts +++ b/miniprogram/app.ts @@ -1,9 +1,9 @@ -import { IAppAPIParam } from "./core/Api"; +import { IAppAPIParam, IAnyData } from "./core/Api"; import { IAppStorageParam, Storage, IStorageData } from "./core/Storage"; import { Logger, LevelLogLabel, LifeCycleLogLabel } from "./core/Logger"; -App({ +App({ /** * API 模块需要的全局数据