提交 b7acaf7a 编写于 作者: W wanganxp

调整tabbar顺序,修复复杂长列表加载第二页重复的bug

上级 7485f26c
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
<script> <script>
export default { export default {
data() {
return {
}
},
methods: { methods: {
exitAppClick:function(){ exitAppClick:function(){
uni.exit({ uni.exit({
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
<script lang="uts"> <script lang="uts">
type Page = { type Page = {
name : string name : string
enable ?: boolean
url : string url : string
enable ?: boolean
api ?: Array<string>
} }
type ListItem = { type ListItem = {
id : string id : string
...@@ -52,8 +53,8 @@ ...@@ -52,8 +53,8 @@
return { return {
list: [ list: [
{ {
id: 'base', id: 'globle',
name: '基础', name: '全局',
open: false, open: false,
pages: [ pages: [
{ {
...@@ -63,31 +64,40 @@ ...@@ -63,31 +64,40 @@
{ {
name: 'getCurrentPages', name: 'getCurrentPages',
url: 'get-current-pages', url: 'get-current-pages',
}, }
] as Page[],
},
{
id: 'base',
name: '基础',
open: false,
pages: [
{ {
name: '事件总线event-bus', name: '事件总线event-bus',
url: 'event-bus', url: 'event-bus',
api:["$on","$once","$off","$emit"]
}, },
{ {
name: '获取启动参数', name: '获取启动参数',
url: 'get-launch-options-sync', url: 'get-launch-options-sync',
},
{
name: '退出应用',
url: 'exit',
}, },
] as Page[], ] as Page[],
}, },
{ {
id: 'page', id: 'page',
name: '页面', name: '页面和路由',
open: false, open: false,
pages: [ pages: [
{ {
name: '页面跳转', name: '页面跳转',
url: 'navigator', url: 'navigator',
}, api:["navigator","reLaunch","navigateBack","redirectTo","switchTab"]
/* {
name: '页面栈管理',
url: 'getCurrentPages',
enable: false,
}, },
/*
{ {
name: '设置导航条标题', name: '设置导航条标题',
url: 'set-navigation-bar-title', url: 'set-navigation-bar-title',
...@@ -99,18 +109,53 @@ ...@@ -99,18 +109,53 @@
}, },
{ {
name: '设置TabBar', name: '设置TabBar',
url: 'set-tabbar', url: 'set-tabbar',
api:["showTabBar","hideTabBar","showTabBarRedDot","hideTabBarRedDot","setTabBarBadge","removeTabBarBadge","setTabBarStyle","setTabBarItem"]
}, },
{ {
name: '页面下拉刷新', name: '页面下拉刷新',
url: 'pull-down-refresh', url: 'pull-down-refresh',
api:["stopPullDownRefresh"]
}, },
{ {
name: '将页面滚动到指定位置', name: '将页面滚动到指定位置',
url: 'page-scroll-to', url: 'page-scroll-to',
}, },
] as Page[], ] as Page[],
}, },
{
id: 'network',
name: '网络',
open: false,
pages: [
{
name: '发起一个请求',
url: 'request',
},
{
name: '上传文件',
url: 'upload-file',
},
{
name: '下载文件',
url: 'download-file',
},
{
name: '获取设备网络状态',
url: 'get-network-type',
},
{
name: 'socketTask',
url: 'websocket-socketTask',
api:[""] //它不是uni.的api
},
{
name: '全局websocket',
url: 'websocket-global',
api:["connectSocket","onSocketOpen","onSocketError","sendSocketMessage","onSocketMessage","closeSocket","onSocketClose"]
},
] as Page[],
},
{ {
id: 'ui', id: 'ui',
name: '界面', name: '界面',
...@@ -133,7 +178,8 @@ ...@@ -133,7 +178,8 @@
}, */ }, */
{ {
name: '节点信息', name: '节点信息',
url: 'nodes-info', url: 'nodes-info',
api:["createSelectorQuery"]
}, },
{ {
name: '显示操作菜单', name: '显示操作菜单',
...@@ -141,7 +187,8 @@ ...@@ -141,7 +187,8 @@
}, },
{ {
name: '显示模态弹窗', name: '显示模态弹窗',
url: 'modal', url: 'modal',
api:["showModal"]
}, },
{ {
name: '显示加载提示框', name: '显示加载提示框',
...@@ -149,7 +196,8 @@ ...@@ -149,7 +196,8 @@
}, },
{ {
name: '显示消息提示框', name: '显示消息提示框',
url: 'toast', url: 'toast',
api:["showToast"]
}, },
{ {
name: '动态加载字体', name: '动态加载字体',
...@@ -162,10 +210,6 @@ ...@@ -162,10 +210,6 @@
name: '设备', name: '设备',
open: false, open: false,
pages: [ pages: [
{
name: '获取设备网络状态',
url: 'get-network-type',
},
{ {
name: '获取系统信息', name: '获取系统信息',
url: 'get-system-info', url: 'get-system-info',
...@@ -175,20 +219,20 @@ ...@@ -175,20 +219,20 @@
url: 'get-device-info', url: 'get-device-info',
}, },
{ {
name: '获取APP基础信息', name: '获取窗口信息',
url: 'get-app-base-info', url: 'get-window-info',
}, },
{ {
name: '获取系统设置', name: '获取APP基础信息',
url: 'get-system-setting', url: 'get-app-base-info',
}, },
{ {
name: '获取APP授权设置', name: '获取APP授权设置',
url: 'get-app-authorize-setting', url: 'get-app-authorize-setting',
}, },
{ {
name: '获取窗口信息', name: '获取系统设置',
url: 'get-window-info', url: 'get-system-setting',
}, },
{ {
name: '电量', name: '电量',
...@@ -248,40 +292,6 @@ ...@@ -248,40 +292,6 @@
}, */ }, */
] as Page[], ] as Page[],
}, },
{
id: 'network',
name: '网络',
open: false,
pages: [
{
name: '发起一个请求',
url: 'request',
},
{
name: '上传文件',
url: 'upload-file',
},
{
name: '下载文件',
url: 'download-file',
},
] as Page[],
},
{
id: 'websocket',
name: 'websocket',
open: false,
pages: [
{
name: 'socketTask',
url: 'websocket-socketTask',
},
{
name: '全局websocket',
url: 'websocket-global',
},
] as Page[],
},
{ {
id: 'media', id: 'media',
name: '媒体', name: '媒体',
...@@ -289,7 +299,8 @@ ...@@ -289,7 +299,8 @@
pages: [ pages: [
{ {
name: '图片选择和预览', name: '图片选择和预览',
url: 'preview-image', url: 'preview-image',
api: ["previewImage","closePreviewImage","chooseImage"]
}, },
{ {
name: "保存图片到相册", name: "保存图片到相册",
...@@ -355,12 +366,13 @@ ...@@ -355,12 +366,13 @@
}, },
{ {
id: 'storage', id: 'storage',
name: '存储', name: '数据存储',
open: false, open: false,
pages: [ pages: [
{ {
name: 'storage(key-value存储)', name: 'storage(key-value存储)',
url: 'storage', url: 'storage',
api:["uni.getStorageInfo","uni.getStorageInfoSync","uni.getStorage","uni.getStorageSync","uni.setStorage","uni.setStorageSync","uni.removeStorage","uni.removeStorageSync","uni.clearStorage","uni.clearStorageSync"]
}, },
] as Page[], ] as Page[],
}, },
...@@ -439,18 +451,6 @@ ...@@ -439,18 +451,6 @@
}, },
] as Page[], ] as Page[],
}, */ }, */
{
id: 'exit',
name: '退出',
open: false,
pages: [
{
name: 'exit退出',
url: 'exit',
enable: true
},
] as Page[],
},
] as ListItem[], ] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png', arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png', arrowDownIcon: '/static/icons/arrow-down.png',
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
dataList: [] as ListItem[], dataList: [] as ListItem[],
isEnded: false, isEnded: false,
loadingError: '', loadingError: '',
$currentPage: 0 $currentPage: 1
} }
}, },
computed: { computed: {
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
}) })
}, },
// score 0 ~ 50 // score 0 ~ 50
convertToStarUnicode(score : Number) : string { convertToStarUnicode(score : number) : string {
const fill_code = '\ue879' const fill_code = '\ue879'
const half_code = '\ue87a' const half_code = '\ue87a'
const null_code = '\ue87b' const null_code = '\ue87b'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册