From 35f3f260f3d3c51ac2256899ade3b9a144b46b28 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Fri, 19 Apr 2024 05:58:04 +0800
Subject: [PATCH] first

---
 src/store/modules/home.store.js |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/store/modules/home.store.js b/src/store/modules/home.store.js
index 280a90f..edf6ef0 100644
--- a/src/store/modules/home.store.js
+++ b/src/store/modules/home.store.js
@@ -6,7 +6,7 @@
   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 {
@@ -15,6 +15,7 @@
     currency: {}, // 当前汇率
     coinArr: [], // 解构出来的币种数组
     hotArr: [], // 热门币种
+    newcoinArr: [], // 热门币种
     coinList: [], // 品种
     kefu_url: "",
     theme: "light",
@@ -23,6 +24,7 @@
     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,
@@ -40,6 +42,15 @@
     [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 = [];
@@ -68,6 +79,16 @@
       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);

--
Gitblit v1.9.3