// stores/user.ts
import { defineStore } from 'pinia'
import { setAuthToken, clearAuthToken } from '@/utils/auth'
import type { IUserInfo } from '@/types/user'

export const useSysStore = defineStore('sys', {
  state: (): IUserInfo => ({
    language: uni.getStorageSync('appLanguage') || 'zh-CN',
    vipTypeDict: {
      1: '医学超V',
      2: '国学与心理学超V',
      4: '中医学VIP',
      5: '针灸学VIP',
      6: '肿瘤学VIP',
      7: '国学VIP',
      8: '心理学VIP',
      9: '中西汇通学VIP',
    },
    customerServicePhone: '021-08371305',
    orderStatusMap: {
      '0': '待付款',
      '3': '已完成',
    }
  }),

  getters: {
    
  },

  actions: {
    /** 设置语言 */
    setLanguage(language: string) {
      this.language = language
      uni.setStorageSync('appLanguage', language)
    }
  },
})
