From 72e20c59b2de49c42c4624e837df19aee05f5d38 Mon Sep 17 00:00:00 2001 From: zhaofengliang Date: Fri, 11 Oct 2024 11:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20show-toast=20=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/show-toast/show-toast.test.js | 7 +++++++ pages/API/show-toast/show-toast.uvue | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/pages/API/show-toast/show-toast.test.js b/pages/API/show-toast/show-toast.test.js index b68cb65f..8b4bbf96 100644 --- a/pages/API/show-toast/show-toast.test.js +++ b/pages/API/show-toast/show-toast.test.js @@ -53,6 +53,13 @@ describe('API-toast', () => { } }) + it("icon=none-mask=true-toast-test", async () => { + await page.setData({maskSelect: true}) + await page.callMethod('toast3Tap') + await page.waitFor(300); + await toScreenshot('icon=none-mask=true-toast-image') + }) + it("image-toast-test", async () => { await page.setData({imageSelect: true}) await page.waitFor(300); diff --git a/pages/API/show-toast/show-toast.uvue b/pages/API/show-toast/show-toast.uvue index a1b1f328..11fb4554 100644 --- a/pages/API/show-toast/show-toast.uvue +++ b/pages/API/show-toast/show-toast.uvue @@ -156,6 +156,22 @@ this.exeRet = "fail:" + JSON.stringify(res) }, }) + }, + toast3Tap: function () { + uni.showToast({ + title: "默认", + icon: 'none', + duration: this.intervalSelect, + image: this.imageSelect ? "/static/uni.png" : null, + mask: this.maskSelect, + success: (res) => { + // console.log('success:',res) + this.exeRet = "success:" + JSON.stringify(res) + }, + fail: (res) => { + this.exeRet = "fail:" + JSON.stringify(res) + }, + }) }, // #ifdef APP toast2Tap: function () { -- GitLab