Commit d2fe64ed862067b702b7b6e4830a7b262edff09d

Authored by 刘淇
1 parent c18d9360

西城 所有车牌购买会员卡

src/api/cards/cards.js
... ... @@ -11,6 +11,19 @@ export function queryVipCardsByCustId(params) {
11 11 }
12 12  
13 13  
  14 +// 查询车牌已购买的会员卡
  15 +export function queryVipCardsByCarNumberForH5(params) { // 轮播图
  16 + return request({
  17 + url: '/parkvip/queryVipCardsByCarNumberForH5',
  18 + method: 'post',
  19 + data: params
  20 + })
  21 +}
  22 +
  23 +
  24 +
  25 +
  26 +
14 27 // 根据组织id查询区域卡/时域卡规则信息
15 28 export function queryVipAreaCardByOrgId(params) {
16 29 return request({
... ... @@ -34,12 +47,25 @@ export function queryVipAreaCardByOrgId(params) {
34 47 // 搜索停车场
35 48 export function queryParkListForVipCard(params) {
36 49 return request({
37   - url: 'applyVipCard/queryParkListForVipCard',
  50 + url: 'parkvip/queryParkListForVipCardByH5',
38 51 method: 'post',
39 52 data: params
40 53 })
41 54 }
42 55  
  56 +
  57 +
  58 +
  59 +// 搜索卡类型 xuqiang
  60 +export function queryVipCardInfoByPlNoForH5(params) {
  61 + return request({
  62 + url: '/parkvip/queryVipCardInfoByPlNoForH5',
  63 + method: 'post',
  64 + data: params
  65 + })
  66 +}
  67 +
  68 +
43 69 // 搜索卡类型
44 70 export function queryVipCardInfoByPlNo(params) {
45 71 return request({
... ...
src/api/plateNumber/plateNumber.js
... ... @@ -9,6 +9,3 @@ export function swiperQuery(params) { // 轮播图
9 9 }
10 10  
11 11  
12   -
13   -
14   -
... ...
src/router/index.js
... ... @@ -32,7 +32,7 @@ export default new Router({
32 32 name: 'plateNumber',
33 33 component: plateNumber,
34 34 meta:{
35   - title:'停车缴费'
  35 + title:'车牌查询会员卡'
36 36 }
37 37 },
38 38  
... ...
src/utils/request.js
... ... @@ -5,7 +5,7 @@ import axios from 'axios'
5 5 const service = axios.create({
6 6 // http://dev.renniting.cn/pay/ 赤峰测试
7 7 // http://pay.service.renniting.cn/ 赤峰
8   - baseURL: 'http://pay.service.renniting.cn/', // url = base url + request url
  8 + baseURL: 'http://dev.renniting.cn/pay/', // url = base url + request url
9 9 // withCredentials: true, // send cookies when cross-domain requests
10 10 timeout: 6000 // request timeout
11 11 })
... ...
src/utils/utils.js
... ... @@ -162,7 +162,7 @@ export default {
162 162 // 黄石 appid wxa1a66cc7d263afe6
163 163 // 阳明 wxdfb0276f85514ea3
164 164 // 无锡 wx1e9001e5940605b1
165   - myOrgId: "10005", // 归属地 赤峰id 10003 黄石 10079 无锡10005 扬明10193
  165 + myOrgId: "10003", // 归属地 赤峰id 10003 黄石 10079 无锡10005 扬明10193 西城10007
166 166 myGetSign: function(objb) { // 获取签名
167 167 var compare = function(obj1, obj2) {
168 168 var val1 = obj1.keyname;
... ... @@ -209,7 +209,7 @@ export default {
209 209 deviceInfo: this.myDeviceInfo,
210 210 salt: salt,
211 211 sign_type: "md5",
212   - token: sessionStorage.getItem("wx_Token"), //c23849735f3442f3b95f7bec816317ae "63a193ae1db543fab63052348cbcfa1d" sessionStorage.getItem("wx_Token")
  212 + // token: sessionStorage.getItem("wx_Token"), //c23849735f3442f3b95f7bec816317ae "63a193ae1db543fab63052348cbcfa1d" sessionStorage.getItem("wx_Token")
213 213 orgId: this.myOrgId
214 214 };
215 215 return reqData;
... ...
src/views/cards/Cards.vue
... ... @@ -45,12 +45,13 @@
45 45  
46 46 </div>
47 47 <!--<x-button type="primary" ></x-button>-->
48   - <mt-button type="primary" size="large" @click.native="$router.push({path:'buyCard'})">购买会员卡</mt-button>
  48 + <!--<mt-button type="primary" size="large" @click.native="$router.push({path:'buyCard'})">购买会员卡</mt-button>-->
  49 + <mt-button type="primary" size="large" @click.native="toBuy">购买会员卡</mt-button>
49 50 </div>
50 51 </template>
51 52  
52 53 <script>
53   -import { queryVipCardsByCustId } from "@/api/cards/cards";
  54 +import { queryVipCardsByCustId, queryVipCardsByCarNumberForH5 } from "@/api/cards/cards";
54 55 export default {
55 56 name: "Cards",
56 57 data() {
... ... @@ -59,10 +60,25 @@ export default {
59 60 };
60 61 },
61 62 mounted() {
62   - this.queryVipCardsByCustId();
  63 + // this.queryVipCardsByCustId();
  64 + this.queryVipCardsByCarNumberForH5()
63 65 },
64 66 methods: {
65 67 // 获取会员卡列表
  68 + queryVipCardsByCarNumberForH5:function(){
  69 + let jsondata = this.$utils.commonParams();
  70 + jsondata.carNumber = this.$route.query.carNumber
  71 + jsondata.carNumberColor = this.$route.query.carNumberColor
  72 + jsondata.sign = this.$utils.signObject(jsondata);
  73 + queryVipCardsByCarNumberForH5(jsondata).then(data => {
  74 + console.log(data);
  75 + if (data.code == 0) {
  76 +
  77 + } else {
  78 + this.$vux.toast.text(data.message, "top");
  79 + }
  80 + });
  81 + },
66 82 queryVipCardsByCustId: function() {
67 83 let jsondata = this.$utils.commonParams();
68 84 jsondata.sign = this.$utils.signObject(jsondata);
... ... @@ -81,6 +97,17 @@ export default {
81 97 console.log(i);
82 98 sessionStorage.setItem("renewData", JSON.stringify(i));
83 99 this.$router.push("renew");
  100 + },
  101 +
  102 + // 购买
  103 + toBuy:function() {
  104 + this.$router.push({
  105 + path:'buyCard',
  106 + query:{
  107 + carNumber:this.$route.query.carNumber,
  108 + carNumberColor: this.$route.query.carNumberColor
  109 + }
  110 + })
84 111 }
85 112 }
86 113 };
... ...
src/views/cards/buyCard.vue
... ... @@ -11,24 +11,36 @@
11 11 </li>
12 12  
13 13  
  14 + <li>
  15 + <div style="color: #666">绑定车牌</div>
  16 + <div> {{$route.query.carNumber}}</div>
  17 + </li>
  18 +
  19 +
  20 + <li>
  21 + <div style="color: #666">卡类型</div>
  22 + <div>月卡</div>
  23 + </li>
  24 +
  25 +
14 26 <!--<li>-->
15 27 <!--<div style="color: #666">卡名称</div>-->
16 28 <!--<div>微纳园卡</div>-->
17 29 <!--</li>-->
18 30  
19   - <li>
20   - <div style="color: #666">选择卡类型</div>
21   - <div @click="cardTypeListVisible = true">{{carType}}</div>
22   - <div class="arrow">></div>
23   - <!--<div class="arrow">></div>-->
24   - </li>
  31 + <!--<li>-->
  32 + <!--<div style="color: #666">选择卡类型</div>-->
  33 + <!--<div @click="cardTypeListVisible = true">{{carType}}</div>-->
  34 + <!--<div class="arrow">></div>-->
  35 + <!--&lt;!&ndash;<div class="arrow">></div>&ndash;&gt;-->
  36 + <!--</li>-->
25 37  
26 38  
27   - <li>
28   - <div style="color: #666">绑定车牌</div>
29   - <div @click="carNumberVisible = true">{{carNumber}}</div>
30   - <div class="arrow">></div>
31   - </li>
  39 + <!--<li>-->
  40 + <!--<div style="color: #666">绑定车牌</div>-->
  41 + <!--<div @click="carNumberVisible = true">{{carNumber}}</div>-->
  42 + <!--<div class="arrow">></div>-->
  43 + <!--</li>-->
32 44  
33 45 <li>
34 46 <div style="color: #A31414">生效时间</div>
... ... @@ -167,7 +179,8 @@ import {
167 179 queryVipCardInfoByPlNo,
168 180 queryUserCars,
169 181 weixinpay,
170   - createVipCardOrder
  182 + createVipCardOrder,
  183 + queryVipCardInfoByPlNoForH5
171 184 } from "@/api/cards/cards";
172 185 import { timestampToTime } from "../../utils/utils.js";
173 186 export default {
... ... @@ -180,7 +193,7 @@ export default {
180 193 startDate: new Date(),
181 194 dateVal: "",
182 195 selectedValue: "",
183   - startData: "",
  196 + startData: new Date(),
184 197 endDate: "",
185 198 parkName: "请点击选择",
186 199 parkNameVisible: false,
... ... @@ -200,7 +213,7 @@ export default {
200 213 disPrice: 0, // 优惠金额
201 214 needPay: 0, // 应付
202 215 agreement: false,
203   - typeNum: 0, // 卡类型判断
  216 + typeNum: 4, // 卡类型判断
204 217 showHideOnBlur: false, // 购买协议
205 218 createVipCardOrder: {}, // 创建订单对象
206 219 orderId: "" // 订单号
... ... @@ -208,7 +221,7 @@ export default {
208 221 },
209 222 mounted() {
210 223 this.queryParkListForVipCard(); // 获取停车场
211   - this.queryUserCars(); // 获取用户车牌
  224 + // this.queryUserCars(); // 获取用户车牌
212 225 },
213 226 computed: {
214 227 // 卡类型 1-年卡;2-半年卡;3-季卡;4-月卡;5-日卡;
... ... @@ -216,24 +229,24 @@ export default {
216 229 if (this.startData) {
217 230 switch (this.typeNum) {
218 231 case 1:
219   - this.endDate = this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD");
220   - return this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD");
  232 + this.endDate = this.$moment(this.startData).add(12 * this.cardNum, "month").format("YYYY-MM-DD");
  233 + return this.$moment(this.startData).add(12 * this.cardNum, "month").format("YYYY-MM-DD");
221 234 break;
222 235 case 2:
223   - this.endDate = this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD");
224   - return this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD");
  236 + this.endDate = this.$moment(this.startData).add(6 * this.cardNum, "month").format("YYYY-MM-DD");
  237 + return this.$moment(this.startData).add(6 * this.cardNum, "month").format("YYYY-MM-DD");
225 238 break;
226 239 case 3:
227   - this.endDate = this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD");
228   - return this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD");
  240 + this.endDate = this.$moment(this.startData).add(3 * this.cardNum, "month").format("YYYY-MM-DD");
  241 + return this.$moment(this.startData).add(3 * this.cardNum, "month").format("YYYY-MM-DD");
229 242 break;
230 243 case 4:
231   - this.endDate = this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD");
232   - return this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD");
  244 + this.endDate = this.$moment(this.startData).add(1 * this.cardNum, "month").format("YYYY-MM-DD");
  245 + return this.$moment(this.startData).add(1 * this.cardNum, "month").format("YYYY-MM-DD");
233 246 break;
234 247 case 5:
235   - this.endDate = this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD");
236   - return this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD");
  248 + this.endDate = this.$moment(this.startData).add(1 * this.cardNum, "days").format("YYYY-MM-DD");
  249 + return this.$moment(this.startData).add(1 * this.cardNum, "days").format("YYYY-MM-DD");
237 250 break;
238 251 }
239 252 // return this.$moment(this.startData).add(1,"month").format("YYYY-MM-DD");
... ... @@ -274,7 +287,7 @@ export default {
274 287 },
275 288 // 打开时间选择器
276 289 selectData() {
277   - this.dateVal = this.startData
  290 + this.dateVal = this.startData;
278 291 this.$refs["datePicker"].open();
279 292 // console.log(this.startData)
280 293 // this.endDate = this.startData.setMonth(this.startData.getMonth()+1)
... ... @@ -283,7 +296,7 @@ export default {
283 296 //
284 297 queryParkListForVipCard() {
285 298 let jsondata = this.$utils.commonParams();
286   - jsondata.parkName = ""; //搜索的停车场名称
  299 + jsondata.plName = ""; //搜索的停车场名称
287 300 jsondata.sign = this.$utils.signObject(jsondata);
288 301 queryParkListForVipCard(jsondata).then(data => {
289 302 console.log(data);
... ... @@ -302,7 +315,7 @@ export default {
302 315 });
303 316 },
304 317 handleConfirm() {
305   - console.log('11111');
  318 + console.log("11111");
306 319 console.log(this.dateVal);
307 320 this.startData = this.$utils.timestampToTime(this.dateVal);
308 321 // this.endDate = this.dateVal.setMonth(this.dateVal.getMonth() + 1);
... ... @@ -313,20 +326,22 @@ export default {
313 326 this.parkName = e.name;
314 327 this.parkNo = e.parkNo;
315 328 // alert(this.parkNo)
316   - this.queryVipCardInfoByPlNo();
  329 + this.queryVipCardInfoByPlNoForH5();
317 330 },
318 331 // 根据停车场搜卡类型
319   - queryVipCardInfoByPlNo() {
  332 + queryVipCardInfoByPlNoForH5() {
320 333 let me = this;
321 334 let jsondata = this.$utils.commonParams();
322 335 jsondata.plNo = this.parkNo;
323   - jsondata.plNo = this.parkNo;
  336 + jsondata.cardType = "4";
  337 + // jsondata.parkName = this.parkName;
  338 +
324 339 jsondata.sign = this.$utils.signObject(jsondata);
325   - queryVipCardInfoByPlNo(jsondata).then(data => {
  340 + queryVipCardInfoByPlNoForH5(jsondata).then(data => {
326 341 console.log(data);
327 342 if (data.code == 0) {
328   - me.cardTypeList = []
329   - me.carType = '请点击选择'
  343 + me.cardTypeList = [];
  344 + me.carType = "请点击选择";
330 345 // res.vipCardList =
331 346 // this.cardTypeList = res.vipCardList
332 347 // { name: "月卡", num: 1, method: this.clickAction },
... ... @@ -337,10 +352,9 @@ export default {
337 352 me.cardTypeList.push(item);
338 353 });
339 354 console.log(me.cardTypeList);
340   - if(me.carType=='请点击选择'){
341   -
342   - }else{
343   - me.cardNum = 1
  355 + if (me.carType == "请点击选择") {
  356 + } else {
  357 + me.cardNum = 1;
344 358 me.unitPrice = vipCardList[0].price;
345 359 me.disPrice = vipCardList[0].price * ((10 - vipCardList[0].discValue) / 10);
346 360 me.needPay = this.unitPrice - this.disPrice;
... ... @@ -385,7 +399,6 @@ export default {
385 399 },
386 400 addCardNum() { // 增加购买数量
387 401 this.cardNum++;
388   -
389 402 this.calcMoney();
390 403 },
391 404 reduceCarNum() { // 增加购买数量
... ... @@ -404,15 +417,15 @@ export default {
404 417 this.$vux.toast.text("请选择停车场", "top");
405 418 return;
406 419 }
407   - console.log(this.carType)
408   - if (this.carType == "请点击选择") {
409   - this.$vux.toast.text("请选择卡类型", "top");
410   - return;
411   - }
412   - if (this.carNumber == "请选择车牌") {
413   - this.$vux.toast.text("请选择车牌", "top");
414   - return;
415   - }
  420 + // console.log(this.carType);
  421 + // if (this.carType == "请点击选择") {
  422 + // this.$vux.toast.text("请选择卡类型", "top");
  423 + // return;
  424 + // }
  425 + // if (this.carNumber == "请选择车牌") {
  426 + // this.$vux.toast.text("请选择车牌", "top");
  427 + // return;
  428 + // }
416 429 if (!this.agreement) {
417 430 this.$vux.toast.text("请同意购买须知", "top");
418 431 return;
... ...
src/views/parkPay/plateNumber.vue
... ... @@ -74,19 +74,19 @@
74 74  
75 75  
76 76 <div class="submit-box" @click="submitFn()">
77   - 查询
  77 + 购买
78 78 </div>
79 79  
80   - <div>
81   - <p style="margin-bottom: 18px;margin-top: 18px;">查询记录</p>
82   - <ul class="bound-list" v-if="boundList.length>0">
83   - <li v-for="i in boundList" :key="i" @click="boundHandle(i)">
84   - <span>{{ i }}</span>
85   - </li>
86   - </ul>
87   - <div v-else style="text-align: center;padding: 10px 0;">暂无查询记录</div>
88   - <!--<div class="addCarNum"><span></span>添加车辆</div>-->
89   - </div>
  80 + <!--<div>-->
  81 + <!--<p style="margin-bottom: 18px;margin-top: 18px;">查询车牌记录</p>-->
  82 + <!--<ul class="bound-list" v-if="boundList.length>0">-->
  83 + <!--<li v-for="i in boundList" :key="i" @click="boundHandle(i)">-->
  84 + <!--<span>{{ i }}</span>-->
  85 + <!--</li>-->
  86 + <!--</ul>-->
  87 + <!--<div v-else style="text-align: center;padding: 10px 0;">暂无查询记录</div>-->
  88 + <!--&lt;!&ndash;<div class="addCarNum"><span></span>添加车辆</div>&ndash;&gt;-->
  89 + <!--</div>-->
90 90  
91 91  
92 92  
... ... @@ -416,7 +416,7 @@ export default {
416 416 boundHandle(i) { // 记录点击事件
417 417 console.log(i)
418 418 this.$router.push({
419   - path:'parkRecord',
  419 + path:'cards',
420 420 query:{
421 421 carNumber:i,
422 422 carNumberColor: this.currentColor
... ... @@ -530,7 +530,7 @@ export default {
530 530 console.log(this.boundList)
531 531  
532 532 this.$router.push({
533   - path:'parkRecord',
  533 + path:'Cards',
534 534 query:{
535 535 carNumber:plateLicense,
536 536 carNumberColor: this.currentColor
... ...