1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import { address, store, goods, express } from "@/api/main";
- // 省市区
- export function useAddress() {
- const addressOptions = ref([]);
- const getAddress = () => {
- address().then((res) => {
- if (res.code === 0) {
- addressOptions.value = res.data;
- }
- });
- };
- return { addressOptions, getAddress };
- }
- // 店铺
- export function useStore() {
- const storeOptions = ref([]);
- const getStore = () => {
- store().then((res) => {
- if (res.code === 0) {
- storeOptions.value = res.data.records;
- }
- });
- };
- return { storeOptions, getStore };
- }
- // 产品型号
- export function useGoods() {
- const goodsForm = ref({
- pageNum: 1,
- pageSize: 10,
- });
- const goodsOptions = ref([]);
- const getGoods = () => {
- goods(goodsForm.value).then((res) => {
- if (res.code === 0) {
- goodsOptions.value = res.data.records;
- }
- });
- };
- return { goodsForm, goodsOptions, getGoods };
- }
- // 物流公司
- export function useExpress() {
- const expressOptions = ref({});
- const getExpress = (e) => {
- express({ name: e }).then((res) => {
- expressOptions.value = res
- });
- };
- return { expressOptions, getExpress };
- }
- // 非接口共用
- export function useCommon() {
- // 推送状态
- const pushStatusOptions = ref([
- { value: 0, label: "待推送" },
- { value: 1, label: "成功" },
- { value: 2, label: "失败" },
- ]);
- // 售后类型
- const applyTypeOptions = ref([
- { value: 1, label: "补发" },
- { value: 2, label: "换新" },
- { value: 3, label: "维修" },
- ]);
- // 维修审核
- const repairStatusOptions = ref([
- { value: 1, label: "审核通过" },
- { value: 2, label: "审核失败" },
- { value: 3, label: "待审核" },
- ]);
- // 维修类型
- const repairTypeOptions = ref([
- { value: 1, label: "保内维修" },
- { value: 2, label: "保外维修" },
- ]);
- return {
- pushStatusOptions,
- applyTypeOptions,
- repairStatusOptions,
- repairTypeOptions,
- };
- }
|