dcc
2024-07-17 f9f136972efce01e7ac5a82e2a3abf343d1ce5a7
src/page/user/Warehouse.vue
@@ -1,7 +1,7 @@
<template>
  <div class="ware">
    <div style="padding: 0 0.4rem 0.4rem">
      <div class="tabs-box" onscroll="handleScroll">
      <!-- <div class="tabs-box" onscroll="handleScroll">
        <div
          v-for="(item, index) in tabsArr"
          :key="index"
@@ -12,7 +12,7 @@
        >
          {{ item.title }}
        </div>
      </div>
      </div> -->
      <template v-if="active === '1'">
        <div v-for="(item, index) in tabsArr" :key="index">
@@ -47,45 +47,45 @@
  components: { card, itemCard, dataList },
  data() {
    return {
      actives: "1",
      active: "1",
      actives: "2",
      active: "2",
      activeObj: {},
      tabsArr: [
        // {
        //   title: this.$t("hometips"),
        //   name: "1",
        //   bgc: "rgb(8, 82, 196)",
        //   laber: "ALL",
        //   symbolCode: "USD",
        //   symbol: "$",
        // },
        {
          title: this.$t("hometips"),
          name: "1",
          bgc: "rgb(8, 82, 196)",
          laber: "ALL",
          symbolCode: "USD",
          symbol: "$",
        },
        {
          title: this.$t("mggs"),
          assname: this.$t("美股总资产"),
          title: this.$t("ydgs"),
          assname: this.$t("印股总资产"),
          name: "2",
          bgc: "rgb(12, 175, 226)",
          laber: "US",
          symbolCode: "USD",
          symbol: "$",
          laber: "IN",
          symbolCode: "INR",
          symbol: "₹",
        },
        {
          title: this.$t("马来西亚"),
          assname: this.$t("馬股总资产"),
          name: "4",
          bgc: "rgb(163, 91, 255)",
          laber: "MAS",
          symbolCode: "MYR",
          symbol: "RM",
        },
        {
          title: this.$t("港股"),
          assname: this.$t("港股总资产"),
          name: "5",
          bgc: "rgb(255 91 230)",
          laber: "HK",
          symbolCode: "HKD",
          symbol: "HK$",
        },
        // {
        //   title: this.$t("马来西亚"),
        //   assname: this.$t("馬股总资产"),
        //   name: "4",
        //   bgc: "rgb(163, 91, 255)",
        //   laber: "MAS",
        //   symbolCode: "MYR",
        //   symbol: "RM",
        // },
        // {
        //   title: this.$t("港股"),
        //   assname: this.$t("港股总资产"),
        //   name: "5",
        //   bgc: "rgb(255 91 230)",
        //   laber: "HK",
        //   symbolCode: "HKD",
        //   symbol: "HK$",
        // },
      ],
      getMoneyList: [],
    };
@@ -94,13 +94,11 @@
    this.getMoneys();
  },
  mounted() {
    if (this.$route.query.index == "0") {
      let arr = this.tabsArr.filter((item) => item.name == 4)[0];
    if (this.$route.query.buyType) {
      let arr = this.tabsArr.filter(
        (item) => item.laber == this.$route.query.buyType
      )[0];
      this.onClick(arr);
    } else if (this.$route.query.index == "1") {
      let arr = this.tabsArr.filter((item) => item.name == 2)[0];
      this.onClick(arr);
    } else {
    }
  },
  methods: {
@@ -125,21 +123,17 @@
        });
        let obj = arr.filter((item) => item.name == this.active)[0];
        this.activeObj = obj;
        console.log(obj, "0000000", this.tabsArr);
        this.tabsArr = arr;
        this.$forceUpdate(); // 强制Vue重新渲染
      }
    },
    onClick(e) {
      console.log(e, "====");
      this.active = e.name;
      this.activeObj = e;
      this.getMoneys();
      if (e.name !== "1") {
        this.$refs.dataListref.getList(e.laber);
      }
      // console.log(e);
    },
  },
};