作者 anyv
1 个管道 的构建 通过 耗费 0 秒

Merge branch 'master' of http://114.215.101.231:8099/anyv/xkeasy

... ... @@ -75,7 +75,7 @@ class OrderSalesmanController extends WeChatBaseController
$where['school'] = ['eq',$param['school']];
}
if(!empty($param['grade'])){
$param['grade'] = explode('',$param['grade']);
$param['grade'] = explode('-',$param['grade']);
$where['grade'] = ['eq',$param['grade'][0]];
$where['class'] = ['eq',$param['grade'][1]];
}
... ...
... ... @@ -10,6 +10,7 @@ namespace app\portal\controller;
use cmf\controller\WeChatBaseController;
use EasyWeChat\Foundation\Application;
use think\Db;
class ShareController extends WeChatBaseController
... ... @@ -65,6 +66,62 @@ class ShareController extends WeChatBaseController
// }
$share_image = cmf_get_image_url('poster/poster_'.$user_id.".png");
$this->assign('share_image',$share_image);
//分享
$options = config('wechat_config');
$app = new Application($options);
$js = $app->js;
$jssdk = $js->config(array('onMenuShareAppMessage', 'onMenuShareTimeline','onMenuShareQQ'), false, false, true);
$this->assign('jssdk',$jssdk);
//分享内容
$share_url = url('to_user',array('user_id'=>$user_id),false,true);
$share['share_title'] = 'title';
$share['share_desc'] = 'desc';
$share['share_image'] = $share_image;
$share['share_url'] = $share_url;
$this->assign('share',$share);
return $this->fetch();
}
public function to_user(){
$user_id = $this->request->param('user_id',0,'intval');
if(empty($user_id)){
$this->error('缺少必要参数');
}
$my_user = Db::name('my_user')->where('uid',$user_id)->find();
$user = Db::name('user')->where('id',$user_id)->find();
if(empty($my_user)){
$this->error('查询为空','','','');
}
if($my_user['is_pro'] != 1){
$this->error('无权限','','','');
}
$url = $this->get_url($my_user['id'],$my_user['status']);
$webPath = 'qrcode/share_'.$user_id.'.png';
$savePath = './upload/'.$webPath;
//生成带参二维码
if(!file_exists($savePath)){
$prcode_url = $this->get_code($user_id,$url);
}
//保存头像
$avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']);
if($avatar['code']==1){
$this->error($avatar['msg']);
}
$savePath = './upload/poster';
if(!file_exists($savePath)){
mkdir ($savePath,0777,true);
}
$image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg");
$image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png");
$image = \think\Image::open(ROOT_PATH."public/upload/qrcode/share_".$user_id.".png");
$image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/share_'.$user_id.".png");
$image = \think\Image::open(ROOT_PATH."public/white.png");
$image->water(ROOT_PATH."public/upload/qrcode/share_".$user_id.".png",[195,725],100)
->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100)
->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100)
->save('./upload/poster/poster_'.$user_id.".png");
$share_image = cmf_get_image_url('poster/poster_'.$user_id.".png");
$this->assign('share_image',$share_image);
return $this->fetch();
}
public function information(){
... ...
... ... @@ -610,7 +610,7 @@
alert('请选择学校')
} else if ($(this).hasClass("there_unActive")) {
var banji = $(this).text();
$('.log_three_select_school2').text($xuexiao + ' ' + "" + ' ' + banji);
$('.log_three_select_school2').text($xuexiao + ' ' + "-" + ' ' + banji);
$(".log_three_select_school2").css("color", "#333")
$(".tx_mask_school").hide();
$('#school').val($xuexiao);
... ... @@ -771,7 +771,7 @@
// if(i == 0){
// html += "<div class=\"three_model_school_name there_unActive\" data-id=\""+result[i].id+"\">"+result[i].grade+"—"+i2+"</div>";
// }
html += "<div class=\"three_model_school_name\" data-id=\"" + result[i].id + "\">" + result[i].grade + "" + i2 + "班</div>";
html += "<div class=\"three_model_school_name\" data-id=\"" + result[i].id + "\">" + result[i].grade + "-" + i2 + "班</div>";
}
}
$('.grade').html(html);
... ...
... ... @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-我的推广</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
... ... @@ -19,28 +19,46 @@
align-items: flex-start;
flex-direction: column;
}
.code_Box {
background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left;
background-size: 100%;
-webkit-background-size: 100%;
}
/*.code_Box {*/
/*background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left;*/
/*background-size: 100%;*/
/*-webkit-background-size: 100%;*/
/*}*/
</style>
</head>
<body>
<!-- 顶部 -->
<div class="order_top" style="background-color: #FF5C19">
<a href="javascript:history.back(-1)">
<img src="__TMPL__/public/assets/images/left2.png" alt="">
</a>
<p style="color:white">我的推广</p>
</div>
<div class="code_Box">
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<!-- 顶部 -->
<div class="order_top" style="background-color: #FF5C19">
<a href="javascript:history.back(-1)">
<img src="__TMPL__/public/assets/images/left2.png" alt="">
</a>
<p style="color:white">我的推广</p>
</div>
<div class="code_Box" style="background: #FE3A00;">
<img src="{:cmf_get_image_url($share_image)}" style="-webkit-background-size: 100%;background-size: 100%;height: auto;width: 100%;"/>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</body>
<script>
wx.config({$jssdk});
wx.ready(function () {
var shareData = {
title: "{$share.share_title}",
desc: "{$share.share_desc}",
link: "{$share.share_url}",
imgUrl: "{$share.share_image}",
success: function () {
//分享成功返回信息
}
}
//分享到朋友圈
wx.onMenuShareTimeline(shareData);
//分享给朋友
wx.onMenuShareAppMessage(shareData);
})
</script>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-我的推广</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
<style>
html,
body {
width: 100%;
height: 100%;
display: flex;
display: -webkit-flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
}
/*.code_Box {*/
/*background: #FF5C19 url("{:cmf_get_image_url($share_image)}") no-repeat top left;*/
/*background-size: 100%;*/
/*-webkit-background-size: 100%;*/
/*}*/
</style>
</head>
<body>
<!-- 顶部 -->
<div class="order_top" style="background-color: #FF5C19">
<a href="javascript:history.back(-1)">
<img src="__TMPL__/public/assets/images/left2.png" alt="">
</a>
<p style="color:white">ta的推广</p>
</div>
<div class="code_Box">
<img src="{:cmf_get_image_url($share_image)}"/>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
</body>
</html>
\ No newline at end of file
... ...