export const navigateTo = (url) => {
    uni.navigateTo({
        url: url,
        fail: (err) => {
            console.log('err', err);

            uni.switchTab({
                url: url
            });

        }
    });
}

/**
 * 跳转登录页面
 * @param {String} page 跳转页面
 */
export const navigateToAccountLogin = (page = "") => {
    if (page == "") {
        const _page = getCurrentPages()[0];
        page = _page.route;
    }
    // navigateTo(`/pages/me/account-login?page=${encodeURIComponent(page)}`);
}

/**
 * 跳转协议页面
 * @param {String} type 协议类型
 */
export const navigateToAgreement = (type) => {
 
    navigateTo(`/pages/other/agreement?type=${type}`);
};

