1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export const dialog = (content, {comfirm = () => {}, cancel = () => {}}, config = {}) => {
|
8 | wx.showModal({
|
9 | title: config.title || '提示',
|
10 | content: content,
|
11 | showCancel: config.showCancel,
|
12 | cancelText: config.cancelText || '取消',
|
13 | confirmText: config.confirmText || '确定',
|
14 | confirmColor: config.confirmColor || '#00AAFF',
|
15 | cancelColor: config.cancelColor || '#999',
|
16 | success: function(res) {
|
17 | if (res.confirm) {
|
18 | comfirm()
|
19 | } else if (res.cancel) {
|
20 | cancel()
|
21 | }
|
22 | }
|
23 | })
|
24 | }
|