XIGUASSR
2022-11-11 c3afe3d4e0a8663b379510c38ec543ac8dbc2e5e
src/page/home/home.vue
@@ -35,8 +35,11 @@
            <div class="an_left_icon">
              <img :src="Announcement" alt />
            </div>
            <div class="an_right_message">
              {{ artList.artTitle }}
            <div class="an_right_message " >
              <div class="animate">
                {{ artList.artTitle }}
              </div>
            </div>
          </div>
        </div>
@@ -106,35 +109,37 @@
                  </div>
                </van-swipe-item> -->
                <van-swipe-item v-for="(item, index)  in proData" :key="index">
                  <div class="item_cont" :class="idx!=2?'item_conts':''" v-for="(item2, idx) in proData[currentIndex]" :key="idx">
                  <div class="item_cont" :class="idx!=2?'item_conts':''" v-for="(item2, idx) in proData[currentIndex]" :key="idx" @click="goDetail(item2)">
                    <div class="top_fo">
                      <div class="title">
                        {{ item2.indexName }}
                        {{ item2.name }}
                      </div>
                      <div class="numbers">
                        {{ item2.currentPoint }}
                        {{ item2.price }}
                      </div>
                      <div class="percentage" :class="item2.floatRate > 0 ? 'gree' : 'redd'">
                        <span style="font-weight: 500;">{{ item2.floatRate > 0 ? `+${item2.floatRate}%` :
                            `${item2.floatRate}%`
                      <div class="percentage" :class="item2.range > 0 ? 'gree' : 'redd'">
                        <span style="font-weight: 500;">{{ item2.range > 0 ? `${item2.range}` :
                            `${item2.range}`
                        }}</span>
                      </div>
                    </div>
                    <div class="bottom_fo">
                      <div class="title">
                        <span class="numberid" style="margin-right: 0.12rem;">{{ item2.indexCode }}</span>
                        <img v-for="items in item2.random" :src="Huo" alt style="width: 0.4rem;height: 0.4rem;" />
                        <span class="numberid" style="margin-right: 0.12rem;">{{ item2.symbol }}</span>
                        <div v-for="(items,indexs) in Number(item2.pnum.slice(0, 1))" style="width: 0.4rem;height: 0.4rem;display: flex;">
                          <img v-if="indexs<3" :src="Huo" alt style="width: 0.4rem;height: 0.4rem;" />
                        </div>
                      </div>
                      <div class="numbers" :class="item2.floatPoint > 0 ? 'gree' : 'redd'">
                        <span class="point">{{ item2.floatPoint > 0 ? `+${item2.floatPoint}%` : `${item2.floatPoint}%`
                        <span class="point">{{ item2.pnum
                        }}</span>
                      </div>
                      <div class="percentage">
                        <!-- <span class="aikesi">100X</span> -->
                        <el-tag key="100X"
                          style="width: 80%;text-align: center;height: 0.45rem!important;line-height: 0.45rem!important;">
                          {{ getNum1(item2.random) + 'X' }}
                          {{ getNum1(Number(item2.pnum.slice(0, 1))) + 'X' }}
                        </el-tag>
                      </div>
                    </div>
@@ -215,9 +220,6 @@
import AllList from "@/page/list/list-all";
import HomeList from "./components/home-list";
import Echart from "./components/echart.vue";
import {
  Toast
} from "mint-ui";
import * as api from "@/axios/api";
import Logo from "@/assets/img/icon_home_logo.png";
import Searchs from "@/assets/home/search.png";
@@ -299,18 +301,35 @@
      //123随机
      var num = Math.floor(Math.random() * 3 + 1);
      return num;
    },
    //构造随机数列表  50 100 200
    getNum1(num) {
      if (num == 1) {
        return 50;
      } else if (num == 2) {
        return 100;
      } else if (num == 3) {
      } else if (num >= 3) {
        return 200;
      }
    },
    goDetail(item) {
      this.$router.push({
        path: "/kline",
        query: {
          name: item.name,
          stockplate: item.stock_plate,
          code: item.symbol.substring(2, item.symbol.length),
          type: item.market,
          sok: this.filterSH(item.market),
          if_zhishu: '0',
        }
      });
    },
    filterSH(val) {
      if (val === "sh") {
        return 1;
      } else if (val === "bj" || val === "sz") {
        return 0;
      }
    },
    goJy(index){
@@ -338,7 +357,7 @@
      if (result.status === 0) {
        this.bannerList = result.data
      } else {
        Toast(result.msg)
        this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': result.msg});
      }
    },
    goOnline() {
@@ -357,13 +376,13 @@
      if (data.status === 0) {
        this.onlineService = data.data.onlineService
      } else {
        Toast(data.msg)
        this.$store.commit('elAlertShow',{'elAlertShow':true,'elAlertText': data.msg});
      }
    },
    async getStock() {
      let data = await api.getIndexMarket();
      for (var i = 0; i < data.data.length; i += 3) {
        this.proData.push(data.data.slice(i, i + 3));
      for (var i = 0; i < data.data.result.data.length; i += 3) {
        this.proData.push(data.data.result.data.slice(i, i + 3));
      }
    },
@@ -405,7 +424,8 @@
    },
    handleSearchClick() {
      this.loading = !this.loading;
      //this.loading = !this.loading;
      this.$router.push({path:"/trading-list",query:{type:1}});
    }
  },
  filters: {
@@ -451,8 +471,13 @@
    this.getArtList();
    this.getBanner()
    setInterval(() => {
      this.isGoTo = !this.isGoTo
      if(window.localStorage.getItem('USERTOKEN')){
        this.isGoTo = false;
      }else{
        this.isGoTo = !this.isGoTo
      }
    }, 10000);
    setTimeout(() => {
@@ -562,7 +587,7 @@
      align-items: center;
      .an_left_icon {
        width: 5%;
        width: 4%;
        height: 70%;
        display: flex;
        align-items: center;
@@ -576,10 +601,13 @@
      .an_right_message {
        width: 93%;
        height: 100%;
        display: flex;
        line-height: 0.559rem;
        align-items: center;
        align-content: center;
        font-size: 0.29rem;
        white-space: nowrap;
         overflow: hidden;
        // text-overflow:ellipsis;
      }
    }
  }
@@ -739,7 +767,7 @@
      }
      .title {
        width: 20%;
        width: 30%;
        height: 100%;
        display: flex;
        align-items: center;
@@ -761,6 +789,9 @@
      .numberid {
        font-size: 0.28rem;
        display: flex;
        line-height: 0.5rem;
      }
      .numbers {
@@ -773,7 +804,8 @@
      .point {
        font-size: 0.28rem;
        height: 0.5rem;
        line-height: 0.5rem;
      }
      .percentage {
@@ -781,6 +813,12 @@
        height: 100%;
        display: flex;
        align-items: center;
        text-align: center;
        justify-content: center;
      }
      .percentage span{
        height: 0.5rem;
        line-height: 0.5rem;
      }
    }
@@ -940,4 +978,63 @@
  border: 0.0513rem solid #41AC75;
  color: #41AC75;
}
.animate {
padding-left: 20px;
font-size: 0.29rem;
color: #000;
display: inline-block;
white-space: nowrap;
animation: 10s wordsLoop linear infinite normal;
}
@keyframes wordsLoop {
0% {
    transform: translateX(100%);
    -webkit-transform: translateX(100%);
}
100% {
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%);
}
}
@-webkit-keyframes wordsLoop {
0% {
    transform: translateX(100%);
    -webkit-transform: translateX(100%);
}
100% {
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%);
}
}
</style>