|
@@ -57,9 +57,10 @@ class Poster extends Auth{
|
|
|
$url = request('url',0);
|
|
|
$position = request('position',0);
|
|
|
$thumb = request('thumb',0);
|
|
|
+ $size = request('size',0);
|
|
|
if( !$thumb ) return json_send(['code'=>'error','msg'=>'请上传海报图片']);
|
|
|
// 获取分享海报图片
|
|
|
- $result = $this->getShareImage('id='.$id,$thumb,$url,$position);
|
|
|
+ $result = $this->getShareImage('id='.$id,$thumb,$url,$position,$size);
|
|
|
$this->assign('image',$result);
|
|
|
$this->assign('crumbs','海报');
|
|
|
// 加载模板
|
|
@@ -71,13 +72,13 @@ class Poster extends Auth{
|
|
|
* @param int $scene 场景值
|
|
|
*
|
|
|
*/
|
|
|
- private function getShareImage($scene,$thumb,$url,$position){
|
|
|
+ private function getShareImage($scene,$thumb,$url,$position,$size){
|
|
|
// 尝试执行
|
|
|
try {
|
|
|
// 加载图片
|
|
|
$image = Image::make(public_path('uploads/').$thumb);
|
|
|
// 生成小程序二维码
|
|
|
- $qrcode = Mini::getUnlimit($scene,['page'=>$url,'width'=>480,'is_hyaline'=>true]);
|
|
|
+ $qrcode = Mini::getUnlimit($scene,['page'=>$url,'width'=>$size,'is_hyaline'=>true]);
|
|
|
// 错误提示
|
|
|
if( isset($qrcode['error']) ) return $qrcode;
|
|
|
// 加载图片
|