diff --git a/pages/API/show-toast/show-toast.test.js b/pages/API/show-toast/show-toast.test.js index b68cb65fde4f7a06887df10ff7723367e5720b02..8b4bbf9632aeeaa80d0cd915bacbd5060c5543ad 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 a1b1f328d6e4819382cdf5666b3de37aadc856de..11fb45545e6ca88722f503e577468fb0b6178f69 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 () {