提交 364112ab 编写于 作者: X xiaoyucoding

modify: 条件编译屏蔽 H5 上不支持的示例

上级 506afee6
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<view class="uni-list"> <view class="uni-list">
<view class="uni-list-cell uni-collapse"> <view class="uni-list-cell uni-collapse">
<view class="uni-list-cell-navigate uni-navigate-bottom" hover-class="uni-list-cell-hover" :class="list.open ? 'uni-active' : ''" <view class="uni-list-cell-navigate uni-navigate-bottom" hover-class="uni-list-cell-hover" :class="list.open ? 'uni-active' : ''"
@click="trigerCollapse(index)"> @click="trigerCollapse(index)">
{{list.name}} {{list.name}}
</view> </view>
<view class="uni-list uni-collapse" :class="list.open ? 'uni-active' : ''"> <view class="uni-list uni-collapse" :class="list.open ? 'uni-active' : ''">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,key) in list.pages" :key="key" :url="item.url" <view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,key) in list.pages" :key="key" :url="item.url"
@click="goDetailPage(item.url)"> @click="goDetailPage(item.url)">
<view class="uni-list-cell-navigate uni-navigate-right"> {{item.name}} </view> <view class="uni-list-cell-navigate uni-navigate-right"> {{item.name}} </view>
</view> </view>
</view> </view>
...@@ -27,39 +27,44 @@ ...@@ -27,39 +27,44 @@
<script> <script>
export default { export default {
data() { data() {
let list = [ let list = [{
{
id: 'page', id: 'page',
name: '界面', name: '界面',
open: false, open: false,
pages: [{ pages: [{
name: '设置界面标题', name: '设置界面标题',
url: 'set-navigation-bar-title' url: 'set-navigation-bar-title'
}, { }, {
name: '页面跳转', name: '页面跳转',
url: 'navigator' url: 'navigator'
}, { }, {
name: '下拉刷新', name: '下拉刷新',
url: 'pull-down-refresh' url: 'pull-down-refresh'
}, { },
name: '创建动画', //#ifndef H5
url: 'animation' {
}, { name: '创建动画',
name: '创建绘画', url: 'animation'
url: 'canvas' },
}, { {
name: '显示操作菜单', name: '创建绘画',
url: 'action-sheet' url: 'canvas'
}, { },
name: '显示模态弹窗', //#endif
url: 'modal' {
}, { name: '显示操作菜单',
name: '显示加载提示框', url: 'action-sheet'
url: 'show-loading' }, {
}, { name: '显示模态弹窗',
name: '显示消息提示框', url: 'modal'
url: 'toast' }, {
}] name: '显示加载提示框',
url: 'show-loading'
}, {
name: '显示消息提示框',
url: 'toast'
}
]
}, { }, {
id: 'device', id: 'device',
name: '设备', name: '设备',
...@@ -73,13 +78,17 @@ ...@@ -73,13 +78,17 @@
}, { }, {
name: '打电话', name: '打电话',
url: 'make-phone-call' url: 'make-phone-call'
}, { },
//#ifndef H5
{
name: '扫码', name: '扫码',
url: 'scan-code' url: 'scan-code'
}, { }, {
name: '剪贴板', name: '剪贴板',
url: 'clipboard' url: 'clipboard'
}, { },
//#endif
{
name: '监听加速度传感器', name: '监听加速度传感器',
url: 'on-accelerometer-change' url: 'on-accelerometer-change'
}, { }, {
...@@ -117,19 +126,27 @@ ...@@ -117,19 +126,27 @@
pages: [{ pages: [{
name: '图片', name: '图片',
url: 'image' url: 'image'
}, { },
//#ifndef H5
{
name: '录音', name: '录音',
url: 'voice' url: 'voice'
}, { }, {
name: '背景音频', name: '背景音频',
url: 'background-audio' url: 'background-audio'
}, { },
//#endif
{
name: '视频', name: '视频',
url: 'video' url: 'video'
}, { },
//#ifndef H5
{
name: '文件', name: '文件',
url: 'file' url: 'file'
}] },
//#endif
]
}, { }, {
id: 'location', id: 'location',
name: '位置', name: '位置',
...@@ -152,7 +169,9 @@ ...@@ -152,7 +169,9 @@
name: '数据存储', name: '数据存储',
url: 'storage' url: 'storage'
}] }]
}, { },
//#ifndef H5
{
id: 'login', id: 'login',
name: '登录', name: '登录',
open: false, open: false,
...@@ -163,7 +182,8 @@ ...@@ -163,7 +182,8 @@
name: '获取用户信息', name: '获取用户信息',
url: 'get-user-info' url: 'get-user-info'
}] }]
}, { },
{
id: 'payment', id: 'payment',
name: '支付', name: '支付',
open: false, open: false,
...@@ -171,7 +191,8 @@ ...@@ -171,7 +191,8 @@
name: '发起支付', name: '发起支付',
url: 'request-payment' url: 'request-payment'
}] }]
}, { },
{
id: 'share', id: 'share',
name: '分享', name: '分享',
open: false, open: false,
...@@ -179,9 +200,10 @@ ...@@ -179,9 +200,10 @@
name: '分享', name: '分享',
url: 'share' url: 'share'
}] }]
} },
//#endif
//#ifdef APP-PLUS //#ifdef APP-PLUS
, { {
id: 'speech', id: 'speech',
name: '语音', name: '语音',
open: false, open: false,
...@@ -197,7 +219,7 @@ ...@@ -197,7 +219,7 @@
name: '推送', name: '推送',
url: '/platforms/app-plus/push/push' url: '/platforms/app-plus/push/push'
}] }]
} },
//#endif //#endif
]; ];
return { return {
...@@ -210,7 +232,7 @@ ...@@ -210,7 +232,7 @@
path: '/pages/tabBar/API/API' path: '/pages/tabBar/API/API'
} }
}, },
onNavigationBarButtonTap(e){ onNavigationBarButtonTap(e) {
uni.navigateTo({ uni.navigateTo({
url: '/platforms/app-plus/about/about' url: '/platforms/app-plus/about/about'
}) })
...@@ -237,13 +259,15 @@ ...@@ -237,13 +259,15 @@
</script> </script>
<style> <style>
.uni-card { .uni-card {
box-shadow: none; box-shadow: none;
} }
.uni-list:after {
height: 0; .uni-list:after {
} height: 0;
.uni-list:before { }
height: 0;
} .uni-list:before {
</style> height: 0;
}
</style>
...@@ -31,7 +31,14 @@ ...@@ -31,7 +31,14 @@
id: 'view', id: 'view',
name: '视图容器', name: '视图容器',
open: false, open: false,
pages: ['view', 'scroll-view', 'swiper', 'movable-view'] pages: [
'view',
'scroll-view',
'swiper',
//#ifndef H5
'movable-view',
//#endif
]
}, { }, {
id: 'content', id: 'content',
name: '基础内容', name: '基础内容',
...@@ -60,13 +67,13 @@ ...@@ -60,13 +67,13 @@
name: '地图', name: '地图',
open: false, open: false,
pages: ['map'] pages: ['map']
// #ifndef H5 // #ifndef H5
}, { }, {
id: 'web-view', id: 'web-view',
name: '网页', name: '网页',
open: false, open: false,
pages: ['web-view'], pages: ['web-view'],
// #endif // #endif
}] }]
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册