Commit c865a00f85df43e337af7c230670e9ee495623bc

Authored by liuqimichale
1 parent 44cb771a

赤峰支付宝支付

src/components/navigation.vue
@@ -3,8 +3,9 @@ @@ -3,8 +3,9 @@
3 <div style="height: 206px;"> 3 <div style="height: 206px;">
4 <div class="swiper-container"> 4 <div class="swiper-container">
5 <div class="swiper-wrapper"> 5 <div class="swiper-wrapper">
6 - <div class="swiper-slide" v-for="item in swiperData" :key="item.id" :style="{backgroundImage:'url(' + item.url + ')'}"  
7 - @click="openImgUrl(item)" 6 + <div class="swiper-slide" v-for="item in swiperData" :key="item.id"
  7 + :style="{backgroundImage:'url(' + item.url + ')'}"
  8 + @click="openImgUrl(item)"
8 ></div> 9 ></div>
9 </div> 10 </div>
10 <!-- 如果需要分页器 --> 11 <!-- 如果需要分页器 -->
@@ -23,11 +24,11 @@ @@ -23,11 +24,11 @@
23 <p class="carNumber">{{carNumber}}</p> 24 <p class="carNumber">{{carNumber}}</p>
24 </div> 25 </div>
25 26
26 - <p class="toParkRecord"> 27 + <p class="toParkRecord" @click="toParkRecord">
27 是我的车,去支付 28 是我的车,去支付
28 </p> 29 </p>
29 30
30 - <p class="toPlateNumber"> 31 + <p class="toPlateNumber" @click="toPlateNumber">
31 不是我的车,手动输入 32 不是我的车,手动输入
32 </p> 33 </p>
33 34
@@ -39,7 +40,8 @@ @@ -39,7 +40,8 @@
39 40
40 <script> 41 <script>
41 import Swiper from 'swiper' // 应入swiper 42 import Swiper from 'swiper' // 应入swiper
42 -import { swiperQuery } from '../api/navigation/navigation' 43 +import {swiperQuery} from '../api/navigation/navigation'
  44 +
43 export default { 45 export default {
44 name: 'navigation', 46 name: 'navigation',
45 data() { 47 data() {
@@ -59,7 +61,7 @@ export default { @@ -59,7 +61,7 @@ export default {
59 this.initSWiper() 61 this.initSWiper()
60 }, 62 },
61 methods: { 63 methods: {
62 - initSWiper(){ 64 + initSWiper() {
63 var salt = this.$utils.myCommonSalt(32) 65 var salt = this.$utils.myCommonSalt(32)
64 var jsondata = { 66 var jsondata = {
65 app_id: this.$utils.myVarAppid, 67 app_id: this.$utils.myVarAppid,
@@ -67,14 +69,14 @@ export default { @@ -67,14 +69,14 @@ export default {
67 salt: salt, 69 salt: salt,
68 sign_type: 'md5', 70 sign_type: 'md5',
69 sign: '1', 71 sign: '1',
70 - orgId:this.$utils.myOrgId, 72 + orgId: this.$utils.myOrgId,
71 jumpType: '8' 73 jumpType: '8'
72 }; 74 };
73 // jsondata = JSON.stringify(jsondata); 75 // jsondata = JSON.stringify(jsondata);
74 - swiperQuery(jsondata).then( res => { 76 + swiperQuery(jsondata).then(res => {
75 this.swiperData = res.data 77 this.swiperData = res.data
76 console.log(this.swiperData) 78 console.log(this.swiperData)
77 - new Swiper ('.swiper-container', { 79 + new Swiper('.swiper-container', {
78 pagination: '.swiper-pagination', 80 pagination: '.swiper-pagination',
79 paginationClickable: true, 81 paginationClickable: true,
80 centeredSlides: true, 82 centeredSlides: true,
@@ -90,23 +92,41 @@ export default { @@ -90,23 +92,41 @@ export default {
90 }) 92 })
91 }) 93 })
92 }, 94 },
93 - openImgUrl(i){ // 点击图片跳转 95 + openImgUrl(i) { // 点击图片跳转
94 window.open(i.jumpUrl) 96 window.open(i.jumpUrl)
95 - } 97 + },
  98 + toPlateNumber() { // 前往输入车牌页面
  99 + this.$router.push({
  100 + path: 'plateNumber',
  101 +
  102 + }
  103 + )
  104 + },
  105 + toParkRecord() { // 前往停车记录页面
  106 + this.$router.push({
  107 + path: 'parkRecord',
  108 + query: {
  109 + carNumber: this.carNumber,
  110 + carNumberColor: this.carWrapBG
  111 + }
  112 + })
  113 + },
96 } 114 }
97 } 115 }
98 </script> 116 </script>
99 117
100 <style scoped lang="scss"> 118 <style scoped lang="scss">
101 - .swiper-container{ 119 + .swiper-container {
102 height: 206px; 120 height: 206px;
103 } 121 }
104 - .swiper-slide{ 122 +
  123 + .swiper-slide {
105 /*width: 100%;*/ 124 /*width: 100%;*/
106 height: 206px; 125 height: 206px;
107 background-repeat: no-repeat; 126 background-repeat: no-repeat;
108 background-size: 100% 100%; 127 background-size: 100% 100%;
109 } 128 }
  129 +
110 .carNumberTip { 130 .carNumberTip {
111 width: 200px; 131 width: 200px;
112 margin: 20px auto 10px; 132 margin: 20px auto 10px;
@@ -129,6 +149,7 @@ export default { @@ -129,6 +149,7 @@ export default {
129 font-size: 24px; 149 font-size: 24px;
130 color: #fff; 150 color: #fff;
131 } 151 }
  152 +
132 .carBlue { 153 .carBlue {
133 background: url("../assets/images/blueBG.png") no-repeat; 154 background: url("../assets/images/blueBG.png") no-repeat;
134 background-size: 100% 100%; 155 background-size: 100% 100%;
@@ -153,7 +174,8 @@ export default { @@ -153,7 +174,8 @@ export default {
153 background: url("../assets/images/blackBG.png") no-repeat; 174 background: url("../assets/images/blackBG.png") no-repeat;
154 background-size: 100% 100%; 175 background-size: 100% 100%;
155 } 176 }
156 - .toParkRecord{ 177 +
  178 + .toParkRecord {
157 margin-top: 40px; 179 margin-top: 40px;
158 margin-bottom: 20px; 180 margin-bottom: 20px;
159 height: 50px; 181 height: 50px;
@@ -164,7 +186,8 @@ export default { @@ -164,7 +186,8 @@ export default {
164 background-size: 100% 50px; 186 background-size: 100% 50px;
165 cursor: pointer; 187 cursor: pointer;
166 } 188 }
167 - .toPlateNumber{ 189 +
  190 + .toPlateNumber {
168 text-align: right; 191 text-align: right;
169 cursor: pointer; 192 cursor: pointer;
170 } 193 }
src/components/orderPay.vue
@@ -67,6 +67,7 @@ export default { @@ -67,6 +67,7 @@ export default {
67 this.clientBrowser = this.$utils.clientBrowser() //支付方式 67 this.clientBrowser = this.$utils.clientBrowser() //支付方式
68 this.paySrcType = this.$route.query.paySrcType // 实收 68 this.paySrcType = this.$route.query.paySrcType // 实收
69 this.orderId = this.$route.query.ordeID 69 this.orderId = this.$route.query.ordeID
  70 + console.log(this.orderId)
70 this.appOrderTimeout = this.$route.query.appOrderTimeout 71 this.appOrderTimeout = this.$route.query.appOrderTimeout
71 if (this.clientBrowser == "微信") { 72 if (this.clientBrowser == "微信") {
72 this.webAppCode = this.getCode(); 73 this.webAppCode = this.getCode();
@@ -75,7 +76,7 @@ export default { @@ -75,7 +76,7 @@ export default {
75 methods: { 76 methods: {
76 getCode() { 77 getCode() {
77 var appID = this.$utils.myVxAppId; 78 var appID = this.$utils.myVxAppId;
78 - var code = this.$route.query.code 79 + var code = this.getUrlParamfunction(code)
79 var local = window.location.href; 80 var local = window.location.href;
80 if (code == null || code === '') { 81 if (code == null || code === '') {
81 window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect' 82 window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect'
@@ -83,12 +84,19 @@ export default { @@ -83,12 +84,19 @@ export default {
83 return code; 84 return code;
84 } 85 }
85 }, 86 },
  87 + getUrlParamfunction(name) {
  88 + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
  89 + var r = window.location.search.substr(1).match(reg)
  90 + if (r != null) return unescape(r[2])
  91 + return null
  92 + },
86 toPay() { 93 toPay() {
87 let me = this 94 let me = this
88 let _order = [] 95 let _order = []
89 - this.orderId = JSON.parse(this.orderId) 96 +
90 console.log(this.orderId) 97 console.log(this.orderId)
91 if (this.paySrcType == 103) { 98 if (this.paySrcType == 103) {
  99 + this.orderId = JSON.parse(this.orderId)
92 this.orderId.forEach(item => { 100 this.orderId.forEach(item => {
93 _order.push({ 101 _order.push({
94 orderId: item 102 orderId: item
@@ -100,8 +108,6 @@ export default { @@ -100,8 +108,6 @@ export default {
100 108
101 if (this.clientBrowser == '支付宝') { // 支付宝支付 109 if (this.clientBrowser == '支付宝') { // 支付宝支付
102 var aliParams = {}; 110 var aliParams = {};
103 - console.log(this.orderId)  
104 - console.log(typeof this.orderId)  
105 aliParams.orderId = this.orderId; 111 aliParams.orderId = this.orderId;
106 aliParams.carNumber = this.carNumber; 112 aliParams.carNumber = this.carNumber;
107 aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 113 aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
@@ -110,7 +116,7 @@ export default { @@ -110,7 +116,7 @@ export default {
110 aliParams.orgId = this.$utils.myOrgId, 116 aliParams.orgId = this.$utils.myOrgId,
111 aliParams.backType = 2, 117 aliParams.backType = 2,
112 aliParams.recordArreaInfos = JSON.stringify(this.orderId); 118 aliParams.recordArreaInfos = JSON.stringify(this.orderId);
113 - 119 + console.log(aliParams)
114 aliPay(aliParams).then(response => { 120 aliPay(aliParams).then(response => {
115 console.log(response) 121 console.log(response)
116 if (response.code == 0) {//进场 122 if (response.code == 0) {//进场
@@ -146,15 +152,15 @@ export default { @@ -146,15 +152,15 @@ export default {
146 var wxParams = {}; 152 var wxParams = {};
147 wxParams.orderId = orderIdData; 153 wxParams.orderId = orderIdData;
148 wxParams.backType = 2, 154 wxParams.backType = 2,
149 - wxParams.orgId = this.$utils.myOrgId,  
150 - wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 155 + wxParams.orgId = this.$utils.myOrgId,
  156 + wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
151 wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 157 wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
152 wxParams.carNumber = this.carNumber; 158 wxParams.carNumber = this.carNumber;
153 wxParams.paySrcType = this.paySrcType;//101停车支付 159 wxParams.paySrcType = this.paySrcType;//101停车支付
154 wxParams.recordArreaInfos = JSON.stringify(orderIdData); 160 wxParams.recordArreaInfos = JSON.stringify(orderIdData);
155 wxParams.openId = openIdData; 161 wxParams.openId = openIdData;
156 wxParams.appId = this.$utils.myVxAppId; 162 wxParams.appId = this.$utils.myVxAppId;
157 - vxPayQuery(wxParams).then( res => { 163 + vxPayQuery(wxParams).then(res => {
158 if (res.code == 0) { // 164 if (res.code == 0) { //
159 //alertMsg("出场成功"); 165 //alertMsg("出场成功");
160 if (res.data) { 166 if (res.data) {
@@ -180,7 +186,7 @@ export default { @@ -180,7 +186,7 @@ export default {
180 } 186 }
181 }) 187 })
182 }, 188 },
183 - onBridgeReady (data) { 189 + onBridgeReady(data) {
184 console.log('调用微信支付WeixinJSBridge') 190 console.log('调用微信支付WeixinJSBridge')
185 var vm = this 191 var vm = this
186 WeixinJSBridge.invoke( 192 WeixinJSBridge.invoke(
@@ -197,7 +203,7 @@ export default { @@ -197,7 +203,7 @@ export default {
197 function (res) { 203 function (res) {
198 // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 204 // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
199 if (res.err_msg === 'get_brand_wcpay_request:ok') { 205 if (res.err_msg === 'get_brand_wcpay_request:ok') {
200 - console.log('成功') 206 + console.log('成功')
201 } else { 207 } else {
202 console.log('失败') 208 console.log('失败')
203 alert('支付失败') 209 alert('支付失败')
src/components/parkRecord.vue
@@ -171,7 +171,7 @@ export default { @@ -171,7 +171,7 @@ export default {
171 parkState: 10, 171 parkState: 10,
172 terminalSource: 7, 172 terminalSource: 7,
173 carNumber: this.carNumber, 173 carNumber: this.carNumber,
174 - // sign: md5sign, 174 + carNumberColor: this.carColor,
175 orgId: this.$utils.myOrgId 175 orgId: this.$utils.myOrgId
176 } 176 }
177 jsondata.sign = this.$utils.signObject(jsondata) 177 jsondata.sign = this.$utils.signObject(jsondata)
src/components/plateNumber.vue
@@ -389,7 +389,8 @@ export default { @@ -389,7 +389,8 @@ export default {
389 this.$router.push({ 389 this.$router.push({
390 path:'parkRecord', 390 path:'parkRecord',
391 query:{ 391 query:{
392 - carNumber:plateLicense 392 + carNumber:plateLicense,
  393 + carNumberColor: this.currentColor
393 } 394 }
394 }) 395 })
395 }, 396 },
src/utils/request.js
@@ -7,7 +7,11 @@ const service = axios.create({ @@ -7,7 +7,11 @@ const service = axios.create({
7 7
8 // http://pay.service.renniting.cn/ 赤峰 8 // http://pay.service.renniting.cn/ 赤峰
9 // http://pay.service.huangshiparking.com/ 黄石 9 // http://pay.service.huangshiparking.com/ 黄石
10 - baseURL: 'http://pay.service.renniting.cn/', // url = base url + request url 10 +
  11 + // 'http://39.98.58.92:8090'; 赤峰测试环境
  12 +
  13 +
  14 + baseURL: 'http://39.98.58.92:8090/', // url = base url + request url
11 // withCredentials: true, // send cookies when cross-domain requests 15 // withCredentials: true, // send cookies when cross-domain requests
12 timeout: 6000 // request timeout 16 timeout: 6000 // request timeout
13 }) 17 })
src/utils/utils.js
@@ -91,16 +91,16 @@ export default { @@ -91,16 +91,16 @@ export default {
91 // ud8yq5tv0inxupc05xfeau39jywlqoj2 新的id 91 // ud8yq5tv0inxupc05xfeau39jywlqoj2 新的id
92 // ny1u72b6k374sg379z0kqjgfxe2ycnpw 新的签名 92 // ny1u72b6k374sg379z0kqjgfxe2ycnpw 新的签名
93 93
94 - myVarAppid:'0eca8f5373ca4866aec2f8e9d9367104',// 公共请求Appid 94 + myVarAppid:'ud8yq5tv0inxupc05xfeau39jywlqoj2',// 公共请求Appid
95 95
96 myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息 96 myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息
97 97
98 - myVxAppId: 'wxa1a66cc7d263afe6', 98 + myVxAppId: 'wx2af2bab90d433c86',
99 // 测试环境 微信赤峰 appid wxff4cebaedbf4f886 99 // 测试环境 微信赤峰 appid wxff4cebaedbf4f886
100 // 微信赤峰 appid wx2af2bab90d433c86 100 // 微信赤峰 appid wx2af2bab90d433c86
101 // 黄石 appid wxa1a66cc7d263afe6 101 // 黄石 appid wxa1a66cc7d263afe6
102 102
103 - myOrgId: '10079', // 归属地 赤峰id 10003 黄石 10079 103 + myOrgId: '10003', // 归属地 赤峰id 10003 黄石 10079
104 104
105 myGetSign: function (objb) { // 获取签名 105 myGetSign: function (objb) { // 获取签名
106 var compare = function (obj1, obj2) { 106 var compare = function (obj1, obj2) {
@@ -115,13 +115,13 @@ export default { @@ -115,13 +115,13 @@ export default {
115 } 115 }
116 } 116 }
117 objb.sort(compare); 117 objb.sort(compare);
118 - var strmd5 = '14318527b13840c2a4af63fef52c2d6e'; 118 + var strmd5 = 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
119 for(var i=0;i<objb.length;i++){ 119 for(var i=0;i<objb.length;i++){
120 if(objb[i].value != null&&objb[i].value != ''){ 120 if(objb[i].value != null&&objb[i].value != ''){
121 strmd5 += objb[i].keyname+objb[i].value; 121 strmd5 += objb[i].keyname+objb[i].value;
122 } 122 }
123 } 123 }
124 - strmd5 += '14318527b13840c2a4af63fef52c2d6e'; 124 + strmd5 += 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
125 // console.log('strmd5-------->'+strmd5); 125 // console.log('strmd5-------->'+strmd5);
126 strmd5 = md5(strmd5); 126 strmd5 = md5(strmd5);
127 strmd5=strmd5.toUpperCase(); 127 strmd5=strmd5.toUpperCase();