add make_bgurl(image)

This commit is contained in:
Luk 2024-02-16 09:58:37 +08:00
parent 5c1b5a05b1
commit 80fc62e602

View File

@ -154,6 +154,10 @@ export default {
return `${protocol}://${hostname}${port ? ':' : ''}${port}/${route}` return `${protocol}://${hostname}${port ? ':' : ''}${port}/${route}`
}, },
make_bgurl (image) {
return image ? `url(${this.make_server_url(image)})` : ''
},
/** uni.request uniCloud.callFunction /** uni.request uniCloud.callFunction
* 返回值{ _state, 成功结果或错误结果 }其中 _state 除了后台返回的还可以是 * 返回值{ _state, 成功结果或错误结果 }其中 _state 除了后台返回的还可以是
* - CLIENT_WOBASE_BROKEN: 前端发现后台断线 * - CLIENT_WOBASE_BROKEN: 前端发现后台断线
@ -172,10 +176,13 @@ export default {
const thisRoute = getCurrentPages()?.pop?.()?.route || 'VueApp' // 立刻保存 route因为在调用后台后可能已切换到了其他页面。 const thisRoute = getCurrentPages()?.pop?.()?.route || 'VueApp' // 立刻保存 route因为在调用后台后可能已切换到了其他页面。
const startTime = new Date().toJSON() const startTime = new Date().toJSON()
let apiurl = undefined let apiurl = undefined
apiWhat._clientInfo = globalThis.wo?.envar?.clientInfo apiWhat._clientInfo = {
// #ifdef WEB ...globalThis.wo?.envar?.clientInfo,
Object.assign(apiWhat._clientInfo, { requrl: globalThis.location?.href, lang: globalThis.wo?.ss?.i18n?.mylang }) lang: globalThis.wo?.ss?.i18n?.mylang,
// #endif // #ifdef WEB
requrl: globalThis.location?.href
// #endif
}
apiWhat._passtoken = uni.getStorageSync('_passtoken') apiWhat._passtoken = uni.getStorageSync('_passtoken')
let result = {} let result = {}
if (baseType === 'UNICLOUD_OBJECT') { if (baseType === 'UNICLOUD_OBJECT') {
@ -513,7 +520,11 @@ export default {
} }
}, },
showModal (option) { showModal (option = {}) {
option.title = this.localizeText(option.title)
option.content = this.localizeText(option.content)
option.cancelText = this.localizeText(option.cancelText || { zhCN: '取消', enUS: 'Cancel' })
option.confirmText = this.localizeText(option.confirmText || { zhCN: '好的', enUS: 'OK' })
// #ifdef APP // #ifdef APP
if (option.content) option.content = '\n' + option.content if (option.content) option.content = '\n' + option.content
// #endif // #endif