Commit c865a00f85df43e337af7c230670e9ee495623bc

Authored by liuqimichale
1 parent 44cb771a

赤峰支付宝支付

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