dcc
2024-06-13 24e2c4a6983d3ed1c67080b460f7e28f5e2e55f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
  <div class="listItem px-5">
      <van-list v-model:loading="loading" :finished="finished" :loading-text="$t('加载中') + '...'" :finished-text="$t('没有更多了')" @load="onLoad">
          <div v-for="(item, index) in list" :key="index" class="list-div flex">
              <div class="tab1">
                  <div class="list-title">{{ item.name }}</div>
                  <div class="text_color6">{{ item.productCode }}</div>
              </div>
              <div class="tab2">{{ item.marketPrice }}</div>
              <div class="tab3 text-right">{{ item.subscribeTotalNumber }}</div>
          </div>
      </van-list>
  </div>
</template>
 
<script setup>
import {onMounted, ref, computed, inject} from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { listListingAndlisted } from '@/service/ipo.api.js'
import { useI18n } from "vue-i18n";
const { t } = useI18n()
const route = useRoute()
const router = useRouter()
 
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
const index = ref(1)
 
onMounted(() => {
 
 
})
const stockType = inject('stockType')
const onLoad = () => {
    let params = {
      current: index.value,
      ipoStatus: 1,
      size: 10,
      type: stockType || 'US-stocks'
    }
    listListingAndlisted(params).then(res => {
      if(res.length) {
        list.value = list.value.concat(res)
      }
      index.value++
      loading.value = false;
      if (res.length < 10) {
        finished.value = true;
      }
    })
}
 
const getTime = (time) => {
  return time.split(' ')[0];
}
 
const goToDetail = (id) => {
  router.push({
      path: "/ipo/progress",
      query: {
          id
      }
  })
}
</script>
<style lang="scss" scoped>
.listItem {
  .flex-2 {
      flex: 2;
  }
 
  .tab1{
    width: 40%;
  }
  .tab2{
    width: 30%;
  }
  .tab3{
    width: 30%;
  }
 
  .list-div {
      padding: 20px 0;
 
      .list-title {
          width: 100px;
          text-overflow: ellipsis;
          // white-space: nowrap;
          overflow: hidden;
      }
  }
}</style>