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

View File

@@ -0,0 +1,44 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const store_index = require("../store/index.js");
function useNav() {
const navTo = (path, token, call) => {
if (call) {
common_vendor.index.makePhoneCall({
phoneNumber: "17707569278"
});
return;
}
console.log(token, "token");
console.log(store_index.store.state.token, "store.state.token");
if (token && !store_index.store.state.token) {
return common_vendor.index.showModal({
title: "提示",
content: "你还未登录,是否前往登录?",
success: function(res) {
if (res.confirm) {
common_vendor.index.navigateTo({
url: "/pages/login/login"
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
} else {
common_vendor.index.navigateTo({
url: path
});
}
};
const nav = (e) => {
common_vendor.index[e.type == "nav" || !e.type ? "navigateTo" : e.type == "switchTab" ? "switchTab" : "navigateTo"]({
url: e.path
});
};
return {
nav,
navTo
};
}
exports.useNav = useNav;