Commit 6d13a0037e5b779794eb342f2a1b4a8c45a20981

Authored by 刘淇
1 parent 834a2f37

会员卡聚合支付

src/api/card/card.js
... ... @@ -35,9 +35,9 @@ export function queryUserCars(params) { //车辆信息查询
35 35 }
36 36  
37 37  
38   -export function createVipCardOrder2022(params) { //会员卡购买续费2022
  38 +export function createVipCardOrder(params) { //会员卡购买续费
39 39 return request({
40   - url: 'vip/createVipCardOrder2022',
  40 + url: 'vip/createVipCardOrder',
41 41 method: 'post',
42 42 data: params
43 43 })
... ... @@ -51,3 +51,4 @@ export function queryVipCardsByCustId(params) { //查询用户已购买的会员
51 51 })
52 52 }
53 53  
  54 +
... ...
src/utils/utils.js
... ... @@ -129,7 +129,9 @@ export default {
129 129 jsonObj.app_id = "lrpo55tmveqe07w3gpovzgx34pdez7eh";
130 130 jsonObj.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E";
131 131 jsonObj.salt = myCommonSalt(32);
132   - jsonObj.token = localStorage.getItem('userToken');
  132 + // jsonObj.token = localStorage.getItem('userToken');
  133 + jsonObj.token = 'e3b5417a987641219efb8dc1f8b5fbce' // 为了测试
  134 +
133 135 let sort = [];
134 136 for (let k in jsonObj) {
135 137 sort.push({
... ...
src/views/cards/buyVipCard.vue
... ... @@ -90,7 +90,8 @@
90 90 </template>
91 91  
92 92 <script>
93   -import { queryUserCars, createVipCardOrder2022 } from "@/api/card/card";
  93 +import { queryUserCars, createVipCardOrder } from "@/api/card/card";
  94 +import { doPay } from '@/api/doPay'
94 95 export default {
95 96 name: "buyVipCard",
96 97 data() {
... ... @@ -116,7 +117,8 @@ export default {
116 117 actPrice: "",//单价
117 118 discValue: "",//优惠
118 119 payPrice: "", // 支付金额
119   - xufeiFlag: ""//判断是否续费 1否 2是
  120 + xufeiFlag: "",//判断是否续费 1否 2是
  121 + custCardNo:'', // 卡编号
120 122 };
121 123 },
122 124 created() {
... ... @@ -167,6 +169,7 @@ export default {
167 169 console.log(this.payPrice);
168 170 if (this.xufeiFlag == 2) { // 2代表续费
169 171 this.valueStart = this.$route.query.expDate;
  172 + this.custCardNo = this.$route.query.custCardNo;
170 173 // effDate
171 174 this.getEffDate(1);
172 175 } else {
... ... @@ -280,6 +283,7 @@ export default {
280 283 // paySrcType 301 会员卡购买单 302 会员卡续费
281 284 // cardCouponsId 是 string 已购买的会员卡id 新增不传 续费必传
282 285 // optType 是 string 操作类型 1 购买 2 续费
  286 + console.log(this.xufeiFlag )
283 287 if (this.carNum == "点击选择车牌") {
284 288 this.$toast("请先选择车牌");
285 289 return;
... ... @@ -295,22 +299,52 @@ export default {
295 299 effDate: this.valueStart,
296 300 expDate: this.effDate,
297 301 carNumber: this.carNum,
298   - optType: this.xufeiFlag == 1 ? "1" : "2",
299   - cardCouponsId: this.$router.query.custCardNo,
  302 + optType: this.xufeiFlag == 2 ? "2" : "1",
  303 + cardCouponsId: this.custCardNo,
300 304 forceBuy: "1"
301 305 };
302 306 jsondata.sign = this.$utils.signObject(jsondata);
303   - createVipCardOrder2022(jsondata).then(response => {
  307 + createVipCardOrder(jsondata).then(response => {
304 308 console.log(response);
305 309 if (response.code == 0) {
306   - let orderId = response.data.orderId;
307   - console.log(orderId);
  310 + let rltOrderId = response.data.orderId;
  311 + let orderFeeMon = response.data.orderFee
  312 + this.cardDoPay(rltOrderId,orderFeeMon)
  313 + console.log(rltOrderId);
308 314 } else if (response.code == 5006) {
309 315 this.$toast("请先去补缴欠费订单");
310 316 } else {
311 317 this.$toast(response.message);
312 318 }
313 319 });
  320 + },
  321 + cardDoPay(rltOrderId,orderFee){
  322 + console.log(orderFee)
  323 + let jsondata = {
  324 + orderBigType:300,
  325 + payOrderType:301,
  326 + openId: '',
  327 + appId: this.$utils.xuanhuaAppid,
  328 + carNumber: this.carNum,
  329 + rltOrderId: rltOrderId,
  330 + payType: '4',
  331 + paySource: '3',
  332 + //支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费
  333 + paySrcType:this.xufeiFlag == 2 ? "302" : "301", // 1购买 2续费
  334 + sourceType: '3',
  335 + //个人使用的卡券cardId
  336 + // couponPersonId: me.selCoupon.custCardId,
  337 + terminalSource: this.$utils.commonTerminalSource, //小程序
  338 + orderTotalFee: this.actPrice*this.count, // 应收
  339 + orderActFee: orderFee , // 实收
  340 + // terminalOS: common.terminalOS,
  341 + orgId: this.$utils.myOrgId,
  342 + };
  343 + jsondata.sign = this.$utils.signObject(jsondata);
  344 + doPay(jsondata).then(response => {
  345 + console.log(response.data.payinfo)
  346 + window.location.href = response.data.payinfo
  347 + })
314 348 }
315 349 }
316 350 };
... ...
src/views/cards/cardList.vue
... ... @@ -79,11 +79,11 @@ export default {
79 79 queryVipCardListByOrgId() {
80 80 let jsondata = {
81 81 orgId: this.$utils.orgId,
82   - longitude: "115.10114",
83   - latitude: "40.616892",
  82 + latitude: "115.10114",
  83 + longitude: "40.616892",
84 84 type: "00",
85   - limit: "10000000",
86   - saleChannel: "2"
  85 + limit: "1000",
  86 + saleChannel: "2" // 办理渠道, 1:APP 4:微信小程序
87 87 };
88 88 jsondata.sign = this.$utils.signObject(jsondata);
89 89 queryVipCardListByOrgId(jsondata).then(response => {
... ...
src/views/cards/ownCards.vue
... ... @@ -27,33 +27,7 @@ export default {
27 27 name: "ownCards",
28 28 data() {
29 29 return {
30   - mycardlist: [{
31   - "cardName": "测试1",
32   - "parkName": "东济路",
33   - "num": 1,
34   - "discount": "1.0",
35   - "invoiceState": "0",
36   - "useType": "1",
37   - "cardNo": "V1123900924620210176",
38   - "expDate": "2023-07-28",
39   - "effDate": "2023-06-29",
40   - "carType": "2",
41   - "payType": "12",
42   - "price": "100",
43   - "isSupportRenew": "1",
44   - "cardStatus": "2",
45   - "parkNo": "P15040000000018",
46   - "payFinishTime": "2023-06-29 09:01:37",
47   - "cardType": "4",
48   - "orderPayedFee": "10",
49   - "custCardNo": "7011123901072930799616",
50   - "carNumber": "苏B13ERR",
51   - "parkAddr": "江阴市江阴高新技术产业开发区东济路",
52   - "totalAmount": "100",
53   - "saleChannel": "4",
54   - "custCardId": "4493",
55   - "actPrice": "100"
56   - }]
  30 + mycardlist: []
57 31 };
58 32 },
59 33 created() {
... ... @@ -67,7 +41,7 @@ export default {
67 41 jsondata.sign = this.$utils.signObject(jsondata);
68 42 queryVipCardsByCustId(jsondata).then(response => {
69 43 console.log(response);
70   - // this.mycardlist = response.data
  44 + this.mycardlist = response.data
71 45 });
72 46 },
73 47 gotoNextPay(i) {
... ...