Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
1b60bd23
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看板
提交
1b60bd23
编写于
9月 12, 2023
作者:
Y
yurj26
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: remove warning
上级
47d2beb8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
107 addition
and
213 deletion
+107
-213
pages/API/toast/toast.uvue
pages/API/toast/toast.uvue
+105
-120
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+0
-32
pages/tabBar/CSS.uvue
pages/tabBar/CSS.uvue
+1
-31
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+0
-29
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+1
-1
未找到文件。
pages/API/toast/toast.uvue
浏览文件 @
1b60bd23
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button class="uni-btn-v" type="default" @tap="toast1Tap">点击弹出默认toast</button>
<button class="uni-btn-v" type="default" @tap="toastTapIconError">点击弹出设置icon的toast</button>
<button class="uni-btn-v" type="default" @tap="toast2Tap">点击弹出设置duration的toast</button>
<button class="uni-btn-v" type="default" @tap="toast3Tap">点击弹出显示loading的toast</button>
<!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<button class="uni-btn-v" type="default" @tap="toast5Tap">点击显示无图标的居底toast</button>
<!-- #endif -->
<button class="uni-btn-v" type="default" @tap="hideToast">点击隐藏toast</button>
</view>
<text>{{exeRet}}</text>
</view>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button class="uni-btn-v" type="default" @tap="toast1Tap">点击弹出默认toast</button>
<button class="uni-btn-v" type="default" @tap="toastTapIconError">点击弹出设置icon的toast</button>
<button class="uni-btn-v" type="default" @tap="toast2Tap">点击弹出设置duration的toast</button>
<button class="uni-btn-v" type="default" @tap="toast3Tap">点击弹出显示loading的toast</button>
<!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<button class="uni-btn-v" type="default" @tap="toast5Tap">点击显示无图标的居底toast</button>
<!-- #endif -->
<button class="uni-btn-v" type="default" @tap="hideToast">点击隐藏toast</button>
</view>
<text>{{exeRet}}</text>
</view>
</view>
</template>
<script lang="uts">
export default {
data() {
return {
title: 'toast',
exeRet:'',
_showTimer: 0
}
},
// #ifdef MP-ALIPAY
onUnload() {
clearTimeout(this._showTimer);
},
// #endif
methods: {
toast1Tap: function () {
uni.showToast({
title: "默认",
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toastTapIconError: function () {
uni.showToast({
title: "默认",
icon:'error',
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast2Tap: function () {
uni.showToast({
title: "duration 3000",
duration: 3000,
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast3Tap: function () {
uni.showToast({
title: "loading",
icon: "loading",
duration: 5000,
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
// #ifdef MP-ALIPAY
this._showTimer = setTimeout(() => {
// icon 是 loading 时,showToast 实际执行的是 showLoading
my.hideLoading()
// 执行完所有代码再清除定时器
clearTimeout(this._showTimer);
}, 3000)
// #endif
},
toast4Tap: function () {
uni.showToast({
title: "logo",
image: "/static/uni.png",
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
// #ifdef APP-PLUS
toast5Tap: function () {
uni.showToast({
title: "显示一段轻提示",
position: 'bottom',
success:function(res){
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail:function(res){
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
// #endif
hideToast: function () {
uni.hideToast()
}
}
export default {
data() {
return {
title: 'toast',
exeRet: ''
}
},
methods: {
toast1Tap: function () {
uni.showToast({
title: "默认",
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toastTapIconError: function () {
uni.showToast({
title: "默认",
icon: 'error',
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast2Tap: function () {
uni.showToast({
title: "duration 3000",
duration: 3000,
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast3Tap: function () {
uni.showToast({
title: "loading",
icon: "loading",
duration: 5000,
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast4Tap: function () {
uni.showToast({
title: "logo",
image: "/static/uni.png",
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
// #ifdef APP-PLUS
toast5Tap: function () {
uni.showToast({
title: "显示一段轻提示",
position: 'bottom',
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
// #endif
hideToast: function () {
uni.hideToast()
}
}
</script>
\ No newline at end of file
}
</script>
pages/tabBar/API.uvue
浏览文件 @
1b60bd23
...
...
@@ -47,7 +47,6 @@
type ListItem = {
id : string
name : string
open : boolean
pages : Page[]
url ?: string
enable ?: boolean
...
...
@@ -59,7 +58,6 @@
{
id: 'global',
name: '全局',
open: false,
pages: [
{
name: 'getApp',
...
...
@@ -74,7 +72,6 @@
{
id: 'base',
name: '基础',
open: false,
pages: [
{
name: '事件总线event-bus',
...
...
@@ -94,7 +91,6 @@
{
id: 'page',
name: '页面和路由',
open: false,
pages: [
{
name: '页面跳转',
...
...
@@ -162,7 +158,6 @@
{
id: 'ui',
name: '界面',
open: false,
pages: [
/* {
name: "创建动画",
...
...
@@ -211,7 +206,6 @@
{
id: 'device',
name: '设备',
open: false,
pages: [
{
name: '获取系统信息',
...
...
@@ -298,7 +292,6 @@
{
id: 'media',
name: '媒体',
open: false,
pages: [
{
name: "图片",
...
...
@@ -399,7 +392,6 @@
id: "rewarded-video-ad",
url: "rewarded-video-ad",
name: "激励视频广告",
open: false,
enable: false,
pages: [] as Page[]
},
...
...
@@ -407,14 +399,12 @@
id: "full-screen-video-ad",
url: "full-screen-video-ad",
name: "全屏视频广告",
open: false,
enable: false,
pages: [] as Page[]
},
{
id: "login",
name: "登录",
open: false,
pages: [
{
name: "登录",
...
...
@@ -429,7 +419,6 @@
{
id: "share",
name: "分享",
open: false,
pages: [
{
name: "分享",
...
...
@@ -440,7 +429,6 @@
{
id: "payment",
name: "支付",
open: false,
pages: [
{
name: "发起支付",
...
...
@@ -451,7 +439,6 @@
{
id: "speech",
name: "语音",
open: false,
pages: [
{
name: "语音识别",
...
...
@@ -462,7 +449,6 @@
{
id: "push",
name: "推送",
open: false,
pages: [
{
name: "推送",
...
...
@@ -477,24 +463,6 @@
}
},
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 == false) {
uni.showToast({
...
...
pages/tabBar/CSS.uvue
浏览文件 @
1b60bd23
...
...
@@ -38,7 +38,6 @@
type ListItem = {
id : string
name : string
open : boolean
pages : Page[]
url ?: string
enable ?: boolean
...
...
@@ -50,7 +49,6 @@
{
id: 'background',
name: 'background',
open: false,
pages: [
{
name: 'background-color',
...
...
@@ -65,7 +63,6 @@
{
id: 'border',
name: 'border',
open: false,
pages: [
{
name: 'border',
...
...
@@ -96,7 +93,6 @@
{
id: 'box-shadow',
name: 'box-shadow',
open: false,
pages: [
{
name: 'box-shadow',
...
...
@@ -107,7 +103,6 @@
{
id: 'display',
name: 'display',
open: false,
pages: [
{
name: 'flex',
...
...
@@ -122,7 +117,6 @@
{
id: 'flex',
name: 'flex',
open: false,
pages: [
{
name: 'align-content',
...
...
@@ -165,7 +159,6 @@
{
id: 'layout',
name: 'layout',
open: false,
pages: [
{
name: 'height',
...
...
@@ -208,7 +201,6 @@
{
id: 'margin',
name: 'margin',
open: false,
pages: [
{
name: 'margin-bottom',
...
...
@@ -235,7 +227,6 @@
{
id: 'padding',
name: 'padding',
open: false,
pages: [
{
name: 'padding-bottom',
...
...
@@ -262,7 +253,6 @@
{
id: 'text',
name: 'text',
open: false,
pages: [
{
name: 'color',
...
...
@@ -309,7 +299,6 @@
{
id: 'transform',
name: 'transform',
open: false,
pages: [
{
name: 'translate',
...
...
@@ -328,7 +317,6 @@
{
id: 'transition',
name: 'transition',
open: false,
pages: [
{
name: 'transition',
...
...
@@ -343,24 +331,6 @@
}
},
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 == false) {
uni.showToast({
...
...
@@ -384,4 +354,4 @@
.item {
margin-bottom: 12px;
}
</style>
\ No newline at end of file
</style>
pages/tabBar/component.uvue
浏览文件 @
1b60bd23
...
...
@@ -54,7 +54,6 @@ type Page = {
type ListItem = {
id : string
name : string
open : boolean
pages : Page[]
url ?: string
enable ?: boolean
...
...
@@ -66,7 +65,6 @@ export default {
{
id: 'view',
name: '视图容器',
open: false,
pages: [
{
name: 'view',
...
...
@@ -95,7 +93,6 @@ export default {
{
id: 'content',
name: '基础内容',
open: false,
pages: [
{
name: 'text',
...
...
@@ -112,7 +109,6 @@ export default {
{
id: 'form',
name: '表单组件',
open: false,
pages: [
{
name: 'button',
...
...
@@ -162,7 +158,6 @@ export default {
{
id: 'nav',
name: '导航',
open: false,
pages: [{
name: 'navigator',
enable: true
...
...
@@ -171,7 +166,6 @@ export default {
{
id: 'media',
name: '媒体组件',
open: false,
pages: [
{
name: 'image',
...
...
@@ -191,7 +185,6 @@ export default {
{
id: 'map',
name: '地图',
open: false,
pages: [
{
name: 'map',
...
...
@@ -202,7 +195,6 @@ export default {
{
id: 'canvas',
name: '画布',
open: false,
pages: [
{
name: 'canvas'
...
...
@@ -213,7 +205,6 @@ export default {
{
id: 'web-view',
name: '网页',
open: false,
pages: [
{
name: '网络网页',
...
...
@@ -233,14 +224,12 @@ export default {
url: 'ad',
name: 'AD组件',
enable: false,
open: false,
pages: [] as Page[]
}
*/
{
id: 'general-attr-event',
name: '通用属性和事件',
open: false,
pages: [
{
name: '通用属性',
...
...
@@ -261,24 +250,6 @@ export default {
}
},
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 == false) {
uni.showToast({
...
...
pages/tabBar/template.uvue
浏览文件 @
1b60bd23
...
...
@@ -174,7 +174,7 @@ export default {
}
},
methods: {
triggerCollapse(index
?
: number, item: ListItem) {
triggerCollapse(index: number, item: ListItem) {
if (item.pages.length == 0) {
const page: Page = {
name: item.name,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录