first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:09:02 +08:00
commit dac42e3b0c
3512 changed files with 181637 additions and 0 deletions

46
hooks/useNav.js Normal file
View File

@@ -0,0 +1,46 @@
import {
ref,
watch
} from 'vue';
import store from '@/store/index.js';
export function useNav() {
const navTo = (path, token, call) => {
uni.navigateTo({
url: path
})
// if (token && !store.state.token) {
// return uni.showModal({
// title: '提示',
// content: '你还未登录,是否前往登录?',
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: '/pages/login/login'
// })
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// } else {
// uni.navigateTo({
// url: path
// })
// }
}
const nav = (e) => {
uni[e.type == 'nav' || !e.type ? 'navigateTo' : e.type == 'switchTab' ? 'switchTab' : 'navigateTo']({
url: e.path
})
}
return {
nav,
navTo
}
}
export default useNav