dever 6 years ago
parent
commit
b9ac02dc8f
44 changed files with 618 additions and 2 deletions
  1. 1 1
      journal/database/buy.php
  2. 3 1
      journal/database/info.php
  3. 27 0
      main/database/config.php
  4. 0 0
      service/assets/mobile/css/global.css
  5. 1 0
      service/assets/mobile/css/global.css.map
  6. 2 0
      service/assets/mobile/css/index.css
  7. 1 0
      service/assets/mobile/css/index.css.map
  8. 2 0
      service/assets/mobile/css/list.css
  9. 1 0
      service/assets/mobile/css/list.css.map
  10. 2 0
      service/assets/mobile/css/pay.css
  11. 1 0
      service/assets/mobile/css/pay.css.map
  12. 2 0
      service/assets/mobile/css/success.css
  13. 1 0
      service/assets/mobile/css/success.css.map
  14. BIN
      service/assets/mobile/images/[.png
  15. BIN
      service/assets/mobile/images/].png
  16. BIN
      service/assets/mobile/images/code.jpg
  17. BIN
      service/assets/mobile/images/code.png
  18. BIN
      service/assets/mobile/images/cover.jpg
  19. BIN
      service/assets/mobile/images/list.png
  20. BIN
      service/assets/mobile/images/logo.jpg
  21. BIN
      service/assets/mobile/images/success.png
  22. 21 0
      service/assets/mobile/index.html
  23. 0 0
      service/assets/mobile/js/global.js
  24. 0 0
      service/assets/mobile/js/global.js.map
  25. 2 0
      service/assets/mobile/js/index.js
  26. 1 0
      service/assets/mobile/js/index.js.map
  27. 2 0
      service/assets/mobile/js/list.js
  28. 1 0
      service/assets/mobile/js/list.js.map
  29. 2 0
      service/assets/mobile/js/pay.js
  30. 1 0
      service/assets/mobile/js/pay.js.map
  31. 2 0
      service/assets/mobile/js/success.js
  32. 1 0
      service/assets/mobile/js/success.js.map
  33. 48 0
      service/assets/mobile/list.html
  34. 54 0
      service/assets/mobile/pay.html
  35. 29 0
      service/assets/mobile/success.html
  36. 36 0
      service/config/base.php
  37. 8 0
      service/index.php
  38. 232 0
      service/src/Data.php
  39. 17 0
      service/template/mobile/home.php
  40. 13 0
      service/template/mobile/inc/foot.php
  41. 10 0
      service/template/mobile/inc/head.php
  42. 40 0
      service/template/mobile/list.php
  43. 34 0
      service/template/mobile/pay.php
  44. 20 0
      service/template/mobile/success.php

+ 1 - 1
journal/database/buy.php

@@ -47,7 +47,7 @@ return array
             'default'   => '20',
             'desc'      => '每购买一本刊获得多少积分',
             'match'     => 'is_numeric',
-            'update'    => 'text',
+            //'update'    => 'text',
         ),
 
         'buy_title'     => array

+ 3 - 1
journal/database/info.php

@@ -42,7 +42,7 @@ $buy = array
 $page = 15;
 
 # 常用的col
-$col = 'id,name,subname,pic_cover,pic_view_cover,pic_view_bg,pdate,num_add_view+num_view as num_view,num_ding+num_add_ding as num_ding,num_comment,buy,share_yes,share_title,share_pic,share_content,pic_gd,cate_id';
+$col = 'id,name,subname,pic_cover,pic_view_cover,pic_view_bg,pdate,num_add_view+num_view as num_view,num_ding+num_add_ding as num_ding,num_comment,buy,share_yes,share_title,share_pic,share_content,pic_gd,cate_id,cash';
 
 return array
 (
@@ -480,6 +480,8 @@ return array
 			'option' => array
 			(
 				//'audit' => 2,
+				'buy' => 'yes',
+				'cate_id' => 'yes',
 				'status' => 2,
 				'state' => 1,
 			),

+ 27 - 0
main/database/config.php

@@ -136,6 +136,33 @@ return array
 			//'large' 	=> true,
 		),
 
+		'hr4'		=> array
+		(
+			'name' 		=> '公众号支付设置',
+			'class'		=> '',//本项必须填写
+			'attr'		=> '',
+		),
+
+		'service_name'		=> array
+		(
+			'type' 		=> 'varchar-100',
+			'name' 		=> '公众号名称',
+			'default' 	=> '',
+			'desc' 		=> '公众号名称',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+		),
+
+		'service_text'		=> array
+		(
+			'type' 		=> 'varchar-100',
+			'name' 		=> '公众号支付成功时的小程序名称',
+			'default' 	=> 'Jstyle精美电子刊',
+			'desc' 		=> '公众号支付成功时的小程序名称',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

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


+ 1 - 0
service/assets/mobile/css/global.css.map

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

+ 2 - 0
service/assets/mobile/css/index.css

@@ -0,0 +1,2 @@
+.content{margin-bottom:1.0267rem;box-shadow:0 .04rem 0 #f3f3f3;padding-top:1.0267rem}.content .iphone,.content img{display:block;width:6.1333rem;height:10.12rem;margin:0 auto}.title{margin:0 .6667rem .4267rem;font-size:.48rem}.title,.txt{text-align:center}.txt{margin:0 .6667rem .5333rem;color:#999;font-size:.3467rem}
+/*# sourceMappingURL=index.css.map?v=0b04b240*/

+ 1 - 0
service/assets/mobile/css/index.css.map

@@ -0,0 +1 @@
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/index.css?v=0b04b240","sourceRoot":""}

+ 2 - 0
service/assets/mobile/css/list.css

@@ -0,0 +1,2 @@
+.title{padding:.4rem .64rem 0;font-size:.56rem;font-weight:700;margin-bottom:.76rem}.logo{margin:0 auto 1.0667rem;background:url(../images/logo.jpg) no-repeat;background-size:2.2667rem 2.2667rem;width:2.2667rem;padding-top:2.6rem;text-align:center;font-size:.3733rem}.tab{border-bottom:.0267rem solid #ccc;margin:0 .6667rem .5067rem}.list .item{position:relative;background:url(../images/list.png) no-repeat;background-size:9.3067rem 5.1067rem;width:9.3067rem;height:5.1067rem;margin:0 auto .4rem}.list .item .default{float:left;display:block;margin:.08rem 0 0 .3467rem;width:3.4133rem;height:4.5867rem}.list .item .info{margin:0 .3867rem 0 4.1867rem}.list .item .info h2{padding:1.2933rem 0 .4rem;font-size:.3733rem;border-bottom:.026667rem dotted #ccc;margin-bottom:.4rem}.list .item .info p{margin-bottom:.4667rem;font-size:.3733rem}.list .item .info p .price{float:left;color:#d1171a}.list .item .info p .num{float:right;color:#999}.list .item .button{position:absolute;bottom:.36rem;left:4.1867rem;width:4.6667rem;height:.9333rem;line-height:.9333rem;border-radius:.4667rem;font-size:.3467rem}
+/*# sourceMappingURL=list.css.map?v=0b04b240*/

+ 1 - 0
service/assets/mobile/css/list.css.map

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

+ 2 - 0
service/assets/mobile/css/pay.css

@@ -0,0 +1,2 @@
+.container{padding:0 .4rem;-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.h1{font-size:.4rem;font-weight:700;line-height:.64rem;padding:.6533rem 0}.list .item{height:1.3333rem;border-radius:.1333rem;border:.0267rem solid #000;margin-bottom:.4rem;box-sizing:border-box;padding:0 .4rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:.4rem;color:#000}.list .item.active{background-color:#cc1619;border-color:#cc1619;color:#fff}.buytip{font-size:.32rem;color:#999;text-align:center;text-decoration:underline;padding-bottom:.8rem}.p{font-size:.4rem;text-align:justify;line-height:.64rem;margin-bottom:.4rem;display:block;box-sizing:border-box}.richtext{margin-bottom:.5333rem}.button{width:4rem}
+/*# sourceMappingURL=pay.css.map?v=0b04b240*/

+ 1 - 0
service/assets/mobile/css/pay.css.map

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

+ 2 - 0
service/assets/mobile/css/success.css

@@ -0,0 +1,2 @@
+.code{background:url(../images/code.png) no-repeat top #eee;background-size:4.8rem 4.8133rem;height:3.1067rem;padding-bottom:.533333rem;padding-top:1.7067rem;margin-bottom:.5333rem}.code img{width:2.7467rem;height:2.7467rem;display:block;margin:0 auto}.success{background:url(../images/success.png) no-repeat top;background-size:2.0667rem 1.5733rem;width:2.0667rem;height:1.5733rem;margin:0 auto .506667rem}.txt{margin:0 1.6rem .533333rem;font-size:.3733rem}.txt span{color:#d1171a}.download{margin-bottom:.333333rem;font-size:.373333rem;text-align:center}.download *{border-bottom:.026667rem solid #d1171a;color:#d1171a}.tip{margin-bottom:.5333rem;text-align:center;color:#999;font-size:.32rem}.read{margin-bottom:1.066667rem;position:relative;height:.9333rem}.read p{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);background:url(../images/].png) no-repeat 100% 0;background-size:.2667rem .9333rem;padding:0 .4rem;color:#d1171a;font-size:.3733rem;line-height:.933333rem}.read p,.read P:before{position:absolute;top:0;height:.9333rem}.read P:before{left:0;background:url(../images/[.png) no-repeat 0 0;background-size:.2667rem .9333rem;padding-right:.4rem;content:""}.btn{margin:0 .6rem}.btn .button{float:right;width:4rem}.btn .button.opposite{float:left}
+/*# sourceMappingURL=success.css.map?v=0b04b240*/

+ 1 - 0
service/assets/mobile/css/success.css.map

@@ -0,0 +1 @@
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/success.css?v=0b04b240","sourceRoot":""}

BIN
service/assets/mobile/images/[.png


BIN
service/assets/mobile/images/].png


BIN
service/assets/mobile/images/code.jpg


BIN
service/assets/mobile/images/code.png


BIN
service/assets/mobile/images/cover.jpg


BIN
service/assets/mobile/images/list.png


BIN
service/assets/mobile/images/logo.jpg


BIN
service/assets/mobile/images/success.png


+ 21 - 0
service/assets/mobile/index.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+    <title>精美时尚</title>
+<link href="css/global.css?v=0b04b240" rel="stylesheet"><link href="css/index.css?v=0b04b240" rel="stylesheet"></head>
+
+<body>
+    <div class="content">
+        <div class="iphone">
+            <img class="default" src="images/cover.jpg" alt="">
+        </div>
+    </div>
+    <h2 class="title ellipsis">Jstyle精美电子刊·订阅</h2>
+    <p class="txt">登录后才可以使用精美时尚服务</p>
+    <button class="button">微信登录</button>
+<script type="text/javascript" src="js/global.js?v=0b04b240"></script><script type="text/javascript" src="js/index.js?v=0b04b240"></script></body>
+
+</html>

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


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


+ 2 - 0
service/assets/mobile/js/index.js

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

+ 1 - 0
service/assets/mobile/js/index.js.map

@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///js","webpack:///./mobile/src/router/index.js"],"names":["webpackJsonp","1","module","exports","__webpack_require__","13","8"],"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/index.js?v=0b04b240","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__(8);\n\n/***/ }),\n\n/***/ 13:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(1);\n\n\n/***/ }),\n\n/***/ 8:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n},[13]);\n\n\n// WEBPACK FOOTER //\n// js?v=0b04b240","import './global';\r\nimport '../css/index.css';\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/index.js"],"sourceRoot":""}

+ 2 - 0
service/assets/mobile/js/list.js

@@ -0,0 +1,2 @@
+webpackJsonp([2],{14:function(n,t,c){n.exports=c(2)},2:function(n,t,c){"use strict";c(0),c(9)},9:function(n,t){}},[14]);
+//# sourceMappingURL=list.js.map?v=0b04b240

+ 1 - 0
service/assets/mobile/js/list.js.map

@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///js/list.js","webpack:///./mobile/src/router/list.js"],"names":["webpackJsonp","14","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,GACAA,EAAA,IDqBME,EACA,SAAUJ,EAAQC,OAMrB","file":"js/list.js?v=0b04b240","sourcesContent":["webpackJsonp([2],{\n\n/***/ 14:\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},[14]);\n\n\n// WEBPACK FOOTER //\n// js/list.js?v=0b04b240","import './global';\r\nimport '../css/list.css';\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/list.js"],"sourceRoot":""}

+ 2 - 0
service/assets/mobile/js/pay.js

@@ -0,0 +1,2 @@
+webpackJsonp([1],{10:function(n,e){},15:function(n,e,o){n.exports=o(3)},3:function(n,e,o){"use strict";o(0),o(10),$(document).on("touchend",'[bind-id="item"]',function(){$(this).addClass("active").siblings(".item").removeClass("active")}),$("#open").on("touchend",function(){$("#layer").removeClass("fn-hide")}),$("#close").on("touchend",function(){$("#layer").addClass("fn-hide")})}},[15]);
+//# sourceMappingURL=pay.js.map?v=0b04b240

+ 1 - 0
service/assets/mobile/js/pay.js.map

@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///js/pay.js","webpack:///./mobile/src/router/pay.js"],"names":["webpackJsonp","10","module","exports","15","__webpack_require__","3","$","document","on","this","addClass","siblings","removeClass"],"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,IAEAE,EAAEC,UAAUC,GAAG,WAAY,mBAAoB,WAC3CF,EAAEG,MAAMC,SAAS,UAAUC,SAAS,SAASC,YAAY,YAG7DN,EAAE,SAASE,GAAG,WAAW,WACrBF,EAAE,UAAUM,YAAY,aAG5BN,EAAE,UAAUE,GAAG,WAAW,WACtBF,EAAE,UAAUI,SAAS,gBD6BtB","file":"js/pay.js?v=0b04b240","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$(document).on('touchend', '[bind-id=\"item\"]', function () {\n    $(this).addClass('active').siblings('.item').removeClass('active');\n});\n\n$('#open').on('touchend', function () {\n    $('#layer').removeClass('fn-hide');\n});\n\n$('#close').on('touchend', function () {\n    $('#layer').addClass('fn-hide');\n});\n\n/***/ })\n\n},[15]);\n\n\n// WEBPACK FOOTER //\n// js/pay.js?v=0b04b240","import './global';\r\nimport '../css/pay.css';\r\n\r\n$(document).on('touchend', '[bind-id=\"item\"]', function(){\r\n    $(this).addClass('active').siblings('.item').removeClass('active');\r\n});\r\n\r\n$('#open').on('touchend',function(){\r\n    $('#layer').removeClass('fn-hide');\r\n});\r\n\r\n$('#close').on('touchend',function(){\r\n    $('#layer').addClass('fn-hide');\r\n});\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/pay.js"],"sourceRoot":""}

+ 2 - 0
service/assets/mobile/js/success.js

@@ -0,0 +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]);
+//# sourceMappingURL=success.js.map?v=0b04b240

+ 1 - 0
service/assets/mobile/js/success.js.map

@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///js/success.js","webpack:///./mobile/src/router/success.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/success.js?v=0b04b240","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/success.js?v=0b04b240","import './global';\r\nimport '../css/success.css';\r\n\n\n\n// WEBPACK FOOTER //\n// ./mobile/src/router/success.js"],"sourceRoot":""}

+ 48 - 0
service/assets/mobile/list.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+    <title>精美时尚</title>
+<link href="css/global.css?v=0b04b240" rel="stylesheet"><link href="css/list.css?v=0b04b240" rel="stylesheet"></head>
+
+<body>
+    <h2 class="title">Jstyle精美电子刊·	订阅</h2>
+    <div class="logo">Jstyle精美</div>
+    <div class="tab"></div>
+    <div class="list">
+        <div class="item">
+            <img class="default" />
+            <div class="info">
+                <h2>段宜恩电子刊段宜恩电子刊段宜恩电子刊</h2>
+                <p class="clearfix">
+                    <span class="price">¥6.00</span>
+                    <span class="num">销量:5221</span>
+                </p>
+            </div>
+            <button class="button">购买阅读</button>
+        </div>
+        <div class="item">
+            <img class="default" />
+            <div class="info">
+                <h2>段宜恩电子刊段宜恩电子刊段宜恩电子刊</h2>
+                <p class="clearfix">
+                    <span class="price">¥6.00</span>
+                    <span class="num">销量:5221</span>
+                </p>
+            </div>
+            <button class="button">购买兑换</button>
+        </div>
+        
+    </div>
+<script type="text/javascript" src="js/global.js?v=0b04b240"></script><script type="text/javascript" src="js/list.js?v=0b04b240"></script></body>
+
+</html>
+<script>
+function pay(id)
+{
+    var url = config.host + 'pay&id=' + id;
+    location.href = url;
+}
+</script>

+ 54 - 0
service/assets/mobile/pay.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+    <title>精美时尚</title>
+<link href="css/global.css?v=0b04b240" rel="stylesheet"><link href="css/pay.css?v=0b04b240" rel="stylesheet"></head>
+
+<body>
+    <div class="container">
+        <div>
+            <div class="h1">正在购买《xxxx》</div>
+            <div class="list">
+                <a  class="item" bind-id="item" href="#"><p>购买10本</p><p>¥6</p></a>
+                <a  class="item" bind-id="item" href="#"><p>购买10本</p><p>¥6</p></a>
+                <a  class="item" bind-id="item" href="#"><p>购买10本</p><p>¥6</p></a>
+            </div>
+        </div>
+        <div class='buytip' id="open"><p>购买说明</p></div> 
+    </div>
+    <div class="mask fn-hide" id="layer">
+        <div class="layer "> 
+            <p class="richtext">asdfsdf</p>
+            <div class="btn-wrapper">
+                <div class="button opposite" id="close">我知道了</div>
+            </div>
+        </div>
+    </div>
+    <div id="pay"></div>
+<script type="text/javascript" src="js/global.js?v=0b04b240"></script><script type="text/javascript" src="js/pay.js?v=0b04b240"></script></body>
+
+</html>
+
+<script>
+function pay(buy_id, journal_id)
+{
+    var url = config.host + 'data.pay';
+    $.get(url, {buy_id:buy_id, journal_id:journal_id}, function(t) {
+        $("#pay").html(t);
+    })
+}
+
+$(function()
+{
+    $('#open').click(function(){
+        $('#layer').show();
+    });
+
+    $('#close').click(function(){
+        $('#layer').hide();
+    })
+})
+</script>

+ 29 - 0
service/assets/mobile/success.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+    <title>精美时尚</title>
+<link href="css/global.css?v=0b04b240" rel="stylesheet"><link href="css/success.css?v=0b04b240" rel="stylesheet"></head>
+
+<body>
+    <div class="code">
+        <img class="default" src="images/code.jpg" alt="">
+    </div>
+    <div class="success"></div>
+    <p class="txt">购买成功,长按上方小程序码识别或微信搜索“<span>Jstyle精美电子刊</span>”进入小程序使用阅读码</p>
+    <p class="download" style="display:none;"><a href="#">点击下载“Jstyle精美”APP查看电子刊</a></p>
+    <div style="display:none;">
+        <p class="tip">(点击下方阅读码可直接复制)</p>
+        <div class="read">
+            <p>阅读码:1521DSJDB55</p>
+        </div>
+    </div>
+    <div class="btn clearfix">
+        <a class="button opposite" href="#">查看全部</a>
+        <a class="button" href="#">继续购买</a>
+    </div>
+<script type="text/javascript" src="js/global.js?v=0b04b240"></script><script type="text/javascript" src="js/success.js?v=0b04b240"></script></body>
+
+</html>

+ 36 - 0
service/config/base.php

@@ -0,0 +1,36 @@
+<?php
+
+# 一些基本配置
+$config['base'] = array
+(
+    
+);
+
+$config['template'] = array
+(
+    # 静态页面目录
+    'assets' => 'mobile',
+
+    # 模板编译器目录
+    'template' => 'mobile',
+
+    # 模板html文件的所在目录,默认为html
+    'path' => '',
+
+    'replace' => array
+    (
+        'css' => 'css/',
+        'js' => 'js/',
+        'images' => 'images/',
+    ),
+
+    # 编译器与模板对应关系目录,定义之后,代表可以完全不改动前端的代码,可以为空,为空则一一对应,参考manage
+    'relation' => array
+    (
+        # 首页启动屏幕
+        'home' => 'index',
+    ),
+    
+);
+
+return $config;

+ 8 - 0
service/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'service');
+define('DEVER_APP_LANG', '公众号支付');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 1);
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-tower layui-icon-dollar');
+include(DEVER_APP_PATH . '../boot.php');

+ 232 - 0
service/src/Data.php

@@ -0,0 +1,232 @@
+<?php namespace Service\Src;
+
+use Dever;
+
+class Data
+{
+    # 获取基本配置
+    public function config()
+    {
+        $user = Dever::load('passport/user')->data();
+        if ($user) {
+            $url = Dever::url('list', 'service');
+            Dever::location($url);
+            return;
+        }
+        $cate = Dever::input('cate', 1);
+        $cate = Dever::db('journal/cate')->one($cate);
+
+        $cate['login_title'] = '登录后才可以使用' . Dever::config('base')->name . '服务';
+
+        $cate['bglogo'] = ':url('.$cate['logo'].') no-repeat;';
+
+        $url = urlencode(Dever::url('home', 'service'));
+        $cate['login'] = 'location.href=\'' . Dever::url('request.auth?account=1&refer=' . $url, 'oauth') . '\'';
+        return $cate;
+    }
+    
+    # 列表页
+    public function lists()
+    {
+        $where['cate_id'] = 1;
+        $where['buy'] = 1;
+        $data = Dever::db('journal/info')->getAll($where);
+
+        if ($data) {
+            foreach ($data as $k => $v) {
+                if ($v['cash'] > 0) {
+                    $data[$k]['price'] = '¥' . number_format($v['cash'], 2);
+                } else {
+                    $data[$k]['price'] = '免费';
+                }
+
+                $data[$k]['ding'] = '销量:' . $v['num_ding'];
+            }
+        }
+
+        return $data;
+    }
+
+    public function info()
+    {
+        $id = Dever::input('id');
+        $info = Dever::db('journal/info')->one($id);
+
+        $info['buy'] = '正在购买《' . $info['name'] . '》';
+
+        $buy = Dever::db('journal/buy')->one(array('id' => $id));
+
+        if ($buy) {
+            $info['buy_desc'] = $buy['buy_content'];
+        } else {
+            $info['buy_desc'] = '';
+        }
+        
+        return $info;
+    }
+
+    public function code()
+    {
+        # 生成二维码
+        $id = Dever::input('id');
+
+        $this->data = Dever::load('passport/user')->data();
+        if (!$this->data) {
+            $url = Dever::url('home', 'service');
+            //Dever::location($url);
+            //return;
+        } else {
+            $this->data['uid'] = $this->data['id'];
+        }
+
+        $this->data['uid'] = 4;
+
+        $type = 4;
+
+        $scene = Dever::login($this->data['uid']) . ',' . $type . ',' . $id;
+
+        $path = '';
+        //echo $scene;die;
+        $send['project'] = Dever::input('project', 1);
+        $send['send'] = $scene;
+        $send['width'] = 152;
+        $send['path'] = $path; 
+        //$logo = Dever::load('wechat_applet/code.get', $send);
+
+        $code = 'https://cm.5dev.cn/applet_on/data/upload/1/2018/06/06/239fa207778aa923f4ff7594dfbdfcca.png';
+
+        return $code;
+    }
+
+    public function success()
+    {
+        $config = Dever::db('main/config')->one(1);
+
+        $id = Dever::input('id');
+        $config['list'] = Dever::url('list', 'service');
+        $config['buy'] = Dever::url('pay?id=' . $id, 'service');
+
+        return $config;
+    }
+
+    public function buy()
+    {
+        $id = Dever::input('id');
+        $data = Dever::db('journal/buy_num')->getAll(array('info_id' => $id));
+        $info = Dever::db('journal/info')->one($id);
+
+        if ($data) {
+            foreach ($data as $k => $v) {
+                if ($info['cash'] > 0) {
+                    $data[$k]['price'] = '¥' . number_format($info['cash'] * $v['num'], 2);
+                } else {
+                    $data[$k]['price'] = '免费';
+                }
+
+                if (!$v['name']) {
+                    $data[$k]['name'] = '购买' . $v['num'] . '本';
+                }
+                
+            }
+        }
+        return $data;
+    }
+
+    public function pay()
+    {
+        $this->data = Dever::load('passport/user')->data();
+        if (!$this->data) {
+            $url = Dever::url('home', 'service');
+            //Dever::location($url);
+            //return;
+        } else {
+            $this->data['uid'] = $this->data['id'];
+        }
+
+        $this->data['uid'] = 4;
+
+        $buy_id = Dever::input('buy_id');
+        $journal_id = Dever::input('journal_id');
+
+        if (!$buy_id) {
+            Dever::alert('请传入正确的支付ID');
+        }
+        if (!$journal_id) {
+            Dever::alert('请传入正确的小刊ID');
+        }
+
+        $info = Dever::db('journal/info')->one($journal_id);
+        $buy = Dever::db('journal/buy_num')->one($buy_id);
+
+        if (!$buy || !$info) {
+            Dever::alert('请传入正确的小刊ID');
+        }
+
+        if (!$buy['name']) {
+            $buy['name'] = '购买' . $buy['num'] . '本';
+        }
+
+        $user = Dever::db('passport/user')->one($this->data['uid']);
+        $wechat = Dever::db('passport/wechat_oauth')->one(array('uid' => $this->data['uid']));
+
+        $source_type = Dever::input('source_type');
+
+        if ($source_type == 'ios' || $source_type == 'android') {
+            $method = 'app';
+        } else {
+            $method = 'applet';
+        }
+
+        $order_id = $this->createOrder('JP');
+        $order_data['order_id'] = $order_id;
+        $order_data['product_id'] = $journal_id;
+        $order_data['buy_id'] = $buy_id;
+        $order_data['uid'] = $this->data['uid'];
+
+        $order_data['type'] = 1;
+        $order_data['status'] = 1;
+        $order_data['name'] = $info['name'] . '-' . $buy['name'];
+        //$order_data['num'] = Dever::input('num', 1);
+        $order_data['num'] = $buy['num'];
+        $order_data['cash'] = $info['cash'] * $order_data['num'];
+
+        $id = Dever::db('journal/order')->insert($order_data);
+
+        if (!$id) {
+            Dever::alert('支付失败');
+        }
+
+        //$param参数
+        $param = array
+        (
+            'account_id' => 2,
+            'project_id' => 1,
+            'uid' => $this->data['uid'],
+            'username' => $user['username'],
+            'name' => $order_data['name'],
+            'cash' => $order_data['cash'],
+            'cash' => '0.01',
+            'openid' => $wechat['openid'],
+            'product_id' => $journal_id . '-' . $buy_id,
+            'order_id' => $order_id,
+            'refer' => Dever::url('success?id=' . $journal_id . '&buy=' . $buy_id)
+        );
+
+        return Dever::load('pay/api.page', $param);
+    }
+
+    private function createOrder($prefix = 'JC')
+    {
+        //$order = Dever::order($prefix);
+
+        $order = Dever::rand(2, 2) . Dever::rand(6, 0);
+
+        $info = Dever::db('journal/order')->one(array('order_id' => $order));
+
+        if ($info) {
+            return $this->createOrder();
+        }
+
+        return $order;
+    }
+}

+ 17 - 0
service/template/mobile/home.php

@@ -0,0 +1,17 @@
+<?php
+
+$view
+
+->import('inc/head')
+
+->fetch('img@src',    'service/data.config#cover')
+
+->fetch('.txt', 'service/data.config#login_title')
+
+->fetch('.ellipsis', 'service/data.config#title')
+
+->fetch('.button@onclick', 'service/data.config#login')
+
+->import('inc/foot')
+
+->display();

+ 13 - 0
service/template/mobile/inc/foot.php

@@ -0,0 +1,13 @@
+<?php
+
+$view
+
+->fetch(array('script@src', 0),     Dever::assets('global.js'))
+->fetch(array('script@src', 1),     Dever::assets('<{(isset($name) ? $name : "index")}>.js', 'js'))
+
+
+->append('body',    '<script src="'.Dever::assets('lib/jquery/jquery.min.js', 'script').'"></script>')
+->append('body',    '<script src="'.Dever::assets('dever/core.js', 'script').'"></script>')
+->append('body',    '<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>')
+
+;

+ 10 - 0
service/template/mobile/inc/head.php

@@ -0,0 +1,10 @@
+<?php
+
+$view
+->fetch('title',                    '<{isset($title) ? $title . "_" . Dever::load("service/data.config#title") : Dever::load("service/data.config#title")}>')
+
+->fetch(array('link@href', 0),      Dever::assets("global.css"))
+->fetch(array('link@href', 1),      Dever::assets('<{(isset($name) ? $name : "index")}>.css', "css"))
+
+
+->append('head',    '<script><{Dever::script()}>config.uid=<{Dever::load("passport/user.data") ? Dever::load("passport/user.data#id") : -1}></script>');

+ 40 - 0
service/template/mobile/list.php

@@ -0,0 +1,40 @@
+<?php
+
+$view
+
+->set('name', 'list')
+
+->import('inc/head')
+
+->fetch('.title', 'service/data.config#title')
+
+->fetch('.logo@style', 'service/data.config#bglogo')
+
+# 循环
+->loop
+(
+    '.item',
+    'service/data.lists',
+    array
+    (
+        'h2' => '$v.name',
+        '.price' => '$v.price',
+
+        '.num' => '$v.ding',
+
+        'img' => array
+        (
+            'src' => '$v.pic_gd',
+        ),
+
+        '.button' => array
+        (
+            'onclick' => 'pay(<{$v.id}>)',
+        )
+        
+    )
+)
+
+->import('inc/foot')
+
+->display();

+ 34 - 0
service/template/mobile/pay.php

@@ -0,0 +1,34 @@
+<?php
+
+$view
+
+->set('name', 'pay')
+
+->import('inc/head')
+
+->fetch('.h1', 'service/data.info#buy')
+
+->fetch('.richtext', 'service/data.info#buy_desc')
+
+# 循环
+->loop
+(
+    '.item',
+    'service/data.buy',
+    array
+    (
+        'p|0' => '$v.name',
+        'p|1' => '$v.price',
+
+        'self' => array
+        (
+            'href' => 'javascript:;',
+            'onclick' => 'pay(<{$v.id}>, <{$v.info_id}>)',
+        ),
+        
+    )
+)
+
+->import('inc/foot')
+
+->display();

+ 20 - 0
service/template/mobile/success.php

@@ -0,0 +1,20 @@
+<?php
+
+$view
+
+->set('name', 'success')
+
+->import('inc/head')
+
+->fetch('.default@src', 'service/data.code')
+
+->fetch('span', 'service/data.success#service_text')
+
+->fetch('.opposite@href', 'service/data.success#list')
+
+->fetch(array('.button@href', 1), 'service/data.success#buy')
+
+
+->import('inc/foot')
+
+->display();

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