|
|
@ -48,9 +48,9 @@ class InviteUser extends BaseQRcode |
|
|
|
public function getImage(): string |
|
|
|
public function getImage(): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 判断海报图文件存在则直接返回url |
|
|
|
// 判断海报图文件存在则直接返回url |
|
|
|
if (file_exists($this->getPosterPath())) { |
|
|
|
// if (file_exists($this->getPosterPath())) { |
|
|
|
return $this->getPosterUrl(); |
|
|
|
// return $this->getPosterUrl(); |
|
|
|
} |
|
|
|
// } |
|
|
|
// 商城ID |
|
|
|
// 商城ID |
|
|
|
$storeId = $this->userInfo['store_id']; |
|
|
|
$storeId = $this->userInfo['store_id']; |
|
|
|
$backdrop = __DIR__ . '/resource/invite_user.png'; |
|
|
|
$backdrop = __DIR__ . '/resource/invite_user.png'; |
|
|
@ -63,8 +63,12 @@ class InviteUser extends BaseQRcode |
|
|
|
// 下载小程序码 |
|
|
|
// 下载小程序码 |
|
|
|
$page = 'pages/login/index'; |
|
|
|
$page = 'pages/login/index'; |
|
|
|
$qrcode = $this->getQrcode($storeId, $scene, $page, $this->channel); |
|
|
|
$qrcode = $this->getQrcode($storeId, $scene, $page, $this->channel); |
|
|
|
|
|
|
|
//获取图片名称 |
|
|
|
|
|
|
|
$arr = explode('/', $qrcode); |
|
|
|
|
|
|
|
$name = end($arr); |
|
|
|
|
|
|
|
return base_url() . 'temp/' . $this->userInfo['store_id'] . '/' . $name . '?t=' . time(); |
|
|
|
// 拼接海报图 |
|
|
|
// 拼接海报图 |
|
|
|
return $this->savePoster($backdrop, $qrcode); |
|
|
|
//return $this->savePoster($backdrop, $qrcode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -83,9 +87,9 @@ class InviteUser extends BaseQRcode |
|
|
|
// 打开小程序码 |
|
|
|
// 打开小程序码 |
|
|
|
$editor->open($qrcodeImage, $qrcode); |
|
|
|
$editor->open($qrcodeImage, $qrcode); |
|
|
|
// 重设小程序码宽高 |
|
|
|
// 重设小程序码宽高 |
|
|
|
$editor->resizeExact($qrcodeImage, 140, 140); |
|
|
|
$editor->resizeExact($qrcodeImage, 110, 110); |
|
|
|
// 小程序码添加到背景图 |
|
|
|
// 小程序码添加到背景图 |
|
|
|
$editor->blend($backdropImage, $qrcodeImage, 'normal', 1.0, 'top-left', 520, 700); |
|
|
|
$editor->blend($backdropImage, $qrcodeImage, 'normal', 1.0, 'top-left', 175, 555); |
|
|
|
// 保存图片 |
|
|
|
// 保存图片 |
|
|
|
$editor->save($backdropImage, $this->getPosterPath()); |
|
|
|
$editor->save($backdropImage, $this->getPosterPath()); |
|
|
|
return $this->getPosterUrl(); |
|
|
|
return $this->getPosterUrl(); |
|
|
|