1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| import Vue from "vue";
| import Vuex from "vuex";
| import storage from "@/utils/storage";
|
| Vue.use(Vuex);
|
| const store = new Vuex.Store({
| state: {
| isShowToast:false, // 是否在展示Toast中
| remark:[], //填写订单备注
| shareLink:"", //分享链接
| verificationKey: "", //获取key表示验证通过
| distributionId:"", //分销员Id 如果当前账户从未登录过时记录
| hasLogin: storage.getHasLogin(),
| userInfo: storage.getUserInfo(),
| uuid: storage.getUuid(),
| token: "",
| // 活动弹窗状态
| activityPopup: {
| show: false,
| title: '',
| desc: '',
| image: '',
| endTime: 0
| }
| },
| mutations: {
| // 显示弹窗
| showActivityPopup(state, data) {
| state.activityPopup = {
| show: true,
| ...data // 合并传入的弹窗数据(标题、描述等)
| }
| console.log("Vuex 状态更新后:", state.activityPopup);
| },
| // 隐藏弹窗
| hideActivityPopup(state) {
| state.activityPopup.show = false
| },
| login(state, userInfo) {
| state.userInfo = userInfo || {};
| state.userName =
| userInfo.Name || userInfo.Nickname || userInfo.Username || "匿名用户";
| state.hasLogin = true;
| },
| logout(state) {
| state.userName = "";
| state.hasLogin = false;
| },
|
| // 设置填写订单中备注
| setRemark(state, remark) {
| state.remark = remark;
| }
| },
| actions: {},
| });
|
| export default store;
|
|