first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

54
hooks/useNav.js Normal file
View File

@@ -0,0 +1,54 @@
import {
ref,
watch
} from 'vue';
import {
Store
} from '@/store';
const store = Store();
export function useNav() {
const navTo = (path, token, call) => {
if (call) {
uni.makePhoneCall({
phoneNumber: '17707569278'
});
return
}
const Authorization = uni.getStorageSync('Authorization') || ''
if (token && !Authorization) {
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