feat: router

master
luqianyu 2020-12-08 14:03:11 +08:00 committed by XuPeng
parent 6453e28f67
commit a64d2aff64
6 changed files with 68 additions and 1 deletions

View File

@ -36,7 +36,9 @@
"pages/API/clipboard-data/clipboard-data",
"pages/API/screen-brightness/screen-brightness",
"pages/API/vibrate/vibrate",
"pages/API/add-contact/add-contact"
"pages/API/add-contact/add-contact",
"pages/API/buffer/buffer",
"pages/API/router/router"
],
"window": {
"backgroundTextStyle": "light",

View File

@ -27,6 +27,10 @@ Page({
zh: '定时器',
url: 'timmer/timmer'
},
{
zh: '路由',
url: 'router/router'
}
],
},
{

View File

@ -0,0 +1,28 @@
// pages/API/get-network-type/get-network-type.js
Page({
data: {
result: '',
timeInterval: null,
timeout: null,
},
switchTab() {
console.log('wx.switchTab', '/pages/API/index/index');
wx.switchTab({url: '/pages/API/index/index'})
},
reLaunch() {
console.log('wx.reLaunch', '/pages/API/index/index');
wx.reLaunch({url: '/pages/API/index/index'})
},
redirectTo() {
console.log('wx.redirectTo', '/pages/API/buffer/buffer');
wx.redirectTo({url: '/pages/API/buffer/buffer'})
},
navigateTo() {
console.log('wx.navigateTo', '/pages/API/buffer/buffer');
wx.navigateTo({url: '/pages/API/buffer/buffer'})
},
navigateBack() {
wx.navigateBack()
}
})

View File

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "获取手机网络状态"
}

View File

@ -0,0 +1,22 @@
<!--pages/API/get-network-type/get-network-type.wxml-->
<import src="../../common/head.wxml" />
<import src="../../common/foot.wxml" />
<view class="container">
<template is="head" data="{{title: 'router'}}"/>
<view class="page-body">
<view class="page-section">
<view class="btn-area">
<button type="primary" bindtap="switchTab">switchTab</button>
<button type="primary" bindtap="reLaunch">reLaunch</button>
<button type="primary" bindtap="redirectTo">redirectTo</button>
<button type="primary" bindtap="navigateTo">navigateTo</button>
<button type="primary" bindtap="navigateBack">navigateBack</button>
</view>
</view>
</view>
<template is="foot" />
</view>

View File

@ -0,0 +1,8 @@
/* pages/API/get-network-type/get-network-type.wxss */
.page-body-info {
height: 100px;
}
.page-body-text-network-type {
font-size: 40px;
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
}