dever 6 anni fa
parent
commit
49d4db6755

+ 114 - 109
act/lib/Pay.php

@@ -159,134 +159,139 @@ class Pay
         $send['signature'] = md5($key . '&' . http_build_query($send));
         $send['signature'] = md5($key . '&' . http_build_query($send));
         $signature = Dever::input('signature');
         $signature = Dever::input('signature');
         if ($send['signature'] == $signature) {
         if ($send['signature'] == $signature) {
-            $product_id = $send['pay_product_id'];
-            $uid = $send['pay_uid'];
-            $cash = $send['pay_cash'];
-            $order_id = $send['pay_order_id'];
-            $status = $send['pay_status'];
-            $msg = $send['pay_msg'];
+            $this->act_action($send);
+        }
 
 
-            $order = Dever::db('act/order')->one(array('order_id' => $order_id, 'uid' => $uid));
+        return 'ok';
+	}
 
 
-            if ($send['pay_status'] == 2 && $order) {
+    public function act_action($send)
+    {
+        $product_id = $send['pay_product_id'];
+        $uid = $send['pay_uid'];
+        $cash = $send['pay_cash'];
+        $order_id = $send['pay_order_id'];
+        $status = $send['pay_status'];
+        $msg = $send['pay_msg'];
+
+        $order = Dever::db('act/order')->one(array('order_id' => $order_id, 'uid' => $uid));
+
+        if ($send['pay_status'] == 2 && $order) {
+            
+            $update = array();
+            $update['where_id'] = $order['id'];
+            $update['status'] = 2;
+            if ($order['type'] == 3 && !$order['code']) {
+                if ($order['system'] == 2) {
+                    $code = Dever::load('code/lib/core')->createCodeByOrder($order);
+                } else {
+                    $code = Dever::load('code/lib/core')->createCodeByOrder($order, -1);
+                }
                 
                 
-                $update = array();
-                $update['where_id'] = $order['id'];
-                $update['status'] = 2;
-                if ($order['type'] == 3 && !$order['code']) {
-                    if ($order['system'] == 2) {
-                        $code = Dever::load('code/lib/core')->createCodeByOrder($order);
-                    } else {
-                        $code = Dever::load('code/lib/core')->createCodeByOrder($order, -1);
-                    }
-                    
-                    if ($code) {
-                        $update['code'] = $code;
-                    }
+                if ($code) {
+                    $update['code'] = $code;
                 }
                 }
+            }
 
 
-                Dever::db('act/order')->update($update);
-
-                $score = false;
-                $num = false;
-                $journal = Dever::load('act/order')->getJournal($order['product_id']);
-                if ($order['buy_id'] > 0) {
-                    $buy = Dever::load('act/order')->getBuy($order['buy_id']);
-                    if ($buy && $buy['score'] > 0) {
-                    	$score = $buy['num'] * $buy['score'];
-                    } else {
-                    	if ($order['type'] == 1) {
-	                    	# 直接购买
-	                    	$col = 'score';
-	                    } elseif ($order['type'] == 3) {
-	                    	$col = 'dh_score';
-	                    }
-
-	                    if ($journal && $buy && $journal[$col] > 0) {
-	                        $score = $buy['num'] * $journal[$col];
-	                    } elseif ($journal && $buy) {
-	                        $num = $buy['num'];
-	                    }
+            Dever::db('act/order')->update($update);
+
+            $score = false;
+            $num = false;
+            $journal = Dever::load('act/order')->getJournal($order['product_id']);
+            if ($order['buy_id'] > 0) {
+                $buy = Dever::load('act/order')->getBuy($order['buy_id']);
+                if ($buy && $buy['score'] > 0) {
+                    $score = $buy['num'] * $buy['score'];
+                } else {
+                    if ($order['type'] == 1) {
+                        # 直接购买
+                        $col = 'score';
+                    } elseif ($order['type'] == 3) {
+                        $col = 'dh_score';
                     }
                     }
 
 
-                    if ($buy && $buy['num']) {
+                    if ($journal && $buy && $journal[$col] > 0) {
+                        $score = $buy['num'] * $journal[$col];
+                    } elseif ($journal && $buy) {
+                        $num = $buy['num'];
+                    }
+                }
 
 
-                        $active = Dever::load('act/order')->getActive($order['product_id']);
-                        $active_state = true;
-                        if ($active && $active['status'] == 2) {
-                            //$active_state = false;
-                        }
-                        if ($active && time() > $active['end']) {
-                            $active_state = false;
-                        }
-                        if ($active_state) {
-                            # 增加本数
-                            Dever::load('act/lib/num')->submit($order['product_id'], $order['uid'], $buy['num']);
-                        }
+                if ($buy && $buy['num']) {
 
 
-                        # 增加订阅数
-                        Dever::load('act/lib/num')->setCounter($order['product_id'], $buy['num']);
+                    $active = Dever::load('act/order')->getActive($order['product_id']);
+                    $active_state = true;
+                    if ($active && $active['status'] == 2) {
+                        //$active_state = false;
+                    }
+                    if ($active && time() > $active['end']) {
+                        $active_state = false;
+                    }
+                    if ($active_state) {
+                        # 增加本数
+                        Dever::load('act/lib/num')->submit($order['product_id'], $order['uid'], $buy['num']);
                     }
                     }
-                }
-                # 积分
-                Dever::score($order['uid'], 'buy_journal', '购买小刊', '', $score, $num);
 
 
-                if ($order['system'] == 2) {
-                    return;
+                    # 增加订阅数
+                    Dever::load('act/lib/num')->setCounter($order['product_id'], $buy['num']);
                 }
                 }
+            }
+            # 积分
+            Dever::score($order['uid'], 'buy_journal', '购买小刊', '', $score, $num);
 
 
-                # 发消息
-                $journal['id'] = $order['product_id'];
-                $journal['name'] = $order['name'];
-                if (strstr('-', $journal['name'])) {
-                	$name = explode('-', $journal['name']);
-                	$journal['name'] = $name[0];
-                }
-                
-                //$journal = Dever::db('journal/info')->one($order['product_id']);
+            if ($order['system'] == 2) {
+                return;
+            }
 
 
-                if (Dever::project('message')) {
-                    Dever::load('message/lib/data')->push(-1, $order['uid'], '购买提醒', '购买成功,您获得了 '.$journal['name'].' 的阅读资格!', 11, $order['cate_id'], 1, Dever::load('act/lib/note')->push(4, $journal['id'], $journal['name']));
-                }
+            # 发消息
+            $journal['id'] = $order['product_id'];
+            $journal['name'] = $order['name'];
+            if (strstr('-', $journal['name'])) {
+                $name = explode('-', $journal['name']);
+                $journal['name'] = $name[0];
+            }
+            
+            //$journal = Dever::db('journal/info')->one($order['product_id']);
 
 
-                $user = Dever::db('passport/user')->one($order['uid']);
+            if (Dever::project('message')) {
+                Dever::load('message/lib/data')->push(-1, $order['uid'], '购买提醒', '购买成功,您获得了 '.$journal['name'].' 的阅读资格!', 11, $order['cate_id'], 1, Dever::load('act/lib/note')->push(4, $journal['id'], $journal['name']));
+            }
 
 
-                # 发短信
-                /*
-                if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms') && $order['cate_id'] == 1) {
-                    $send = array();
-                    $send['name'] = $journal['name'];
-                    Dever::load('sms/api.send', 'buy_journal', $user['mobile'], $send);
-                }
-                */
-
-                # 发模板消息
-                $wechat = Dever::db('passport/wechat')->one(array('uid' => $order['uid'], 'type' => 1, 'system_id' => $order['cate_id']));
-                if ($wechat && Dever::project('wechat_applet')) {
-                    $send['key'] = 'buy_journal';
-                    $send['project_id'] = $order['cate_id'];
-                    $send['touser'] = $wechat['openid'];
-                    $send['page'] = Dever::config('base')->applet_index . '?scene=' . $order['uid'] . ',' . '4,' . $order['product_id'];
-                    $send['data'] = array
-                    (
-                        'keyword1' => array('value' => date('Y年m月d日 H:i', $order['cdate'])),
-                        'keyword2' => array('value' => '购买成功,您获得了 '.$journal['name'].' 的阅读资格!'),
-                    );
-                    $send['data'] = json_encode($send['data']);
-                    $send['form_id'] = Dever::load('act/lib/form')->get($order['uid'], 2, $order['cate_id']);
-
-                    if ($send['form_id']) {
-                        Dever::load('wechat_applet/msg.send', $send);
-                    }
-                }
+            $user = Dever::db('passport/user')->one($order['uid']);
 
 
-            } else {
-                Dever::db('act/order')->update(array('where_id' => $order['id'], 'status' => 3));
+            # 发短信
+            /*
+            if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms') && $order['cate_id'] == 1) {
+                $send = array();
+                $send['name'] = $journal['name'];
+                Dever::load('sms/api.send', 'buy_journal', $user['mobile'], $send);
+            }
+            */
+
+            # 发模板消息
+            $wechat = Dever::db('passport/wechat')->one(array('uid' => $order['uid'], 'type' => 1, 'system_id' => $order['cate_id']));
+            if ($wechat && Dever::project('wechat_applet')) {
+                $send['key'] = 'buy_journal';
+                $send['project_id'] = $order['cate_id'];
+                $send['touser'] = $wechat['openid'];
+                $send['page'] = Dever::config('base')->applet_index . '?scene=' . $order['uid'] . ',' . '4,' . $order['product_id'];
+                $send['data'] = array
+                (
+                    'keyword1' => array('value' => date('Y年m月d日 H:i', $order['cdate'])),
+                    'keyword2' => array('value' => '购买成功,您获得了 '.$journal['name'].' 的阅读资格!'),
+                );
+                $send['data'] = json_encode($send['data']);
+                $send['form_id'] = Dever::load('act/lib/form')->get($order['uid'], 2, $order['cate_id']);
+
+                if ($send['form_id']) {
+                    Dever::load('wechat_applet/msg.send', $send);
+                }
             }
             }
-        }
 
 
-        return 'ok';
-	}
+        } else {
+            Dever::db('act/order')->update(array('where_id' => $order['id'], 'status' => 3));
+        }
+    }
 
 
     public function send_api()
     public function send_api()
     {
     {

+ 1 - 1
buy/assets/mobile/css/auth.css

@@ -1,2 +1,2 @@
 .logo{margin:3.13333rem auto .6rem;width:2.66667rem;height:2.66667rem;display:block}.txt{margin-bottom:.73333rem;color:#000;line-height:1.6;text-align:center}.button,.txt{font-size:.4rem}.button{margin:0 auto;background:#cc1619;width:7.06667rem;height:1.06667rem;line-height:1.06667rem;color:#fff}
 .logo{margin:3.13333rem auto .6rem;width:2.66667rem;height:2.66667rem;display:block}.txt{margin-bottom:.73333rem;color:#000;line-height:1.6;text-align:center}.button,.txt{font-size:.4rem}.button{margin:0 auto;background:#cc1619;width:7.06667rem;height:1.06667rem;line-height:1.06667rem;color:#fff}
-/*# sourceMappingURL=auth.css.map?v=75777fd7*/
+/*# sourceMappingURL=auth.css.map?v=4b099281*/

+ 1 - 1
buy/assets/mobile/css/auth.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/auth.css?v=75777fd7","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/auth.css?v=4b099281","sourceRoot":""}

+ 1 - 1
buy/assets/mobile/css/codedetail.css

@@ -1,2 +1,2 @@
 .tips{width:8.66667rem;margin:.58667rem auto .26667rem;line-height:.53333rem}.button,.tips{font-size:.32rem}.button{margin:0;width:2.4rem;line-height:.86667rem;height:.86667rem}.button.black{background-color:#000}.button.disabled{background-color:#ccc}.btn-wrap{width:8.66667rem;margin:0 auto .54667rem}.code-list{border-top:1px solid #ccc;width:8.66667rem;margin:0 auto}.code-list dl{-ms-flex-pack:justify;justify-content:space-between;padding:.53333rem 0;border-bottom:1px solid #ccc}.code-list dl,.code-list dl dd p{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.code-list dl dd p{font-size:.37333rem;line-height:.56rem;margin-bottom:.2rem}.code-list dl dd p .ico-code{display:block;width:.45333rem;height:.4rem;background:url(../images/ico-code.png) no-repeat;background-size:.45333rem .4rem;margin-right:.13333rem}.code-list dl dd p b{font-weight:400}.code-list dl dd span{font-size:.32rem}.code-list dl dd span.used{color:#d1171a}.success{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.75);border-radius:.2rem;width:6.6667rem;height:1.0667rem;line-height:1.0667rem;font-size:.4rem;text-align:center;color:#fff}
 .tips{width:8.66667rem;margin:.58667rem auto .26667rem;line-height:.53333rem}.button,.tips{font-size:.32rem}.button{margin:0;width:2.4rem;line-height:.86667rem;height:.86667rem}.button.black{background-color:#000}.button.disabled{background-color:#ccc}.btn-wrap{width:8.66667rem;margin:0 auto .54667rem}.code-list{border-top:1px solid #ccc;width:8.66667rem;margin:0 auto}.code-list dl{-ms-flex-pack:justify;justify-content:space-between;padding:.53333rem 0;border-bottom:1px solid #ccc}.code-list dl,.code-list dl dd p{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.code-list dl dd p{font-size:.37333rem;line-height:.56rem;margin-bottom:.2rem}.code-list dl dd p .ico-code{display:block;width:.45333rem;height:.4rem;background:url(../images/ico-code.png) no-repeat;background-size:.45333rem .4rem;margin-right:.13333rem}.code-list dl dd p b{font-weight:400}.code-list dl dd span{font-size:.32rem}.code-list dl dd span.used{color:#d1171a}.success{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.75);border-radius:.2rem;width:6.6667rem;height:1.0667rem;line-height:1.0667rem;font-size:.4rem;text-align:center;color:#fff}
-/*# sourceMappingURL=codedetail.css.map?v=75777fd7*/
+/*# sourceMappingURL=codedetail.css.map?v=4b099281*/

+ 1 - 1
buy/assets/mobile/css/codedetail.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/codedetail.css?v=75777fd7","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/codedetail.css?v=4b099281","sourceRoot":""}

File diff suppressed because it is too large
+ 0 - 0
buy/assets/mobile/css/global.css


+ 1 - 1
buy/assets/mobile/css/global.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/global.css?v=75777fd7","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/global.css?v=4b099281","sourceRoot":""}

File diff suppressed because it is too large
+ 0 - 0
buy/assets/mobile/css/list.css


+ 1 - 1
buy/assets/mobile/css/list.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/list.css?v=75777fd7","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/list.css?v=4b099281","sourceRoot":""}

File diff suppressed because it is too large
+ 0 - 2
buy/assets/mobile/css/pay.css


+ 1 - 1
buy/assets/mobile/css/pay.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/pay.css?v=75777fd7","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/pay.css?v=4b099281","sourceRoot":""}

+ 1 - 1
buy/assets/mobile/js/auth.js

@@ -1,2 +1,2 @@
 webpackJsonp([3],{1:function(n,t,c){"use strict";c(0),c(7)},12:function(n,t,c){n.exports=c(1)},7:function(n,t){}},[12]);
 webpackJsonp([3],{1:function(n,t,c){"use strict";c(0),c(7)},12:function(n,t,c){n.exports=c(1)},7:function(n,t){}},[12]);
-//# sourceMappingURL=auth.js.map?v=3f8cf811
+//# sourceMappingURL=auth.js.map?v=4b099281

+ 1 - 1
buy/assets/mobile/js/auth.js.map

@@ -1 +1 @@
-{"version":3,"sources":["webpack:///js/auth.js","webpack:///./mobile/src/router/auth.js"],"names":["webpackJsonp","1","module","exports","__webpack_require__","12","7"],"mappings":"AAAAA,cAAc,IAERC,EACA,SAAUC,EAAQC,EAASC,GAEjC,YCLAA,GAAA,GACAA,EAAA,IDaMC,GACA,SAAUH,EAAQC,EAASC,GAEjCF,EAAOC,QAAUC,EAAoB,IAK/BE,EACA,SAAUJ,EAAQC,OAMrB","file":"js/auth.js?v=3f8cf811","sourcesContent":["webpackJsonp([3],{\n\n/***/ 1:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(7);\n\n/***/ }),\n\n/***/ 12:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(1);\n\n\n/***/ }),\n\n/***/ 7:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n},[12]);\n\n\n// WEBPACK FOOTER //\n// js/auth.js?v=3f8cf811","import './global';\r\nimport '../css/auth.css';\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/auth.js"],"sourceRoot":""}
+{"version":3,"sources":["webpack:///js/auth.js","webpack:///./mobile/src/router/auth.js"],"names":["webpackJsonp","1","module","exports","__webpack_require__","12","7"],"mappings":"AAAAA,cAAc,IAERC,EACA,SAAUC,EAAQC,EAASC,GAEjC,YCLAA,GAAA,GACAA,EAAA,IDaMC,GACA,SAAUH,EAAQC,EAASC,GAEjCF,EAAOC,QAAUC,EAAoB,IAK/BE,EACA,SAAUJ,EAAQC,OAMrB","file":"js/auth.js?v=4b099281","sourcesContent":["webpackJsonp([3],{\n\n/***/ 1:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(7);\n\n/***/ }),\n\n/***/ 12:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(1);\n\n\n/***/ }),\n\n/***/ 7:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n},[12]);\n\n\n// WEBPACK FOOTER //\n// js/auth.js?v=4b099281","import './global';\r\nimport '../css/auth.css';\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/auth.js"],"sourceRoot":""}

+ 1 - 1
buy/assets/mobile/js/codedetail.js

@@ -1,2 +1,2 @@
 webpackJsonp([2],{13:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(9)},9:function(n,t){}},[13]);
 webpackJsonp([2],{13:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(9)},9:function(n,t){}},[13]);
-//# sourceMappingURL=codedetail.js.map?v=3f8cf811
+//# sourceMappingURL=codedetail.js.map?v=4b099281

+ 1 - 1
buy/assets/mobile/js/codedetail.js.map

@@ -1 +1 @@
-{"version":3,"sources":["webpack:///js/codedetail.js","webpack:///./mobile/src/router/codedetail.js"],"names":["webpackJsonp","13","module","exports","__webpack_require__","2","9"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,EAASC,GAEjCF,EAAOC,QAAUC,EAAoB,IAK/BC,EACA,SAAUH,EAAQC,EAASC,GAEjC,YCbAA,GAAA,GAEAA,EAAA,IDoBME,EACA,SAAUJ,EAAQC,OAMrB","file":"js/codedetail.js?v=3f8cf811","sourcesContent":["webpackJsonp([2],{\n\n/***/ 13:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(2);\n\n\n/***/ }),\n\n/***/ 2:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(9);\n\n/***/ }),\n\n/***/ 9:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n},[13]);\n\n\n// WEBPACK FOOTER //\n// js/codedetail.js?v=3f8cf811","import './global';\r\n// import '../js/clipboard.js';\r\nimport '../css/codedetail.css';\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/codedetail.js"],"sourceRoot":""}
+{"version":3,"sources":["webpack:///js/codedetail.js","webpack:///./mobile/src/router/codedetail.js"],"names":["webpackJsonp","13","module","exports","__webpack_require__","2","9"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,EAASC,GAEjCF,EAAOC,QAAUC,EAAoB,IAK/BC,EACA,SAAUH,EAAQC,EAASC,GAEjC,YCbAA,GAAA,GAEAA,EAAA,IDoBME,EACA,SAAUJ,EAAQC,OAMrB","file":"js/codedetail.js?v=4b099281","sourcesContent":["webpackJsonp([2],{\n\n/***/ 13:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(2);\n\n\n/***/ }),\n\n/***/ 2:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(9);\n\n/***/ }),\n\n/***/ 9:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n},[13]);\n\n\n// WEBPACK FOOTER //\n// js/codedetail.js?v=4b099281","import './global';\r\n// import '../js/clipboard.js';\r\nimport '../css/codedetail.css';\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/codedetail.js"],"sourceRoot":""}

File diff suppressed because it is too large
+ 0 - 0
buy/assets/mobile/js/global.js


File diff suppressed because it is too large
+ 0 - 0
buy/assets/mobile/js/global.js.map


+ 1 - 1
buy/assets/mobile/js/list.js

@@ -1,2 +1,2 @@
 webpackJsonp([1],{10:function(n,t){},15:function(n,t,c){n.exports=c(3)},3:function(n,t,c){"use strict";c(0),c(10)}},[15]);
 webpackJsonp([1],{10:function(n,t){},15:function(n,t,c){n.exports=c(3)},3:function(n,t,c){"use strict";c(0),c(10)}},[15]);
-//# sourceMappingURL=list.js.map?v=3f8cf811
+//# sourceMappingURL=list.js.map?v=4b099281

+ 1 - 1
buy/assets/mobile/js/list.js.map

@@ -1 +1 @@
-{"version":3,"sources":["webpack:///js/list.js","webpack:///./mobile/src/router/list.js"],"names":["webpackJsonp","10","module","exports","15","__webpack_require__","3"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,KAMlBC,GACA,SAAUF,EAAQC,EAASE,GAEjCH,EAAOC,QAAUE,EAAoB,IAK/BC,EACA,SAAUJ,EAAQC,EAASE,GAEjC,YCpBAA,GAAA,GACAA,EAAA,OD4BG","file":"js/list.js?v=3f8cf811","sourcesContent":["webpackJsonp([1],{\n\n/***/ 10:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 15:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(3);\n\n\n/***/ }),\n\n/***/ 3:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(10);\n\n/***/ })\n\n},[15]);\n\n\n// WEBPACK FOOTER //\n// js/list.js?v=3f8cf811","import './global';\nimport '../css/list.css';\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/list.js"],"sourceRoot":""}
+{"version":3,"sources":["webpack:///js/list.js","webpack:///./mobile/src/router/list.js"],"names":["webpackJsonp","10","module","exports","15","__webpack_require__","3"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,KAMlBC,GACA,SAAUF,EAAQC,EAASE,GAEjCH,EAAOC,QAAUE,EAAoB,IAK/BC,EACA,SAAUJ,EAAQC,EAASE,GAEjC,YCpBAA,GAAA,GACAA,EAAA,OD4BG","file":"js/list.js?v=4b099281","sourcesContent":["webpackJsonp([1],{\n\n/***/ 10:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 15:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(3);\n\n\n/***/ }),\n\n/***/ 3:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(10);\n\n/***/ })\n\n},[15]);\n\n\n// WEBPACK FOOTER //\n// js/list.js?v=4b099281","import './global';\nimport '../css/list.css';\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/list.js"],"sourceRoot":""}

+ 1 - 1
buy/assets/mobile/js/pay.js

@@ -1,2 +1,2 @@
 webpackJsonp([0],{11:function(n,t){},16:function(n,t,c){n.exports=c(4)},4:function(n,t,c){"use strict";c(0),c(11)}},[16]);
 webpackJsonp([0],{11:function(n,t){},16:function(n,t,c){n.exports=c(4)},4:function(n,t,c){"use strict";c(0),c(11)}},[16]);
-//# sourceMappingURL=pay.js.map?v=3f8cf811
+//# sourceMappingURL=pay.js.map?v=4b099281

+ 1 - 1
buy/assets/mobile/js/pay.js.map

@@ -1 +1 @@
-{"version":3,"sources":["webpack:///js/pay.js","webpack:///./mobile/src/router/pay.js"],"names":["webpackJsonp","11","module","exports","16","__webpack_require__","4"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,KAMlBC,GACA,SAAUF,EAAQC,EAASE,GAEjCH,EAAOC,QAAUE,EAAoB,IAK/BC,EACA,SAAUJ,EAAQC,EAASE,GAEjC,YCpBAA,GAAA,GACAA,EAAA,OD4BG","file":"js/pay.js?v=3f8cf811","sourcesContent":["webpackJsonp([0],{\n\n/***/ 11:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 16:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(4);\n\n\n/***/ }),\n\n/***/ 4:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(11);\n\n/***/ })\n\n},[16]);\n\n\n// WEBPACK FOOTER //\n// js/pay.js?v=3f8cf811","import './global';\nimport '../css/pay.css';\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/pay.js"],"sourceRoot":""}
+{"version":3,"sources":["webpack:///js/pay.js","webpack:///./mobile/src/router/pay.js"],"names":["webpackJsonp","11","module","exports","16","__webpack_require__","4"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,KAMlBC,GACA,SAAUF,EAAQC,EAASE,GAEjCH,EAAOC,QAAUE,EAAoB,IAK/BC,EACA,SAAUJ,EAAQC,EAASE,GAEjC,YCpBAA,GAAA,GACAA,EAAA,OD4BG","file":"js/pay.js?v=4b099281","sourcesContent":["webpackJsonp([0],{\n\n/***/ 11:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 16:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(4);\n\n\n/***/ }),\n\n/***/ 4:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(0);\n\n__webpack_require__(11);\n\n/***/ })\n\n},[16]);\n\n\n// WEBPACK FOOTER //\n// js/pay.js?v=4b099281","import './global';\nimport '../css/pay.css';\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/pay.js"],"sourceRoot":""}

+ 16 - 2
buy/assets/mobile/pay.html

@@ -16,7 +16,7 @@
                 <p>查看购买说明</p>
                 <p>查看购买说明</p>
             </div>
             </div>
             <div class="list">
             <div class="list">
-                <a class="item" href="#">
+                <a class="item active" bind-id="item" href="#">
                     <p>购买10本</p>
                     <p>购买10本</p>
                     <p>¥6</p>
                     <p>¥6</p>
                 </a>
                 </a>
@@ -30,6 +30,10 @@
                 </a>
                 </a>
             </div>
             </div>
         </div>
         </div>
+        <div class='fix-footer'>
+            <a href="javascript:history.go(-1)" class='back-btn'>返回</a>
+            <a href="javascript:;" id="dopay" class="fix-button">确认购买</a>
+        </div>
     </div>
     </div>
     <div class="mask fn-hide" id="layer">
     <div class="mask fn-hide" id="layer">
         <div class="layer ">
         <div class="layer ">
@@ -55,9 +59,18 @@
 <script type="text/javascript" src="js/global.js?v=3f8cf811"></script><script type="text/javascript" src="js/pay.js?v=3f8cf811"></script></body>
 <script type="text/javascript" src="js/global.js?v=3f8cf811"></script><script type="text/javascript" src="js/pay.js?v=3f8cf811"></script></body>
 <script>
 <script>
     
     
+    var payStatus = false;
     $(document).on('click', '[bind-id="item"]', function(){
     $(document).on('click', '[bind-id="item"]', function(){
         $(this).addClass('active').siblings('.item').removeClass('active');
         $(this).addClass('active').siblings('.item').removeClass('active');
-        $('#pay-layer').show();
+        //$('#pay-layer').show();
+    });
+
+    $('#dopay').on('click',function(){
+        if (payStatus == false) {
+            var url = $('.active').attr('data-pay');
+            payStatus = true;
+            pay(url);
+        }
     });
     });
 
 
     $('#open').on('click',function(){
     $('#open').on('click',function(){
@@ -72,6 +85,7 @@
     {
     {
         $.get(url, function(t) {
         $.get(url, function(t) {
             $("#pay").html(t);
             $("#pay").html(t);
+            payStatus = false;
         })
         })
     }
     }
 
 

+ 4 - 0
buy/src/Buy.php

@@ -248,6 +248,10 @@ class Buy extends Base
 
 
         if ($data) {
         if ($data) {
             foreach ($data as $k => $v) {
             foreach ($data as $k => $v) {
+                $data[$k]['class'] = 'item';
+                if ($k == 0) {
+                    $data[$k]['class'] .= ' active';
+                }
                 if ($v['price'] > 0) {
                 if ($v['price'] > 0) {
                     $data[$k]['price'] = '¥' . number_format($v['price'], 2);
                     $data[$k]['price'] = '¥' . number_format($v['price'], 2);
                 } elseif ($info['cash'] > 0) {
                 } elseif ($info['cash'] > 0) {

+ 3 - 1
buy/template/mobile/pay.php

@@ -50,7 +50,9 @@ $view
         'self' => array
         'self' => array
         (
         (
             'href' => 'javascript:;',
             'href' => 'javascript:;',
-            'onclick' => 'pay(\'<{$v.pay_url}>\')',
+            'class' => '$v.class', 
+            'data-pay' => '$v.pay_url',
+            'data-click' => 'pay(\'<{$v.pay_url}>\')',
         ),
         ),
     )
     )
 )
 )

+ 15 - 0
config/env/localhost/default.php

@@ -89,6 +89,20 @@ if (isset($dc['mysql_user'])) {
     $config['database']['wechat'] = $dc['mysql_user'];
     $config['database']['wechat'] = $dc['mysql_user'];
 }
 }
 
 
+if (DEVER_APP_NAME == 'tests') {
+    # 测试
+    $dc['mysql_user']['charset'] = 'utf8';
+    $dc['mysql_user']['database'] = 'wonderful_test';
+    $dc['mysql_user']['type'] = 'pdo';
+    $config['database']['default'] = $dc['mysql_user'];
+    $config['database']['code'] = $dc['mysql_user'];
+    $config['database']['act'] = $dc['mysql_user'];
+    $config['database']['passport'] = $dc['mysql_user'];
+    $config['database']['pay'] = $dc['mysql_user'];
+    $config['database']['score'] = $dc['mysql_user'];
+    $config['database']['wechat'] = $dc['mysql_user'];
+}
+
 # 缓存配置
 # 缓存配置
 $config['cache'] = array
 $config['cache'] = array
 (
 (
@@ -125,6 +139,7 @@ $config['cache'] = array
         'buy.pay' => 0,
         'buy.pay' => 0,
         'journal_v1.top' => 600,
         'journal_v1.top' => 600,
         //'journal_v1.getList' => 0,
         //'journal_v1.getList' => 0,
+        'tests' => 0,
     ),
     ),
 
 
     # 哪些路由中的参数不参与生成缓存的key
     # 哪些路由中的参数不参与生成缓存的key

Some files were not shown because too many files changed in this diff