55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
import { defineStore } from 'pinia';
|
|
import { ref } from 'vue';
|
|
|
|
export const useAppStore = defineStore('app', () => {
|
|
|
|
const list = ref([
|
|
{userId: "1", headpic: "/images/1667520250923113.webp"},
|
|
{userId: "2", headpic: "/images/16555781459976085.webp"},
|
|
{userId: "3", headpic: "/images/16595363622946259.webp"},
|
|
{userId: "4", headpic: "/images/16620693455819353.webp"},
|
|
]);
|
|
|
|
function get(userId) {
|
|
return list.value.find(i=>i.userId==userId);
|
|
}
|
|
|
|
const walletConnected = ref(false);
|
|
const accountId = ref('');
|
|
const chainId = ref(0);
|
|
const presaleStatus = ref(0);
|
|
const step = ref(0);
|
|
const nonce = ref('');
|
|
const token = ref('');
|
|
|
|
function updateWalletStatus(_connected) {
|
|
walletConnected.value = _connected;
|
|
}
|
|
|
|
function updateAccount(_accountId) {
|
|
|
|
accountId.value = _accountId;
|
|
|
|
}
|
|
function updateChainID(_chainId) {
|
|
chainId.value = _chainId;
|
|
}
|
|
function updateStep(_step) {
|
|
step.value = _step;
|
|
}
|
|
function updateNonce(_nonce) {
|
|
nonce.value = _nonce;
|
|
}
|
|
function updateToken(_token) {
|
|
token.value = _token;
|
|
}
|
|
|
|
return { list, get,
|
|
accountId, updateAccount,
|
|
chainId, updateChainID,
|
|
walletConnected, updateWalletStatus,
|
|
step, updateStep,
|
|
nonce, updateNonce,
|
|
token, updateToken,
|
|
}
|
|
}) |