|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+<head>
|
|
|
4
|
+ <title>微信支付</title>
|
|
|
5
|
+ <meta charset="utf-8" />
|
|
|
6
|
+ <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" />
|
|
|
7
|
+ <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/lanren.css">
|
|
|
8
|
+ <script type="text/javascript">
|
|
|
9
|
+ //调用微信JS api 支付
|
|
|
10
|
+ function jsApiCall()
|
|
|
11
|
+ {
|
|
|
12
|
+ WeixinJSBridge.invoke(
|
|
|
13
|
+ "getBrandWCPayRequest",
|
|
|
14
|
+ {$jsApiParameters},
|
|
|
15
|
+ function(res){
|
|
|
16
|
+ WeixinJSBridge.log(res.err_msg);
|
|
|
17
|
+ alert(res.err_code+res.err_desc+res.err_msg);
|
|
|
18
|
+ if (res.err_msg=='get_brand_wcpay_request:cancel'){
|
|
|
19
|
+ //支付取消逻辑
|
|
|
20
|
+ }else if (res.err_msg=='get_brand_wcpay_request:ok'){
|
|
|
21
|
+ //支付成功逻辑
|
|
|
22
|
+ }else{
|
|
|
23
|
+ //支付失败逻辑
|
|
|
24
|
+ }
|
|
|
25
|
+ }
|
|
|
26
|
+ );
|
|
|
27
|
+ }
|
|
|
28
|
+ function callpay()
|
|
|
29
|
+ {
|
|
|
30
|
+ if (typeof WeixinJSBridge == "undefined"){
|
|
|
31
|
+ if( document.addEventListener ){
|
|
|
32
|
+ document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
|
|
33
|
+ }else if (document.attachEvent){
|
|
|
34
|
+ document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
|
|
35
|
+ document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
|
|
36
|
+ }
|
|
|
37
|
+ }else{
|
|
|
38
|
+ jsApiCall();
|
|
|
39
|
+ }
|
|
|
40
|
+ }
|
|
|
41
|
+ </script>
|
|
|
42
|
+</head>
|
|
|
43
|
+<body>
|
|
|
44
|
+
|
|
|
45
|
+<div class="wenx_xx">
|
|
|
46
|
+ <div class="mz">DEF0000000001</div>
|
|
|
47
|
+ <div class="wxzf_price">¥0.01</div>
|
|
|
48
|
+</div>
|
|
|
49
|
+<div class="skf_xinf">
|
|
|
50
|
+ <div class="all_w"> <span class="bt">收款方</span> <span class="fr">{$site_info.site_name}</span> </div>
|
|
|
51
|
+</div>
|
|
|
52
|
+<a onclick="callpay()" class="ljzf_but all_w">立即支付</a>
|
|
|
53
|
+<script type="text/javascript">
|
|
|
54
|
+ callpay();
|
|
|
55
|
+</script>
|
|
|
56
|
+</body>
|
|
|
57
|
+</html> |