From 84c979e87110bf2f65355e0c0d384512a923b1f4 Mon Sep 17 00:00:00 2001 From: XHY Date: Tue, 15 Nov 2022 12:44:11 +0800 Subject: [PATCH] =?UTF-8?q?iOS=E7=AB=AF=E6=B7=BB=E5=8A=A0=20Alert=E3=80=81?= =?UTF-8?q?toast=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pages/SDKIntegration/SDKIntegration.vue | 8 ++++---- .../{XToast/XToast.vue => Toast/Toast.vue} | 4 ++-- uni_modules/uts-alert/utssdk/app-ios/index.uts | 6 +++--- uni_modules/uts-toast/utssdk/app-ios/index.uts | 11 +++++++++++ 5 files changed, 21 insertions(+), 10 deletions(-) rename pages/SDKIntegration/{XToast/XToast.vue => Toast/Toast.vue} (86%) diff --git a/pages.json b/pages.json index 2f049ca..2c3d858 100644 --- a/pages.json +++ b/pages.json @@ -63,7 +63,7 @@ }, { - "path" : "pages/SDKIntegration/XToast/XToast", + "path" : "pages/SDKIntegration/Toast/Toast", "style" : { "navigationBarTitleText": "", diff --git a/pages/SDKIntegration/SDKIntegration.vue b/pages/SDKIntegration/SDKIntegration.vue index 38f1ac7..ac30884 100644 --- a/pages/SDKIntegration/SDKIntegration.vue +++ b/pages/SDKIntegration/SDKIntegration.vue @@ -3,8 +3,8 @@ - - + + @@ -19,9 +19,9 @@ }, methods: { - gotoXToast:function(e){ + gotoToast:function(e){ uni.navigateTo({ - url:'/pages/SDKIntegration/XToast/XToast' + url:'/pages/SDKIntegration/Toast/Toast' }) }, gotoTencentLocation:function(e){ diff --git a/pages/SDKIntegration/XToast/XToast.vue b/pages/SDKIntegration/Toast/Toast.vue similarity index 86% rename from pages/SDKIntegration/XToast/XToast.vue rename to pages/SDKIntegration/Toast/Toast.vue index 35bda61..eddea2c 100644 --- a/pages/SDKIntegration/XToast/XToast.vue +++ b/pages/SDKIntegration/Toast/Toast.vue @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ data() { return { - title:"XToast集成示例" + title:"Toast 示例" } }, methods:{ diff --git a/uni_modules/uts-alert/utssdk/app-ios/index.uts b/uni_modules/uts-alert/utssdk/app-ios/index.uts index af18cfc..f5e3abd 100644 --- a/uni_modules/uts-alert/utssdk/app-ios/index.uts +++ b/uni_modules/uts-alert/utssdk/app-ios/index.uts @@ -1,5 +1,5 @@ import { UIAlertController , UIAlertAction , UITextField } from "UIKit" -import { uniViewController } from "DCUTSPlugin" +import { DCUTS } from "DCUTSFoundation" import { DispatchQueue } from 'Dispatch'; export function showAlert(title: string|null, message: string|null, result: (index: Number) => void) { @@ -26,7 +26,7 @@ export function showAlert(title: string|null, message: string|null, result: (ind alert.addAction(cancelAction) // 从 uniViewController 打开 alert 弹窗 - uniViewController().present(alert, animated= true) + DCUTS.getCurrentViewController().present(alert, animated= true) }) } @@ -58,6 +58,6 @@ export function showPrompt(title: string|null, message: string|null,placeholder: alert.addAction(okAction) // 从 uniViewController 打开 alert 弹窗 - uniViewController().present(alert, animated= true) + DCUTS.getCurrentViewController().present(alert, animated= true) }) } \ No newline at end of file diff --git a/uni_modules/uts-toast/utssdk/app-ios/index.uts b/uni_modules/uts-toast/utssdk/app-ios/index.uts index e69de29..2696507 100644 --- a/uni_modules/uts-toast/utssdk/app-ios/index.uts +++ b/uni_modules/uts-toast/utssdk/app-ios/index.uts @@ -0,0 +1,11 @@ +import { DCUTS } from "DCUTSFoundation" +import "ToastSwiftFramework" +import { DispatchQueue } from 'Dispatch'; + +export function showToast():boolean{ + + DispatchQueue.main.async(execute=():void => { + DCUTS.getCurrentViewController().view.makeToast("这是一条提示信息") + }) + return true +} \ No newline at end of file -- GitLab