...
|
...
|
@@ -33,27 +33,37 @@ class ShareController extends WeChatBaseController |
|
|
if($my_user['is_pro'] != 1){
|
|
|
$this->error('无权限','','','');
|
|
|
}
|
|
|
/* if(empty($my_user['phone'])){
|
|
|
$this->redirect('information');
|
|
|
}*/
|
|
|
/* if(empty($my_user['phone'])){
|
|
|
$this->redirect('information');
|
|
|
}*/
|
|
|
//判断有没有生成过
|
|
|
// if(!file_exists('./upload/poster/poster_'.$user_id.".png")){
|
|
|
$url = $this->get_url($my_user['id'],$my_user['status']);
|
|
|
$webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png';
|
|
|
$savePath = './upload/'.$webPath;
|
|
|
//生成带参二维码
|
|
|
$url = $this->get_url($my_user['id'],$my_user['status']);
|
|
|
$webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png';
|
|
|
$savePath = './upload/'.$webPath;
|
|
|
//生成带参二维码
|
|
|
if(!file_exists($savePath)){
|
|
|
$prcode_url = $this->code_img($my_user['id'],$my_user['status']);
|
|
|
}
|
|
|
$savePath = './upload/poster';
|
|
|
if(!file_exists($savePath)){
|
|
|
mkdir ($savePath,0777,true);
|
|
|
}
|
|
|
if($my_user['status'] == 3){
|
|
|
//老师
|
|
|
$image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png");
|
|
|
$image->thumb(300,300,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.$my_user['status'].".png");
|
|
|
$image = \think\Image::open(ROOT_PATH."public/bg2.png");
|
|
|
$image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[410,1015],100)
|
|
|
// ->water(ROOT_PATH."public/bg2.png",\think\Image::WATER_CENTER,100)
|
|
|
->save('./upload/poster/poster_'.$user_id.".png");
|
|
|
}else{
|
|
|
//业务员
|
|
|
//保存头像
|
|
|
$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/code_img".$user_id.$my_user['status'].".png");
|
...
|
...
|
@@ -63,21 +73,23 @@ class ShareController extends WeChatBaseController |
|
|
->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);
|
|
|
//分享
|
|
|
$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);
|
|
|
// $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'] = "$user[user_nickname]的海报";
|
|
|
$share['share_desc'] = '快来加入我的团队';
|
|
|
$share['share_image'] = $share_image;
|
|
|
$share['share_url'] = $share_url;
|
|
|
$this->assign('status',$my_user['status']);
|
|
|
$this->assign('share',$share);
|
|
|
return $this->fetch();
|
|
|
}
|
...
|
...
|
|