import {reactive, toRefs} from 'vue' import {defineStore} from 'pinia' export const useBasicInfoStore = defineStore('basicInfo', () => { //试卷type,免费--0,会员免费--1,收费--2 //支付方式,0(AccountBalancePay),1(AliPay),2(WeChatPay),3(BankPay) //订单类型 0(RECHARGE),1(PAPER),2(MALL) const state = reactive({ nickName: '', vip: true, vipPrice: 30, vipDiscount: 7.5, vipTerm: '2024-10-10', balance: 0, phone: '13888888888', testTitle: '', typeTitle: '', typeIndex: 1,//单选题-1,多选题-2,填空题-3,名词解释-4,判断题-5,简答题-6,论述题-7,分析题-8,案例选择题-9,案例分析题-10, userinfo: { avatarurl: "", birthday: null, cellphone: null, city: null, country: null, createtime: "", diamondtype: null, discountrate: null, gender: null, id: "", idcard: null, isdeleted: false, language: null, name: null, nickname: "", openid: "", password: null, province: null, randomcode: null, remark: null, token: "", type: null, updatetime: null, }, token: '', hasLogin: false, appconfig: [], payInfo: {}, routePage: '', updatecount: 0, paperId: null, questionType: null, category: null, product: null, }) return {...toRefs(state)} }, { // persist: true, persist: { storage: { getItem(key) { return uni.getStorageSync(key) }, setItem(key, value) { uni.setStorageSync(key, value) } } } })