| | |
| | | SET_KEFU, |
| | | SET_THEME, |
| | | } from "@/store/const.store"; |
| | | import { _getCoins, _getExchangeRate } from "@/API/home.api"; |
| | | import { _getCoins, _getExchangeRate, itemlist } from "@/API/home.api"; |
| | | import { customer } from "@/API/user.api"; |
| | | |
| | | export default { |
| | |
| | | currency: {}, // 当前汇率 |
| | | coinArr: [], // 解构出来的币种数组 |
| | | hotArr: [], // 热门币种 |
| | | newcoinArr: [], // 热门币种 |
| | | coinList: [], // 品种 |
| | | kefu_url: "", |
| | | theme: "light", |
| | |
| | | coinList: (state) => state.coinList, |
| | | coinArr: (state) => state.coinArr, |
| | | hotArr: (state) => state.hotArr, |
| | | newcoinArr: (state) => state.newcoinArr, |
| | | currency: (state) => state.currency, |
| | | kefu_url: (state) => state.kefu_url, |
| | | theme: (state) => state.theme, |
| | |
| | | [SET_CURRENCY](state, currency) { |
| | | state.currency = currency; |
| | | }, |
| | | SET_NEW_CION_LIST(state, currency) { |
| | | const arr = []; |
| | | currency.map((item) => { |
| | | arr.push(item.tokenCode); |
| | | }); |
| | | |
| | | state.newcoinArr = arr; |
| | | }, |
| | | |
| | | [SET_COIN_SYMBOL_ARR](state, list) { |
| | | const arr = []; |
| | | const hots = []; |
| | |
| | | commit(SET_COIN_LIST, list); // 拆分的单个数据 |
| | | Promise.resolve(list); |
| | | }, |
| | | async NEW_CION_LIST({ commit, state }) { |
| | | // 获取配置的币种 |
| | | |
| | | const list = await itemlist().catch((err) => { |
| | | Promise.reject(err); |
| | | }); |
| | | |
| | | commit("SET_NEW_CION_LIST", list); // 拆分的单个数据 |
| | | Promise.resolve(list); |
| | | }, |
| | | async [SET_CURRENCY]({ commit, state, rootState }) { |
| | | // 设置汇率 |
| | | console.log("rootState", rootState); |