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

refactor: 调整 uni-push 示例位置

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