lxf
2025-04-30 b4c4556a5eddf6708ec55b07e3edc15b2217842e
src/page/list/tradingList/data.list.vue
@@ -2,16 +2,16 @@
  <div class="list-data">
    <div class="header-box">
      <van-row type="flex" align="center" gutter="20">
        <van-col span="8">
        <van-col span="11">
          <div>
            {{ $t("hj313") }}
          </div>
        </van-col>
        <van-col span="3">
        <!-- <van-col span="3">
          <div style="text-align: right">
            {{ $t("市场") }}
          </div>
        </van-col>
        </van-col> -->
        <van-col :span="active == 'DZ' ? '12' : '7'">
          <div style="text-align: right">
            {{ $t("hj314") }}
@@ -31,7 +31,7 @@
            @select="onSelect"
          >
            <template #reference>
              <van-button type="primary">الترتيب</van-button>
              <van-button type="primary">{{ $t("排序") }}</van-button>
            </template>
          </van-popover>
        </van-col>
@@ -58,8 +58,13 @@
          v-for="(item, index) in listArr"
          :key="item.indexCode"
        >
          <van-row type="flex" align="center" gutter="20">
            <van-col span="8" style="padding-right: 0 !important;">
          <van-row
            type="flex"
            align="center"
            justify="space-between"
            gutter="20"
          >
            <van-col span="13" style="padding-right: 0 !important;">
              <div>
                <div class="tp">
                  <div class="collection" @click="optionszx(item)">
@@ -87,17 +92,17 @@
              </div>
            </van-col>
            <van-col span="3" v-if="active != 'HJ'">
            <!-- <van-col span="3" v-if="active != 'HJ'">
              <div style="text-align: right">
                {{ (item.gid || item.stockGid).toUpperCase() }}
              </div>
            </van-col>
            </van-col> -->
            <van-col :span="active == 'DZ' ? '12' : '7'">
            <van-col :span="active == 'DZ' ? '12' : '5'">
              <div style="text-align: right">
                <div class="tp">
                  <span class="price_color">
                    {{ item.nowPrice | _toLocaleString(false) }}
                    {{ item.nowPrice }}
                  </span>
                </div>
                <div class="bt" v-if="active != 'DZ'">
@@ -105,7 +110,7 @@
                </div>
              </div>
            </van-col>
            <van-col span="6" v-if="!['DZ', 'HJ'].includes(active)">
            <van-col span="6" v-if="!['DZ'].includes(active)">
              <div style="text-align: right">
                <div
                  class="tp right_bs"
@@ -115,17 +120,38 @@
                </div>
              </div>
            </van-col>
            <van-col span="6" v-if="active == 'DZ'">
              <div>
                <div style="text-align: center">
                  {{ $t("差价") }}{{ Math.abs(item.priceSpread) }}
                </div>
                <van-circle
                  v-model="currentRate"
                  :rate="Math.abs(item.priceSpreadPercentum)"
                  :speed="100"
                  :text="textCircle"
                  layer-color="#ebedf0"
                  color="#ee0a24"
                />
              </div>
            </van-col>
          </van-row>
          <div class="box-a" v-if="active == 'DZ'">
            <div class="box_a_left">
              {{ $t("kpsj") }}:{{
                $moment(item.startTime).format("DD-MM-YYYY hh:mm:ss A")
              }}
              <div class="box_a_left-t">
                {{ $t("gbsj") }}
              </div>
              <div class="box_a_left-b">
                {{ $moment(item.endTime).format("DD-MM-YYYY") }}
              </div>
            </div>
            <div class="box_a_right">
              {{ $t("gbsj") }}:{{
              <!-- {{ $t("gbsj") }}:{{
                $moment(item.endTime).format("DD-MM-YYYY hh:mm:ss A")
              }}
              }} -->
              <van-tag type="danger" size="large"
                >{{ $t("申请竞拍") }}
              </van-tag>
            </div>
          </div>
        </div>
@@ -201,16 +227,22 @@
      orderBy: "",
      refreshing: false,
      actions: [
        { text: "ترتيب", zh: "升序", val: "asc" },
        { text: "التخفيض", zh: "降序", val: "desc" },
        { text: "طبيعي", zh: "正常", val: "" }
      ]
        { text: this.$t("升序"), zh: "升序", val: "asc" },
        { text: this.$t("降序"), zh: "降序", val: "desc" },
        { text: this.$t("正常"), zh: "正常", val: "" }
      ],
      currentRate: 0
    };
  },
  beforeDestroy() {
    if (this.Trade) {
      this.Trade.close();
      console.log("WebSocket disconnected");
    }
  },
  computed: {
    textCircle() {
      return `${this.currentRate.toFixed(0)}%` + this.$t("溢价率");
    }
  },
  mounted() {
@@ -306,17 +338,29 @@
          data.data.list = Object.entries(data.data).map(([name, nowPrice]) => {
            let nowPriceArr = Object.entries(nowPrice);
            let nowPriceObj = {};
            nowPriceArr.map(item => {
              if (name === item[0]) {
                nowPriceObj.st_name = item[0];
                nowPriceObj.nowPrice = item[1];
              }
              nowPriceObj = {
                ...nowPriceObj,
                [item[0]]: item[1]
              };
            });
            return {
              name,
              st_name: nowPriceArr[0][0],
              nowPrice: nowPriceArr[0][1],
              stock_type: "HJ"
              stock_type: "HJ",
              ...nowPriceObj
            };
          });
        } else {
          //大宗
          opt.stockType = "";
          data = await api.stockgetDzList(opt);
          this.loadings = false;
          this.finished = true;
        }
      } else {
        // 自选
@@ -413,6 +457,7 @@
.box-a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-top: 10px;
}
@@ -482,4 +527,18 @@
  text-align: left;
  color: #14181f;
}
.box_a_left-t {
  background: #ee0a24;
  color: #fff;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem 0.2rem 0 0;
}
.box_a_left-b {
  background: #fff;
  color: #ee0a24;
  padding: 0.1rem 0.3rem;
  border-radius: 0 0 0.2rem 0.2rem;
  border: 1px #ee0a24 solid;
}
</style>