1
PC-20250623MANY\Administrator
2025-09-18 360bd2a01c720adce45266391f7bfbc086803502
src/components/index-component.vue
@@ -1,15 +1,17 @@
<template>
  <div class="index_component" :class="dataObj.chg > 0 ? 'bg-green' : 'bg-red'" @click="toLine">
  <div class="index_component" :class="dataObj.chg < 0 ? 'bg-green' : 'bg-red'" @click="toLine">
    <div class="item_title">
      <span class="line-one">{{ dataObj.name }}</span>
      <span class="line-one">{{ dataObj.symbol }}</span>
    </div>
    <div class="item_price">{{ dataObj.last }}</div>
    <div class="item_index flex-between">
      <span>{{ dataObj.chg }}</span>
      <span>{{ dataObj.chgPct }}%</span>
    </div>
    <div style="width:100%;flex:1">
      <Echart :ids="ids" :colorType="dataObj.chg / 1" :data="klist"></Echart>
    <div style="width:100%;flex:1" class="flex-center">
      <!-- <Echart :ids="ids" :colorType="dataObj.chg / 1" :data="klist"></Echart> -->
      <img src="@/assets/img/down_5.png" style="width:80%;" v-if="dataObj.chg < 0" />
      <img src="@/assets/img/down_4.png" style="width:80%;" v-else />
    </div>
  </div>
</template>
@@ -42,19 +44,20 @@
  methods: {
    // 跳转到指数图
    toLine() {
      return
      // 点击进入详情
      const obj = {
        pid: this.dataObj.id || "",
        type: this.dataObj.stockType || ""
        type: "US",
      };
      window.localStorage.setItem("kLine", JSON.stringify(obj));
      this.$router.push({
        path: "/kLineIndex",
        // path: "/kline",
        query: {
          // if_us: 1,
          code: this.dataObj.id,
          type: this.dataObj.stockType
          type: "US"
        }
      });
    }
@@ -63,15 +66,13 @@
</script>
<style lang="less" scoped>
@red: #ee0a24;
.bg-red {
  background-color: rgba(red, 0.1);
  color: @red;
  background: linear-gradient(180deg, #2d1b23, #161a23);
  color: #f54346;
}
.bg-green {
  background-color: #f3fbf9;
  background: linear-gradient(180deg, #152B28, #161A23);
  color: green;
}
@@ -86,7 +87,8 @@
  .item_title {
    padding: 0 0.5em;
    font-size: 0.35em;
    color: #333;
    color: #fff;
    text-align: center;
    span {
      width: 100%;