Browse Source

新的邀请海报

lizhen_gitee 1 year ago
parent
commit
4a42313730

+ 1 - 1
addons/poster/library/Image.php

@@ -40,7 +40,7 @@ class Image
 
         set_time_limit(0);
         @ini_set('memory_limit', '256M');
-        $this->target = imagecreatetruecolor(640, 1008);
+        $this->target = imagecreatetruecolor(690, 1000);
 
         $white = imagecolorallocate($this->target, 255, 255, 255);
         imagefill($this->target, 0, 0, $white);

+ 27 - 11
application/api/controller/Userintro.php

@@ -15,8 +15,8 @@ class Userintro extends Api
 
     //生成我的视频海报
     //生成邀请码二维码图片
-    public function inviteimage($introcode) {
-        $params['text'] = config('h5_url') . '/#/pages/home/index?introcode=' . $introcode;
+    public function inviteimage() {
+        $params['text'] = config('app_download_url') . '/index/appdownload';
         $qrcode_service = \addons\qrcode\library\Service::qrcode($params);
 //        $mimetype = 'image/png';
 //        $response = Response::create()->header("Content-Type", $mimetype);
@@ -39,14 +39,30 @@ class Userintro extends Api
 
     //生成视频分享海报
     public function shareposter() {
-
         $inviteimage = $this->inviteimage($this->auth->introcode);
 
         $data = [
-
             [
-                "left"=> "100px",
-                "top"=> "424px",
+                "left"=> "140px",
+                "top"=> "120px",
+                "type"=> "img",
+                "width"=> "50px",
+                "height"=> "50px",
+                "src"=> localpath_to_netpath($this->auth->avatar)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
+            ],
+            [
+                "left"=> "95px",
+                "top"=> "190px",
+                "type"=> "nickname",
+                "width"=> "166px",
+                "height"=> "38px",
+                "size"=> "11px",
+                "color"=> "#FFFFFF",
+                "content" => '这里真心不错,推荐你来',
+            ],
+            [
+                "left"=> "105px",
+                "top"=> "400px",
                 "type"=> "nickname",
                 "width"=> "166px",
                 "height"=> "38px",
@@ -55,11 +71,11 @@ class Userintro extends Api
                 "content" => '邀请码:'.$this->auth->introcode,
             ],
             [
-                "left"=> "90px",
-                "top"=> "260px",
+                "left"=> "100px",
+                "top"=> "265px",
                 "type"=> "img",
-                "width"=> "140px",
-                "height"=> "140px",
+                "width"=> "130px",
+                "height"=> "130px",
                 "src"=> httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
             ],
 
@@ -81,7 +97,7 @@ class Userintro extends Api
         ];
 
         $image = new \addons\poster\library\Image();
-        $imgurl = $image->createPosterImage_user($poster, $this->auth->getUser());
+        $imgurl = $image->createPosterImage($poster, $this->auth->getUser());
 
         if (!$imgurl) {
             $this->error('生成海报出错');

+ 16 - 0
application/common.php

@@ -836,4 +836,20 @@ function request_post_hub($field_array = [],$required = [],$noempty = []){
     }
 
     return $data;
+}
+if (!function_exists('httpurllocal')) {
+    /**
+     * 判断当前url是否为全路径,并返回全路径
+     */
+    function httpurllocal($path) {
+        if(!$path) return $path;
+        $host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
+        // 获取当前域名
+        if(strpos($path,'http://') === false && strpos($path,'https://') === false) {
+            $url = $host.$path;
+        } else {
+            $url = $path;
+        }
+        return $url;
+    }
 }

+ 3 - 2
application/config.php

@@ -366,8 +366,9 @@ return [
         'secret' => 'sAsx6iK7CsrqJm55xfKlOd4jqDwSHJ9jKKFjoXc59be1GzG3oxKVWSJ03eAIWuWU',
     ],
 
-    'pay_notify_url' => 'https://tken.huxiukeji.cn',
-    'domain_cdnurl' => 'https://mita-1253256600.cos.ap-nanjing.myqcloud.com',
+    'app_download_url' => 'https://tken.huxiukeji.cn',//app下载页域名
+    'pay_notify_url' => 'https://tken.huxiukeji.cn',  //支付异步回调域名
+    'domain_cdnurl' => 'https://mita-1253256600.cos.ap-nanjing.myqcloud.com',//图片地址
 
     //开放平台的,不是小程序的
     'wxMiniProgram' => [

+ 0 - 0
public/assets/img/posterbg.png → public/assets/img/posteruserbg.png