123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- export const navToAsync = (url) => {
- return new Promise((resolve, reject) => {
- uni.navigateTo({
- url: url,
- success: res => {
- return true;
- },
- fail: err => {
- return false;
- }
- });
- });
- }
- export const navto = (url, replace = false) => {
- if (replace) {
- return uni.redirectTo({
- url: url
- });
- }
- return uni.navigateTo({
- url: url
- });
- }
- export const home = () => {
- return navto('/pages/index/index', true);
- }
- export const back = () => {
- return new Promise((resolve, reject) => {
- uni.navigateBack({
- success: res => {
- return true;
- },
- fail: err => {
- uni.reLaunch({
- url: '/pages/index/index',
- });
- return false;
- }
- });
- });
- // return uni.navigateBack();
- }
- export const login = () => {
- let url : String
- // #ifdef MP-WEIXIN
- url = '/pages/login/index'
- // #endif
- // #ifdef APP
- url = '/pages/login/index'
- // #endif
- uni.navigateTo({
- url: url,
- })
- }
- export const goBJList = (replace = false) => {
- navto('/pages/feedback/index', replace)
- }
- // 办件详情
- export const goBJDetails = (id = null) => {
- if (id) {
- navto('/pages/feedback/details?id=' + id)
- } else {
- navto('/pages/feedback/details')
- }
- }
- // 登录页面
- export const goLogin = () => {
- navto('/pages/login/index')
- }
- // 错误页面
- export const getErrorPage = () => {
- navto('/pages/error/index')
- }
|