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