1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
| 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)
| }
| }
| }
| })
|
|