lizhen_gitee 1 gadu atpakaļ
vecāks
revīzija
8b1b4099ee

+ 14 - 47
application/api/controller/Userintro.php

@@ -16,66 +16,33 @@ class Userintro extends Api
     //生成我的视频海报
     //生成邀请码二维码图片
     public function inviteimage() {
-        $params['text'] = config('app_download_url') . '/index/index/appdownload';
+        $params['text'] = config('h5register_url') . $this->auth->introcode;
         $qrcode_service = \addons\qrcode\library\Service::qrcode($params);
-//        $mimetype = 'image/png';
-//        $response = Response::create()->header("Content-Type", $mimetype);
 
-        // 直接显示二维码
-//        header('Content-Type: ' . $qrcode_service->getContentType());
-//        $response->content($qrcode_service->writeString());
-        $qrcodePath = ROOT_PATH . 'public/uploads/qrcode/';
+        $qrcodePath = ROOT_PATH . 'public/uploads/hbplayer/'.date('Ymd');
         if (!is_dir($qrcodePath)) {
             @mkdir($qrcodePath);
         }
         if (is_really_writable($qrcodePath)) {
-            $filename = md5(implode('', $params)) . '.png';
-            $filePath = $qrcodePath . $filename;
+            $filename = $this->auth->introcode . '.png';
+            $filePath = $qrcodePath .'/'. $filename;
             $qrcode_service->writeFile($filePath);
         }
 
-        return '/uploads/qrcode/' . $filename;
+        return '/uploads/hbplayer/'.date('Ymd') .'/'. $filename;
     }
 
     //生成视频分享海报
     public function shareposter() {
-        $inviteimage = $this->inviteimage($this->auth->introcode);
+        $inviteimage = $this->inviteimage();
 
         $data = [
             [
-                "left"=> "140px",
-                "top"=> "120px",
+                "left"=> "190px",
+                "top"=> "320px",
                 "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",
-                "size"=> "11px",
-                "color"=> "#333333",
-                "content" => '邀请码:'.$this->auth->introcode,
-            ],
-            [
-                "left"=> "100px",
-                "top"=> "265px",
-                "type"=> "img",
-                "width"=> "130px",
-                "height"=> "130px",
+                "width"=> "110px",
+                "height"=> "110px",
                 "src"=> httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
             ],
 
@@ -85,8 +52,8 @@ class Userintro extends Api
         $data = json_encode($data, 320);
 
         $poster = [
-            'id' => 1,
-            'title' => '测试',
+            'id' => $this->auth->id,
+            'title' => '珍友',
             'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
             'bg_image' => '/assets/img/posteruserbg.png',
             'data' => $data,
@@ -104,9 +71,9 @@ class Userintro extends Api
         }
         $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
 
-        //echo '<html><body><img src="'.$imgurl.'"></body></html>';
+        echo '<html><body><img src="'.$imgurl.'"></body></html>';
 
-        $this->success('', $imgurl);
+        //$this->success('', $imgurl);
     }
 
 

+ 1 - 1
application/config.php

@@ -352,9 +352,9 @@ return [
 
     'avatar_boy'  => '/assets/img/avatar_boy.png', //默认男头像
     'avatar_girl' => '/assets/img/avatar_girl.png',//默认女头像
-    'app_download_url' => 'https://anxinlao.huxiukeji.cn',//app下载页域名
     'pay_notify_url' => 'https://anxinlao.huxiukeji.cn',  //支付异步回调域名
     'domain_cdnurl' => 'https://anxinliao-1324465692.cos.ap-chongqing.myqcloud.com',//图片地址
+    'h5register_url' => 'https://kgeweb.huxiukeji.cn/?invite_no=',
 
     //开放平台的,不是小程序的
     'wxMiniProgram' => [

BIN
public/assets/img/posteruserbg.png