jhzh
2024-09-23 e678ec74066a2c5b5b3b404d3344bffbd3cf59bd
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>
  <div class="pl-30 pr-30 pt-55 payment_item c2cColor" :class="{ 'border-b-grey': item.type === 'CN' }">
    <div class="title flex justify-between w-full">
      <div class="flex items-center">
        <div class="w-11 h-36 mr-22 rounded-2xl" :style="{ 'background': color }"></div>
        <div class="font-37">{{ $t(item.methodName) }}</div>
      </div>
      <div class="icon edit" @click="editClick(item, $event)">
        <img class="edit w-32 h-32" src="~@/assets/image/payment/edit.png" alt="">
      </div>
    </div>
    <div class="mt-20 font-32">{{ item.realName }}</div>
    <div class="number">
      <div class="font-700 mt-18 font-37" :class="{ 'ml-44': item.type === 'EN', 'font-32': item.type === 'EN' }">
        {{ item.paramValue1 ? item.paramValue1 : fullNumber(item.paramValue1) }}
      </div>
    </div>
  </div>
</template>
 
<script>
import { getRandom, } from "@/utils/utis";
 
export default {
  name: "CarItem",
  props: ["item", "type"],
  data() {
    return {
      color: "#",
    }
  },
  created() {
    for (let i = 0; i < 6; i++) {
      this.color += getRandom();
    }
    console.log(this.color)
  },
  methods: {
    fullNumber(number) {
      if (this.item.type === 'CN') {
        return number.replace(/(\d{4})/g, "$1 ").trim()
        // return number;
      } else {
        return number;
      }
    },
    // 进入银行卡详情页面
    editClick(data) {
      this.$router.push({
        name: 'bankCarDetail',
        query: {
          id: data.id,
          type: 'CN',
          configType: 'edit'
        }
      })
    }
  },
  computed: {}
}
</script>
 
<style lang="scss" scoped>
.pt-55 {
  padding-top: 55px;
  ;
}
 
.payment_item {
  @include themify() {
    background: themed("tab_background");
  }
 
  @include themify() {
    border-bottom: 1px solid themed("divi_line");
  }
}
</style>