12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // 组件引用
- import { defineStore } from "pinia";
- // 接口引用
- // 公共方法引用
- import storage from "@/utils/storage";
- import common from "@/plugins/common.plugins.js";
- const stystemStores = defineStore(`${storage.get("nickName") + storage.get("tenantId")}_storage-stystem`, {
- state: () => ({
- homeList: {
- swiperBool: false,
- swiperIndex: 0,
- swiperTime: 5000,
- swiperList: [],
- cuIconList: [],
- recentlyUsed: [],
- },
- infoList: {
-
- },
- }),
- unistorage: true,
- actions: {
- /**
- * @九宫格页面跳转
- */
- navItemClick(item) {
- if (item.path) {
- item.sort = 0;
- this.homeList.recentlyUsed.push(item);
- this.homeList.recentlyUsed = common.uniq(this.homeList.recentlyUsed, "path");
- this.homeList.recentlyUsed.filter((el) => {
- if (el.path === item.path) {
- el.meta.icon = item.meta.icon;
- el.sort++;
- }
- });
- this.homeList.recentlyUsed = common.sortEvent(this.homeList.recentlyUsed, 1);
- if (item.path.indexOf("http") != -1) {
- uni.navigateTo({
- url: "/pages/common/webview/index?url=" + item.path,
- });
- } else {
- uni.navigateTo({
- url: item.path,
- });
- }
- } else {
- uni.showModal({
- title: "Tips",
- content: "此模块开发中~",
- showCancel: false,
- success: function (res) {
- if (res.confirm) {
- } else if (res.cancel) {
- }
- },
- });
- }
- }
- },
- });
- export default stystemStores;
|