Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
add636fc
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
add636fc
编写于
7月 08, 2023
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
缩短了tabbar页面的层级,把api里的页面和界面分开。遗留页面生命周期和页面下拉刷新待完善
上级
e4667d08
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
1446 addition
and
1335 deletion
+1446
-1335
pages.json
pages.json
+585
-597
pages/API/modal/modal.uvue
pages/API/modal/modal.uvue
+1
-1
pages/API/page-lifecircle/page-lifecircle.uvue
pages/API/page-lifecircle/page-lifecircle.uvue
+40
-0
pages/API/pull-down-refresh/pull-down-refresh.uvue
pages/API/pull-down-refresh/pull-down-refresh.uvue
+83
-0
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+475
-475
pages/tabBar/CSS.uvue
pages/tabBar/CSS.uvue
+2
-2
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+260
-260
未找到文件。
pages.json
浏览文件 @
add636fc
此差异已折叠。
点击以展开。
pages/API/modal/modal.uvue
浏览文件 @
add636fc
...
...
@@ -41,7 +41,7 @@
</view>
</template>
<script lang="ts">
<script lang="
u
ts">
type ItemType = {
value : string,
name : string,
...
...
pages/API/page-lifecircle/page-lifecircle.uvue
0 → 100644
浏览文件 @
add636fc
<template>
<view>
<text>onLoad触发时间</text>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
// const d = Date.now();
// const s = d.toDateString()
console.log("onLoad");
},
onShow() {
console.log("onShow");
},
onReady() {
console.log("onReady");
},
onHide() {
console.log("onHide");
},
onUnload() {
console.log("onUnLoad");
},
methods: {
}
}
</script>
<style>
</style>
pages/API/pull-down-refresh/pull-down-refresh.uvue
0 → 100644
浏览文件 @
add636fc
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view style="font-size: 12px; color: #666;">注:PC 不支持下拉刷新</view>
<view class="text" v-for="(num,index) in data" :key="index">list - {{num}}</view>
<view class="uni-loadmore" v-if="showLoadMore">{{loadMoreText}}</view>
</view>
</view>
</template>
<script lang="uts">
export default {
data() {
return {
title: '下拉刷新 + 加载更多',
data: [],
loadMoreText: "加载中...",
showLoadMore: false,
max: 0
}
},
onLoad() {
this.initData();
},
onUnload() {
this.max = 0,
this.data = [],
this.loadMoreText = "加载更多",
this.showLoadMore = false;
},
onReachBottom() {
console.log("onReachBottom");
if (this.max > 40) {
this.loadMoreText = "没有更多数据了!"
return;
}
this.showLoadMore = true;
setTimeout(() => {
this.setListData();
}, 300);
},
onPullDownRefresh() {
console.log('onPullDownRefresh');
this.initData();
},
methods: {
initData(){
setTimeout(() => {
this.max = 0;
this.data = [];
let data = [];
this.max += 20;
for (var i = this.max - 19; i < this.max + 1; i++) {
data.push(i)
}
this.data = this.data.concat(data);
uni.stopPullDownRefresh();
}, 300);
},
setListData() {
let data = [];
this.max += 10;
for (var i = this.max - 9; i < this.max + 1; i++) {
data.push(i)
}
this.data = this.data.concat(data);
}
}
}
</script>
<style>
.text {
margin: 16rpx 0;
width:100%;
background-color: #fff;
height: 120rpx;
line-height: 120rpx;
text-align: center;
color: #555;
border-radius: 8rpx;
}
</style>
pages/tabBar/API
/API
.uvue
→
pages/tabBar/API.uvue
浏览文件 @
add636fc
此差异已折叠。
点击以展开。
pages/tabBar/CSS
/CSS
.uvue
→
pages/tabBar/CSS.uvue
浏览文件 @
add636fc
<template>
A
<template>
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/extuiIndex.png"></image>
...
...
@@ -355,5 +355,5 @@
</script>
<style>
@import '../../
../
common/uni-uvue.css';
@import '../../common/uni-uvue.css';
</style>
\ No newline at end of file
pages/tabBar/component
/component
.uvue
→
pages/tabBar/component.uvue
浏览文件 @
add636fc
<template>
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/componentIndex.png"></image>
</view>
<view class="uni-hello-text">
<text class="hello-text">uni-app内置组件,展示样式仅供参考,文档详见:</text>
<u-link :href="'https://uniapp.dcloud.io/component/'" :text="'https://uniapp.dcloud.io/component/'"
:inWhiteList="true"></u-link>
</view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{item.name}}</text>
<image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon"
class="uni-icon"></image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text"
:class="page.enable != true ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
</template>
<script lang="ts">
type Page = {
name : string,
enable ?: boolean,
url ?: string
}
type ListItem = {
id : string,
name : string,
open : boolean,
pages : Page[],
url ?: string,
enable ?: boolean
}
export default {
data() {
return {
list: [{
id: 'view',
name: '视图容器',
open: false,
pages: [
{
name: 'view',
enable: true
},
{
name: 'scroll-view',
enable: true
},
{
name: 'swiper',
enable: true
},
// #ifndef MP-TOUTIAO || MP-LARK
{
name: 'movable-view',
enable: false
},
{
name: 'cover-view',
enable: false
},
<template>
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/componentIndex.png"></image>
</view>
<view class="uni-hello-text">
<text class="hello-text">uni-app内置组件,展示样式仅供参考,文档详见:</text>
<u-link :href="'https://uniapp.dcloud.io/component/'" :text="'https://uniapp.dcloud.io/component/'"
:inWhiteList="true"></u-link>
</view>
<view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{item.name}}</text>
<image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon"
class="uni-icon"></image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text"
:class="page.enable != true ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
</template>
<script lang="ts">
type Page = {
name : string,
enable ?: boolean,
url ?: string
}
type ListItem = {
id : string,
name : string,
open : boolean,
pages : Page[],
url ?: string,
enable ?: boolean
}
export default {
data() {
return {
list: [{
id: 'view',
name: '视图容器',
open: false,
pages: [
{
name: 'view',
enable: true
},
{
name: 'scroll-view',
enable: true
},
{
name: 'swiper',
enable: true
},
// #ifndef MP-TOUTIAO || MP-LARK
{
name: 'movable-view',
enable: false
},
{
name: 'cover-view',
enable: false
},
// #endif
{
name:'list',
enable:true
}
] as Page[]
}, {
id: 'content',
name: '基础内容',
open: false,
pages: [
{
name: 'text',
enable: true
},
{
name: 'rich-text',
enable: false
},
{
name: 'progress',
enable: true
}
] as Page[]
}, {
id: 'form',
name: '表单组件',
open: false,
pages: [
{
name: 'button',
enable: true
},
{
name: 'checkbox',
enable: true
},
{
name: 'form',
enable: false
},
{
name: 'input',
enable: true
}, {
name: 'label',
enable: false
}, {
name: 'picker',
enable: false
}, {
name: 'picker-view',
enable: false
}, {
name: 'radio',
enable: true
}, {
name: 'slider',
enable: true
}, {
name: 'slider-100',
enable: true
},{
name: 'switch',
enable: true
}, {
name: 'textarea',
enable: true
},
// #ifdef APP-PLUS || MP-WEIXIN || H5 || MP-BAIDU
{
name: 'editor',
enable: false
},
// #endif
] as Page[]
}, {
id: 'nav',
name: '导航',
open: false,
pages: [{
name: 'navigator',
enable: false
}] as Page[]
}, {
id: 'media',
name: '媒体组件',
open: false,
pages: [{
name: 'image',
enable: true
}, {
name: 'video',
enable: false
}] as Page[]
},
// #ifndef MP-TOUTIAO || MP-KUAISHOU
{
id: 'map',
name: '地图',
open: false,
pages: [
{
name: 'map',
enable: false
}
] as Page[]
},
// #endif
// #ifndef QUICKAPP-WEBVIEW-UNION
{
id: 'canvas',
name: '画布',
open: false,
pages: [
{
name: 'canvas'
}
] as Page[]
},
// #endif
// #ifdef APP-PLUS || H5
{
id: 'web-view',
name: '网页',
open: false,
pages: [
{
name: '网络网页',
enable: true,
url: '/pages/component/web-view/web-view'
},
{
name: '本地网页',
enable: true,
url: '/pages/component/web-view-local/web-view-local'
}
] as Page[]
},
// #endif
// #ifndef H5 || MP-BAIDU || QUICKAPP-WEBVIEW || MP-LARK || MP-JD
{
id: 'ad',
url: 'ad',
name: 'AD组件',
enable: false,
open: false,
pages: [] as Page[]
}
// #endif
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
},
methods: {
triggerCollapse(index ?: number, item : ListItem) {
if (item.pages.length == 0) {
const page : Page = {
name: item.name,
enable: item.enable,
url: item.url
}
this.goDetailPage(page);
return;
}
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
this.list[i].open = !this.list[i].open;
} else {
this.list[i].open = false;
}
}
},
goDetailPage(e : Page) {
if (e.enable != true) {
uni.showToast({
icon: 'none',
title: '暂不支持'
})
return
}
const url = e.url != null ? e.url! : `/pages/component/${e.name}/${e.name}`
uni.navigateTo({
url
})
}
}
}
</script>
<style>
@import '../../
../common/uni-uvue.css';
}
] as Page[]
}, {
id: 'content',
name: '基础内容',
open: false,
pages: [
{
name: 'text',
enable: true
},
{
name: 'rich-text',
enable: false
},
{
name: 'progress',
enable: true
}
] as Page[]
}, {
id: 'form',
name: '表单组件',
open: false,
pages: [
{
name: 'button',
enable: true
},
{
name: 'checkbox',
enable: true
},
{
name: 'form',
enable: false
},
{
name: 'input',
enable: true
}, {
name: 'label',
enable: false
}, {
name: 'picker',
enable: false
}, {
name: 'picker-view',
enable: false
}, {
name: 'radio',
enable: true
}, {
name: 'slider',
enable: true
}, {
name: 'slider-100',
enable: true
},{
name: 'switch',
enable: true
}, {
name: 'textarea',
enable: true
},
// #ifdef APP-PLUS || MP-WEIXIN || H5 || MP-BAIDU
{
name: 'editor',
enable: false
},
// #endif
] as Page[]
}, {
id: 'nav',
name: '导航',
open: false,
pages: [{
name: 'navigator',
enable: false
}] as Page[]
}, {
id: 'media',
name: '媒体组件',
open: false,
pages: [{
name: 'image',
enable: true
}, {
name: 'video',
enable: false
}] as Page[]
},
// #ifndef MP-TOUTIAO || MP-KUAISHOU
{
id: 'map',
name: '地图',
open: false,
pages: [
{
name: 'map',
enable: false
}
] as Page[]
},
// #endif
// #ifndef QUICKAPP-WEBVIEW-UNION
{
id: 'canvas',
name: '画布',
open: false,
pages: [
{
name: 'canvas'
}
] as Page[]
},
// #endif
// #ifdef APP-PLUS || H5
{
id: 'web-view',
name: '网页',
open: false,
pages: [
{
name: '网络网页',
enable: true,
url: '/pages/component/web-view/web-view'
},
{
name: '本地网页',
enable: true,
url: '/pages/component/web-view-local/web-view-local'
}
] as Page[]
},
// #endif
// #ifndef H5 || MP-BAIDU || QUICKAPP-WEBVIEW || MP-LARK || MP-JD
{
id: 'ad',
url: 'ad',
name: 'AD组件',
enable: false,
open: false,
pages: [] as Page[]
}
// #endif
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
},
methods: {
triggerCollapse(index ?: number, item : ListItem) {
if (item.pages.length == 0) {
const page : Page = {
name: item.name,
enable: item.enable,
url: item.url
}
this.goDetailPage(page);
return;
}
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
this.list[i].open = !this.list[i].open;
} else {
this.list[i].open = false;
}
}
},
goDetailPage(e : Page) {
if (e.enable != true) {
uni.showToast({
icon: 'none',
title: '暂不支持'
})
return
}
const url = e.url != null ? e.url! : `/pages/component/${e.name}/${e.name}`
uni.navigateTo({
url
})
}
}
}
</script>
<style>
@import '../../
common/uni-uvue.css';
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录