diff --git a/pages/API/toast/toast.uvue b/pages/API/toast/toast.uvue index 4118b2697a9d4fb09d5868f2749d7464461ec6ef..203ac37354546af36fed1bf556062f344a960e6b 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