|
@@ -16,142 +16,139 @@
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background: #F7F7F7;
|
|
|
+ font-size: 100%;
|
|
|
+ font-family: PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;
|
|
|
}
|
|
|
.maincontent {
|
|
|
width: 100%;
|
|
|
+ background: #ffffff;
|
|
|
+ padding: 9.6% 0;
|
|
|
}
|
|
|
img {
|
|
|
width: 100%;
|
|
|
min-width: 100%;
|
|
|
height: auto;
|
|
|
}
|
|
|
- </style>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
-
|
|
|
-<?php
|
|
|
-
|
|
|
-if($output['pay_state'] == 'success') {
|
|
|
- echo "<h3>支付成功</h3>";
|
|
|
-}
|
|
|
-elseif($output['pay_state'] == 'fail') {
|
|
|
- echo "<h3>支付失败</h3>";
|
|
|
-}
|
|
|
-else {
|
|
|
- echo "<h3>支付处理中</h3>";
|
|
|
-}
|
|
|
- $pay_state = $output['pay_state'];
|
|
|
- echo "<input type=\"hidden\" value=\"{$pay_state}\" name=\"pay_state\" id=\"pay_state\">";
|
|
|
-?>
|
|
|
-</body>
|
|
|
-
|
|
|
-<script>
|
|
|
- function init_ios_bridge(callback)
|
|
|
- {
|
|
|
- if (window.WebViewJavascriptBridge) {
|
|
|
- return callback(WebViewJavascriptBridge);
|
|
|
+ .img_box {
|
|
|
+ width: 26%;
|
|
|
+ margin: 0 auto;
|
|
|
}
|
|
|
-
|
|
|
- if (window.WVJBCallbacks) {
|
|
|
- return window.WVJBCallbacks.push(callback);
|
|
|
+ .status_msg_box {
|
|
|
+ width: 75%;
|
|
|
+ margin: 6.5% auto 0 auto;
|
|
|
+ display: table;
|
|
|
+ font-size: 1rem;
|
|
|
}
|
|
|
-
|
|
|
- window.WVJBCallbacks = [callback];
|
|
|
- var WVJBIframe = document.createElement('iframe');
|
|
|
- WVJBIframe.style.display = 'none';
|
|
|
- WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
|
|
|
- document.documentElement.appendChild(WVJBIframe);
|
|
|
- setTimeout(function() {
|
|
|
- document.documentElement.removeChild(WVJBIframe);
|
|
|
- }, 0);
|
|
|
- }
|
|
|
-
|
|
|
- function init_android_bridge()
|
|
|
- {
|
|
|
- if (window.WebViewJavascriptBridge)
|
|
|
- {
|
|
|
- WebViewJavascriptBridge.init();
|
|
|
+ .status_icon {
|
|
|
+ display: table-cell;
|
|
|
+ width: 12.5%;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- document.addEventListener(
|
|
|
- 'WebViewJavascriptBridgeReady'
|
|
|
- , function() {
|
|
|
- WebViewJavascriptBridge.init();},
|
|
|
- false);
|
|
|
+ .status_msg {
|
|
|
+ display: table-cell;
|
|
|
+ width: 87.5%;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
+ color: #333333;
|
|
|
+ padding-left: 3.9%;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- function call_native_handler(handler, data)
|
|
|
- {
|
|
|
- if (window.WebViewJavascriptBridge)
|
|
|
- {
|
|
|
- window.WebViewJavascriptBridge.callHandler(handler,
|
|
|
- data,
|
|
|
- null);
|
|
|
+ .link {
|
|
|
+ margin-top: 20%;
|
|
|
+ padding: 0 5%;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- document.addEventListener(
|
|
|
- 'WebViewJavascriptBridgeReady'
|
|
|
- , function()
|
|
|
- {
|
|
|
- window.WebViewJavascriptBridge.callHandler(
|
|
|
- handler,
|
|
|
- data,
|
|
|
- null,
|
|
|
- false);
|
|
|
- }
|
|
|
- );
|
|
|
+ .callback_link {
|
|
|
+ width: 48%;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 5px;
|
|
|
+ color: #fff;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
- }
|
|
|
- function register_js_hander(name,callback)
|
|
|
- {
|
|
|
- if (window.WebViewJavascriptBridge)
|
|
|
- {
|
|
|
- window.WebViewJavascriptBridge.registerHandler(name,
|
|
|
- callback);
|
|
|
+ .link_1 {
|
|
|
+ background: #09bb07;
|
|
|
+ float: left;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- document.addEventListener(
|
|
|
- 'WebViewJavascriptBridgeReady'
|
|
|
- , function()
|
|
|
- {
|
|
|
- window.WebViewJavascriptBridge.registerHandler(name,callback);
|
|
|
- }
|
|
|
- );
|
|
|
+ .link_2 {
|
|
|
+ background: #ff4e4e;
|
|
|
+ float:right;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- var isMobile = {
|
|
|
- Android: function() {
|
|
|
- return navigator.userAgent.match(/Android/i);
|
|
|
- },
|
|
|
- BlackBerry: function() {
|
|
|
- return navigator.userAgent.match(/BlackBerry/i);
|
|
|
- },
|
|
|
- iOS: function() {
|
|
|
- return navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
|
|
- },
|
|
|
- Opera: function() {
|
|
|
- return navigator.userAgent.match(/Opera Mini/i);
|
|
|
- },
|
|
|
- Windows: function() {
|
|
|
- return navigator.userAgent.match(/IEMobile/i);
|
|
|
- },
|
|
|
- any: function() {
|
|
|
- return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
|
|
|
+ .link_3.callback_link {
|
|
|
+ width: 100%;
|
|
|
+ background: #09bb07;
|
|
|
}
|
|
|
- };
|
|
|
+ /* iphone5 */
|
|
|
+ @media screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2){
|
|
|
+ .status_msg_box {
|
|
|
+ width: 84%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
|
|
|
+<?php if($output['pay_state'] != 'no_order') { ?>
|
|
|
+<div class="maincontent">
|
|
|
+ <div class="img_box">
|
|
|
+ <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/cmbpay/images/success_icon.png" alt="支付成功"/>
|
|
|
+ </div>
|
|
|
+ <div class="status_msg_box">
|
|
|
+ <div class="status_icon">
|
|
|
+ <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/cmbpay/images/ok.png" alt="支付成功"/>
|
|
|
+ </div>
|
|
|
+ <div class="status_msg">
|
|
|
+ 恭喜您,订单支付成功!我们会尽快将宝贝送达哦!
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="link">
|
|
|
+ <div class="callback_link link_1" id="link_main">返回</div>
|
|
|
+ <div class="callback_link link_2" id="link_order">查看订单</div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<?php } else { ?>
|
|
|
+<div class="maincontent">
|
|
|
+ <div class="img_box">
|
|
|
+ <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/cmbpay/images/fail_icon.png" alt="支付成功"/>
|
|
|
+ </div>
|
|
|
+ <div class="status_msg_box">
|
|
|
+ <div class="status_icon">
|
|
|
+ <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/cmbpay/images/error.png" alt="支付成功"/>
|
|
|
+ </div>
|
|
|
+ <div class="status_msg">
|
|
|
+ 温馨提示:如果您已付款,请稍候前往我的订单查看支付情况!
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="link">
|
|
|
+ <div class="callback_link link_3" id="link_home">返回</div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<?php }?>
|
|
|
+<input type="hidden" value="<?php if($output['pay_state'] != 'no_order') { echo $output['pay_sn']; } ?>" id="pay_sn">
|
|
|
+</body>
|
|
|
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/bridge.js"></script>
|
|
|
+<script>
|
|
|
if(isMobile.iOS()) {
|
|
|
init_ios_bridge(function(bridge) { });
|
|
|
} else {
|
|
|
init_android_bridge();
|
|
|
}
|
|
|
|
|
|
- var data=document.getElementById('pay_state').value;
|
|
|
- call_native_handler('CMBonPayReturn',data);
|
|
|
+ var link_main=document.getElementById('link_main'),
|
|
|
+ link_order=document.getElementById('link_order'),
|
|
|
+ link_home=document.getElementById('link_home'),
|
|
|
+ pay_sn=document.getElementById('pay_sn').value;
|
|
|
+
|
|
|
+ link_main.addEventListener('click',function(){
|
|
|
+ call_native_handler('on_native_click','{"action":"main","params":null}');
|
|
|
+ },false);
|
|
|
+
|
|
|
+ link_order.addEventListener('click',function(){
|
|
|
+ call_native_handler('on_native_click','{"action":"orderinfo","params":' + pay_sn + '}');
|
|
|
+ },false);
|
|
|
+
|
|
|
+ link_home.addEventListener('click',function(){
|
|
|
+ call_native_handler('on_native_click','{"action":"main","params":null}');
|
|
|
+ },false);
|
|
|
</script>
|
|
|
</html>
|