瀏覽代碼

增加点金计划页面

zaijin 3 年之前
父節點
當前提交
5b8566350c

+ 2 - 0
pages/center/order/orderDetails/orderDetails.vue

@@ -231,6 +231,8 @@ export default {
         return '贵州银行扫码支付'
       } else if (value === 5) {
         return '贵州银行被扫支付'
+      } else if (value === 6) {
+        return '贵州银行无感支付'
       } else {
         return ''
       }

+ 9 - 0
pages/handleMonthly/handleMonthly.vue

@@ -75,6 +75,9 @@
 
 <script>
 	import getUrlParams from "../../utils/getUrlParams.js";
+	// import {
+	// 	getEnvIsWx
+	// } from '@/utils/judgEnvironment.js'
 	import {
 		monthlyWxPay
 	} from '@/common/http.api.js'
@@ -258,6 +261,7 @@
 					jumpUrl: this.jumpUrl
 				}).then(res => {
 					if(res.code === 200){
+						localStorage.setItem('jumpUrl', this.jumpUrl)
 						window.location.href = res.data.url
 					} else {
 						this.$refs.uToast.show({
@@ -333,6 +337,11 @@
 				this.$u.api.monthlyWxPay(params)
 					.then(res => {
 						if (res.code === 200) {
+							// if (getEnvIsWx()) {
+							// 	location.href = res.data.qrCodeUrl + '&jump_url=' + encodeURIComponent(this.jumpUrl)
+							// } else {
+							// 	location.href = res.data.qrCodeUrl
+							// }
 							location.href = res.data.qrCodeUrl
 						} else {
 							this.$refs.uToast.show({

+ 10 - 1
pages/paymentMethod/paymentMethod.vue

@@ -40,6 +40,9 @@
 
 <script>
 	import getUrlParams from "@/utils/getUrlParams.js";
+	// import {
+	// 	getEnvIsWx
+	// } from '@/utils/judgEnvironment.js'
 	export default {
 		props: {
 			// 弹框显示
@@ -84,7 +87,7 @@
 				this.$u.api.payGzbank(params).then(res=>{
 					if (res.data.needPay) {
 						let payUrl = res.data.url;
-						window.location.href = payUrl;
+						location.href = payUrl;
 					} else {
 						this.$refs.uToast.show({
 							title: '无需支付',
@@ -171,6 +174,12 @@
 				this.$u.api.ordinaryWxPay(params)
 					.then(res => {
 						if (res.code === 200) {
+							// if (getEnvIsWx()) {
+							// 	location.href = res.data.qrCodeUrl + '&jump_url=' + encodeURIComponent(this.jumpUrl)
+							// } else {
+							// 	location.href = res.data.qrCodeUrl
+							// }
+							localStorage.setItem('jumpUrl', this.jumpUrl)
 							location.href = res.data.qrCodeUrl
 						} else {
 							uni.hideLoading()

+ 1 - 0
static/html/WXPAY_verify_233079524.txt

@@ -0,0 +1 @@
+5f940481154dfd5ab14cdc0727225e8d

+ 146 - 0
static/html/wxPayCallback - 副本.html

@@ -0,0 +1,146 @@
+<html>
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+	<link rel="shortcut icon" type="image/x-icon" href="./../favicon.ico">
+	<title>城市智慧停车中转页面</title>
+	<style type="text/css">
+		html,
+		body,
+		div {
+			margin: 0;
+			padding: 0;
+		}
+		.container {
+			height: calc(100% - 26vh);
+			padding: 13vh 0;
+			text-align: center;
+			background: linear-gradient(138deg, #7EBAB8 0%, #48999A 100%);
+			box-shadow: 0px 2px 4px 0px #0B7C7D;
+		}
+		.text-img {
+			height: 21vh;
+			background-size: contain;
+			background-repeat: no-repeat;
+			background-position: center center;
+			background-image: url('./../img/text-html-bg.png');
+		}
+		.car-img {
+			height: 40vh;
+			margin-top: 39px;
+			background-size: contain;
+			background-repeat: no-repeat;
+			background-position: 19px center;
+			background-image: url('./../img/car-html-bg.png');
+		}
+		.button {
+			width: calc(100% - 84px);
+			height: 6vh;
+			margin-top: 4vh;
+			outline: none;
+			border: none;
+			background: #FFFFFF;
+			box-shadow: 0px 7px 13px 0px rgba(0, 105, 106, 0.26);
+			border-radius: 10px;
+			font-size: 1.1em;
+			font-weight: 500;
+			color: #1D8587;
+			font-family: 'PingFangSC-Medium, PingFang SC';
+		}
+	</style>
+</head>
+<body>
+	<div class="container">
+		<div class="text-img"></div>
+		<div class="car-img"></div>
+		<button type="button" class="button" onclick="goToBgzchina()">回到普定智慧停车</button>
+	</div>
+	<!-- <script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script> -->
+	<script type="text/javascript" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+	<script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
+	<script>
+		// 测试环境
+		// const baseUrl = 'https://wx.hw.hongweisoft.com/parking'
+		// 正式环境
+		const baseUrl = 'https://parking.pdzhtc.com'
+		
+		//	初始化console.log(?)
+		// const vConsole = new VConsole();
+		
+		// 尽量在页面加载完成后实现“点金计划”的相关代码
+		// 函数-获取返回页面参数
+		function getParameters(key) {
+			const params =  window.location.search.substring(1);
+			const vars = params.split("&");
+			for (let i = 0; i < vars.length; i++) {
+					const kvPair = vars[i].split("=");
+					if (kvPair[0] == key) return kvPair[1];
+			}
+			return null;
+		};
+		// end getParameters(key)
+	
+		//测试微信通知过来的参数【非必需】
+		var sub_mch_id = getParameters("sub_mch_id"); //特约商户号
+		console.log("1、特约商户号=" + sub_mch_id);
+		var out_trade_no = getParameters("out_trade_no"); //商户订单号
+		console.log("2、商户订单号=" + out_trade_no);
+		var check_code = getParameters("check_code"); //md5校验码。如果需要计算(参考说明文档)校验则需要后台完成
+		console.log("3、md5校验码=" + check_code);
+		// 跳转地址
+		let jump_url = 'https://h5.pdzhtc.com'
+		if (out_trade_no) {
+			getOrderId(out_trade_no)
+		}
+		//初始化微信点金计划小票【必需,否则在微信不能展示该页面】
+		let mchData = {
+			action: 'onIframeReady',
+			displayStyle: 'SHOW_CUSTOM_PAGE',
+			height: 960,
+		};
+		//高度可选(参考说明文档)
+		const postData = JSON.stringify(mchData);
+		parent.postMessage(postData, 'https://payapp.weixin.qq.com');
+
+		//测试跳转到其他页面【非必需】
+		function goToBgzchina() {
+				const mchData = {
+						action: 'jumpOut',
+						jumpOutUrl: jump_url // 要跳转到的页面。注意:不支持跳转到小程序
+				};
+				const postData = JSON.stringify(mchData);
+				parent.postMessage(postData, 'https://payapp.weixin.qq.com');
+		}
+		// end goToBgzchina
+		
+		// 通过商户订单号获取跳转地址
+		function getOrderId(id) {
+			const localToken = JSON.parse(localStorage.getItem('lifeData') ?? '{}')
+			const token = localToken?.data?.vuex_token
+			$.ajax({
+				//请求方式
+				type : "get",
+				//请求地址
+				url : baseUrl + '/client/orderinfo/orderListByPoly/' + id,
+				// token
+				beforeSend: function(request) {
+					request.setRequestHeader("Authorization", 'Bearer ' + token);
+				},
+				//请求成功
+				success: function(result) {
+						if (result.code === 200) {
+							jump_url = result?.data?.jumpUrl ?? 'https://h5.pdzhtc.com'
+						} else {
+							alert(result.msg)
+						}
+				},
+				//请求失败,包含具体的错误信息
+				error: function(e){
+						alert('程序错误!')
+				}
+		});
+		}
+	</script>
+</body>
+</html>

+ 101 - 0
static/html/wxPayCallback.html

@@ -0,0 +1,101 @@
+<!--周世豪,20210716-->
+<html>
+<head>
+    <meta charset="utf-8">
+		<meta http-equiv="X-UA-Compatible" content="IE=edge">
+		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <title>贵州银行聚合支付小票demo</title>
+    <!--<script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script>-->
+    <script type="text/javascript" src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+    <script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
+    <style type="text/css">
+			body {
+				margin: 0;
+				padding: 0;
+				width: 100%;
+				height: 600px;
+			}
+			.container {
+				height: 100%;
+				padding: 50px 0;
+				text-align: center;
+				background: linear-gradient(138deg, #7EBAB8 0%, #48999A 100%);
+				box-shadow: 0px 2px 4px 0px #0B7C7D;
+			}
+			.text-img {
+				width: calc(100% - 40px);
+				margin: 0 auto;
+			}
+			.car-img {
+				width: 100%;
+				margin-top: 39px;
+			}
+			.button {
+				display: inline-block;
+				width: calc(100% - 84px);
+				height: 6vh;
+				line-height: 6vh;
+				text-decoration: none;
+				margin-top: 4vh;
+				outline: none;
+				border: none;
+				background: #FFFFFF;
+				box-shadow: 0px 7px 13px 0px rgba(0, 105, 106, 0.26);
+				border-radius: 10px;
+				font-size: 1.1em;
+				font-weight: 500;
+				color: #1D8587;
+				font-family: 'PingFangSC-Medium, PingFang SC';
+			}
+    </style>
+</head>
+<body>
+    <div class="container">
+		<div class="text-img">
+			<img src="https://h5.pdzhtc.com/static/img/text-html-bg.png" alt="" width="375" height="150"/>
+		</div>
+		<div class="car-img">
+			<img src="https://h5.pdzhtc.com/static/img/car-html-bg.png" alt="" width="375" height="270"/>
+		</div>
+		<a href="javascript:goToBgzchina()" class="button">回到普定智慧停车</a>
+	</div>
+    <script>
+        //const vConsole = new VConsole();//初始化console.log(?)
+        //尽量在页面加载完成后实现“点金计划”的相关代码
+        //函数-获取返回页面参数
+        function getParameters(key) {
+            var params = window.location.search.substring(1);
+            var vars = params.split("&");
+            for (var i = 0; i < vars.length; i++) {
+                var kvPair = vars[i].split("=");
+                if (kvPair[0] == key)return kvPair[1];
+            }
+            return null;
+        };//end getParameters(key)
+    
+        //测试微信通知过来的参数【非必需】
+        var sub_mch_id = getParameters("sub_mch_id"); //特约商户号
+        console.log("1、特约商户号=" + sub_mch_id);
+        var out_trade_no = getParameters("out_trade_no"); //商户订单号
+        console.log("2、商户订单号=" + out_trade_no);
+        var check_code = getParameters("check_code"); //md5校验码。如果需要计算(参考说明文档)校验则需要后台完成
+        console.log("3、md5校验码=" + check_code);
+    
+        //初始化微信点金计划小票【必需,否则在微信不能展示该页面】
+        let mchData ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE',
+                               height:960};//高度可选(参考说明文档)
+        var postData = JSON.stringify(mchData);
+        parent.postMessage(postData,'https://payapp.weixin.qq.com');
+    
+        //测试跳转到其他页面【非必需】
+        function goToBgzchina() {
+            var mchData = {
+                action: 'jumpOut',
+                jumpOutUrl: 'https://h5.pdzhtc.com' //要跳转到的页面。注意:不支持跳转到小程序
+            };
+            var postData = JSON.stringify(mchData);
+            parent.postMessage(postData, 'https://payapp.weixin.qq.com');
+        }//end goToBgzchina
+    </script>
+</body>
+</html>

二進制
static/img/car-html-bg.png


二進制
static/img/text-html-bg.png


+ 12 - 0
utils/judgEnvironment.js

@@ -0,0 +1,12 @@
+/**
+ * 判断当前浏览器环境是不是微信
+ */
+export function getEnvIsWx() {
+	let en = window.navigator.userAgent.toLowerCase()
+	// 匹配en中是否含有MicroMessenger字符串
+	if (en.match(/MicroMessenger/i) == 'micromessenger') {
+		return true
+	} else {
+		return false
+	}
+}