Commit e7ca4bcb4fd91517631e2702508f47339ae298eb

Authored by 刘淇
1 parent d3808923

会员卡

src/api/card/card.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +export function queryVipCardListByOrgId(params) { //查询停车场-会员卡-根据orgID
  4 + return request({
  5 + url: 'parkvip/queryVipCardListByOrgId',
  6 + method: 'post',
  7 + data: params
  8 + })
  9 +}
  10 +
  11 +
  12 +export function queryVipCardListByPlName(params) { //搜索有会员卡的停车场
  13 + return request({
  14 + url: 'parkvip/queryVipCardListByPlName',
  15 + method: 'post',
  16 + data: params
  17 + })
  18 +}
  19 +
  20 +export function queryVipCardByPlNo(params) { //查询某个停车场的 具体的会员卡信息
  21 + return request({
  22 + url: 'parkvip/queryVipCardByPlNo',
  23 + method: 'post',
  24 + data: params
  25 + })
  26 +}
... ...
src/router/index.js
1   -import Vue from 'vue'
2   -import Router from 'vue-router'
3   -import plateNumber from '@/views/parkPay/plateNumber'
  1 +import Vue from "vue";
  2 +import Router from "vue-router";
  3 +import plateNumber from "@/views/parkPay/plateNumber";
4 4 // import parkRecord from '@/views/parkPay/parkRecord'
5 5 // import selfNav from '@/views/mySelf/selfNav'
6   -
7   -Vue.use(Router)
8   -
  6 +Vue.use(Router);
9 7 export default new Router({
10 8 routes: [
11 9 {
12   - path: '/',
  10 + path: "/",
13 11 redirect: {
14   - name: 'plateNumber'
  12 + name: "plateNumber"
15 13 }
16 14 },
17 15 // {
... ... @@ -19,155 +17,119 @@ export default new Router({
19 17 // name: 'navigation',
20 18 // component: navigation
21 19 // },
22   -
23 20 {
24   - path: '/parkRecord',
25   - name: 'parkRecord',
  21 + path: "/parkRecord",
  22 + name: "parkRecord",
26 23 component: () => import("@/views/parkPay/parkRecord.vue")
27 24 },
28 25 {
29   - path: '/plateNumber',
30   - name: 'plateNumber',
  26 + path: "/plateNumber",
  27 + name: "plateNumber",
31 28 component: plateNumber
32 29 },
33   -
34 30 {
35   - path: '/orderPay',
36   - name: 'orderPay',
  31 + path: "/orderPay",
  32 + name: "orderPay",
37 33 component: () => import("@/views/parkPay/orderPay.vue")
38 34 },
39   -
40   -
41 35 {
42   - path: '/map',
43   - name: 'map',
  36 + path: "/map",
  37 + name: "map",
44 38 component: () => import("@/views/map/map.vue")
45 39 },
46   -
47 40 {
48   - path: '/parkList',
49   - name: 'parkList',
  41 + path: "/parkList",
  42 + name: "parkList",
50 43 component: () => import("@/views/map/parkList.vue")
51 44 },
52   -
53 45 {
54   - path: '/parkinfo',
55   - name: 'parkinfo',
  46 + path: "/parkinfo",
  47 + name: "parkinfo",
56 48 component: () => import("@/views/map/parkinfo.vue")
57 49 },
58   -
59 50 {
60   - path: '/search',
61   - name: 'search',
  51 + path: "/search",
  52 + name: "search",
62 53 component: () => import("@/views/map/search.vue")
63 54 },
64   -
65   -
66   -
67   -
68   -
69   -
70   - //---------------- 个人页面导航
  55 + //---------------- 个人页面导航
71 56 {
72   - path: '/selfNav',
73   - name: 'selfNav',
  57 + path: "/selfNav",
  58 + name: "selfNav",
74 59 component: () => import("@/views/mySelf/selfNav.vue"),
75   - meta: {title: "个人中心"}
  60 + meta: {
  61 + title: "个人中心" ,
  62 + keepAlive: false, //此组件不需要被缓存
  63 + }
76 64 },
77   -
78 65 // ------------------------建议反馈
79 66 {
80   - path: '/suggestionBack',
81   - name: 'suggestionBack',
  67 + path: "/suggestionBack",
  68 + name: "suggestionBack",
82 69 component: () => import("@/views/mySelf/feedback/suggestionBack.vue"),
83   - meta: {title: "建议反馈"}
  70 + meta: { title: "建议反馈" }
84 71 },
85   -
86 72 // ------------------------停车记录
87 73 {
88   - path: '/parkNotes',
89   - name: 'parkNotes',
  74 + path: "/parkNotes",
  75 + name: "parkNotes",
90 76 component: () => import("@/views/mySelf/parkNotes/parkNotes.vue")
91 77 },
92   -
93   -
94 78 // ------------------------登录
95 79 {
96   - path: '/binDing',
97   - name: 'binDing',
  80 + path: "/binDing",
  81 + name: "binDing",
98 82 component: () => import("@/views/binding/binDing.vue"),
99   - meta: {title: "绑定手机号"}
  83 + meta: { title: "绑定手机号" }
100 84 },
101 85 {
102   - path: '/myCars',
103   - name: 'myCars',
  86 + path: "/myCars",
  87 + name: "myCars",
104 88 component: () => import("@/views//mySelf/myCars/myCars.vue"),
105   - meta: {title: "我的车牌"}
  89 + meta: { title: "我的车牌" }
106 90 },
107   -
108 91 {
109   - path: '/addCarNum',
110   - name: 'addCarNum',
  92 + path: "/addCarNum",
  93 + name: "addCarNum",
111 94 component: () => import("@/views//mySelf/myCars/addCarNum.vue"),
112   - meta: {title: "添加车牌"}
  95 + meta: { title: "添加车牌" }
113 96 },
114 97 {
115   - path: '/rzCarNumber',
116   - name: 'rzCarNumber',
117   - component: () => import("@/views//mySelf/myCars/rzCarNumber.vue"),
  98 + path: "/rzCarNumber",
  99 + name: "rzCarNumber",
  100 + component: () => import("@/views//mySelf/myCars/rzCarNumber.vue")
118 101 // meta: {title: "认证车牌"}
119 102 },
120   -
121   -
122 103 {
123   - path: '/cardList',
124   - name: 'cardList',
  104 + path: "/cardList",
  105 + name: "cardList",
125 106 component: () => import("@/views//cards/cardList.vue"),
126   - meta: {title: "会员卡列表"}
  107 + meta: { title: "会员卡列表" }
127 108 },
128   -
129   -
130 109 {
131   - path: '/buyCardDetail',
132   - name: 'buyCardDetail',
  110 + path: "/buyCardDetail",
  111 + name: "buyCardDetail",
133 112 component: () => import("@/views//cards/buyCardDetail.vue"),
134   - meta: {title: "购买会员卡"}
  113 + meta: { title: "购买会员卡" }
135 114 },
136   -
137 115 {
138   - path: '/buyVipCard',
139   - name: 'buyVipCard',
  116 + path: "/buyVipCard",
  117 + name: "buyVipCard",
140 118 component: () => import("@/views//cards/buyVipCard.vue"),
141   - meta: {title: "购买会员卡"}
  119 + meta: { title: "购买会员卡" }
142 120 },
143   -
144   -
145   -
146   -
147   -
148 121 // ------------------------购买会员卡提示
149 122 {
150   - path: '/cardPoint',
151   - name: 'cardPoint',
  123 + path: "/cardPoint",
  124 + name: "cardPoint",
152 125 component: () => import("@/views/cards/cardPoint.vue")
153 126 },
154   -
155   -
156 127 // ------------------------购买会员卡
157 128 {
158   - path: '/buyCard',
159   - name: 'buyCard',
  129 + path: "/buyCard",
  130 + name: "buyCard",
160 131 component: () => import("@/views/cards/buyCard.vue"),
161   - meta: {title: "购买会员卡"}
162   - },
163   -
164   -
165   -
166   -
167   -
168   -
169   -
170   -
171   -
  132 + meta: { title: "购买会员卡" }
  133 + }
172 134 ]
173   -})
  135 +});
... ...
src/views/cards/buyCardDetail.vue
... ... @@ -10,35 +10,45 @@
10 10 <div class="van-ellipsis" style="padding: 20px 0 10px 20px">万达停车场plName</div>
11 11 <div class="van-ellipsis" style="padding: 0 0 0 20px">万达停车场plAddress</div>
12 12 </div>
13   -
14   -
15   -
16   - <van-cell-group inset style="margin-bottom: 10px;" @click="LinkBuyCard">
  13 + <van-cell-group inset style="margin-bottom: 10px;" v-for="i in list" @click="LinkBuyCard">
17 14 <van-cell >
18 15 <template #title>
19 16 <span style="font-size: 20px;font-weight: 600;">年卡</span>
20 17 </template>
21 18 </van-cell>
22   - <van-cell title="万达月卡cardName" center value="立即购买" label="单价:¥1800.00" is-link>
  19 + <van-cell :title= "i.cardName" center value="立即购买" :label="'单价:'+(i.actPrice/100).toFixed(2)" is-link>
23 20 </van-cell>
24 21 </van-cell-group>
25 22  
26   - <van-cell-group inset style="margin-bottom: 10px;">
27   - <van-cell >
28   - <template #title>
29   - <span style="font-size: 20px;font-weight: 600;">年卡</span>
30   - </template>
31   - </van-cell>
32   - <van-cell title="万达月卡cardName" center value="立即购买" label="单价:¥1800.00" is-link>
33   - </van-cell>
34   - </van-cell-group>
  23 + <!--<van-cell-group inset style="margin-bottom: 10px;">-->
  24 + <!--<van-cell >-->
  25 + <!--<template #title>-->
  26 + <!--<span style="font-size: 20px;font-weight: 600;">年卡</span>-->
  27 + <!--</template>-->
  28 + <!--</van-cell>-->
  29 + <!--<van-cell title="万达月卡cardName" center value="立即购买" label="单价:¥1800.00" is-link>-->
  30 + <!--</van-cell>-->
  31 + <!--</van-cell-group>-->
35 32 </section>
36 33  
37 34 </template>
38 35  
39 36 <script>
  37 +
  38 +import { queryVipCardByPlNo } from "@/api/card/card";
40 39 export default {
41 40 name: "buyCardDetail",
  41 + data(){
  42 + return{
  43 + plNo:'',
  44 + list:[]
  45 + }
  46 + },
  47 + created(){
  48 + this.plNo = this.$route.query.plNo
  49 + console.log(this.plNo)
  50 + this.queryVipCardByPlNo()
  51 + },
42 52  
43 53 methods:{
44 54 LinkBuyCard(){
... ... @@ -46,6 +56,19 @@ export default {
46 56 name: "buyVipCard"
47 57 }
48 58 );
  59 + },
  60 + queryVipCardByPlNo() {
  61 + let jsondata = {
  62 + parkNo:this.plNo,
  63 + saleChannel: "2"
  64 + };
  65 + jsondata.sign = this.$utils.signObject(jsondata);
  66 + queryVipCardByPlNo(jsondata).then(response => {
  67 + // console.log(response.data[0].parkList);
  68 +
  69 + console.log(response);
  70 + this.list = response.data
  71 + });
49 72 }
50 73 }
51 74 };
... ...
src/views/cards/cardList.vue
... ... @@ -15,21 +15,17 @@
15 15 </van-col>
16 16 </van-row>
17 17  
18   - <ul>
19   - <li class="cardListWrap" @click="toBuyCardPage">
20   - <div class="van-ellipsis" style="padding: 20px 0 10px 10px">万达停车场plName</div>
21   - <div class="van-ellipsis" style="padding: 10px 0 20px 10px">万达停车场plAddress</div>
22   - </li>
23   - <li class="cardListWrap">
24   - <div class="van-ellipsis" style="padding: 20px 0 10px 10px">万达停车场plName</div>
25   - <div class="van-ellipsis" style="padding: 10px 0 20px 10px">万达停车场plAddress</div>
  18 + <ul v-if="cardList.length>0">
  19 + <li class="cardListWrap" v-for="i in cardList[0].parkList" @click="toBuyCardPage(i)">
  20 + <div class="van-ellipsis" style="padding: 20px 0 10px 10px">{{i.plName}}</div>
  21 + <div class="van-ellipsis" style="padding: 10px 0 20px 10px;color: #999">{{i.plAddress}}</div>
26 22 </li>
27 23 </ul>
28 24  
29 25  
30   - <section style="text-align: center;padding-top: 20px">
31   - <van-image :src="require('../../assets/images/cards/novipcard.png')" />
32   - <p>为找到会员卡</p>
  26 + <section style="text-align: center;padding-top: 20px" v-else>
  27 + <van-image :src="require('../../assets/images/cards/novipcard.png')"/>
  28 + <p>未找到会员卡</p>
33 29 </section>
34 30  
35 31  
... ... @@ -38,33 +34,69 @@
38 34 </template>
39 35  
40 36 <script>
41   -import { Toast } from 'vant';
  37 +import { queryVipCardListByOrgId, queryVipCardListByPlName } from "@/api/card/card";
42 38 export default {
43 39 name: "cardList",
44 40 data() {
45 41 return {
46   - value: '',
  42 + value: "",
  43 + cardList: []
47 44 };
48 45 },
  46 + created() {
  47 + this.queryVipCardListByOrgId();
  48 + },
49 49 methods: {
50 50 onSearch(val) {
51   - Toast(val);
  51 + console.log("111" + val);
  52 + // Toast(val);
  53 + let jsondata = {
  54 + orgId: this.$utils.orgId,
  55 + parkName: val,
  56 + saleChannel: "2"
  57 + };
  58 + jsondata.sign = this.$utils.signObject(jsondata);
  59 + queryVipCardListByPlName(jsondata).then(response => {
  60 + // console.log(response.data[0].parkList);
  61 + this.cardList = response.data;
  62 + console.log(response);
  63 + });
52 64 },
53 65 onCancel() {
54   - Toast('取消');
  66 + // Toast('取消');
55 67 },
56   - toBuyCardPage(){
  68 + toBuyCardPage(i) {
57 69 this.$router.push({
58   - name: "buyCardDetail"
  70 + name: "buyCardDetail",
  71 + query: {
  72 + plNo: i.plNo,
  73 + plName: i.plName,
  74 + plAddress: i.plAddress
  75 + }
59 76 }
60 77 );
  78 + },
  79 + queryVipCardListByOrgId() {
  80 + let jsondata = {
  81 + orgId: this.$utils.orgId,
  82 + longitude: "115.10114",
  83 + latitude: "40.616892",
  84 + type: "00",
  85 + limit: "10000000",
  86 + saleChannel: "2"
  87 + };
  88 + jsondata.sign = this.$utils.signObject(jsondata);
  89 + queryVipCardListByOrgId(jsondata).then(response => {
  90 + console.log(response.data);
  91 + this.cardList = response.data;
  92 + });
61 93 }
62   - },
  94 + }
63 95 };
64 96 </script>
65 97  
66 98 <style scoped>
67   - .cardListWrap{
  99 + .cardListWrap {
68 100 margin-top: 15px;
69 101 margin-left: 0px;
70 102 margin-right: 0px;
... ...
src/views/mySelf/selfNav.vue
... ... @@ -81,10 +81,10 @@ export default {
81 81 );
82 82 } else {
83 83 this.$toast("请先登录");
84   - this.$router.push({
85   - name: "binDing"
86   - }
87   - );
  84 + // this.$router.push({
  85 + // name: "binDing"
  86 + // }
  87 + // );
88 88 }
89 89 },
90 90 toBindingPage() {
... ...