From c8298dd3e3b4c9a986e959a9b95c1d36a4cd34af Mon Sep 17 00:00:00 2001 From: xiaoyucoding Date: Thu, 15 Nov 2018 12:03:09 +0800 Subject: [PATCH] =?UTF-8?q?add:=20H5=20=E5=B9=B3=E5=8F=B0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=B3=E4=BA=8E=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/hello-uniapp/pages.json | 21 +--- .../hello-uniapp/pages/tabBar/API/API.vue | 7 +- .../pages/tabBar/component/component.vue | 103 ++++++++++-------- .../pages/tabBar/template/template.vue | 13 ++- .../hello-uniapp/platforms/h5/about/about.vue | 71 ++++++++++++ 5 files changed, 148 insertions(+), 67 deletions(-) create mode 100644 examples/hello-uniapp/platforms/h5/about/about.vue diff --git a/examples/hello-uniapp/pages.json b/examples/hello-uniapp/pages.json index 735de004a..998db06a6 100644 --- a/examples/hello-uniapp/pages.json +++ b/examples/hello-uniapp/pages.json @@ -14,11 +14,6 @@ "color": "#999999" }] } - }, - "h5": { - "titleNView": { - "buttons": [] - } } } }, @@ -35,11 +30,6 @@ "color": "#999999" }] } - }, - "h5": { - "titleNView": { - "buttons": [] - } } } }, @@ -56,11 +46,6 @@ "color": "#999999" }] } - }, - "h5": { - "titleNView": { - "buttons": [] - } } } }, @@ -485,6 +470,12 @@ "navigationBarTitleText": "关于" } }, + { + "path": "platforms/h5/about/about", + "style": { + "navigationBarTitleText": "关于" + } + }, { "path": "platforms/app-plus/tabbar/tabbar", "style": { diff --git a/examples/hello-uniapp/pages/tabBar/API/API.vue b/examples/hello-uniapp/pages/tabBar/API/API.vue index 1cb854c15..f869e5559 100644 --- a/examples/hello-uniapp/pages/tabBar/API/API.vue +++ b/examples/hello-uniapp/pages/tabBar/API/API.vue @@ -234,7 +234,12 @@ }, onNavigationBarButtonTap(e) { uni.navigateTo({ - url: '/platforms/app-plus/about/about' + // #ifdef APP-PLUS + url: '/platforms/app-plus/about/about', + // #endif + // #ifdef H5 + url: '/platforms/h5/about/about', + // #endif }) }, methods: { diff --git a/examples/hello-uniapp/pages/tabBar/component/component.vue b/examples/hello-uniapp/pages/tabBar/component/component.vue index ca296ba31..598a52c2c 100644 --- a/examples/hello-uniapp/pages/tabBar/component/component.vue +++ b/examples/hello-uniapp/pages/tabBar/component/component.vue @@ -28,58 +28,62 @@ data() { return { lists: [{ - id: 'view', - name: '视图容器', - open: false, - pages: [ - 'view', - 'scroll-view', - 'swiper', - //#ifndef H5 - 'movable-view', - //#endif - ] - }, { - id: 'content', - name: '基础内容', - open: false, - pages: ['text', 'rich-text', 'icon', 'progress'] - }, { - id: 'form', - name: '表单组件', - open: false, - pages: ['button', 'checkbox', 'form', 'input', 'label', 'picker', 'picker-view', 'radio', - 'slider', - 'switch', 'textarea' - ] - }, { - id: 'nav', - name: '导航', - open: false, - pages: ['navigator'] - }, { - id: 'media', - name: '媒体组件', - open: false, - pages: ['image', 'audio', 'video'] - }, { - id: 'map', - name: '地图', - open: false, - pages: ['map'] + id: 'view', + name: '视图容器', + open: false, + pages: [ + 'view', + 'scroll-view', + 'swiper', + //#ifndef H5 + 'movable-view', + //#endif + ] + }, { + id: 'content', + name: '基础内容', + open: false, + pages: ['text', 'rich-text', 'icon', 'progress'] + }, { + id: 'form', + name: '表单组件', + open: false, + pages: ['button', 'checkbox', 'form', 'input', 'label', 'picker', 'picker-view', 'radio', + 'slider', + 'switch', 'textarea' + ] + }, { + id: 'nav', + name: '导航', + open: false, + pages: ['navigator'] + }, { + id: 'media', + name: '媒体组件', + open: false, + pages: ['image', 'audio', 'video'] + }, { + id: 'map', + name: '地图', + open: false, + pages: ['map'] + + }, // #ifndef H5 - }, { - id: 'web-view', - name: '网页', - open: false, - pages: ['web-view'], + { + id: 'web-view', + name: '网页', + open: false, + pages: ['web-view'], + + }, // #endif - }] + ] } }, onLoad() { // #ifdef APP-PLUS - //web-view组件支持本地html,依赖最新版的客户端基座 + // web-view组件支持本地html,依赖最新版的客户端基座 var innerversion = plus.runtime.innerVersion; var _v = innerversion.substring(innerversion.lastIndexOf('.') + 1, innerversion.length); if (_v && parseInt(_v) >= 53650) { @@ -103,7 +107,12 @@ }, onNavigationBarButtonTap(e) { uni.navigateTo({ - url: '/platforms/app-plus/about/about' + // #ifdef APP-PLUS + url: '/platforms/app-plus/about/about', + // #endif + // #ifdef H5 + url: '/platforms/h5/about/about', + // #endif }) }, methods: { diff --git a/examples/hello-uniapp/pages/tabBar/template/template.vue b/examples/hello-uniapp/pages/tabBar/template/template.vue index 9a82911b4..238b392c2 100644 --- a/examples/hello-uniapp/pages/tabBar/template/template.vue +++ b/examples/hello-uniapp/pages/tabBar/template/template.vue @@ -191,12 +191,12 @@ }, { name: '倒计时', url: 'countdown' - } + }, // #ifdef APP-PLUS - , { + { name: '聊天窗口 chat', url: 'im-chat' - } + }, // #endif ] } @@ -209,7 +209,12 @@ }, onNavigationBarButtonTap(e) { uni.navigateTo({ - url: '/platforms/app-plus/about/about' + // #ifdef APP-PLUS + url: '/platforms/app-plus/about/about', + // #endif + // #ifdef H5 + url: '/platforms/h5/about/about', + // #endif }) }, methods: { diff --git a/examples/hello-uniapp/platforms/h5/about/about.vue b/examples/hello-uniapp/platforms/h5/about/about.vue new file mode 100644 index 000000000..8f427890f --- /dev/null +++ b/examples/hello-uniapp/platforms/h5/about/about.vue @@ -0,0 +1,71 @@ + + + + + -- GitLab