10.10综合交易所原始源码_移动端
1
admin
2026-02-10 c547081aa61be5c7b6d4c12853c675954c2156eb
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<template>
  <div id="adScreeningSelectItemPage">
    <div class="px-8">
      <div class="flex justify-between box-border items-center">
        <div class="text-grey text-26">{{ $t(title) }}</div>
        <div class="text-26" @click="show = !show">
          <span class="mr-4 text-color">{{ $t('全部') }}</span>
          <van-icon name="arrow-down" class="text-color" />
        </div>
      </div>
      <div class="select-wrapper mt-9" :class="{ 'show': show }">
        <div v-if="dataType() === '[object Object]'"
          class="relative h-20 text-center rounded-xl text-28 c2cColor box-border tabBackground flex justify-center items-center"
          @click="handlerClick({ code: 99 })" :class="{ 'active': value === 99 }">
          <img v-show="value === 99" class="absolute top-0 left-0 w-full h-full" src="@/assets/image/c2c/Group317.png"
            alt="">
          {{ $t('全部') }}
        </div>
        <div
          class="relative text-center rounded-xl text-28 c2cColor box-border tabBackground px-1 py-2 flex justify-center items-center"
          v-for="(item, index) in options" :key="index" @click="handlerClick(item)" :class="{ 'active': a(value, item) }">
          <img v-show="a(value, item)" class="absolute top-0 left-0 w-full h-full" src="@/assets/image/c2c/Group317.png"
            alt="">
          {{ item.title || item.name }}
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import {
  Icon
} from "vant";
 
export default {
  name: "SelectItem",
  props: ['title', 'options', 'value'],
  data() {
    return {
      activeIndex: 0,
      show: false,
    }
  },
  created() {
    // const type = Object.prototype.toString.call(this.options)
    // if (type === '[object Array]') {
    //   this.activeIndex = 0;
    // } else {
    //   const keys = Object.keys(this.options)
    //   console.log(keys[0]);
    //   this.activeIndex = this.options[keys[0]].code;
    // }
  },
  methods: {
    handlerClick(item) {
      let val;
      if (item.method_type || item.method_type === 0) {
        console.log(item.method_type);
        val = item.method_type
      } else {
        val = item.code
      }
      this.$emit('input', val)
    },
    dataType() {
      return Object.prototype.toString.call(this.options)
    },
    a(a, item) {
      let val;
      if (item.method_type || item.method_type === 0) {
        val = item.method_type
      } else {
        val = item.code
      }
      return a === val;
    }
  },
  components: {
    [Icon.name]: Icon,
  }
}
</script>
 
<style lang="scss" scoped>
#adScreeningSelectItemPage {
  .text-color {
    color: #868D9A;
  }
 
  .show {
    height: 310px !important;
  }
 
  .active {
    border-color: #1D91FF !important;
  }
 
  .select-wrapper {
    overflow-y: scroll;
    height: 82px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    transition: all ease .4s;
    //background: #00ff33;
 
    &>div {
      border: 1px solid $tab_background;
    }
  }
}
</style>