Ver código fonte

海外商品-微信支付修改

kevin 1 ano atrás
pai
commit
42e8c02860
2 arquivos alterados com 76 adições e 2 exclusões
  1. 2 2
      frontendEle/src/views/shop/order-overseas.vue
  2. 74 0
      pay/wechat.html

+ 2 - 2
frontendEle/src/views/shop/order-overseas.vue

@@ -237,8 +237,8 @@
             }
             }
           } else {
           } else {
             //移动端
             //移动端
-            let origin = window.location.origin + '/#/shop/order-list'
-            window.location.replace(info.mweb_url + '&redirect_url=' + encodeURIComponent(origin))
+            // let origin = window.location.origin + '/#/shop/order-list'
+            window.location.replace("https://fele.ncshop.elken.com/wechat.html?mweb_url=" + info.mweb_url)
             if (this.payType === 'WECHAT') {
             if (this.payType === 'WECHAT') {
               //微信
               //微信
             } else {
             } else {

+ 74 - 0
pay/wechat.html

@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>pay</title>
+</head>
+<body>
+	<div class="loading"></div>
+</body>
+<script type="text/javascript" src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
+<script>
+	function getQueryString(name, url) {
+		let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+		let r = url.substr(1).match(reg);
+	    if (r != null) {
+	        return unescape(r[2]);
+	    }
+	    return null;
+	}
+
+	let mweb_url = getQueryString('mweb_url', window.location.search);
+	console.log('mweb_url', mweb_url)
+	$(function() {
+		// test
+		// let redirect_url = 'https://nc-fele-mips.elken.com:8015/#/shop/order-list';
+		// prod
+		let redirect_url = 'https://fele.ncshop.elken.com/#/shop/order-list';
+		// window.location.replace(mweb_url + '&redirect_url=' + encodeURIComponent(redirect_url))
+	});
+</script>
+<style>
+	html{
+		width: 100%;
+		height: 100%;
+		overflow: hidden;
+	}
+	body{
+		width: 100%;
+		height: 100%;
+		overflow: hidden;
+
+	}
+	.payment {
+		width: 100%;
+		height: 100%;
+	}
+
+	.loading {
+		position: relative;
+		width: 100%;
+		height: 100%;
+	}
+
+	.loading::before {
+		content: '';
+		position: absolute;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		width: 50px;
+		height: 50px;
+		border-radius: 50%;
+		border: 3px solid rgba(0, 0, 0, .2);
+		border-top-color: #000;
+		animation: rotate 1s infinite linear;
+	}
+
+	@keyframes rotate {
+		to {
+			transform: translate(-50%, -50%) rotate(360deg);
+		}
+	}
+</style>
+</html>