zj
2024-06-03 96140d8eb2531144828dffe2ad8c19d0d9431009
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
  <div id="full" class="w-full h-full c2cCollection mainBackground">
    <assets-head :title="$t('C2C收款方式')" :backFunc="() => $router.replace('/c2cTrade')" />
    <!--  判断是否有收款方式  -->
    <div v-if="paymentList.length === 0" class="pt-50 pb-78 text-center bg-white">
      <div class="">
        <img class="w-170 h-170" src="~@/assets/image/c2c/23@3x1.png" alt="">
      </div>
      <div class="mt-8 text-grey font-24">{{$t('暂无支持的收款方式')}}</div>
    </div>
    <div v-else>
      <car-item
          class="pb-36"
          v-for="(item, index) in paymentList"
          :key="index"
          :item="item"
          @click.native="enterCollection(item, $event)"
      />
    </div>
 
  </div>
</template>
 
<script>
import otcApi from "@/API/otc";
import {Collapse, CollapseItem, Icon} from "vant";
import CarItem from "@/page/placeAnOrder/page/payment-method/CarItem";
import assetsHead from "@/components/assets-head";
 
export default {
  name: "c2cCollection",
  props: ['isEmpty', 'id'],
  data() {
    return {
      show: true,
      activeNames: [],
      paymentList: [],
      // carData: [
      //   {
      //     title: "银行卡",
      //     number: "4367421420489044633",
      //     name: "James",
      //     bankName: "中国农业银行",
      //     desc: "北京朝阳路支行",
      //     type: 'CN'
      //   },
      //   {
      //     title: "银行卡",
      //     number: "4367421420489041111",
      //     name: "James",
      //     bankName: "中国银行",
      //     desc: "北京朝阳路支行",
      //     type: 'CN'
      //   },
      // ]
    }
  },
  created() {
    // otcApi.ctcPaymentMethodPayList({id: this.id}).then(res => {
    //   this.paymentList = res.data;
    //   console.log(this.paymentList);
    // })
    otcApi.ctcPaymentMethodUserPay({ id: this.id, language: this.$i18n.locale }).then(res => {
      console.log('d111', res)
      this.paymentList = res.data;
    })
  },
  methods: {
    change() {
      setTimeout(() => {
        if (this.activeNames.length > 0) {
 
          this.show = false;
        } else {
          this.show = true;
        }
      }, 200)
    },
    // 折叠面板隐藏
    hide() {
      this.$refs.collapseItem.toggle(false);
      this.show = true;
    },
    // 返回出售界面
    enterCollection(paymentItem, e) { // 获取银行卡号
 
      if (e.target.className.indexOf('edit') === -1) {
        this.$router.replace({
          name: 'c2cTrade',
          query: {
            type: this.$route.query.type,
            total: this.$route.query.total,
            data:this.$route.query.data,
            reciveType: JSON.stringify(paymentItem),
          }
        })
      }
    }
  },
  components: {
    [Icon.name]: Icon,
    [Collapse.name]: Collapse,
    [CollapseItem.name]: CollapseItem,
    assetsHead,
    CarItem,
  }
}
</script>
 
<style lang="scss" scoped>
.c2cCollection{
  ::v-deep .van-cell{
    background: #F5F5F5;
  }
  ::v-deep .van-cell {
    background: #F5F5F5;
  }
  ::v-deep .van-collapse-item__wrapper {
    background: #F5F5F5;
  }
  ::v-deep .van-collapse-item__content {
    padding: 0;
  }
}
::v-deep .van-cell {
  background: #F5F5F5;
}
::v-deep .van-collapse-item__wrapper {
  margin-top: 36px;
}
::v-deep .van-collapse-item__content {
  padding: 0;
}
</style>