|
@@ -81,7 +81,7 @@ class PosterRepository
|
|
|
}
|
|
|
$title = subtext($title, 34);
|
|
|
if(mb_strlen($title, 'utf8') > 17){
|
|
|
- $title = mb_substr($title, 0, 17, 'utf8')."\n".mb_substr($title, 17, -1, 'utf8').' ...';
|
|
|
+ $title = mb_substr($title, 0, 17, 'utf8')."\n".mb_substr($title, 17, -1, 'utf8');
|
|
|
$height = 380;
|
|
|
}else{
|
|
|
$height = 350;
|
|
@@ -156,12 +156,12 @@ class PosterRepository
|
|
|
$main = ImageManagerStatic::make($mainImg);
|
|
|
|
|
|
// U米数
|
|
|
- $beanWidth = 194;
|
|
|
- if(strlen($bean) == 4) $beanWidth = 182;
|
|
|
- $main->text($bean, $beanWidth, 1060, function ($font) {
|
|
|
+ $beanWidth = 180;
|
|
|
+ if(strlen($bean) == 4) $beanWidth = 168;
|
|
|
+ $main->text($bean, $beanWidth, 1014, function ($font) {
|
|
|
$font->file(public_path('font/PingFang Bold.ttf'));
|
|
|
- $font->size(36);
|
|
|
- $font->color('#C74A48');
|
|
|
+ $font->size(34);
|
|
|
+ $font->color('#0CD4C0');
|
|
|
$font->align('left');
|
|
|
});
|
|
|
|
|
@@ -173,28 +173,30 @@ class PosterRepository
|
|
|
for($i=0;$i<6;$i++){
|
|
|
if($str[$i] != $strLower[$i]) $upperNumber++;
|
|
|
}
|
|
|
- $codeWidth = 212 - $upperNumber * 3;
|
|
|
- $main->text($str, $codeWidth, 912, function ($font) {
|
|
|
- $font->file(public_path('font/PingFang Regular.ttf'));
|
|
|
- $font->size(28);
|
|
|
- $font->color('#3C5852');
|
|
|
+ $codeWidth = 592 - $upperNumber * 3;
|
|
|
+ $main->text($str, $codeWidth, 892, function ($font) {
|
|
|
+ $font->file(public_path('font/PingFang Bold.ttf'));
|
|
|
+ $font->size(32);
|
|
|
+ $font->color('#0CD4C0');
|
|
|
$font->align('left');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 用户名称
|
|
|
if($userInfo['username']){
|
|
|
- $main->text(filter_Emoji($userInfo['username']), 30, 860, function ($font) {
|
|
|
- $font->file(public_path('font/PingFang Regular.ttf'));
|
|
|
- $font->size(28);
|
|
|
- $font->color('#3C5852');
|
|
|
+ $userName = filter_Emoji($userInfo['username']);
|
|
|
+ $userName = subtext($userName, 9);
|
|
|
+ $main->text($userName, 40, 892, function ($font) {
|
|
|
+ $font->file(public_path('font/PingFang Bold.ttf'));
|
|
|
+ $font->size(32);
|
|
|
+ $font->color('#333333');
|
|
|
$font->align('left');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 用户头像
|
|
|
if($userInfo['avatar']){
|
|
|
- $avatar = Image::make($userInfo['avatar'])->resize(88,88);
|
|
|
+ $avatar = Image::make($userInfo['avatar'])->resize(100,100);
|
|
|
$new= Image::canvas(750, 1346);
|
|
|
$r=$avatar->width() /2;
|
|
|
for($x=0;$x<$avatar->width();$x++) {
|
|
@@ -210,14 +212,14 @@ class PosterRepository
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $main->insert($new, 'top-left', 30, 717);
|
|
|
+ $main->insert($new, 'top-left', 40, 744);
|
|
|
}
|
|
|
|
|
|
$qrcode = Image::make(QrCode::format('png')->generate(config('customer.share_invite_h5url')."?invite_code={$userInfo['invite_code']}"));
|
|
|
|
|
|
- $qrcode->resize(170,170);
|
|
|
+ $qrcode->resize(140,140);
|
|
|
|
|
|
- $main->insert($qrcode,'top-left', 547, 944);
|
|
|
+ $main->insert($qrcode,'top-left', 570, 1164);
|
|
|
|
|
|
// 存储图片
|
|
|
$filename = date('Ym').'/'.time() . '_' . uniqid() . '.jpg';
|