diff --git a/miniprogram/pages/Account/Account.wxml b/miniprogram/pages/Account/Account.wxml index 0bee339..7194d13 100644 --- a/miniprogram/pages/Account/Account.wxml +++ b/miniprogram/pages/Account/Account.wxml @@ -76,42 +76,10 @@ - - - - 赞助计划 - - - - - - - - 公众号 - - - - - - - - 自助问答 - - - - - - - - 关于我们 - - - - - - - - 联系客服 + + + + {{item.displayName}} diff --git a/miniprogram/pages/Account/FunctionList.ts b/miniprogram/pages/Account/FunctionList.ts index 72909dd..4d78b56 100644 --- a/miniprogram/pages/Account/FunctionList.ts +++ b/miniprogram/pages/Account/FunctionList.ts @@ -1,9 +1,49 @@ import { Modular, Manager } from "../../core/Module"; +interface IFunctionListItem { + + /** + * id + */ + id?: number + + /** + * 显示名称 + */ + displayName: string; + + /** + * 图标路径 + */ + iconUrl: string; +} + +interface IFunctionListData { + functionList?: IFunctionListItem[]; +}; + class FunctionList extends Modular { + + public static readonly functionList: IFunctionListItem[] = [ + { displayName: "赞助计划", iconUrl: "Sponsor" }, + { displayName: "公众号", iconUrl: "PubilcAccount" }, + { displayName: "自助问答", iconUrl: "FAQ" }, + { displayName: "关于我们", iconUrl: "AboutUs" }, + { displayName: "联系客服", iconUrl: "Support" } + ]; + + public data: IFunctionListData = { + functionList: undefined + }; public override onLoad() { - // Do something + console.log(FunctionList.functionList) + this.setData({ + functionList: FunctionList.functionList.map((value, index) => { + value.id = index; + return value; + }) + }) } }