diff --git a/src/api/custom.ts b/src/api/custom.ts new file mode 100644 index 00000000..26af9682 --- /dev/null +++ b/src/api/custom.ts @@ -0,0 +1,13 @@ +import request from '@/utils/request'; + +class CustomAPI { + /** 分类品牌查询接口*/ + static getCustominit() { + return request({ + url: `diyapi/custominit`, + method: 'post', + }); + } +} + +export default CustomAPI; diff --git a/src/store/modules/custom.ts b/src/store/modules/custom.ts new file mode 100644 index 00000000..5b58d086 --- /dev/null +++ b/src/store/modules/custom.ts @@ -0,0 +1,29 @@ +import { ref } from 'vue'; +import { defineStore } from 'pinia'; + +export const DataSourceStore = defineStore('dataSource', () => { + interface product_list { + id: number; + name: string; + }; + // 上传是否需要调接口判断 + const is_data_source_api = ref(false); + // 数据源 + const data_source_list = ref([]); + // 存储上传分类列表 + const set_data_source = (category: product_list[], brand: product_list[]) => { + data_source_list.value = category; + is_data_source_api.value = true; + }; + // 如果为false 则转为true + const set_is_shop_api = (bool: boolean) => { + is_data_source_api.value = bool; + }; + + return { + data_source_list, + is_data_source_api, + set_data_source, + set_is_shop_api, + }; +});