Blame view

src/views/cards/Cards.vue 2.37 KB
8b40a4fc   刘淇   会员卡
1
2
3
  <template>
    <div style="height: 100%;display: flex;flex-direction: column;">
      <div style="flex: 1;overflow-y: auto;padding: 15px">
aabd3df4   刘淇   购买会员卡
4
        <div  class="noCardData" v-if="cardList.length == 0">
8b40a4fc   刘淇   会员卡
5
6
7
          <p>您目前没有任何会员卡,</p>
          <p>请绑定车牌通过认证后再购买会员卡!</p>
        </div>
aabd3df4   刘淇   购买会员卡
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  
        <div v-else>
          <div class="cardBg"  v-for="(i ,index) in cardList">
            <ul class="cardList">
              <li>
                会员卡- {{i.cardType=='1'?'年卡':(i.cardType=='2'?'半年卡':(i.cardType=='3'?'季卡':(i.cardType=='4'?'月卡':(i.cardType=='5'?'日卡':''))))}}
              </li>
              <li>
                绑定车牌号: {{ i.carNumber }}
              </li>
              <li>
                有效时间段: {{i.effDate}} 至 {{i.expDate}}
              </li>
              <li>
                卡名称: {{ i.cardName }}
              </li>
            </ul>
          </div>
          <!--cardType=='1'?'年卡':(cardType=='2'?'半年卡':(cardType=='3'?'季卡':(cardType=='4'?'月卡':(cardType=='5'?'日卡':''))))-->
  
  
8b40a4fc   刘淇   会员卡
29
        </div>
aabd3df4   刘淇   购买会员卡
30
31
32
  
  
  
8b40a4fc   刘淇   会员卡
33
      </div>
aabd3df4   刘淇   购买会员卡
34
      <x-button type="primary" @click.native="$router.push({path:'buyCard'})">购买会员卡</x-button>
8b40a4fc   刘淇   会员卡
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    </div>
  </template>
  
  <script>
  import { queryVipCardsByCustId } from "@/api/cards/cards";
  export default {
    name: "Cards",
    data() {
      return {
        cardList: []
      };
    },
    mounted() {
      this.queryVipCardsByCustId();
    },
    methods: {
      queryVipCardsByCustId: function() {
        let jsondata = this.$utils.commonParams();
        jsondata.sign = this.$utils.signObject(jsondata);
        queryVipCardsByCustId(jsondata).then(data => {
          console.log(data);
          if (data.code == 0) {
            let res = data.data;
aabd3df4   刘淇   购买会员卡
58
            this.cardList = res
8b40a4fc   刘淇   会员卡
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
          } else {
            this.$vux.toast.text(data.message, "top");
          }
        });
      }
    }
  };
  </script>
  
  <style scoped lang="scss">
    .noCardData {
      padding-top: 130px;
      background: url("../../assets/images/cards/nodata.png") no-repeat center 0;
      background-size: 121px 100px;
      text-align: center;
    }
  
    .cardBg {
      width: 100%;
      height: 150px;
      background: #26a2ff url("../../assets/images/cards/cards.png") no-repeat 20px 20px;
      background-size: 90% 90%;
      border-radius: 8px;
      margin-bottom: 15px;
    }
    .cardList{
      padding: 20px 0 0 20px;
      color: #fff;
      li{
        line-height: 30px;
      }
    }
  
  </style>