WIN-2308041133\Administrator 1 tydzień temu
rodzic
commit
8dd86826f3
1 zmienionych plików z 42 dodań i 48 usunięć
  1. 42 48
      app/api/controller/user/UserBillController.php

+ 42 - 48
app/api/controller/user/UserBillController.php

@@ -201,50 +201,47 @@ class UserBillController
                 if (!file_exists($filelink['Normal'])) return app('json')->fail('缺少字体文件Normal');
                 foreach ($routineSpreadBanner as $key => &$item) {
                     $posterInfo = '海报生成失败:(';
-                    // 修改配置:类似第一张图的样式,无头像
                     $config = array(
                         'image' => array(
                             array(
                                 'url' => $urlCode,     //二维码资源
                                 'stream' => 0,
-                                'left' => 114,         // 二维码位置左
-                                'top' => 790,          // 二维码位置上
+                                'left' => 150,         // 调整为居中
+                                'top' => 320,          // 调整位置
                                 'right' => 0,
                                 'bottom' => 0,
-                                'width' => 120,        // 二维码宽度
-                                'height' => 120,       // 二维码高度
+                                'width' => 120,
+                                'height' => 120,
                                 'opacity' => 100
                             )
                         ),
                         'text' => array(
-                            // 第一行文本:邀请好友
+                            // 添加顶部标题
                             array(
-                                'text' => '邀请好友',    // 固定文本
-                                'left' => 250,          // 文本位置左
-                                'top' => 770,           // 文本位置上
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 20,       // 字号稍大
-                                'fontColor' => '40,40,40',       //字体颜
+                                'text' => '邀请好友',
+                                'left' => 150,         // 居中
+                                'top' => 40,           // 顶部位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],
+                                'fontSize' => 30,      // 大字体
+                                'fontColor' => '139,69,19',  // 棕
                                 'angle' => 0,
                             ),
-                            // 第二行文本:品牌/产品名称
                             array(
-                                'text' => 'PIZZA',      // 固定文本,可替换为 sys_config('site_name')
-                                'left' => 250,
-                                'top' => 810,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 24,       // 最大字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'text' => $user['nickname'],
+                                'left' => 150,         // 调整为居中
+                                'top' => 240,          // 调整位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],
+                                'fontSize' => 18,      // 稍大字体
+                                'fontColor' => '64,64,64',
                                 'angle' => 0,
                             ),
-                            // 第三行文本:邀请您加入XX
                             array(
                                 'text' => '邀请您加入' . sys_config('site_name'),
-                                'left' => 250,
-                                'top' => 880,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'left' => 150,         // 调整为居中
+                                'top' => 270,          // 调整位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],
+                                'fontSize' => 16,
+                                'fontColor' => '64,64,64',
                                 'angle' => 0,
                             )
                         ),
@@ -300,14 +297,13 @@ class UserBillController
                 if (!file_exists($filelink['Normal'])) return app('json')->fail('缺少字体文件Normal');
                 foreach ($routineSpreadBanner as $key => &$item) {
                     $posterInfo = '海报生成失败:(';
-                    // 修改配置:类似第一张图的样式,无头像
                     $config = array(
                         'image' => array(
                             array(
                                 'url' => $urlCode,     //二维码资源
                                 'stream' => 0,
-                                'left' => 114,
-                                'top' => 790,
+                                'left' => 150,         // 调整为居中
+                                'top' => 320,          // 调整位置
                                 'right' => 0,
                                 'bottom' => 0,
                                 'width' => 120,
@@ -316,34 +312,32 @@ class UserBillController
                             )
                         ),
                         'text' => array(
-                            // 第一行文本:邀请好友
+                            // 添加顶部标题
                             array(
-                                'text' => '邀请好友',    // 固定文本
-                                'left' => 250,
-                                'top' => 770,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 20,       // 字号稍大
-                                'fontColor' => '40,40,40',       //字体颜
+                                'text' => '邀请好友',
+                                'left' => 150,         // 居中
+                                'top' => 40,           // 顶部位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],
+                                'fontSize' => 30,      // 大字体
+                                'fontColor' => '139,69,19',  // 棕
                                 'angle' => 0,
                             ),
-                            // 第二行文本:品牌/产品名称
                             array(
-                                'text' => 'PIZZA',      // 固定文本,可替换为 sys_config('site_name')
-                                'left' => 250,
-                                'top' => 810,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 24,       // 最大字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'text' => $user['nickname'],
+                                'left' => 150,         // 调整为居中
+                                'top' => 240,          // 调整位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],
+                                'fontSize' => 18,      // 稍大字体
+                                'fontColor' => '64,64,64',
                                 'angle' => 0,
                             ),
-                            // 第三行文本:邀请您加入XX
                             array(
                                 'text' => '邀请您加入' . sys_config('site_name'),
-                                'left' => 250,
-                                'top' => 880,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'left' => 150,         // 调整为居中
+                                'top' => 270,          // 调整位置
+                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],
+                                'fontSize' => 16,
+                                'fontColor' => '64,64,64',
                                 'angle' => 0,
                             )
                         ),