Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
543bcc59
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看板
提交
543bcc59
编写于
7月 11, 2023
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
清理一期不要的,补充一期要的
上级
c50bbd35
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
392 addition
and
471 deletion
+392
-471
pages.json
pages.json
+29
-51
pages/API/navigator/navigator.uvue
pages/API/navigator/navigator.uvue
+117
-108
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+73
-111
pages/tabBar/CSS.uvue
pages/tabBar/CSS.uvue
+13
-46
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+21
-37
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+29
-8
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
...template/swiper-vertical-video/swiper-vertical-video.uvue
+110
-110
未找到文件。
pages.json
浏览文件 @
543bcc59
...
...
@@ -110,6 +110,12 @@
"navigationBarTitleText"
:
"image-path"
}
},
{
"path"
:
"pages/component/image/image-large"
,
"style"
:
{
"navigationBarTitleText"
:
"大图测试"
}
},
{
"path"
:
"pages/component/web-view/web-view"
,
"style"
:
{
...
...
@@ -147,12 +153,6 @@
"navigationBarTitleText"
:
"新UVUE页面2"
}
},
{
"path"
:
"pages/API/page-lifecycle/page-lifecycle"
,
"style"
:
{
"navigationBarTitleText"
:
"页面生命周期"
}
},
{
"path"
:
"pages/API/storage/storage"
,
"style"
:
{
...
...
@@ -463,155 +463,133 @@
{
"path"
:
"pages/API/request/request"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/upload-file/upload-file"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/download-file/download-file"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/websocket-socketTask/websocket-socketTask"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/websocket-global/websocket-global"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/get-system-info/get-system-info"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/get-device-info/get-device-info"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/get-app-base-info/get-app-base-info"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/get-system-setting/get-system-setting"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/get-app-authorize-setting/get-app-authorize-setting"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/API/preview-image/preview-image"
,
"style"
:
{
"navigationBarTitleText"
:
"图片预览"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"图片预览"
}
},
{
"path"
:
"pages/component/scroll-view/scroll-view-refresher"
,
"style"
:
{
"navigationBarTitleText"
:
"scroll-view-refresher"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"scroll-view-refresher"
}
},
{
"path"
:
"pages/component/list/list"
,
"style"
:
{
"navigationBarTitleText"
:
"列表到详情示例"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"列表到详情示例"
}
},
{
"path"
:
"pages/API/get-network-type/get-network-type"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/component/list/detail/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"详情示例"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"详情示例"
}
},
{
"path"
:
"pages/API/page-scroll-to/page-scroll-to"
,
"style"
:
{
"navigationBarTitleText"
:
"pageScrollTo"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"pageScrollTo"
}
},
{
"path"
:
"pages/API/event-bus/event-bus"
,
"style"
:
{
"navigationBarTitleText"
:
"event-bus"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"event-bus"
}
},
{
"path"
:
"pages/template/drop-card/drop-card"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/tabBar/template"
,
"style"
:
{
"navigationBarTitleText"
:
"模板"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"模板"
}
},
{
"path"
:
"pages/component/long-list/long-list"
,
"style"
:
{
"navigationBarTitleText"
:
"长列表示例"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"长列表示例"
}
},
{
"path"
:
"pages/component/long-list/detail/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"详情示例"
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
"详情示例"
}
},
{
"path"
:
"pages/template/swiper-
tiktok/swiper-tiktok
"
,
"path"
:
"pages/template/swiper-
vertical-video/swiper-vertical-video
"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
"navigationBarTitleText"
:
""
}
}
],
...
...
pages/API/navigator/navigator.uvue
浏览文件 @
543bcc59
<template>
<view>
<page-head title="navigate"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view style="flex-direction: row">
<text style="width: 170px">onLoad触发时间戳:</text>
<text style="text-align: right">{{ onLoadTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onReady触发时间戳:</text>
<text style="text-align: right">{{ onReadyTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onUnload触发时间戳:</text>
<text style="text-align: right">退出页面时见控制台</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onShow触发时间戳:</text>
<text style="text-align: right">{{ onShowTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onHide触发时间戳:</text>
<text style="text-align: right">{{ onHideTime }}</text>
</view>
<view class="uni-btn-v">
<button @tap="navigateTo" class="uni-btn">
跳转新页面,并传递数据
</button>
<button @tap="navigateBack" class="uni-btn">返回上一页</button>
<button @tap="redirectTo" class="uni-btn">在当前页面打开</button>
<button @tap="switchTab" class="uni-btn">切换到模板选项卡</button>
<button @tap="reLaunch" class="uni-btn">关闭所有页面,打开首页</button>
<button @tap="customAnimation" class="uni-btn">
使用自定义动画打开页面
</button>
</view>
</view>
</view>
<view>
<page-head title="navigate"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view style="flex-direction: row">
<text style="width: 170px">onLoad触发时间戳:</text>
<text style="text-align: right">{{ onLoadTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onReady触发时间戳:</text>
<text style="text-align: right">{{ onReadyTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onUnload触发时间戳:</text>
<text style="text-align: right">见控制台</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onShow触发时间戳:</text>
<text style="text-align: right">{{ onShowTime }}</text>
</view>
<view style="flex-direction: row">
<text style="width: 170px">onHide触发时间戳:</text>
<text style="text-align: right">{{ onHideTime }}</text>
</view>
<text>onBackPress触发时间戳:见控制台</text>
<!-- <view style="flex-direction: row">
<text style="width: 170px">onBackPress触发时间戳:</text>
<text style="text-align: right">见控制台</text>
</view> -->
<view class="uni-btn-v">
<button @tap="navigateTo" class="uni-btn">
跳转新页面,并传递数据
</button>
<button @tap="navigateBack" class="uni-btn">返回上一页</button>
<button @tap="redirectTo" class="uni-btn">在当前页面打开</button>
<button @tap="switchTab" class="uni-btn">切换到模板选项卡</button>
<button @tap="reLaunch" class="uni-btn">关闭所有页面,打开首页</button>
<button @tap="customAnimation" class="uni-btn">
使用自定义动画打开页面
</button>
</view>
</view>
</view>
</template>
<script lang="ts">
import { setLifeCycleNum, state } from '@/store/index.uts'
export default {
data() {
return {
onLoadTime: 0,
onShowTime: 0,
onReadyTime: 0,
onHideTime: 0,
}
},
onLoad() {
this.onLoadTime = Date.now()
console.log('onLoad', this.onLoadTime)
},
onShow() {
this.onShowTime = Date.now()
console.log('onShow', this.onShowTime)
},
onReady() {
this.onReadyTime = Date.now()
console.log('onReady', this.onReadyTime)
},
onHide() {
this.onHideTime = Date.now()
console.log('onHide', Date.now())
},
onUnload() {
console.log('onUnLoad', Date.now())
},
methods: {
navigateTo() {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=Hello',
})
},
navigateBack() {
uni.navigateBack({
delta: 1,
})
},
redirectTo() {
uni.redirectTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=Hello',
})
},
switchTab() {
uni.switchTab({
url: '/pages/tabBar/template',
})
},
reLaunch() {
uni.reLaunch({
url: '/pages/tabBar/component',
})
},
customAnimation() {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=使用自定义动画打开页面',
animationType: 'slide-in-bottom',
animationDuration: 200,
})
},
setLifeCycleNum(num: number) {
setLifeCycleNum(num)
},
getLifeCycleNum(): number {
return state.lifeCycleNum
},
},
}
</script>
import { setLifeCycleNum, state } from '@/store/index.uts'
export default {
data() {
return {
onLoadTime: 0,
onShowTime: 0,
onReadyTime: 0,
onHideTime: 0,
}
},
onLoad() {
this.onLoadTime = Date.now()
console.log('onLoad', this.onLoadTime)
},
onShow() {
this.onShowTime = Date.now()
console.log('onShow', this.onShowTime)
},
onReady() {
this.onReadyTime = Date.now()
console.log('onReady', this.onReadyTime)
},
onHide() {
this.onHideTime = Date.now()
console.log('onHide', Date.now())
},
onUnload() {
console.log('onUnLoad', Date.now())
},
/* onBackPress() {
console.log('onBackPress', Date.now()) // 为何不生效???
// 要把event也打出来
}, */
methods: {
navigateTo() {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=Hello',
})
},
navigateBack() {
uni.navigateBack({
delta: 1,
})
},
redirectTo() {
uni.redirectTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=Hello',
})
},
switchTab() {
uni.switchTab({
url: '/pages/tabBar/template',
})
},
reLaunch() {
uni.reLaunch({
url: '/pages/tabBar/component',
})
},
customAnimation() {
uni.navigateTo({
url: '/pages/API/navigator/new-page/new-uvue-page-1?data=使用自定义动画打开页面',
animationType: 'slide-in-bottom',
animationDuration: 200,
})
},
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
},
getLifeCycleNum() : number {
return state.lifeCycleNum
},
},
}
</script>
\ No newline at end of file
pages/tabBar/API.uvue
浏览文件 @
543bcc59
...
...
@@ -17,7 +17,7 @@
<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
!= tru
e ? 'text-disabled' : ''">{{page.name}}</text>
:class="page.enable
== fals
e ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
...
...
@@ -50,29 +50,39 @@
{
name: "页面跳转",
url: "navigator",
enable: true
},
{
name: "页面通信event-bus",
url: "event-bus",
},
{
name: "页面栈管理",
url: "getCurrentPages",
enable: false
},
{
name: "设置导航条",
url: "set-navigation-bar-title"
url: "set-navigation-bar-title",
enable: false
},
{
name: "设置TabBar",
url: "set-tabbar",
enable: false
},
{
name: "下拉刷新",
url: "pull-down-refresh",
enable: false
},
{
name: "页面生命周期",
url: "page-lifecircle",
enable: true
},
{
name: "将页面滚动到
目标
位置",
name: "将页面滚动到
指定
位置",
url: "page-scroll-to",
enable: true
},
{
name: "获取启动参数",
url: "get-launch-options-sync",
enable: false
},
] as Page[],
},
...
...
@@ -84,38 +94,38 @@
{
name: "创建动画",
url: "animation",
enable: false
},
{
name: "创建绘画",
url: "canvas",
enable: false
},
{
name: "节点信息",
url: "get-node-info",
enable: false
},
{
name: "节点布局交互状态",
url: "intersection-observer",
enable: false
},
{
name: "显示操作菜单",
url: "action-sheet",
enable: true
},
{
name: "显示模态弹窗",
url: "modal",
enable: true
},
{
name: "显示加载提示框",
url: "show-loading",
enable: true
},
{
name: "显示消息提示框",
url: "toast",
enable: true
},
] as Page[],
},
...
...
@@ -127,38 +137,37 @@
{
name: "获取设备网络状态",
url: "get-network-type",
enable:true
},
{
name: "获取系统信息",
url: "get-system-info",
enable:true
},
{
name: "获取设备信息",
url: "get-device-info",
enable:true
},
{
name: "获取APP基础信息",
url: "get-app-base-info",
enable:true
},
{
name: "获取设备设置",
url: "get-system-setting",
enable:true
},
{
name: "获取APP授权设置",
url: "get-app-authorize-setting",
enable:true
},
{
{
name: "电量",
url: "get-battery",
enable:false
},
/* {
name: "打电话",
url: "make-phone-call",
},
//#ifndef H5
{
name: "震动",
url: "vibrate",
...
...
@@ -171,50 +180,34 @@
name: "扫码",
url: "scan-code",
},
//#endif
//#ifndef H5 || MP-JD
{
name: "剪贴板",
url: "clipboard",
},
//#endif
// #ifndef H5 || MP-ALIPAY
{
name: "屏幕亮度",
url: "brightness",
},
// #endif
// #ifdef APP || MP-WEIXIN || MP-QQ || MP-JD
{
name: "蓝牙",
url: "bluetooth",
},
// #endif
// #ifdef APP || MP-WEIXIN || MP-QQ
{
name: "生物认证",
url: "soter",
},
// #endif
// #ifdef APP || MP-WEIXIN
{
name: "iBeacon",
url: "ibeacon",
},
// #endif
// #ifndef H5
{
name: "监听加速度传感器",
url: "on-accelerometer-change",
},
// #endif
// #ifndef H5 || MP-JD
{
name: "监听罗盘数据",
url: "on-compass-change",
},
// #endif
//#ifdef APP
{
name: "监听距离传感器",
url: "/platforms/app-plus/proximity/proximity",
...
...
@@ -222,8 +215,7 @@
{
name: "监听方向传感器",
url: "/platforms/app-plus/orientation/orientation",
},
//#endif
}, */
] as Page[],
},
{
...
...
@@ -234,17 +226,14 @@
{
name: "发起一个请求",
url: "request",
enable: true
},
{
name: "上传文件",
url: "upload-file",
enable: true
},
{
name: "下载文件",
url: "download-file",
enable: true
},
] as Page[],
},
...
...
@@ -253,17 +242,13 @@
name: "websocket",
open: false,
pages: [
// #ifndef MP-ALIPAY
{
name: "socketTask",
url: "websocket-socketTask",
enable: true
},
// #endif
{
name: "全局websocket",
url: "websocket-global",
enable: true
},
] as Page[],
},
...
...
@@ -273,21 +258,17 @@
open: false,
pages: [
{
name: "图片",
url: "image",
name: "图片
预览
",
url: "
preview-
image",
},
{
name: "图片预览",
url: "preview-image",
enable: true
},
// #ifndef MP-LARK
{
/* {
name: "图片选择和拍照",
url: "image",
enable: false
},{
name: "音频",
url: "inner-audio",
},
// #endif
// #ifdef APP || MP-WEIXIN || MP-BAIDU || MP-QQ|| MP-JD
{
name: "录音",
url: "voice",
...
...
@@ -295,29 +276,22 @@
{
name: "背景音频",
url: "background-audio",
},
// #endif
// #ifndef MP-ALIPAY
},
{
name: "视频",
name: "视频
选择和拍照
",
url: "video",
enable: false
},
// #endif
// #ifndef H5
{
name: "文件",
url: "file",
},
// #endif
// #ifndef H5 || MP-ALIPAY
{
name: "保存媒体到本地",
url: "save-media",
},
// #endif
}, */
] as Page[],
},
// #ifndef MP-KUAISHOU
{
id: "location",
name: "位置",
...
...
@@ -326,53 +300,37 @@
{
name: "获取当前位置",
url: "get-location",
enable: true
},
{
/*
{
name: "使用地图查看位置",
url: "open-location",
},
// #ifndef MP-TOUTIAO
{
name: "使用地图选择位置",
url: "choose-location",
},
// #endif
// #ifndef MP-QQ || MP-TOUTIAO || MP-LARK
{
name: "地图控制",
url: "map",
},
// #endif
// #ifdef APP
{
name: "地图搜索",
url: "map-search",
},
// #endif
}, */
] as Page[],
},
// #endif
{
id: "storage",
name: "
数据
",
name: "
存储
",
open: false,
pages: [
{
name: "
数据存储(key-value
)",
name: "
storage(key-value存储
)",
url: "storage",
enable: true
},
// #ifdef APP
{
name: "SQLite",
url: "sqlite",
},
// #endif
}
] as Page[],
},
// #ifdef APP || MP-WEIXIN
{
/* {
id: "rewarded-video-ad",
url: "rewarded-video-ad",
name: "激励视频广告",
...
...
@@ -380,8 +338,6 @@
enable: false,
pages: [] as Page[]
},
// #endif
// #ifdef APP
{
id: "full-screen-video-ad",
url: "full-screen-video-ad",
...
...
@@ -390,8 +346,6 @@
enable: false,
pages: [] as Page[]
},
// #endif
// #ifndef H5 || QUICKAPP-WEBVIEW || MP-KUAISHOU || MP-LARK
{
id: "login",
name: "登录",
...
...
@@ -407,8 +361,6 @@
},
] as Page[],
},
// #endif
// #ifndef H5 || QUICKAPP-WEBVIEW-UNION
{
id: "share",
name: "分享",
...
...
@@ -420,8 +372,6 @@
},
] as Page[],
},
// #endif
// #ifdef APP || MP-WEIXIN
{
id: "payment",
name: "支付",
...
...
@@ -433,8 +383,6 @@
},
] as Page[],
},
// #endif
// #ifdef APP
{
id: "speech",
name: "语音",
...
...
@@ -456,16 +404,30 @@
url: "/platforms/app-plus/push/push",
},
] as Page[],
},
},
*/
{
id: "
event-bus
",
name: "
event-bus
",
id: "
view-event
",
name: "
视图层事件
",
open: false,
enable: true,
url: "event-bus",
pages: [] as Page[],
},
//#endif
pages: [
{
name: "视图层事件",
url: "view-event",
enable: false
}
] as Page[],
},{
id: "exit",
name: "退出",
open: false,
pages: [
{
name: "exit退出",
url: "exit",
enable: false
}
] as Page[],
}
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
...
...
@@ -492,10 +454,10 @@
}
},
goDetailPage(e : Page) {
if (e.enable
!= tru
e) {
if (e.enable
== fals
e) {
uni.showToast({
icon: 'none
',
title: '暂不支持'
title: '暂不支持
',
icon:"none"
})
return
}
...
...
pages/tabBar/CSS.uvue
浏览文件 @
543bcc59
...
...
@@ -14,7 +14,7 @@
</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
!= tru
e ? 'text-disabled' : ''">{{page.name}}</text>
<text class="uni-navigate-text" :class="page.enable
== fals
e ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
...
...
@@ -46,12 +46,10 @@
pages: [
{
name: 'background-color',
enable: true,
url: '/pages/CSS/background/background-color'
},
{
name: 'background-image',
enable: true,
url: '/pages/CSS/background/background-image'
}
] as Page[]
...
...
@@ -62,27 +60,22 @@
pages: [
{
name: 'border',
enable: true,
url: 'pages/CSS/border/border'
},
{
name: 'border-width',
enable: true,
url: 'pages/CSS/border/border-width'
},
{
name: 'border-style',
enable: true,
url: 'pages/CSS/border/border-style'
},
{
name: 'border-color',
enable: true,
url: 'pages/CSS/border/border-color'
},
{
name: 'border-radius',
enable: true,
url: 'pages/CSS/border/border-radius'
}
] as Page[]
...
...
@@ -93,7 +86,6 @@
pages: [
{
name: 'box-shadow',
enable: true,
url: 'pages/CSS/box-shadow/box-shadow'
},
] as Page[]
...
...
@@ -104,47 +96,38 @@
pages: [
{
name: 'align-content',
enable: true,
url: 'pages/CSS/flex/align-content'
},
{
name: 'align-items',
enable: true,
url: 'pages/CSS/flex/align-items'
},
{
name: 'flex-basis',
enable: true,
url: 'pages/CSS/flex/flex-basis'
},
{
name: 'flex-direction',
enable: true,
url: 'pages/CSS/flex/flex-direction'
},
{
name: 'flex-flow',
enable: true,
url: 'pages/CSS/flex/flex-flow'
},
{
name: 'flex-grow',
enable: true,
url: 'pages/CSS/flex/flex-grow'
},
{
name: 'flex-shrink',
enable: true,
url: 'pages/CSS/flex/flex-shrink'
},
{
name: 'flex',
enable: true,
url: 'pages/CSS/flex/flex'
},
{
name: 'justify-content',
enable: true,
url: 'pages/CSS/flex/justify-content'
}
] as Page[]
...
...
@@ -155,37 +138,30 @@
pages: [
{
name: 'height',
enable: true,
url: 'pages/CSS/layout/height'
},
{
name: 'max-height',
enable: true,
url: 'pages/CSS/layout/max-height'
},
{
name: 'max-width',
enable: true,
url: 'pages/CSS/layout/max-width'
},
{
name: 'min-height',
enable: true,
url: 'pages/CSS/layout/min-height'
},
{
name: 'min-width',
enable: true,
url: 'pages/CSS/layout/min-width'
},
{
name: 'position',
enable: true,
url: 'pages/CSS/layout/position'
},
{
name: 'width',
enable: true,
url: 'pages/CSS/layout/width'
}
] as Page[]
...
...
@@ -196,26 +172,21 @@
pages: [
{
name: 'margin-bottom',
enable: true,
url: 'pages/CSS/margin/margin-bottom'
},
{
name: 'margin-left',
enable: true,
url: 'pages/CSS/margin/margin-left'
},
{
name: 'margin-right',
enable: true,
url: 'pages/CSS/margin/margin-right'
},
{
name: 'margin-top',
enable: true,
url: 'pages/CSS/margin/margin-top'
}, {
name: 'margin',
enable: true,
url: 'pages/CSS/margin/margin'
}
] as Page[]
...
...
@@ -226,26 +197,21 @@
pages: [
{
name: 'padding-bottom',
enable: true,
url: 'pages/CSS/padding/padding-bottom'
},
{
name: 'padding-left',
enable: true,
url: 'pages/CSS/padding/padding-left'
},
{
name: 'padding-right',
enable: true,
url: 'pages/CSS/padding/padding-right'
},
{
name: 'padding-top',
enable: true,
url: 'pages/CSS/padding/padding-top'
}, {
name: 'padding',
enable: true,
url: 'pages/CSS/padding/padding'
}
] as Page[]
...
...
@@ -256,42 +222,34 @@
pages: [
{
name: 'color',
enable: true,
url: 'pages/CSS/text/color'
},
{
name: 'font-family',
enable: true,
url: 'pages/CSS/text/font-family'
},
{
name: 'font-size',
enable: true,
url: 'pages/CSS/text/font-size'
},
{
name: 'font-style',
enable: true,
url: 'pages/CSS/text/font-style'
},
{
name: 'font-weight',
enable: true,
url: 'pages/CSS/text/font-weight'
},
{
name: 'line-height',
enable: true,
url: 'pages/CSS/text/line-height'
},
{
name: 'text-align',
enable: true,
url: 'pages/CSS/text/text-align'
},
{
name: 'text-decoration-line',
enable: true,
url: 'pages/CSS/text/text-decoration-line'
}
] as Page[]
...
...
@@ -302,15 +260,24 @@
pages: [
{
name: 'transition',
enable: true,
url: 'pages/CSS/transition/transition'
},
{
name: 'transform',
enable: true,
url: 'pages/CSS/transform/transform'
}
] as Page[]
}, {
id: 'iconfont',
name: '字体图标',
open: false,
pages: [
{
name: '字体图标',
enable: false,
url: 'pages/CSS/iconfont/iconfont'
},
] as Page[]
}
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
...
...
@@ -338,7 +305,7 @@
}
},
goDetailPage(e : Page) {
if (e.enable
!= tru
e) {
if (e.enable
== fals
e) {
uni.showToast({
icon: 'none',
title: '暂不支持'
...
...
pages/tabBar/component.uvue
浏览文件 @
543bcc59
...
...
@@ -17,7 +17,7 @@
<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
!= tru
e ? 'text-disabled' : ''">{{page.name}}</text>
:class="page.enable
== fals
e ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
...
...
@@ -49,17 +49,14 @@
pages: [
{
name: 'view',
enable: true
},
{
name: 'scroll-view',
enable: true
},
{
name: 'swiper',
enable: true
},
/
/ #ifndef MP-TOUTIAO || MP-LARK
/
*
{
name: 'movable-view',
enable: false
...
...
@@ -68,16 +65,14 @@
name: 'cover-view',
enable: false
},
// #endif
*/
{
name:'list(新闻)',
url:"pages/component/list/list",
enable:true
},
{
name:'list',
url:"pages/component/long-list/long-list",
enable:true
}
] as Page[]
}, {
...
...
@@ -87,7 +82,6 @@
pages: [
{
name: 'text',
enable: true
},
{
name: 'rich-text',
...
...
@@ -95,7 +89,6 @@
},
{
name: 'progress',
enable: true
}
] as Page[]
}, {
...
...
@@ -105,59 +98,51 @@
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
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[]
}] as Page[]
*/
}, {
id: 'media',
name: '媒体组件',
...
...
@@ -168,9 +153,12 @@
}, {
name: 'video',
enable: false
}, {
name: 'animation-view',
enable: false
}] as Page[]
},
/
/ #ifndef MP-TOUTIAO || MP-KUAISHOU
/
*
{
id: 'map',
name: '地图',
...
...
@@ -182,8 +170,6 @@
}
] as Page[]
},
// #endif
// #ifndef QUICKAPP-WEBVIEW-UNION
{
id: 'canvas',
name: '画布',
...
...
@@ -194,8 +180,7 @@
}
] as Page[]
},
// #endif
// #ifdef APP-PLUS || H5
*/
{
id: 'web-view',
name: '网页',
...
...
@@ -213,8 +198,7 @@
}
] as Page[]
},
// #endif
// #ifndef H5 || MP-BAIDU || QUICKAPP-WEBVIEW || MP-LARK || MP-JD
/*
{
id: 'ad',
url: 'ad',
...
...
@@ -223,7 +207,7 @@
open: false,
pages: [] as Page[]
}
// #endif
*/
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
...
...
@@ -250,10 +234,10 @@
}
},
goDetailPage(e : Page) {
if (e.enable
!= tru
e) {
if (e.enable
== fals
e) {
uni.showToast({
icon: 'none
',
title: '暂不支持
'
title: '暂不支持
',
icon: 'none
'
})
return
}
...
...
pages/tabBar/template.uvue
浏览文件 @
543bcc59
...
...
@@ -16,7 +16,7 @@
</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
!= tru
e ? 'text-disabled' : ''">{{page.name}}</text>
<text class="uni-navigate-text" :class="page.enable
== fals
e ? 'text-disabled' : ''">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
...
...
@@ -44,19 +44,40 @@
return {
list: [
{
id: "custom-navigationbar",
url: "custom-navigationbar",
name: "自定义导航栏",
open: false,
enable: false,
pages: [] as Page[]
},{
id: "drop-card",
url: "drop-card",
name: "drop-card",
name: "划走式卡片",
open: false,
pages: [] as Page[]
},
{
id: "swiper-vertical-video",
url: "swiper-vertical-video",
name: "竖滑视频",
open: false,
pages: [] as Page[]
},
{
id: "sticky",
url: "sticky",
name: "吸顶",
open: false,
enable:
tru
e,
enable:
fals
e,
pages: [] as Page[]
},
{
id: "swiper-
tiktok
",
url: "swiper-
tiktok
",
name: "swiper-
tiktok
",
id: "swiper-
list
",
url: "swiper-
list
",
name: "swiper-
list
",
open: false,
enable:
tru
e,
enable:
fals
e,
pages: [] as Page[]
}
] as ListItem[],
...
...
@@ -85,7 +106,7 @@
}
},
goDetailPage(e : Page) {
if (e.enable
!= tru
e) {
if (e.enable
== fals
e) {
uni.showToast({
icon: 'none',
title: '暂不支持'
...
...
pages/template/swiper-
tiktok/swiper-tiktok
.uvue
→
pages/template/swiper-
vertical-video/swiper-vertical-video
.uvue
浏览文件 @
543bcc59
<template>
<view class="page">
<view style="padding: 20px;">
<text>仿抖音,复用组件,无限滚动、加载、浏览视频的示例模板</text>
<text>已知问题:</text>
<text>1.swiper 组件竖滑动有 bug,先横向滑动</text>
<text>2.uvue暂未支持video</text>
</view>
<swiper class="swiper" :current="current" :circular="index != 0" :vertical="false" @change="onSwiperChange" @transition="onTransition">
<swiper-item class="swiper-item" v-for="(item,index) in visibleList" :key="index">
<!-- <video ref="video" class="video" :id="item.id" :ref="item.id" :src="item.src" :controls="false" :loop="true"
:show-center-play-btn="false"></video> -->
第:{{index}}个容器
数据内容:{{item.content}}
</swiper-item>
</swiper>
</view>
</template>
<script>
type ListItem = { _id : string, content : string }
let page : number = 0;
export default {
data() {
return {
list: [] as ListItem[],
visibleList: [] as ListItem[],// 提高性能 可见的只有3个
current: 0 as number,
index: 0
}
},
beforeCreate() {
this.list = this.getData()
this.visibleList = this.list.slice(0, 3)
},
watch: {
current(current : number, oldCurrent : number) {
let changeNumber = current - oldCurrent
if (changeNumber == 1 || changeNumber == -2) {
// console.error('向右');
this.index++
} else {
// console.error('向左');
this.index--
}
// //翻页(3项为一页)
if (Math.abs(changeNumber) == 2) {
// console.log('翻页');
page = Math.floor(this.index / 3);
// console.log(this.index);
// console.log('page',page);
// console.log('slice',3*page,3*page+3);
if (this.list.length < 3 * page + 3) {
let list : ListItem[] = this.getData()
this.list.push(...list.toTypedArray())
<template>
<view class="page">
<view style="padding: 20px;">
<text>仿抖音,复用组件,无限滚动、加载、浏览视频的示例模板</text>
<text>已知问题:</text>
<text>1.swiper 组件竖滑动有 bug,先横向滑动</text>
<text>2.uvue暂未支持video</text>
</view>
<swiper class="swiper" :current="current" :circular="index != 0" :vertical="false" @change="onSwiperChange" @transition="onTransition">
<swiper-item class="swiper-item" v-for="(item,index) in visibleList" :key="index">
<!-- <video ref="video" class="video" :id="item.id" :ref="item.id" :src="item.src" :controls="false" :loop="true"
:show-center-play-btn="false"></video> -->
第:{{index}}个容器
数据内容:{{item.content}}
</swiper-item>
</swiper>
</view>
</template>
<script>
type ListItem = { _id : string, content : string }
let page : number = 0;
export default {
data() {
return {
list: [] as ListItem[],
visibleList: [] as ListItem[],// 提高性能 可见的只有3个
current: 0 as number,
index: 0
}
},
beforeCreate() {
this.list = this.getData()
this.visibleList = this.list.slice(0, 3)
},
watch: {
current(current : number, oldCurrent : number) {
let changeNumber = current - oldCurrent
if (changeNumber == 1 || changeNumber == -2) {
// console.error('向右');
this.index++
} else {
// console.error('向左');
this.index--
}
// //翻页(3项为一页)
if (Math.abs(changeNumber) == 2) {
// console.log('翻页');
page = Math.floor(this.index / 3);
// console.log(this.index);
// console.log('page',page);
// console.log('slice',3*page,3*page+3);
if (this.list.length < 3 * page + 3) {
let list : ListItem[] = this.getData()
this.list.push(...list.toTypedArray())
}
let visibleList = this.list.slice(3 * page, 3 * page + 3)
// 换数据
this.visibleList = visibleList
/*
// 不换数据,只换内容
for (let i = 0; i < 3; i++) {
this.visibleList[i].src = visibleList[i].src
this.visibleList[i].other = visibleList[i].other
}*/
}
}
},
methods: {
getData() : ListItem[] {
/* Promise 暂不支持
Promise<void>
return new Promise((resolve) => {
resolve();
});*/
let list = [] as ListItem[];
for (let i = 0; i < 6; i++) {
let index = this.list.length + i;
let listItem : ListItem = {
"_id": "a00" + index,
"content": "这是第" + index + "条数据"
}
list.push(listItem)
}
return list
},
onSwiperChange(e : SwiperChangeEvent) {
// console.error('SwiperChangeEvent',e.detail.current);
this.current = e.detail.current
let visibleList = this.list.slice(3 * page, 3 * page + 3)
// 换数据
this.visibleList = visibleList
/*
// 不换数据,只换内容
for (let i = 0; i < 3; i++) {
this.visibleList[i].src = visibleList[i].src
this.visibleList[i].other = visibleList[i].other
}*/
}
}
},
methods: {
getData() : ListItem[] {
/* Promise 暂不支持
Promise<void>
return new Promise((resolve) => {
resolve();
});*/
let list = [] as ListItem[];
for (let i = 0; i < 6; i++) {
let index = this.list.length + i;
let listItem : ListItem = {
"_id": "a00" + index,
"content": "这是第" + index + "条数据"
}
list.push(listItem)
}
return list
},
onSwiperChange(e : SwiperChangeEvent) {
// console.error('SwiperChangeEvent',e.detail.current);
this.current = e.detail.current
},
onTransition(e:SwiperTransitionEvent){
console.log('onTransition e.detail.dx',e.detail.dx);
}
}
}
</script>
<style>
.page {
flex: 1;
/* width: 750rpx; */
}
.swiper {
flex: 1;
border: 1px solid #000;
}
.swiper-item {
flex: 1;
border: 1px solid red;
padding: 10px 5px;
}
}
}
}
</script>
<style>
.page {
flex: 1;
/* width: 750rpx; */
}
.swiper {
flex: 1;
border: 1px solid #000;
}
.swiper-item {
flex: 1;
border: 1px solid red;
padding: 10px 5px;
}
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录