first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export default {
getCarList: (state) => state.car.carList,
getTheme: (state) => state.setting.theme
}

View File

@@ -0,0 +1,20 @@
import Vue from 'vue'
import Vuex from 'vuex'
import common from "./modules/public";
import car from "./modules/car";
import setting from "./modules/setting";
import getters from "./getters";
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
common,
car,
setting
},
getters
})
export default store

View File

@@ -0,0 +1,26 @@
import http from "@/service";
export default {
state: {
carList: []
},
getters: {},
mutations: {
SET_LIST(state, data) {
state.carList = data;
}
},
actions: {
// 获取购物车商品的数量
async HttpCarList({ commit }) {
let res = await http.car.CarList();
commit("SET_LIST", res)
},
// 商品添加购物车
async addCarList({ commit }, params) {
let res = await http.car.addCar(params)
}
}
}

View File

@@ -0,0 +1,6 @@
export default {
state: {},
getters: {},
mutations: {},
actions: {}
}

View File

@@ -0,0 +1,8 @@
export default {
state: {
theme: "red"
},
getters: {},
mutations: {},
actions: {}
}