1 个管道
的构建
通过
耗费
0 秒
Merge branch 'master' of http://114.215.101.231:8099/anyv/xkeasy
正在显示
5 个修改的文件
包含
143 行增加
和
22 行删除
@@ -75,7 +75,7 @@ class OrderSalesmanController extends WeChatBaseController | @@ -75,7 +75,7 @@ class OrderSalesmanController extends WeChatBaseController | ||
75 | $where['school'] = ['eq',$param['school']]; | 75 | $where['school'] = ['eq',$param['school']]; |
76 | } | 76 | } |
77 | if(!empty($param['grade'])){ | 77 | if(!empty($param['grade'])){ |
78 | - $param['grade'] = explode('—',$param['grade']); | 78 | + $param['grade'] = explode('-',$param['grade']); |
79 | $where['grade'] = ['eq',$param['grade'][0]]; | 79 | $where['grade'] = ['eq',$param['grade'][0]]; |
80 | $where['class'] = ['eq',$param['grade'][1]]; | 80 | $where['class'] = ['eq',$param['grade'][1]]; |
81 | } | 81 | } |
@@ -10,6 +10,7 @@ namespace app\portal\controller; | @@ -10,6 +10,7 @@ namespace app\portal\controller; | ||
10 | 10 | ||
11 | 11 | ||
12 | use cmf\controller\WeChatBaseController; | 12 | use cmf\controller\WeChatBaseController; |
13 | +use EasyWeChat\Foundation\Application; | ||
13 | use think\Db; | 14 | use think\Db; |
14 | 15 | ||
15 | class ShareController extends WeChatBaseController | 16 | class ShareController extends WeChatBaseController |
@@ -65,6 +66,62 @@ class ShareController extends WeChatBaseController | @@ -65,6 +66,62 @@ class ShareController extends WeChatBaseController | ||
65 | // } | 66 | // } |
66 | $share_image = cmf_get_image_url('poster/poster_'.$user_id.".png"); | 67 | $share_image = cmf_get_image_url('poster/poster_'.$user_id.".png"); |
67 | $this->assign('share_image',$share_image); | 68 | $this->assign('share_image',$share_image); |
69 | + //分享 | ||
70 | + $options = config('wechat_config'); | ||
71 | + $app = new Application($options); | ||
72 | + $js = $app->js; | ||
73 | + $jssdk = $js->config(array('onMenuShareAppMessage', 'onMenuShareTimeline','onMenuShareQQ'), false, false, true); | ||
74 | + $this->assign('jssdk',$jssdk); | ||
75 | + //分享内容 | ||
76 | + $share_url = url('to_user',array('user_id'=>$user_id),false,true); | ||
77 | + $share['share_title'] = 'title'; | ||
78 | + $share['share_desc'] = 'desc'; | ||
79 | + $share['share_image'] = $share_image; | ||
80 | + $share['share_url'] = $share_url; | ||
81 | + $this->assign('share',$share); | ||
82 | + return $this->fetch(); | ||
83 | + } | ||
84 | + public function to_user(){ | ||
85 | + $user_id = $this->request->param('user_id',0,'intval'); | ||
86 | + if(empty($user_id)){ | ||
87 | + $this->error('缺少必要参数'); | ||
88 | + } | ||
89 | + $my_user = Db::name('my_user')->where('uid',$user_id)->find(); | ||
90 | + $user = Db::name('user')->where('id',$user_id)->find(); | ||
91 | + if(empty($my_user)){ | ||
92 | + $this->error('查询为空','','',''); | ||
93 | + } | ||
94 | + if($my_user['is_pro'] != 1){ | ||
95 | + $this->error('无权限','','',''); | ||
96 | + } | ||
97 | + $url = $this->get_url($my_user['id'],$my_user['status']); | ||
98 | + $webPath = 'qrcode/share_'.$user_id.'.png'; | ||
99 | + $savePath = './upload/'.$webPath; | ||
100 | + //生成带参二维码 | ||
101 | + if(!file_exists($savePath)){ | ||
102 | + $prcode_url = $this->get_code($user_id,$url); | ||
103 | + } | ||
104 | + //保存头像 | ||
105 | + $avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']); | ||
106 | + if($avatar['code']==1){ | ||
107 | + $this->error($avatar['msg']); | ||
108 | + } | ||
109 | + $savePath = './upload/poster'; | ||
110 | + if(!file_exists($savePath)){ | ||
111 | + mkdir ($savePath,0777,true); | ||
112 | + } | ||
113 | + $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg"); | ||
114 | + $image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png"); | ||
115 | + $image = \think\Image::open(ROOT_PATH."public/upload/qrcode/share_".$user_id.".png"); | ||
116 | + $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/share_'.$user_id.".png"); | ||
117 | + $image = \think\Image::open(ROOT_PATH."public/white.png"); | ||
118 | + $image->water(ROOT_PATH."public/upload/qrcode/share_".$user_id.".png",[195,725],100) | ||
119 | + ->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100) | ||
120 | + ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100) | ||
121 | + ->save('./upload/poster/poster_'.$user_id.".png"); | ||
122 | + $share_image = cmf_get_image_url('poster/poster_'.$user_id.".png"); | ||
123 | + | ||
124 | + $this->assign('share_image',$share_image); | ||
68 | return $this->fetch(); | 125 | return $this->fetch(); |
69 | } | 126 | } |
70 | public function information(){ | 127 | public function information(){ |
@@ -610,7 +610,7 @@ | @@ -610,7 +610,7 @@ | ||
610 | alert('请选择学校') | 610 | alert('请选择学校') |
611 | } else if ($(this).hasClass("there_unActive")) { | 611 | } else if ($(this).hasClass("there_unActive")) { |
612 | var banji = $(this).text(); | 612 | var banji = $(this).text(); |
613 | - $('.log_three_select_school2').text($xuexiao + ' ' + "—" + ' ' + banji); | 613 | + $('.log_three_select_school2').text($xuexiao + ' ' + "-" + ' ' + banji); |
614 | $(".log_three_select_school2").css("color", "#333") | 614 | $(".log_three_select_school2").css("color", "#333") |
615 | $(".tx_mask_school").hide(); | 615 | $(".tx_mask_school").hide(); |
616 | $('#school').val($xuexiao); | 616 | $('#school').val($xuexiao); |
@@ -771,7 +771,7 @@ | @@ -771,7 +771,7 @@ | ||
771 | // if(i == 0){ | 771 | // if(i == 0){ |
772 | // html += "<div class=\"three_model_school_name there_unActive\" data-id=\""+result[i].id+"\">"+result[i].grade+"—"+i2+"</div>"; | 772 | // html += "<div class=\"three_model_school_name there_unActive\" data-id=\""+result[i].id+"\">"+result[i].grade+"—"+i2+"</div>"; |
773 | // } | 773 | // } |
774 | - html += "<div class=\"three_model_school_name\" data-id=\"" + result[i].id + "\">" + result[i].grade + "—" + i2 + "班</div>"; | 774 | + html += "<div class=\"three_model_school_name\" data-id=\"" + result[i].id + "\">" + result[i].grade + "-" + i2 + "班</div>"; |
775 | } | 775 | } |
776 | } | 776 | } |
777 | $('.grade').html(html); | 777 | $('.grade').html(html); |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 5 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
6 | - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> | 6 | + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/> |
7 | <meta http-equiv="X-UA-Compatible" content="ie=edge"> | 7 | <meta http-equiv="X-UA-Compatible" content="ie=edge"> |
8 | <title>学考无忧-我的推广</title> | 8 | <title>学考无忧-我的推广</title> |
9 | <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"> | 9 | <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"> |
@@ -19,28 +19,46 @@ | @@ -19,28 +19,46 @@ | ||
19 | align-items: flex-start; | 19 | align-items: flex-start; |
20 | flex-direction: column; | 20 | flex-direction: column; |
21 | } | 21 | } |
22 | - | ||
23 | - .code_Box { | ||
24 | - background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left; | ||
25 | - background-size: 100%; | ||
26 | - -webkit-background-size: 100%; | ||
27 | 22 | ||
28 | - } | 23 | + /*.code_Box {*/ |
24 | + /*background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left;*/ | ||
25 | + /*background-size: 100%;*/ | ||
26 | + /*-webkit-background-size: 100%;*/ | ||
27 | + | ||
28 | + /*}*/ | ||
29 | </style> | 29 | </style> |
30 | </head> | 30 | </head> |
31 | 31 | ||
32 | <body> | 32 | <body> |
33 | - <!-- 顶部 --> | ||
34 | - <div class="order_top" style="background-color: #FF5C19"> | ||
35 | - <a href="javascript:history.back(-1)"> | ||
36 | - <img src="__TMPL__/public/assets/images/left2.png" alt=""> | ||
37 | - </a> | ||
38 | - <p style="color:white">我的推广</p> | ||
39 | - </div> | ||
40 | - <div class="code_Box"> | ||
41 | - | ||
42 | - </div> | ||
43 | - <script src="__TMPL__/public/assets/js/base.js"></script> | 33 | +<!-- 顶部 --> |
34 | +<div class="order_top" style="background-color: #FF5C19"> | ||
35 | + <a href="javascript:history.back(-1)"> | ||
36 | + <img src="__TMPL__/public/assets/images/left2.png" alt=""> | ||
37 | + </a> | ||
38 | + <p style="color:white">我的推广</p> | ||
39 | +</div> | ||
40 | +<div class="code_Box" style="background: #FE3A00;"> | ||
41 | + <img src="{:cmf_get_image_url($share_image)}" style="-webkit-background-size: 100%;background-size: 100%;height: auto;width: 100%;"/> | ||
42 | +</div> | ||
43 | +<script src="__TMPL__/public/assets/js/base.js"></script> | ||
44 | +<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> | ||
44 | </body> | 45 | </body> |
45 | - | 46 | +<script> |
47 | + wx.config({$jssdk}); | ||
48 | + wx.ready(function () { | ||
49 | + var shareData = { | ||
50 | + title: "{$share.share_title}", | ||
51 | + desc: "{$share.share_desc}", | ||
52 | + link: "{$share.share_url}", | ||
53 | + imgUrl: "{$share.share_image}", | ||
54 | + success: function () { | ||
55 | + //分享成功返回信息 | ||
56 | + } | ||
57 | + } | ||
58 | + //分享到朋友圈 | ||
59 | + wx.onMenuShareTimeline(shareData); | ||
60 | + //分享给朋友 | ||
61 | + wx.onMenuShareAppMessage(shareData); | ||
62 | + }) | ||
63 | +</script> | ||
46 | </html> | 64 | </html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | ||
6 | + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/> | ||
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
8 | + <title>学考无忧-我的推广</title> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
11 | + <style> | ||
12 | + html, | ||
13 | + body { | ||
14 | + width: 100%; | ||
15 | + height: 100%; | ||
16 | + display: flex; | ||
17 | + display: -webkit-flex; | ||
18 | + justify-content: flex-start; | ||
19 | + align-items: flex-start; | ||
20 | + flex-direction: column; | ||
21 | + } | ||
22 | + | ||
23 | + /*.code_Box {*/ | ||
24 | + /*background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left;*/ | ||
25 | + /*background-size: 100%;*/ | ||
26 | + /*-webkit-background-size: 100%;*/ | ||
27 | + | ||
28 | + /*}*/ | ||
29 | + </style> | ||
30 | +</head> | ||
31 | + | ||
32 | +<body> | ||
33 | +<!-- 顶部 --> | ||
34 | +<div class="order_top" style="background-color: #FF5C19"> | ||
35 | + <a href="javascript:history.back(-1)"> | ||
36 | + <img src="__TMPL__/public/assets/images/left2.png" alt=""> | ||
37 | + </a> | ||
38 | + <p style="color:white">ta的推广</p> | ||
39 | +</div> | ||
40 | +<div class="code_Box"> | ||
41 | +<img src="{:cmf_get_image_url($share_image)}"/> | ||
42 | +</div> | ||
43 | +<script src="__TMPL__/public/assets/js/base.js"></script> | ||
44 | +</body> | ||
45 | + | ||
46 | +</html> |
-
请 注册 或 登录 后发表评论