

export const gotoPage = (path:string) => {
    return new Promise<void>((resolve, reject) => {
        uni.navigateTo({
            url: `/common/views/pages${path}`,
            success: () => {
                resolve()
            },
            fail: () => {
                reject()
            }
        })
        
    })
}

export const gotoPageDynamic = ({id}:any) => {
    return new Promise<void>((resolve, reject) => {
        uni.navigateTo({
            url: `/common/views/pages/dynamic/index?id=${id}`,
            success: () => {
                resolve()
            },
            fail: () => {
                reject()
            }
        })
        
    })
}

export const backtoPage = () => {
    return new Promise<void>((resolve, reject) => {
        uni.navigateBack({
            success: () => {
                resolve()
            },
            fail: () => {
                reject()
            }
        })
        
    })
}