提交 1190d92a 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor: 调整 uni-push 示例位置

上级 e3e849c9
...@@ -470,14 +470,13 @@ ...@@ -470,14 +470,13 @@
"navigationBarTitleText": "ball" "navigationBarTitleText": "ball"
} }
}, },
{ {
"path" : "pages/component/canvas/canvas/doodle", "path": "pages/component/canvas/canvas/doodle",
"group": "0,7", "group": "0,7",
"style" : "style": {
{ "navigationBarTitleText": "涂鸦"
"navigationBarTitleText" : "涂鸦" }
} },
},
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/component/animation-view/animation-view", "path": "pages/component/animation-view/animation-view",
...@@ -608,7 +607,7 @@ ...@@ -608,7 +607,7 @@
}, },
{ {
"path": "pages/API/storage/storage", "path": "pages/API/storage/storage",
"group": "1,9", "group": "1,10",
"style": { "style": {
"navigationBarTitleText": "storage | key-value本地数据存储" "navigationBarTitleText": "storage | key-value本地数据存储"
} }
...@@ -616,7 +615,7 @@ ...@@ -616,7 +615,7 @@
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/API/get-file-system-manager/get-file-system-manager", "path": "pages/API/get-file-system-manager/get-file-system-manager",
"group": "1,10,0", "group": "1,11,0",
"style": { "style": {
"navigationBarTitleText": "getFileSystemManager | 获取文件管理器" "navigationBarTitleText": "getFileSystemManager | 获取文件管理器"
} }
...@@ -674,7 +673,7 @@ ...@@ -674,7 +673,7 @@
}, },
{ {
"path": "pages/API/get-location/get-location", "path": "pages/API/get-location/get-location",
"group": "1,8,0", "group": "1,9,0",
"style": { "style": {
"navigationBarTitleText": "getLocation | 获取当前位置" "navigationBarTitleText": "getLocation | 获取当前位置"
} }
...@@ -682,7 +681,7 @@ ...@@ -682,7 +681,7 @@
// #ifdef WEB // #ifdef WEB
{ {
"path": "pages/API/open-location/open-location", "path": "pages/API/open-location/open-location",
"group": "1,8,1", "group": "1,9,1",
"style": { "style": {
"navigationBarTitleText": "openLocation | 使用地图查看位置" "navigationBarTitleText": "openLocation | 使用地图查看位置"
} }
...@@ -691,7 +690,7 @@ ...@@ -691,7 +690,7 @@
// #ifdef WEB // #ifdef WEB
{ {
"path": "pages/API/choose-location/choose-location", "path": "pages/API/choose-location/choose-location",
"group": "1,8,2", "group": "1,9,2",
"style": { "style": {
"navigationBarTitleText": "chooseLocation | 使用地图选择位置" "navigationBarTitleText": "chooseLocation | 使用地图选择位置"
} }
...@@ -921,7 +920,7 @@ ...@@ -921,7 +920,7 @@
}, },
{ {
"path": "pages/API/get-battery-info/get-battery-info", "path": "pages/API/get-battery-info/get-battery-info",
"group": "1,6,8", "group": "1,6,7",
"style": { "style": {
"navigationBarTitleText": "getBatteryInfo | 获取电池电量信息" "navigationBarTitleText": "getBatteryInfo | 获取电池电量信息"
} }
...@@ -946,7 +945,7 @@ ...@@ -946,7 +945,7 @@
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/API/facial-recognition-meta-info/facial-recognition-meta-info", "path": "pages/API/facial-recognition-meta-info/facial-recognition-meta-info",
"group": "1,11,1", "group": "1,12,1",
"style": { "style": {
"navigationBarTitleText": "facialRecognitionMetaInfo | 金融级实人认证", "navigationBarTitleText": "facialRecognitionMetaInfo | 金融级实人认证",
"enablePullDownRefresh": false "enablePullDownRefresh": false
...@@ -956,7 +955,7 @@ ...@@ -956,7 +955,7 @@
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/API/get-univerify-manager/get-univerify-manager", "path": "pages/API/get-univerify-manager/get-univerify-manager",
"group": "1,11,0", "group": "1,12,0",
"style": { "style": {
"navigationBarTitleText": "getUniverifyManager | App一键登录", "navigationBarTitleText": "getUniverifyManager | App一键登录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
...@@ -974,7 +973,7 @@ ...@@ -974,7 +973,7 @@
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
{ {
"path": "pages/API/create-request-permission-listener/create-request-permission-listener", "path": "pages/API/create-request-permission-listener/create-request-permission-listener",
"group": "1,6,16", "group": "1,6,15",
"style": { "style": {
"navigationBarTitleText": "createRequestPermissionListener | 监听权限申请", "navigationBarTitleText": "createRequestPermissionListener | 监听权限申请",
"enablePullDownRefresh": false "enablePullDownRefresh": false
...@@ -994,7 +993,7 @@ ...@@ -994,7 +993,7 @@
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/API/create-rewarded-video-ad/create-rewarded-video-ad", "path": "pages/API/create-rewarded-video-ad/create-rewarded-video-ad",
"group": "1,12,0", "group": "1,13,0",
"style": { "style": {
"navigationBarTitleText": "createRewardedVideoAd | 激励视频广告", "navigationBarTitleText": "createRewardedVideoAd | 激励视频广告",
"enablePullDownRefresh": false "enablePullDownRefresh": false
...@@ -1029,7 +1028,7 @@ ...@@ -1029,7 +1028,7 @@
// #ifdef WEB // #ifdef WEB
{ {
"path": "pages/API/make-phone-call/make-phone-call", "path": "pages/API/make-phone-call/make-phone-call",
"group": "1,6,9", "group": "1,6,8",
"style": { "style": {
"navigationBarTitleText": "makePhoneCall | 打电话" "navigationBarTitleText": "makePhoneCall | 打电话"
} }
...@@ -1063,7 +1062,7 @@ ...@@ -1063,7 +1062,7 @@
// #ifdef WEB // #ifdef WEB
{ {
"path": "pages/API/clipboard/clipboard", "path": "pages/API/clipboard/clipboard",
"group": "1,6,10", "group": "1,6,9",
"style": { "style": {
"navigationBarTitleText": "clipboard | 剪切板" "navigationBarTitleText": "clipboard | 剪切板"
} }
...@@ -1072,7 +1071,7 @@ ...@@ -1072,7 +1071,7 @@
// #ifdef WEB // #ifdef WEB
{ {
"path": "pages/API/compass/compass", "path": "pages/API/compass/compass",
"group": "1,6,11", "group": "1,6,10",
"style": { "style": {
"navigationBarTitleText": "compass | 罗盘" "navigationBarTitleText": "compass | 罗盘"
} }
...@@ -1135,10 +1134,10 @@ ...@@ -1135,10 +1134,10 @@
// #endif // #endif
// #ifndef WEB // #ifndef WEB
{ {
"path": "pages/API/push/push", "path": "pages/API/uni-push/uni-push",
"group": "1,6,7", "group": "1,15,0",
"style": { "style": {
"navigationBarTitleText": "push | 推送" "navigationBarTitleText": "推送"
} }
}, },
// #endif // #endif
...@@ -2119,10 +2118,6 @@ ...@@ -2119,10 +2118,6 @@
{ {
"id": "api.dom.createSelectorQuery", "id": "api.dom.createSelectorQuery",
"name": "createSelectorQuery" "name": "createSelectorQuery"
},
{
"id": "api.dom.createCanvasContextAsync",
"name": "createCanvasContextAsync"
} }
] ]
}, },
...@@ -2219,10 +2214,6 @@ ...@@ -2219,10 +2214,6 @@
"id": "api.device.installApk", "id": "api.device.installApk",
"name": "installApk" "name": "installApk"
}, },
{
"id": "api.device.push",
"name": "push"
},
{ {
"id": "api.device.getBatteryInfo", "id": "api.device.getBatteryInfo",
"name": "getBatteryInfo" "name": "getBatteryInfo"
...@@ -2295,6 +2286,7 @@ ...@@ -2295,6 +2286,7 @@
} }
] ]
}, },
null,
{ {
"id": "api.location", "id": "api.location",
"name": "位置", "name": "位置",
...@@ -2351,7 +2343,6 @@ ...@@ -2351,7 +2343,6 @@
} }
] ]
}, },
null,
{ {
"id": "api.payment", "id": "api.payment",
"name": "支付", "name": "支付",
...@@ -2366,7 +2357,16 @@ ...@@ -2366,7 +2357,16 @@
} }
] ]
}, },
null, {
"id": "api.push",
"name": "推送",
"children": [
{
"id": "api.push.uni-push",
"name": "push"
}
]
},
{ {
"id": "api.component", "id": "api.component",
"name": "组件上下文对象", "name": "组件上下文对象",
...@@ -2732,4 +2732,4 @@ ...@@ -2732,4 +2732,4 @@
] ]
} }
] ]
} }
\ No newline at end of file
...@@ -11,31 +11,31 @@ ...@@ -11,31 +11,31 @@
<u-link :href="'https://uniapp.dcloud.io/uni-app-x/api/'" :text="'https://uniapp.dcloud.io/uni-app-x/api/'" <u-link :href="'https://uniapp.dcloud.io/uni-app-x/api/'" :text="'https://uniapp.dcloud.io/uni-app-x/api/'"
:inWhiteList="true"></u-link> :inWhiteList="true"></u-link>
</view> </view>
<uni-collapse> <uni-collapse>
<uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name" <uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name"
class="item"> class="item">
<view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active" <view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active"
@click="goPage(`/${page.path}`)"> @click="goPage(`/${page.path}`)">
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{page.style["navigationBarTitleText"]}}</text> <text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{page.style["navigationBarTitleText"]}}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</view> </view>
<uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id"> <uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id">
<uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0"> <uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0">
<view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages" <view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages"
:key="childPage!.path" @click="goPage(`/${childPage.path}`)"> :key="childPage!.path" @click="goPage(`/${childPage.path}`)">
<text class="uni-navigate-text">{{ <text class="uni-navigate-text">{{
childPage.style["navigationBarTitleText"] childPage.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<view v-if="!hasLeftWin" ref="pop" @click="hidePop()" class="popup"> <view v-if="!hasLeftWin" ref="pop" @click="hidePop()" class="popup">
<view style="width: 90%; background-color: white" @click="stopClickPop"> <view style="width: 90%; background-color: white" @click="stopClickPop">
<api-set-tabbar></api-set-tabbar> <api-set-tabbar></api-set-tabbar>
</view> </view>
</view> </view>
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
</template> </template>
<script lang="uts"> <script lang="uts">
import { generateMenu } from './generateMenu.uts' import { generateMenu } from './generateMenu.uts'
import { MenuItem } from './generateMenu.uts' import { MenuItem } from './generateMenu.uts'
const menu = generateMenu('pages/API') const menu = generateMenu('pages/API')
import { state } from '@/store/index.uts' import { state } from '@/store/index.uts'
export default { export default {
data() { data() {
...@@ -54,14 +54,14 @@ ...@@ -54,14 +54,14 @@
menu: menu as (MenuItem | null)[], menu: menu as (MenuItem | null)[],
arrowRightIcon: '/static/icons/arrow-right.png', arrowRightIcon: '/static/icons/arrow-right.png',
} }
}, },
computed: { computed: {
hasLeftWin():boolean{ hasLeftWin():boolean{
return !state.noMatchLeftWindow return !state.noMatchLeftWindow
}, },
leftWinActive():string{ leftWinActive():string{
return state.leftWinActive.slice(1) return state.leftWinActive.slice(1)
} }
}, },
methods: { methods: {
goPage(url : string) { goPage(url : string) {
...@@ -80,23 +80,23 @@ ...@@ -80,23 +80,23 @@
stopClickPop: function (e : PointerEvent) { stopClickPop: function (e : PointerEvent) {
e.stopPropagation() //点击到pop的非灰色区域,拦截点击事件 e.stopPropagation() //点击到pop的非灰色区域,拦截点击事件
} }
}, },
// #ifdef WEB // #ifdef WEB
watch:{ watch:{
$route: { $route: {
immediate: true, immediate: true,
handler(newRoute) { handler(newRoute) {
if (newRoute.matched.length) { if (newRoute.matched.length) {
const activeCategoryIndex = this.menu.findIndex(menuItem => menuItem?.pages.some(page => this.leftWinActive && this.leftWinActive === page?.path)) const activeCategoryIndex = this.menu.findIndex(menuItem => menuItem?.pages.some(page => this.leftWinActive && this.leftWinActive === page?.path))
if (activeCategoryIndex > -1) { if (activeCategoryIndex > -1) {
this.$nextTick(() => { this.$nextTick(() => {
((this.$refs.category as ComponentPublicInstance[])[activeCategoryIndex])?.$callMethod('openCollapse', true) ((this.$refs.category as ComponentPublicInstance[])[activeCategoryIndex])?.$callMethod('openCollapse', true)
}) })
} }
} }
} }
} }
}, },
// #endif // #endif
} }
</script> </script>
...@@ -122,4 +122,4 @@ ...@@ -122,4 +122,4 @@
display: none; display: none;
background-color: rgba(16, 16, 16, 0.5); background-color: rgba(16, 16, 16, 0.5);
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册