提交 1b60bd23 编写于 作者: Y yurj26

chore: remove warning

上级 47d2beb8
...@@ -24,23 +24,17 @@ ...@@ -24,23 +24,17 @@
data() { data() {
return { return {
title: 'toast', title: 'toast',
exeRet:'', exeRet: ''
_showTimer: 0
} }
}, },
// #ifdef MP-ALIPAY
onUnload() {
clearTimeout(this._showTimer);
},
// #endif
methods: { methods: {
toast1Tap: function () { toast1Tap: function () {
uni.showToast({ uni.showToast({
title: "默认", title: "默认",
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res) this.exeRet = "fail:" + JSON.stringify(res)
}, },
}) })
...@@ -48,11 +42,11 @@ ...@@ -48,11 +42,11 @@
toastTapIconError: function () { toastTapIconError: function () {
uni.showToast({ uni.showToast({
title: "默认", title: "默认",
icon:'error', icon: 'error',
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res) this.exeRet = "fail:" + JSON.stringify(res)
}, },
}) })
...@@ -61,10 +55,10 @@ ...@@ -61,10 +55,10 @@
uni.showToast({ uni.showToast({
title: "duration 3000", title: "duration 3000",
duration: 3000, duration: 3000,
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res) this.exeRet = "fail:" + JSON.stringify(res)
}, },
}) })
...@@ -74,31 +68,22 @@ ...@@ -74,31 +68,22 @@
title: "loading", title: "loading",
icon: "loading", icon: "loading",
duration: 5000, duration: 5000,
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(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 () { toast4Tap: function () {
uni.showToast({ uni.showToast({
title: "logo", title: "logo",
image: "/static/uni.png", image: "/static/uni.png",
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res) this.exeRet = "fail:" + JSON.stringify(res)
}, },
}) })
...@@ -108,10 +93,10 @@ ...@@ -108,10 +93,10 @@
uni.showToast({ uni.showToast({
title: "显示一段轻提示", title: "显示一段轻提示",
position: 'bottom', position: 'bottom',
success:function(res){ success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date() this.exeRet = "success:" + JSON.stringify(res) + new Date()
}, },
fail:function(res){ fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res) this.exeRet = "fail:" + JSON.stringify(res)
}, },
}) })
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
type ListItem = { type ListItem = {
id : string id : string
name : string name : string
open : boolean
pages : Page[] pages : Page[]
url ?: string url ?: string
enable ?: boolean enable ?: boolean
...@@ -59,7 +58,6 @@ ...@@ -59,7 +58,6 @@
{ {
id: 'global', id: 'global',
name: '全局', name: '全局',
open: false,
pages: [ pages: [
{ {
name: 'getApp', name: 'getApp',
...@@ -74,7 +72,6 @@ ...@@ -74,7 +72,6 @@
{ {
id: 'base', id: 'base',
name: '基础', name: '基础',
open: false,
pages: [ pages: [
{ {
name: '事件总线event-bus', name: '事件总线event-bus',
...@@ -94,7 +91,6 @@ ...@@ -94,7 +91,6 @@
{ {
id: 'page', id: 'page',
name: '页面和路由', name: '页面和路由',
open: false,
pages: [ pages: [
{ {
name: '页面跳转', name: '页面跳转',
...@@ -162,7 +158,6 @@ ...@@ -162,7 +158,6 @@
{ {
id: 'ui', id: 'ui',
name: '界面', name: '界面',
open: false,
pages: [ pages: [
/* { /* {
name: "创建动画", name: "创建动画",
...@@ -211,7 +206,6 @@ ...@@ -211,7 +206,6 @@
{ {
id: 'device', id: 'device',
name: '设备', name: '设备',
open: false,
pages: [ pages: [
{ {
name: '获取系统信息', name: '获取系统信息',
...@@ -298,7 +292,6 @@ ...@@ -298,7 +292,6 @@
{ {
id: 'media', id: 'media',
name: '媒体', name: '媒体',
open: false,
pages: [ pages: [
{ {
name: "图片", name: "图片",
...@@ -399,7 +392,6 @@ ...@@ -399,7 +392,6 @@
id: "rewarded-video-ad", id: "rewarded-video-ad",
url: "rewarded-video-ad", url: "rewarded-video-ad",
name: "激励视频广告", name: "激励视频广告",
open: false,
enable: false, enable: false,
pages: [] as Page[] pages: [] as Page[]
}, },
...@@ -407,14 +399,12 @@ ...@@ -407,14 +399,12 @@
id: "full-screen-video-ad", id: "full-screen-video-ad",
url: "full-screen-video-ad", url: "full-screen-video-ad",
name: "全屏视频广告", name: "全屏视频广告",
open: false,
enable: false, enable: false,
pages: [] as Page[] pages: [] as Page[]
}, },
{ {
id: "login", id: "login",
name: "登录", name: "登录",
open: false,
pages: [ pages: [
{ {
name: "登录", name: "登录",
...@@ -429,7 +419,6 @@ ...@@ -429,7 +419,6 @@
{ {
id: "share", id: "share",
name: "分享", name: "分享",
open: false,
pages: [ pages: [
{ {
name: "分享", name: "分享",
...@@ -440,7 +429,6 @@ ...@@ -440,7 +429,6 @@
{ {
id: "payment", id: "payment",
name: "支付", name: "支付",
open: false,
pages: [ pages: [
{ {
name: "发起支付", name: "发起支付",
...@@ -451,7 +439,6 @@ ...@@ -451,7 +439,6 @@
{ {
id: "speech", id: "speech",
name: "语音", name: "语音",
open: false,
pages: [ pages: [
{ {
name: "语音识别", name: "语音识别",
...@@ -462,7 +449,6 @@ ...@@ -462,7 +449,6 @@
{ {
id: "push", id: "push",
name: "推送", name: "推送",
open: false,
pages: [ pages: [
{ {
name: "推送", name: "推送",
...@@ -477,24 +463,6 @@ ...@@ -477,24 +463,6 @@
} }
}, },
methods: { 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) { goDetailPage(e : Page) {
if (e.enable == false) { if (e.enable == false) {
uni.showToast({ uni.showToast({
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
type ListItem = { type ListItem = {
id : string id : string
name : string name : string
open : boolean
pages : Page[] pages : Page[]
url ?: string url ?: string
enable ?: boolean enable ?: boolean
...@@ -50,7 +49,6 @@ ...@@ -50,7 +49,6 @@
{ {
id: 'background', id: 'background',
name: 'background', name: 'background',
open: false,
pages: [ pages: [
{ {
name: 'background-color', name: 'background-color',
...@@ -65,7 +63,6 @@ ...@@ -65,7 +63,6 @@
{ {
id: 'border', id: 'border',
name: 'border', name: 'border',
open: false,
pages: [ pages: [
{ {
name: 'border', name: 'border',
...@@ -96,7 +93,6 @@ ...@@ -96,7 +93,6 @@
{ {
id: 'box-shadow', id: 'box-shadow',
name: 'box-shadow', name: 'box-shadow',
open: false,
pages: [ pages: [
{ {
name: 'box-shadow', name: 'box-shadow',
...@@ -107,7 +103,6 @@ ...@@ -107,7 +103,6 @@
{ {
id: 'display', id: 'display',
name: 'display', name: 'display',
open: false,
pages: [ pages: [
{ {
name: 'flex', name: 'flex',
...@@ -122,7 +117,6 @@ ...@@ -122,7 +117,6 @@
{ {
id: 'flex', id: 'flex',
name: 'flex', name: 'flex',
open: false,
pages: [ pages: [
{ {
name: 'align-content', name: 'align-content',
...@@ -165,7 +159,6 @@ ...@@ -165,7 +159,6 @@
{ {
id: 'layout', id: 'layout',
name: 'layout', name: 'layout',
open: false,
pages: [ pages: [
{ {
name: 'height', name: 'height',
...@@ -208,7 +201,6 @@ ...@@ -208,7 +201,6 @@
{ {
id: 'margin', id: 'margin',
name: 'margin', name: 'margin',
open: false,
pages: [ pages: [
{ {
name: 'margin-bottom', name: 'margin-bottom',
...@@ -235,7 +227,6 @@ ...@@ -235,7 +227,6 @@
{ {
id: 'padding', id: 'padding',
name: 'padding', name: 'padding',
open: false,
pages: [ pages: [
{ {
name: 'padding-bottom', name: 'padding-bottom',
...@@ -262,7 +253,6 @@ ...@@ -262,7 +253,6 @@
{ {
id: 'text', id: 'text',
name: 'text', name: 'text',
open: false,
pages: [ pages: [
{ {
name: 'color', name: 'color',
...@@ -309,7 +299,6 @@ ...@@ -309,7 +299,6 @@
{ {
id: 'transform', id: 'transform',
name: 'transform', name: 'transform',
open: false,
pages: [ pages: [
{ {
name: 'translate', name: 'translate',
...@@ -328,7 +317,6 @@ ...@@ -328,7 +317,6 @@
{ {
id: 'transition', id: 'transition',
name: 'transition', name: 'transition',
open: false,
pages: [ pages: [
{ {
name: 'transition', name: 'transition',
...@@ -343,24 +331,6 @@ ...@@ -343,24 +331,6 @@
} }
}, },
methods: { 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) { goDetailPage(e : Page) {
if (e.enable == false) { if (e.enable == false) {
uni.showToast({ uni.showToast({
......
...@@ -54,7 +54,6 @@ type Page = { ...@@ -54,7 +54,6 @@ type Page = {
type ListItem = { type ListItem = {
id : string id : string
name : string name : string
open : boolean
pages : Page[] pages : Page[]
url ?: string url ?: string
enable ?: boolean enable ?: boolean
...@@ -66,7 +65,6 @@ export default { ...@@ -66,7 +65,6 @@ export default {
{ {
id: 'view', id: 'view',
name: '视图容器', name: '视图容器',
open: false,
pages: [ pages: [
{ {
name: 'view', name: 'view',
...@@ -95,7 +93,6 @@ export default { ...@@ -95,7 +93,6 @@ export default {
{ {
id: 'content', id: 'content',
name: '基础内容', name: '基础内容',
open: false,
pages: [ pages: [
{ {
name: 'text', name: 'text',
...@@ -112,7 +109,6 @@ export default { ...@@ -112,7 +109,6 @@ export default {
{ {
id: 'form', id: 'form',
name: '表单组件', name: '表单组件',
open: false,
pages: [ pages: [
{ {
name: 'button', name: 'button',
...@@ -162,7 +158,6 @@ export default { ...@@ -162,7 +158,6 @@ export default {
{ {
id: 'nav', id: 'nav',
name: '导航', name: '导航',
open: false,
pages: [{ pages: [{
name: 'navigator', name: 'navigator',
enable: true enable: true
...@@ -171,7 +166,6 @@ export default { ...@@ -171,7 +166,6 @@ export default {
{ {
id: 'media', id: 'media',
name: '媒体组件', name: '媒体组件',
open: false,
pages: [ pages: [
{ {
name: 'image', name: 'image',
...@@ -191,7 +185,6 @@ export default { ...@@ -191,7 +185,6 @@ export default {
{ {
id: 'map', id: 'map',
name: '地图', name: '地图',
open: false,
pages: [ pages: [
{ {
name: 'map', name: 'map',
...@@ -202,7 +195,6 @@ export default { ...@@ -202,7 +195,6 @@ export default {
{ {
id: 'canvas', id: 'canvas',
name: '画布', name: '画布',
open: false,
pages: [ pages: [
{ {
name: 'canvas' name: 'canvas'
...@@ -213,7 +205,6 @@ export default { ...@@ -213,7 +205,6 @@ export default {
{ {
id: 'web-view', id: 'web-view',
name: '网页', name: '网页',
open: false,
pages: [ pages: [
{ {
name: '网络网页', name: '网络网页',
...@@ -233,14 +224,12 @@ export default { ...@@ -233,14 +224,12 @@ export default {
url: 'ad', url: 'ad',
name: 'AD组件', name: 'AD组件',
enable: false, enable: false,
open: false,
pages: [] as Page[] pages: [] as Page[]
} }
*/ */
{ {
id: 'general-attr-event', id: 'general-attr-event',
name: '通用属性和事件', name: '通用属性和事件',
open: false,
pages: [ pages: [
{ {
name: '通用属性', name: '通用属性',
...@@ -261,24 +250,6 @@ export default { ...@@ -261,24 +250,6 @@ export default {
} }
}, },
methods: { 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) { goDetailPage(e : Page) {
if (e.enable == false) { if (e.enable == false) {
uni.showToast({ uni.showToast({
......
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
} }
}, },
methods: { methods: {
triggerCollapse(index?: number, item: ListItem) { triggerCollapse(index: number, item: ListItem) {
if (item.pages.length == 0) { if (item.pages.length == 0) {
const page: Page = { const page: Page = {
name: item.name, name: item.name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册