lxf
2025-07-16 8588fe30f17d0d28190a279aab8675de0dbf1a5b
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
<template>
  <van-cell-group>
    <van-cell v-for="(item, index) in list" :key="item.symbol" @click="itemClick(item)">
      <template #title>
        <div class="font-13 text-gray">
          <span class="mr-1" v-if="item.netChange > 0">+{{ item.netChange }}</span>
          <span class="mr-1" v-else>{{ item.netChange }}</span>
          <span :class="item.change_ratio > 0 ? 'text-up' : 'text-down'">{{ item.change_ratio }}%</span>
        </div>
        <div class="font-bold text-base" style="color: #1F2025">{{ item.symbol }}</div>
        <div class="text-gray">
          <span>{{ item.current_time ? item.current_time.slice(11) : '-' }}</span>
        </div>
      </template>
      <template #value>
        <div class="flex justify-end h-full flex-wrap">
          <div class="mr-2.5">
            <p class="flex text-primary justify-end" :class="item.open < 1 ? 'text-up' : 'text-down'">
              <span class="font-semibold text-lg">{{
                item.open.toString().substr(0, item.open.toString().length
                  - 1)
              }}</span>
              <span class="text-xs">{{ item.open.toString().substr(item.open.toString().length - 1) }}</span>
            </p>
            <div class="text-gray">
              <span class="mr-1.5">H: {{ item.high }}</span>
            </div>
          </div>
          <div>
            <p class="flex text-primary justify-end" :class="item.close < 1 ? 'text-up' : 'text-down'">
              <span class="font-semibold text-lg">{{
                item.close.toString().substr(0, item.close.toString().length
                  - 1)
              }}</span>
              <span class="text-xs">{{ item.close.toString().substr(item.close.toString().length - 1) }}</span>
            </p>
            <div class="text-gray">
              <span>L: {{ item.low }}</span>
            </div>
          </div>
        </div>
      </template>
    </van-cell>
  </van-cell-group>
</template>
 
<script setup>
const props = defineProps({
  list: {
    type: Array,
    default() {
      return []
    }
  }
})
const emits = defineEmits(['click-item'])
const itemClick = (item) => {
  emits('click-item', item)
}
</script>
 
<style scoped lang="scss">
.text-up {
  color:  $active_line;
}
 
:deep(.van-cell__title){
  width: 120px;
  flex: none;
  color: var(--van-cell-value-color);
 
}
 
:deep(.van-cell__value){
  flex: 1;
  color: var(--van-cell-text-color);
}
</style>