first commit

This commit is contained in:
duanshuwen
2026-05-25 23:40:50 +08:00
commit 30b9100b4a
569 changed files with 75942 additions and 0 deletions

1
src/store/index.js Normal file
View File

@@ -0,0 +1 @@
export * from "./modules";

26
src/store/modules/app.js Normal file
View File

@@ -0,0 +1,26 @@
import { defineStore } from "pinia";
import { devUrl, wssDevUrl } from "../../request/base/baseUrl";
export const useAppStore = defineStore("app", {
state() {
return {
sceneId: "", // 分身场景id
serverConfig: { // 服务器配置
baseUrl: devUrl, // 服务器基础地址
wssUrl: wssDevUrl, // 服务器ws地址
},
};
},
getters: {},
actions: {
setSceneId(data) {
this.sceneId = data;
},
setServerConfig(data) {
this.serverConfig = data;
},
},
unistorage: true,
});

View File

@@ -0,0 +1,6 @@
import { useAppStore } from "./app";
import { useSelectedDateStore } from "./selectedDate";
import { usePictureStore } from "./picture";
import { useLocationStore } from "./location";
export { useAppStore, useSelectedDateStore, usePictureStore, useLocationStore };

View File

@@ -0,0 +1,19 @@
import { defineStore } from "pinia";
export const useLocationStore = defineStore("location", {
state() {
return {
latitude: 0, // 纬度
longitude: 0, // 经度
};
},
actions: {
setLocationData(data) {
this.latitude = data.latitude;
this.longitude = data.longitude;
},
},
unistorage: true,
});

View File

@@ -0,0 +1,17 @@
import { defineStore } from "pinia";
export const usePictureStore = defineStore("picture", {
state() {
return {
previewImageData: [], // 预览图片数据
};
},
actions: {
setPreviewImageData(data) {
this.previewImageData = data;
},
},
unistorage: true,
});

View File

@@ -0,0 +1,21 @@
import { defineStore } from "pinia";
export const useSelectedDateStore = defineStore("selectedDate", {
state() {
return {
selectedDate: {
startDate: "",
endDate: "",
totalDays: 1,
},
};
},
actions: {
setData(data) {
this.selectedDate = data;
},
},
unistorage: true,
});