From 122546b54bdd5d0d2349116469bd961d6510607d Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 29 Jun 2023 18:19:50 +0800 Subject: [PATCH] =?UTF-8?q?toast=20=E7=A4=BA=E4=BE=8B=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/toast/toast.uvue | 55 ++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/pages/API/toast/toast.uvue b/pages/API/toast/toast.uvue index 4118b269..203ac373 100644 --- a/pages/API/toast/toast.uvue +++ b/pages/API/toast/toast.uvue @@ -4,6 +4,7 @@ + @@ -14,6 +15,7 @@ + {{exeRet}} @@ -22,6 +24,7 @@ data() { return { title: 'toast', + exeRet:'', _showTimer: 0 } }, @@ -33,20 +36,50 @@ methods: { toast1Tap: function () { uni.showToast({ - title: "默认" + 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 + 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 + 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(() => { @@ -61,14 +94,26 @@ toast4Tap: function () { uni.showToast({ title: "logo", - image: "/static/uni.png" + 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' + position: 'bottom', + success:function(res){ + this.exeRet = "success:" + JSON.stringify(res) + new Date() + }, + fail:function(res){ + this.exeRet = "fail:" + JSON.stringify(res) + }, }) }, // #endif -- GitLab