Przeglądaj źródła

优化支付宝与微信支付功能,
PC端可以直接展示二维码,提示用户用支付宝扫码支付

齐博 4 lat temu
rodzic
commit
1cb6b34c01

+ 2 - 0
application/common/upgrade/log19.txt

@@ -0,0 +1,2 @@
+优化支付宝与微信支付功能,
+PC端可以直接展示二维码,提示用户用支付宝扫码支付

+ 24 - 12
application/index/controller/Pay.php

@@ -27,23 +27,31 @@ class Pay extends IndexBase
     
 
     
-    //第一个参数,支付类型,第二个对应的方法,第三个指定PC或WAP,对于后台通知,必须要指定
+    /**
+     * 支付入口
+     * @param string $banktype 支付类型 微信支付weixin或支付宝支付alipay,或余额支付rmb
+     * @param string $action 对应的动作行为
+     * @param string $back_post 指定PC或WAP , 对于后台异步通知回调网址,必须要指定
+     * @return mixed|string|unknown|mixed
+     */
     public function index($banktype = '' , $action = '' , $back_post = '')
     {
         if ($banktype == '') {  //没有指定支付方式的话,就让用户自由选择支付方式
             if (empty($this->user)) {
-                $this->error('请先登录!');
+                //$this->error('请先登录!');
             }
             $this->assign('weburl',$this->weburl);
             $this->assign('money',input('money'));
             return $this->fetch();
-            //$this->error('请先选择支付类型!');
             
-        } elseif($banktype == 'rmb') {  //选择余额支付
+        } elseif($banktype == 'rmb') {  //选择余额支付
             
+            if (empty($this->user)) {
+                $this->error('请先登录!');
+            }
             return $this->rmb_pay();
             
-        } else {    //支付宝或微信支付
+        } else {    //支付宝或微信支付的相关 支付前与支付后的操作
             
             $banktype = strtolower($banktype);
             
@@ -56,7 +64,7 @@ class Pay extends IndexBase
         
         $base = ucfirst($banktype); //微信或支付宝
        
-        if(IN_WAP===true || $back_post=='wap'){
+        if(IN_WAP===true || $back_post=='wap'){  //在手机端,或者是强制指定了手机端
             $auto_name = 'Wap_'.$banktype;
         }else{
             $auto_name = 'Pc_'.$banktype;
@@ -127,7 +135,7 @@ class Pay extends IndexBase
         
         $array['money'] = $money;
         $array['title'] = $title?$title:' 在线充值';
-        $array['numcode'] = mymd5(urldecode($numcode),'DE') ? : rands(10);
+        $array['numcode'] = mymd5(urldecode($numcode),'DE') ?: 'n'.date('ymdHis').rands(3);
         
         $array = array_merge($array,$this->send_config());
 
@@ -140,19 +148,23 @@ class Pay extends IndexBase
                 'banktype'=>$array['bankname'],
                 'callback_class'=>mymd5(urldecode(input('callback_class')),'DE'),     //支付成功后,后台执行的类
         ];
-        //file_put_contents(ROOT_PATH.'AA.txt', $this->weburl,FILE_APPEND);
-        $info = PayModel::get(['numcode'=>$array['numcode']]);
-        if($info==false){
+
+        $info = getArray( PayModel::get(['numcode'=>$array['numcode']]) );
+        if(empty($info)){
             PayModel::create($data);
         }elseif($info['money']!=$array['money']){
             $this->error("金额有误!!!");
         }
         
-        
         return $array;
     }
     
-    //支付成功后执行的,不能定义为public,否则会有漏洞
+    /**
+     * 支付成功后执行的,不能定义为public,否则会有漏洞
+     * @param unknown $numcode 订单号
+     * @param string $havepay 是否执行充值操作.
+     * @return number|string
+     */
     protected function have_pay($numcode,$havepay=true){
         
         $rt = PayModel::get(['numcode'=>$numcode]);

+ 2 - 2
application/index/pay/Alipay.php

@@ -8,7 +8,7 @@ class Alipay extends Pay{
     public function gotopay(){
         
         if(!$this->webdb['wap_ali_id'] || !$this->webdb['wap_ali_partner'] || !$this->webdb['wap_ali_public_key']){
-            $this->error('系统没有设置好支付宝接口,所以不能使用支付宝');
+            $this->error('系统没有设置好支付宝wap接口,所以不能使用支付宝');
         }
         $array = $this->olpay_send();
         include(ROOT_PATH.'plugins/alipay/api/alipayapi.php');
@@ -36,7 +36,7 @@ class Alipay extends Pay{
             $return_url .= 'ispay=1';
             $result = $this->have_pay($pay_end_data_numcode);
             if($result===1){
-                $this->success('已经支付过了',$return_url); 
+                $this->success('已支付成功了',$return_url); 
             }elseif($result===-1){
                 $this->success('订单丢失,请联系管理员,请截图保留该订单号'.$pay_end_data_numcode,$return_url);
             }elseif($result==='ok'){

+ 50 - 5
application/index/pay/Pc_alipay.php

@@ -1,18 +1,38 @@
 <?php
 namespace app\index\pay;
+
 use app\index\controller\Pay;
+use app\index\model\Pay AS PayModel;
 
 class Pc_alipay extends Pay{
     
-    //跳到付款页面,准备付款
+    /**
+     * 跳到付款页面,准备付款
+     * @return mixed|string
+     */
     public function gotopay(){
         
         if(!$this->webdb['alipay_service'] || !$this->webdb['alipay_partner'] || !$this->webdb['alipay_key']){
             $this->error('系统没有设置好支付宝接口,所以不能使用支付宝');
         }
         $array = $this->olpay_send();
-        $this->post_pay($array);
-        
+        return $this->post_pay($array);
+    }
+    
+    /**
+     * 提供给PC页面频繁的刷新是否已支付成功
+     * @return void|unknown|\think\response\Json|void|\think\response\Json
+     */
+    public function checkpay(){
+        $numcode = input('numcode');
+        $info = getArray(PayModel::get(['numcode'=>$numcode]));
+        if($info['ifpay']==1){
+            return $this->ok_js([],'支付成功');
+        }elseif(!$info){
+            return $this->err_js('订单不存在');
+        }else{
+            return $this->err_js('订单未支付');
+        }
     }
     
     
@@ -125,8 +145,33 @@ class Pc_alipay extends Pay{
         
         $sign=md5($_url.config('webdb.alipay_key'));
         $url.="&sign=".$sign."&sign_type=MD5";
-        echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=$url'>";
-        exit;
+        
+        //没有配置支付宝WAP版的话,就不考虑扫码支付!
+        if(!$this->webdb['wap_ali_id'] || !$this->webdb['wap_ali_partner'] || !$this->webdb['wap_ali_public_key']){
+            echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=$url'>";
+            exit;
+        }
+
+        $this->assign('payurl',$url);
+        
+        $data=[
+                'money'=>$array['money'],
+                'return_url'=>get_url('home'),   //扫码付款完成之后,就跳到主页去算了
+                'banktype'=>'alipay',
+                'numcode'=>$array['numcode'],
+        ];
+        $qrcode = get_qrcode( get_url( post_olpay($data, false) ) );    //生成二维码给支付宝扫描,直接进入付款那一步
+        $this->assign('qrcode',$qrcode);
+        
+        //PC页面不停的刷新,判断到支付成功后,进行的页面回跳地址
+        $return_url = input('return_url');
+        $return_url .= strstr($return_url,'?') ? '&ispay=1' : '?ispay=1';
+        $this->assign('return_url',$return_url);
+        
+        $this->assign('numcode',$array['numcode']);
+        $this->assign('money',$array['money']);
+        
+        return $this->fetch('alipay');
     }
     
 }

+ 66 - 20
application/index/pay/Weixin.php

@@ -32,23 +32,28 @@ class Weixin extends Pay{
         }
     }
     
-    protected function weixin_pay_inpc($array){
-        //print_r($array) ;exit;
+    /**
+     * 非微信访问,就展示付款二维码
+     * @param unknown $array
+     * @return mixed|string
+     */
+    protected function weixin_pay_inpc($array=[]){
         $data=[
                 'money'=>$array['money'],
-                'return_url'=>$this->request->domain(),
+                'return_url'=>get_url('home'),      //手机付款完成之后,就跳到主页去算了
                 'banktype'=>'weixin',
                 'numcode'=>$array['numcode'],
         ];
-        $url = post_olpay($data, false);
-        $url = get_url($url);
-        $qrcode = get_qrcode($url);
+        $qrcode = get_qrcode( get_url( post_olpay($data, false) ) );    //生成二维码给微信扫描,直接进入付款那一步
+        
+        //PC页面不停的刷新,判断到支付成功后,进行的页面回跳地址
         $return_url = input('return_url');
         $return_url .= strstr($return_url,'?') ? '&ispay=1' : '?ispay=1';
         
         $this->assign('qrcode',$qrcode);
         $this->assign('numcode',$array['numcode']);
         $this->assign('return_url',$return_url);
+        $this->assign('money',$array['money']);
         return $this->fetch('weixin_pay_inpc');
     }
     
@@ -60,38 +65,74 @@ class Weixin extends Pay{
                 ($this->webdb['wxapp_appid'] && $this->webdb['wxapp_appsecret'] && $this->webdb['wxapp_payid'] && $this->webdb['wxapp_paykey'])
         ){
             if(!$this->user){
-                if( in_weixin() ){
-                    weixin_login($url='');
-                }else{
-                    $this->error('请先登录!');
-                }
+//                 if( in_weixin() ){
+//                     weixin_login($url='');
+//                 }else{
+//                     $this->error('请先登录!');
+//                 }
             }else{
-                //可以进一步改进,强制微信登录,绑定微信
-                //$this->error('你的当前帐号还没有绑定微信,不能使用微信支付');
+                //你当前帐号还没有绑定微信,不能使用微信支付
             }
         }else{
             $this->error('系统没有设置好微信支付接口,所以不能使用微信支付');
         }
         
-        if(!in_weixin()){
+        if(!in_weixin()){   //不在微信端,就展示微信付款二维码
             $array = $this->olpay_send();
-            //$this->error('当前页面只能用手机微信访问!');
             return $this->weixin_pay_inpc($array);
         }else{
-            if (input('client_type')=='') {
+            
+            $weixin_openid = $this->get_openid();    //获取当前微信的真实openid
+            
+            if (input('client_type')=='') { //判断是不是在小程序中
                 return $this->fetch('choose_mp_wxapp');
             }
+            
             $array = $this->olpay_send();
             
-            if (input('client_type')=='wxapp') {
+            if (input('client_type')=='wxapp') {    //在微信小程序中支付
                 $this->assign('array',$array);
                 return $this->fetch('wxapp_pay');
-            }else{                
+            }else{                //公众号支付
                 include(ROOT_PATH.'plugins/weixin/api/jsapi.php');
             }
         }
     }
     
+    /**
+     * 获取当前微信的真实openid
+     * 因为登录用户可能没绑定微信,也有可能是绑定了其它微信.所以这里要动态获取当前用户的真实openid
+     */
+    protected function get_openid(){
+        $openid = get_cookie('weixin_openid');
+        if ($openid!='') {
+            return $openid;
+        }
+        $state = input('state');
+        $code = input('code');
+        
+        if($state==1){            
+            if(!$code){
+                $this->error('code 值并不存在!');
+            }            
+            $string = file_get_contents('https://api.weixin.qq.com/sns/oauth2/access_token?appid='.config('webdb.weixin_appid').'&secret='.config('webdb.weixin_appsecret').'&code='.$code.'&grant_type=authorization_code');
+            $array = json_decode($string,true);            
+            $openid = $array['openid'];
+            if($openid){
+                set_cookie('weixin_openid',$openid,3600);
+            }else{
+                if($string == ''){
+                    $this->error('获取微信接口内容失败,请确认你的服务器已打开 extension=php_openssl.dll ');
+                }
+                $this->error('openid 值不存在!错误详情如下:'.$string);
+            }
+        }else{
+            $url = urlencode($this->weburl);
+            header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid='.config('webdb.weixin_appid').'&redirect_uri='.$url.'&response_type=code&scope=snsapi_base&state=1#wechat_redirect');
+            exit;
+        }        
+    }
+    
     
     protected function send_config(){
         
@@ -103,7 +144,9 @@ class Weixin extends Pay{
         return $array;
     }
     
-    //付款完毕,跳转回来时执行的动作,用户看得到的操作界面
+    /**
+     * 付款完毕,跳转回来时执行的动作,用户看得到的操作界面
+     */
     public function pay_end_return(){
         $ispay = input('ispay');
         $numcode = input('numcode');
@@ -125,7 +168,10 @@ class Weixin extends Pay{
         }
     }
     
-    //付款成功后,微信后台通知,前台看不到的界面,只能用日志追踪
+    /**
+     * 付款成功后,微信后台通知,前台看不到的界面,只能用日志追踪
+     * @return string
+     */
     public function back_notice(){
         global $pay_end_data;
         $pay_end_data = '';

+ 5 - 2
plugins/alipay/api/alipayapi.php

@@ -2,8 +2,10 @@
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<title>支付宝手机网站支付接口接口</title>
+	<title>支付宝手机端支付</title>
 </head>
+ <center>支付进行中...</center>
+<div style="display:none;">
 <?php
 
 /* *
@@ -89,9 +91,10 @@ $parameter = array(
 
 //建立请求
 $alipaySubmit = new AlipaySubmit($alipay_config);
-$html_text = $alipaySubmit->buildRequestForm($parameter,"get", "确认");
+$html_text = $alipaySubmit->buildRequestForm($parameter,"get", "确认支付");
 echo $html_text;
 
 ?>
+</div>
 </body>
 </html>

+ 2 - 2
plugins/weixin/api/jsapi.php

@@ -34,7 +34,7 @@ function printf_info($data)
 $tools = new JsApiPay();
 //$openId = $tools->GetOpenid();
 //$openId = get_cookie('WeiXin_OpenId');
-$openId = $this->user['weixin_api'];
+$openId = $weixin_openid?:$this->user['weixin_api'];
 if(!$openId){
 	//$openId = set_weixin_openid();
 	$openId = $tools->GetOpenid();
@@ -74,7 +74,7 @@ $ok_url = "{$array['wx_return_url']}?numcode={$array['numcode']}";
 
 <html>
 <head>
-    <meta http-equiv="content-type" content="text/html;charset=gbk"/>
+    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1"/> 
     <title>微信支付</title>
  <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script> 

+ 6 - 6
plugins/weixin/api/weixin.jsdk.php

@@ -12,7 +12,7 @@ class JSSDK {
   public function getSignPackage() {
     $jsapiTicket = $this->getJsApiTicket();
 
-    // 注意 URL 一定要动态获取,不能 hardcode.
+    // 娉ㄦ剰 URL 涓€瀹氳�鍔ㄦ€佽幏鍙栵紝涓嶈兘 hardcode.
     $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
     //$url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
 	
@@ -25,7 +25,7 @@ class JSSDK {
     $timestamp = time();
     $nonceStr = $this->createNonceStr();
 
-    // 这里参数的顺序要按照 key 值 ASCII 码升序排序
+    // 杩欓噷鍙傛暟鐨勯『搴忚�鎸夌収 key 鍊� ASCII 鐮佸崌搴忔帓搴�
     $string = "jsapi_ticket=$jsapiTicket&noncestr=$nonceStr&timestamp=$timestamp&url=$url";
 
     $signature = sha1($string);
@@ -54,11 +54,11 @@ class JSSDK {
 	  global $webdb;
 	$mymd5 = $webdb['WXFmymd5'] ? $webdb['WXFmymd5'] : $webdb[mymd5] ;
 	$path = $webdb['WXFweb_dir'] ? $webdb['WXFweb_dir'] : $webdb[web_dir] ;
-    // jsapi_ticket 应该全局存储与更新,以下代码以写入到文件中做示例
+    // jsapi_ticket 搴旇�鍏ㄥ眬瀛樺偍涓庢洿鏂帮紝浠ヤ笅浠g爜浠ュ啓鍏ュ埌鏂囦欢涓�仛绀轰緥
     $data = json_decode(file_get_contents(ROOT_PATH."cache{$path}/jsapi_ticket_{$mymd5}.json"));
     if ($data->expire_time < time()) {
       $accessToken = $this->getAccessToken();
-      // 如果是企业号用以下 URL 获取 ticket
+      // 濡傛灉鏄�紒涓氬彿鐢ㄤ互涓� URL 鑾峰彇 ticket
       // $url = "https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=$accessToken";
       $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=$accessToken";
       $res = json_decode($this->httpGet($url));
@@ -78,13 +78,13 @@ class JSSDK {
   }
 
   private function getAccessToken() {
-    // access_token 应该全局存储与更新,以下代码以写入到文件中做示例
+    // access_token 搴旇�鍏ㄥ眬瀛樺偍涓庢洿鏂帮紝浠ヤ笅浠g爜浠ュ啓鍏ュ埌鏂囦欢涓�仛绀轰緥
 	global $webdb;
 	$mymd5 = $webdb['WXFmymd5'] ? $webdb['WXFmymd5'] : $webdb[mymd5] ;
 	$path = $webdb['WXFweb_dir'] ? $webdb['WXFweb_dir'] : $webdb[web_dir] ;
     $data = json_decode(file_get_contents(ROOT_PATH."cache{$path}/access_token{$mymd5}.json"));
     if ($data->expire_time < time()) {
-      // 如果是企业号用以下URL获取access_token
+      // 濡傛灉鏄�紒涓氬彿鐢ㄤ互涓婾RL鑾峰彇access_token
       // $url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$this->appId&corpsecret=$this->appSecret";
       $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$this->appId&secret=$this->appSecret";
       $res = json_decode($this->httpGet($url));

BIN
public/static/images/alipay.png


BIN
public/static/images/logo1.png


+ 156 - 0
public/static/images/post.css

@@ -0,0 +1,156 @@
+.bbsContainer{
+	max-width: 640px;
+	overflow: hidden;
+	margin: auto;
+	background: #F5F5F5;
+}
+.bbsContainer .topBoxs{
+	display: table;
+	width: 100%;
+	background: #FFF;
+	border-bottom: #EEE solid 1px;
+}
+.bbsContainer .topBoxs li{
+	display: table-cell;
+	text-align: left;
+	vertical-align: middle;
+	padding: 15px 0;
+}
+.bbsContainer .topBoxs li.logo{
+	width:60px;
+	padding-left: 15px;
+	padding-right: 15px;
+}
+.bbsContainer .topBoxs li.logo img{
+	max-height: 60px;
+	max-width: 60px;
+	border-radius: 50%;
+}
+.bbsContainer .topBoxs li.info span,.bbsContainer .topBoxs li.info em{
+	display: block;
+	height: 30px;
+	line-height: 30px;
+	overflow: hidden;
+	font-size: 16px;
+	color: #888;
+}
+.bbsContainer .topBoxs li.info span{
+	font-size: 20px;
+	color: #333;
+}
+.bbsContainer .topBoxs li.atten{
+	width:50px;
+	padding-left: 15px;
+	padding-right: 15px;
+	text-align: center;
+	font-size: 30px;
+}
+.bbsContainer .quideBox{
+	height: 45px;
+	line-height: 45px;
+	border-top:#FFF solid 1px;
+	border-bottom: #EEE solid 1px;
+	padding-left: 15px;
+}
+.bbsContainer .PostBox{
+	border-top:#FFF solid 1px;
+	padding:10px;
+}
+.bbsContainer .PostBox ul ol{
+	padding-bottom: 5px;
+	color: #666;
+}
+.bbsContainer .PostBox ul li input[type=text]{
+	width: 100%;
+	border:0px;
+	height: 35px;
+	line-height: 35px;
+	border-radius: 5px;
+	box-shadow: 0px 0px 2px #000;
+	text-indent: 10px;
+	margin-bottom: 10px;
+	outline: none;
+}
+.bbsContainer .PostBox .button{
+	padding: 5px 0px;
+}
+.bbsContainer .PostBox .button button{
+	display: block;
+	width:100%;
+	line-height: 50px;
+	text-align: center;
+	border: 0px;
+	background: #23A3C9;
+	color: #FFF;
+	border-radius: 5px;
+}
+.bbsContainer .PostBox button[type=submit]{
+	background: #FF802C;
+}
+.bbsContainer .PostBox .ListImgs:after{
+	content: '';
+	display: block;
+	clear: both;
+}
+.bbsContainer .PostBox .ListImgs div{
+	width:25%;
+	overflow: hidden;
+	float: left;
+	position: relative;
+}
+.bbsContainer .PostBox .ListImgs div span{
+	display: block;
+	margin: 5px;
+	position: relative;
+	background: #FFF;
+	box-shadow: 0px 0px 2px #CCC;
+}
+.bbsContainer .PostBox .ListImgs div span:before{
+	content: '';
+	display: block;
+	padding-top: 100%;
+}
+.bbsContainer .PostBox .ListImgs div span img{
+	position:absolute;
+	max-width:100%;
+	max-height: 100%;
+	left:50%;
+	top: 50%;
+	border:0;
+  -webkit-transform: translate3D(-50%, -50%, 0);
+      -ms-transform: translate3D(-50%, -50%, 0);
+          transform: translate3D(-50%, -50%, 0);
+} 
+.bbsContainer .PostBox .ListImgs div em{
+	position: absolute;
+	width:25px;
+	height: 25px;
+	text-align: center;
+	line-height: 25px;
+	background:rgba(120,120,120,0.6);
+	color: #FFF;
+	right: 5px;
+	top:5px;
+	cursor: pointer;
+}
+.bbsContainer .PostBox .ListImgs div em:hover{
+	background:rgba(255,60,0,0.6);
+}
+/***/
+.uploadImg{
+	padding: 0 5px 5px 5px;
+}
+.uploadImg li{
+	width:80px;
+	border:#DDD dotted 1px;
+	text-align: center;
+	padding: 15px 0;
+	background: #FFF;
+	font-size:32px;
+	cursor: pointer;
+	color: #999;
+}
+.uploadImg li:hover{
+	border: #F60 dotted 1px;
+	color: #F60;
+}

BIN
public/static/images/wxpay.png


+ 53 - 0
template/index_style/default/index/pay/alipay.htm

@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>支付宝支付</title>
+<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+<meta name="apple-mobile-web-app-capable" content="yes">
+<meta name="apple-mobile-web-app-status-bar-style" content="black">
+<link rel="stylesheet" href="__STATIC__/css/base.css">
+<link rel="stylesheet" href="__STATIC__/css/qb_ui.css">
+<link rel="stylesheet" href="__STATIC__/icon/icon.css">
+<script type="text/javascript" src="__STATIC__/js/core/jquery.min.js"></script>
+<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
+</head>
+<body>
+<link rel="stylesheet" href="__STATIC__/images/post.css">
+<div class="bbsContainer" style="display:none;">
+	<ul class="topBoxs">
+		<li class="logo"><a href="/"><img src="__STATIC__/images/logo1.png"></a></li>
+		<li class="info"><span>{:M('name')}</span><em>{$userdb.username}</em></li>
+		<li class="atten"><a href="{:get_url('member')}"><i class="si si-user"></i></a></li>
+	</ul>
+	<div class="quideBox" style="text-align:center;height:auto;"><img src="__STATIC__/images/alipay.png">
+	<br>请用支付宝(不是微信)扫码支付:<font style="color:red;font-weight:bold;">{$money}</font>元
+	</div>
+
+	 
+	<div class="PostBox" style="text-align:center;">		 
+		<img src="{$qrcode}"/>
+	</div>
+</div>
+<script type="text/javascript">
+
+if(window.top==window.self){
+	window.location.href="{$payurl}";	
+}else{
+	$(".bbsContainer").show();
+	countSecond();
+}
+
+function countSecond(){ 
+	$.get("{:urls('/index/pay/index')}?banktype=alipay&action=checkpay&numcode={$numcode}&"+Math.random(), function(result){
+		if(result.code==0){
+			window.location.href="{$return_url}";
+		}else{
+			setTimeout("countSecond()",3000);
+		}
+	});	
+}
+
+</script>
+</body>
+</html>

+ 4 - 3
template/index_style/default/index/pay/weixin_pay_inpc.htm

@@ -14,15 +14,16 @@
 </head>
 <body>
  
-<link rel="stylesheet" href="__STATIC__/bbs/post.css">
+<link rel="stylesheet" href="__STATIC__/images/post.css">
 <div class="bbsContainer">
 
 	<ul class="topBoxs">
-		<li class="logo"><a href="/"><img src="__STATIC__/bbs/logo1.png"></a></li>
+		<li class="logo"><a href="/"><img src="__STATIC__/images/logo1.png"></a></li>
 		<li class="info"><span>{:M('name')}</span><em>{$userdb.username}</em></li>
 		<li class="atten"><a href="{:get_url('member')}"><i class="si si-user"></i></a></li>
 	</ul>
-	<div class="quideBox" style="text-align:center;">请用微信扫码支付</div>
+	<div class="quideBox" style="text-align:center;height:auto;"><img src="__STATIC__/images/wxpay.png">
+	<br>请用微信扫码支付:<font style="color:red;font-weight:bold;">{$money}</font>元</div>
 
 	 
 	<div class="PostBox" style="text-align:center;">