diff --git a/src/components/orderPay.vue b/src/components/orderPay.vue
index a96aa88..e3d9f35 100644
--- a/src/components/orderPay.vue
+++ b/src/components/orderPay.vue
@@ -208,22 +208,27 @@ export default {
if (this.clientBrowser == '微信') { // 微信支付
- //第一步获取openid
- var codeParams = {
- code: this.webAppCode,
- appId: this.$utils.myVxAppId
- };
- getOpenId(codeParams).then(res => {
- if (res.code == 0) {
- me.vxPay(res.data, this.orderId)
- } else if (res.code == 40163) { //code been used, hints[重复code问题]
- alert('请重新扫码')
- console.log(res.message);
- } else {
- alert('请重新扫码')
- }
- })
-
+ let _openId = sessionStorage.getItem('openIdData')
+ if(_openId){
+ me.vxPay(_openId, this.orderId)
+ }else {
+ //第一步获取openid
+ var codeParams = {
+ code: this.webAppCode,
+ appId: this.$utils.myVxAppId
+ };
+ getOpenId(codeParams).then(res => {
+ if (res.code == 0) {
+ me.vxPay(res.data, this.orderId)
+ sessionStorage.setItem('openIdData', res.data)
+ } else if (res.code == 40163) { //code been used, hints[重复code问题]
+ alert('请重新扫码重复code问题')
+ console.log(res.message);
+ } else {
+ alert('请重新扫码')
+ }
+ })
+ }
}
},
@@ -265,125 +270,140 @@ export default {
}
})
},
- onBridgeReady(params) {
- let me = this
- console.log('调用微信支付WeixinJSBridge')
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest', params,
- //
- // 'getBrandWCPayRequest', { // 下面参数内容都是后台返回的
- // 'appId': data.appId, // 公众号名称,由商户传入
- // 'timeStamp': data.timeStamp, // 时间戳
- // 'nonceStr': data.nonceStr, // 随机串
- // 'package': data.package, // 预支付id
- // 'signType': data.signType, // 微信签名方式
- // 'paySign': data.paySign // 微信签名
- // },
- function (res) {
- // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
- if (res.err_msg === 'get_brand_wcpay_request:ok') {
- console.log('成功')
- var salt = me.$utils.myCommonSalt(32);
- let wxparams = {
- pageNum: 1,
- pageSize: 10000,
- parkState: 10,
- terminalSource: 7,
- carNumber: me.carNumber,
- app_id: me.$utils.myVarAppid,
- deviceInfo: me.$utils.myDeviceInfo,
- salt: salt,
- sign_type: "md5",
- token:'',
- }
- wxparams.sign = me.$utils.signObject(wxparams)
- queryParkingRecordPageByCarNumbers(wxparams).then(response => {
- console.log(response)
- me.parkList = response.data.dataList
-
- if(me.parkList.length == 0){
- me.$router.push({
- path:'parkRecord',
- query:{
- carNumber: me.carNumber,
- carNumberColor: me.carWrapBG,
- parkFlag: 0 // 0表示在停 1表示历史
- }
- })
+ onBridgeReady(params) {
+ let me = this
+ console.log('调用微信支付WeixinJSBridge')
+ WeixinJSBridge.invoke(
+ 'getBrandWCPayRequest', params,
+ //
+ // 'getBrandWCPayRequest', { // 下面参数内容都是后台返回的
+ // 'appId': data.appId, // 公众号名称,由商户传入
+ // 'timeStamp': data.timeStamp, // 时间戳
+ // 'nonceStr': data.nonceStr, // 随机串
+ // 'package': data.package, // 预支付id
+ // 'signType': data.signType, // 微信签名方式
+ // 'paySign': data.paySign // 微信签名
+ // },
+ function (res) {
+ // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+ if (res.err_msg === 'get_brand_wcpay_request:ok') {
+ console.log('成功')
+ var salt = me.$utils.myCommonSalt(32);
+ let wxparams = {
+ pageNum: 1,
+ pageSize: 10000,
+ parkState: 10,
+ terminalSource: 7,
+ carNumber: me.carNumber,
+ app_id: me.$utils.myVarAppid,
+ deviceInfo: me.$utils.myDeviceInfo,
+ salt: salt,
+ sign_type: "md5",
+ token:'',
}
-
- me.parkingData = me.parkList.filter(item => {
- return item.parkState == '10'
- })
- console.log(me.parkingData)
- me.historyList = me.parkList.filter(item => {
- return item.parkState == '20'
- })
- console.log(me.historyList)
- if(me.parkingData.length>0){
- MessageBox.confirm('', {
- message: '您当前有在停订单 是否立即支付?',
- title: '温馨提示',
- confirmButtonText: '去支付',
- cancelButtonText: '取消'
- }).then(action => {
- if (action == 'confirm') { //确认的回调
- console.log('确定');
- me.$router.push({
- path:'parkRecord',
- query:{
- carNumber: me.carNumber,
- carNumberColor: me.carWrapBG,
- parkFlag: 0 // 0表示在停 1表示历史
+ wxparams.sign = me.$utils.signObject(wxparams)
+ queryParkingRecordPageByCarNumbers(wxparams).then(response => {
+ console.log(response)
+ me.parkList = response.data.dataList
+
+ // alert(JSON.stringify(me.parkList))
+ // alert(me.parkList.length)
+ if(me.parkList.length == 0){
+ me.$router.push({
+ path:'parkRecord',
+ query:{
+ carNumber: me.carNumber,
+ carNumberColor: me.carWrapBG,
+ parkFlag: 0 // 0表示在停 1表示历史
+ }
+ })
+
+ }else{
+ me.parkingData = me.parkList.filter(item => {
+ return item.parkState == '10'
+ })
+ console.log(me.parkingData)
+ me.historyList = me.parkList.filter(item => {
+ return item.parkState == '20'
+ })
+ console.log(me.historyList)
+
+ if(me.historyList.length>0){
+ MessageBox.confirm('', {
+ message: '您当前有历史欠费 是否立即补缴?',
+ title: '温馨提示',
+ confirmButtonText: '去补缴',
+ cancelButtonText: '取消'
+ }).then(action => {
+ if (action == 'confirm') { //确认的回调
+ console.log('确定');
+ me.$router.push({
+ path:'parkRecord',
+ query:{
+ carNumber: me.carNumber,
+ carNumberColor: me.carWrapBG,
+ parkFlag: 1 // 0表示在停 1表示历史
+ }
+ })
}
- })
- }
- }).catch(err => {
- if (err == 'cancel') { //取消的回调
- console.log('取消');
- }
- });
- }
-
- if(me.parkingData.length==0&&me.historyList.length>0){
- MessageBox.confirm('', {
- message: '您当前有历史欠费 是否立即补缴?',
- title: '温馨提示',
- confirmButtonText: '去补缴',
- cancelButtonText: '取消'
- }).then(action => {
- if (action == 'confirm') { //确认的回调
- console.log('确定');
- me.$router.push({
- path:'parkRecord',
- query:{
- carNumber: me.carNumber,
- carNumberColor: me.carWrapBG,
- parkFlag: 1 // 0表示在停 1表示历史
+ }).catch(err => {
+ if (err == 'cancel') { //取消的回调
+ console.log('取消');
}
- })
- }
- }).catch(err => {
- if (err == 'cancel') { //取消的回调
- console.log('取消');
+ });
+ }else{
+
+ if(me.paySrcType==101){ //缴费了本次
+ me.$router.push({
+ path:'parkRecord',
+ query:{
+ carNumber: me.carNumber,
+ carNumberColor: me.carWrapBG,
+ parkFlag: 0 // 0表示在停 1表示历史
+ }
+ })
+ }else{
+ MessageBox.confirm('', {
+ message: '您当前有在停订单 是否立即支付?',
+ title: '温馨提示',
+ confirmButtonText: '去支付',
+ cancelButtonText: '取消'
+ }).then(action => {
+ if (action == 'confirm') { //确认的回调
+ console.log('确定');
+ me.$router.push({
+ path:'parkRecord',
+ query:{
+ carNumber: me.carNumber,
+ carNumberColor: me.carWrapBG,
+ parkFlag: 0 // 0表示在停 1表示历史
+ }
+ })
+ }
+ }).catch(err => {
+ if (err == 'cancel') { //取消的回调
+ console.log('取消');
+ }
+ });
+ }
+
}
- });
- }
+ }
- })
+ })
- } else {
- console.log('失败')
- alert('支付失败')
- me.$router.go(-2);
+ } else {
+ console.log('失败')
+ alert('支付失败')
+ me.$router.go(-2);
+ }
}
- }
- )
- },
+ )
+ },
},
filters: {
}
diff --git a/src/components/parkRecord.vue b/src/components/parkRecord.vue
index dc54ee4..db2dd58 100644
--- a/src/components/parkRecord.vue
+++ b/src/components/parkRecord.vue
@@ -113,24 +113,24 @@
暂无记录
- 请至少选择一笔记录 停车15分钟内无需缴费,申请成功。