cardList.vue
2.77 KB
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
<template>
<section style="padding: 0 10px">
<van-row>
<van-col span="18">
<van-search
v-model="value"
placeholder="请输入搜索关键词"
@search="onSearch"
/>
</van-col>
<van-col span="6" style="margin-top: 5px;">
<van-button type="info" round block @click="toOwnCards">续费</van-button>
</van-col>
</van-row>
<ul v-if="cardList.length>0">
<li class="cardListWrap" v-for="i in cardList[0].parkList" @click="toBuyCardPage(i)">
<div class="van-ellipsis" style="padding: 20px 0 10px 10px">{{i.plName}}</div>
<div class="van-ellipsis" style="padding: 10px 0 20px 10px;color: #999">{{i.plAddress}}</div>
</li>
</ul>
<section style="text-align: center;padding-top: 20px" v-else>
<van-image :src="require('../../assets/images/cards/novipcard.png')"/>
<p>未找到会员卡</p>
</section>
</section>
</template>
<script>
import { queryVipCardListByOrgId, queryVipCardListByPlName } from "@/api/card/card";
export default {
name: "cardList",
data() {
return {
value: "",
cardList: []
};
},
created() {
this.queryVipCardListByOrgId();
},
methods: {
onSearch(val) {
console.log("111" + val);
// Toast(val);
let jsondata = {
orgId: this.$utils.orgId,
parkName: val,
saleChannel: "2"
};
jsondata.sign = this.$utils.signObject(jsondata);
queryVipCardListByPlName(jsondata).then(response => {
// console.log(response.data[0].parkList);
this.cardList = response.data;
console.log(response);
});
},
onCancel() {
// Toast('取消');
},
toBuyCardPage(i) {
this.$router.push({
name: "buyCardDetail",
query: {
plNo: i.plNo,
plName: i.plName,
plAddress: i.plAddress
}
}
);
},
queryVipCardListByOrgId() {
let jsondata = {
orgId: this.$utils.orgId,
latitude: "115.10114",
longitude: "40.616892",
type: "00",
limit: "1000",
saleChannel: "2" // 办理渠道, 1:APP 4:微信小程序
};
jsondata.sign = this.$utils.signObject(jsondata);
queryVipCardListByOrgId(jsondata).then(response => {
console.log(response.data);
this.cardList = response.data;
});
},
toOwnCards() {
this.$router.push({
name: "ownCards",
}
);
}
}
};
</script>
<style scoped>
.cardListWrap {
margin-top: 15px;
margin-left: 0px;
margin-right: 0px;
width: 100%;
height: 106px;
background: url("../../assets/images/cards/vipcardbg1.png") no-repeat;
background-size: 100% 100%;
font-size: 16px;
}
</style>