refactor pages struct
This commit is contained in:
7
miniprogram/pages/main/tabs/other/index.json
Normal file
7
miniprogram/pages/main/tabs/other/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group"
|
||||
}
|
||||
}
|
||||
0
miniprogram/pages/main/tabs/other/index.less
Normal file
0
miniprogram/pages/main/tabs/other/index.less
Normal file
33
miniprogram/pages/main/tabs/other/index.ts
Normal file
33
miniprogram/pages/main/tabs/other/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
type NavItem = {
|
||||
title: string;
|
||||
icon: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
interface OtherData {
|
||||
navList: NavItem[];
|
||||
}
|
||||
|
||||
Page({
|
||||
data: <OtherData>{
|
||||
navList: [
|
||||
{
|
||||
title: "备忘录",
|
||||
icon: "task-checked",
|
||||
url: "/pages/main/other/portfolio/index"
|
||||
},
|
||||
{
|
||||
title: "专拍",
|
||||
icon: "face-retouching",
|
||||
url: "/pages/main/other/portfolio/index"
|
||||
}
|
||||
],
|
||||
},
|
||||
onNavTap(e: WechatMiniprogram.BaseEvent) {
|
||||
const { url } = e.currentTarget.dataset as { url?: string };
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url });
|
||||
}
|
||||
});
|
||||
17
miniprogram/pages/main/tabs/other/index.wxml
Normal file
17
miniprogram/pages/main/tabs/other/index.wxml
Normal file
@@ -0,0 +1,17 @@
|
||||
<view class="custom-navbar">
|
||||
<t-navbar title="其他" placeholder />
|
||||
</view>
|
||||
<view class="setting-bg">
|
||||
<t-cell-group class="list">
|
||||
<t-cell
|
||||
wx:for="{{navList}}"
|
||||
wx:for-item="item"
|
||||
wx:key="title"
|
||||
title="{{item.title}}"
|
||||
leftIcon="{{item.icon}}"
|
||||
arrow
|
||||
bind:tap="onNavTap"
|
||||
data-url="{{item.url}}"
|
||||
/>
|
||||
</t-cell-group>
|
||||
</view>
|
||||
Reference in New Issue
Block a user