You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
1.5 KiB
JavaScript

8 months ago
/**
* title显示内容mask是否显示遮罩层
*/
/**
* 成功
*/
function success (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'success',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
function error (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'error',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
function fail (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'fail',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
function exception (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'exception',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
function loading (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'loading',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
function none (title, mask = false) {
return new Promise((resolve, reject) => {
uni.showToast({
icon: 'none',
title,
mask,
success: (e) => {
resolve(e)
},
fail: (err) => {
reject(err)
}
})
})
}
export default {
success,
fail,
exception,
loading,
none
}