1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- export default {
-
- msg(content) {
- uni.showToast({
- title: content,
- icon: 'none'
- })
- },
-
- msgError(content) {
- uni.showToast({
- title: content,
- icon: 'error'
- })
- },
-
- msgSuccess(content) {
- uni.showToast({
- title: content,
- icon: 'success'
- })
- },
-
- hideMsg(content) {
- uni.hideToast()
- },
-
- alert(content) {
- uni.showModal({
- title: '提示',
- content: content,
- showCancel: false
- })
- },
-
- confirm(content) {
- return new Promise((resolve, reject) => {
- uni.showModal({
- title: '系统提示',
- content: content,
- cancelText: '取消',
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- resolve(res.confirm)
- }
- }
- })
- })
- },
-
- showToast(option) {
- if (typeof option === "object") {
- uni.showToast(option)
- } else {
- uni.showToast({
- title: option,
- icon: "none",
- duration: 2500
- })
- }
- },
-
- loading(content) {
- uni.showLoading({
- title: content,
- icon: 'none'
- })
- },
-
- closeLoading() {
- uni.hideLoading()
- }
- }
|