1
PC-20250623MANY\Administrator
2025-07-06 580572e6a215291e6bc10faed249d6e13a00e8d8
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
<template>
  <!--  @click="itemClick(props.item)"-->
  <van-cell>
    <template #title>
      <div class="flex items-center">
        <img src="./bookmark.png" alt="bookmark" class="w-4 h-4 -ml-4" v-if="!props.type">
        <van-icon name="cross" size="24" class="text-down" v-if="props.type === 'edit'" />
        <fxPair @click-item="itemClick(props.item)" :item="item" />
      </div>
    </template>
    <template #value>
      <div class="flex justify-end">
        <!-- 搜索 -->
        <!-- <div class="flex flex-col" v-if="props.type === 'search'">
          <p class="flex text-primary justify-end items-center">
            <van-icon name="search" class="mr-2" />
            <span class="font-semibold text-lg">FXCM</span>
          </p>
          <p class="text-sm">
            forex
          </p>
        </div> -->
        <!-- 价格-->
        <div class="flex flex-col" @click="itemClick(props.item)">
          <p class="flex text-primary justify-end">
            <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>
          <p class="text-up text-sm" :class="item.change_ratio > 0 ? 'text-up' : 'text-down'">
            <span class="mr-2">{{ item.netChange }}</span>
            <span> {{ item.change_ratio }}%</span>
          </p>
        </div>
        <!-- 编辑右侧按钮 -->
        <div class="flex justify-end items-center ml-4" v-if="props.type === 'edit'">
          <van-icon name="exchange" size="20" />
        </div>
      </div>
    </template>
  </van-cell>
</template>
 
<script setup>
import fxPair from '@/components/fx-pair/index.vue'
import { ref } from 'vue'
const emits = defineEmits(['click-item'])
const props = defineProps({
  item: {
    type: Object,
    default() {
      return {}
    }
  },
  type: {
    type: String,
    default: ''
  }
})
 
 
const itemClick = (a) => {
  emits('click-item', props.item)
  // console.log(1111)
}
 
</script>