This commit is contained in:
Luk 2024-01-16 22:15:52 +08:00
parent c71e514af2
commit 76417a0cbd

View File

@ -421,6 +421,7 @@ export default {
}, },
open_url_in_browser (url) { open_url_in_browser (url) {
url = this.localizeText?.(url) || url
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.openURL(url) plus.runtime.openURL(url)
// #endif // #endif
@ -635,7 +636,9 @@ export default {
} }
}, },
copy_to_clipboard (text, { promptLength = 50, hidePrompt = false, wo = globalThis.wo } = {}) { copy_to_clipboard (text, { promptLength = 50, hidePrompt = false } = {}) {
text = this.localizeText?.(text) || text
const self = this
uni.setClipboardData({ uni.setClipboardData({
data: text, data: text,
success: () => { success: () => {
@ -644,9 +647,9 @@ export default {
if (text.length > promptLength) { if (text.length > promptLength) {
text = String(text).substring(0, promptLength) + ' ...' text = String(text).substring(0, promptLength) + ' ...'
} }
wo?.tt?.showToast?.({ self.showToast?.({
type: 'success', type: 'success',
title: `${wo?.ll?.({ zhCN: '已成功拷贝', enUS: 'Successfully copied' })}\n${text}`, title: `${this.localizeText?.({ zhCN: '已成功拷贝\n', enUS: 'Successfully copied\n' }) || ''}${text}`,
}) })
} }
}, },