uni.pro.uploadFile = (obj) => {
    uni.queue.push((callback) => {
        const originComplete = obj.complete
        obj.complete = (...args) => {
            callback()
            if(typeof originComplete === 'function') {
                originComplete(...args)
            }
        }
        uni.uploadFile(obj)
    })
}

uni.pro.navigateTo = (pageName, extras = {}) => {
    let url = uni.url.getUrl(pageName, extras)
    return uni.navigateTo({
        url
    })
}
uni.pro.redirectTo = (pageName, extras = {}) => {
    let url = uni.url.getUrl(pageName, extras)
    return uni.redirectTo({
        url
    })
}

uni.pro.navigateBack = (delta = 1) => {
    uni.navigateBack({
        delta
    })
}

uni.pro.switchTab = (pageName) => {
    let url = uni.url.getUrl(pageName)
    return uni.switchTab({
        url
    })
}

uni.pro.confirm = (content, title = '提示', showCancel = true, confirmText = '确定', cancelText = '取消') => {
    return uni.showModal({ title, content, showCancel, cancelText, confirmText})
}
