Files
xiaowang 69ea01eaa4
自动发布开发环境 Nacos 配置 / publish (push) Successful in 34s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 11s
小程序预约详情支持图片预览、编辑预约与完成收款拆分
2026-11-09 15:18:27 +08:00

37 lines
1.2 KiB
JavaScript

function showActionModal(page, options = {}) {
const modal = page && typeof page.selectComponent === 'function' ? page.selectComponent('#actionModal') : null
if (modal && typeof modal.open === 'function') {
return new Promise(resolve => {
modal.open({
title: options.title,
content: options.content,
icon: options.icon,
cancelText: options.cancelText,
confirmText: options.confirmText,
confirmType: options.confirmType,
layout: options.layout,
editable: options.editable,
placeholderText: options.placeholderText,
inputValue: options.inputValue,
inputType: options.inputType,
onClose: resolve
})
})
}
return new Promise(resolve => {
wx.showModal({
title: options.title,
content: options.content || '',
cancelText: options.cancelText,
confirmText: options.confirmText,
showCancel: !!options.cancelText,
editable: options.editable === true,
placeholderText: options.placeholderText,
success: resolve,
fail: () => resolve({ confirm: false, cancel: true, content: '' })
})
})
}
module.exports = { showActionModal }