lizhen_gitee пре 1 година
родитељ
комит
da91538b9f
3 измењених фајлова са 68 додато и 189 уклоњено
  1. 0 122
      application/api/controller/User.php
  2. 66 65
      application/api/controller/Userintro.php
  3. 2 2
      application/extra/site.php

+ 0 - 122
application/api/controller/User.php

@@ -855,129 +855,7 @@ class User extends Api
         $this->success('获取成功', $openidInfo);
     }
 
-    //生成海报
-    public function createposter() {
-//        $image = input('image', '', 'trim');
-//        if (!$image) {
-//            $this->error('您的网络开小差啦~');
-//        }
-        $image = config('site.intro_imges');
-        $haibao = $this->haibao($this->auth->id,['invite_no'=>$this->auth->invite_no, 'background' => $image]);
-        return $haibao;
-//        $this->success('success', $haibao);
-    }
-
-    //海报
-    public function haibao($player_id,$data){
-
-        //下载页二维码,没必要保留
-        $httpStr = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
-        $params = [
-            'text' => $httpStr.'/index/index/download?code=' . $data['invite_no'],
-            'size' => 90,
-            'logo' => false,
-            'label' => false,
-            'padding' => 0,
-        ];
-        $qrCode = \addons\qrcode\library\Service::qrcode($params);
-        $qrcode_path = 'uploads/hbplayer/'.date('Ymd');
-        mk_dir($qrcode_path);
-        $download_qrcode = $qrcode_path.'/download'.$player_id.'.png';
-        $qrCode->writeFile($download_qrcode);
-
-        //海报
-        $result['url'] = $this->createhaibao($download_qrcode,$player_id,$data);
-
-        $this->success('获取成功',$result);
-    }
-
-    public function createhaibao($download_qrcode,$player_id,$sub_data){
-        //二维码
-        $httpStr = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
-        $download_qrcode= $httpStr.'/'.$download_qrcode;
 
-        $data = [
-            /*[
-                "left" => "15px",
-                "top" => "400px",
-                "type" => "img",
-                "width" => "58px",
-                "height" => "58px",
-                "src" => one_domain_image($this->auth->avatar),
-            ],
-            [
-                "left" => "81px",
-                "top" => "400px",
-                "type" => "nickname",
-                "width" => "80px",
-                "height" => "24px",
-                "size" => "12px",
-                "color" => "#000",
-                "content" => $this->auth->nickname
-            ],
-            [
-                "left" => "81px",
-                "top" => "400px",
-                "type" => "nickname",
-                "width" => "80px",
-                "height" => "24px",
-                "size" => "12px",
-                "color" => "#000",
-                "content" => $this->auth->invite_no
-            ],*/
-            [
-                "left" => "18px",
-                "top" => "410px",
-                "type" => "text",
-                "width" => "80px",
-                "height" => "24px",
-                "size" => "16px",
-                "color" => "#123354",
-                "content" => 'GG语音'
-            ],
-            [
-                "left" => "18px",
-                "top" => "445px",
-                "type" => "text",
-                "width" => "80px",
-                "height" => "24px",
-                "size" => "10px",
-                "color" => "#123354",
-                "content" => '更多现金奖励等你来拿'
-            ],
-            [
-                "left" => "210px",
-                "top" => "385px",
-                "type" => "img",
-                "width" => "95px",
-                "height" => "95px",
-                "src" => $download_qrcode//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
-            ]
-        ];
-
-        $data = json_encode($data, 320);
-
-        $poster = [
-            'id' => $player_id,
-            'title' => 'GG语音',
-            'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
-            'bg_image' => $sub_data['background'] ? cdnurl($sub_data['background']) : '/assets/img/inviteposter.png',
-            'data' => $data,
-            'status' => 'normal',
-            'weigh' => 0,
-            'createtime' => 1653993709,
-            'updatetime' => 1653994259,
-        ];
-
-        $image = new \addons\poster\library\Image();
-        $imgurl = $image->createPosterImage($poster, $this->auth->getUser());
-
-        if (!$imgurl) {
-            $this->error('生成海报出错');
-        }
-//        $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
-        return $httpStr.'/' . $imgurl;
-    }
 
     //申请真人认证
     public function realauth()

+ 66 - 65
application/api/controller/Userintro.php

@@ -13,82 +13,86 @@ class Userintro extends Api
     protected $noNeedRight = ['*'];
 
 
-    //生成我的视频海报
-    //生成邀请码二维码图片
-    public function inviteimage() {
-        $params['text'] = config('app_download_url') . '/index/index/appdownload';
-        $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/';
-        if (!is_dir($qrcodePath)) {
-            @mkdir($qrcodePath);
-        }
-        if (is_really_writable($qrcodePath)) {
-            $filename = md5(implode('', $params)) . '.png';
-            $filePath = $qrcodePath . $filename;
-            $qrcode_service->writeFile($filePath);
-        }
+    //生成海报
+    public function createposter() {
+//        $image = input('image', '', 'trim');
+//        if (!$image) {
+//            $this->error('您的网络开小差啦~');
+//        }
+        $image = config('site.intro_imges');
+        $haibao = $this->haibao($this->auth->id,['invite_no'=>$this->auth->invite_no, 'background' => $image]);
+        return $haibao;
+//        $this->success('success', $haibao);
+    }
 
-        return '/uploads/qrcode/' . $filename;
+    //海报
+    public function haibao($player_id,$data){
+
+        //下载页二维码,没必要保留
+        $httpStr = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
+        $params = [
+            'text' => $httpStr.'/index/index/appdownload?code=' . $data['invite_no'],
+            'size' => 90,
+            'logo' => false,
+            'label' => false,
+            'padding' => 0,
+        ];
+        $qrCode = \addons\qrcode\library\Service::qrcode($params);
+        $qrcode_path = 'uploads/hbplayer/'.date('Ymd');
+        mk_dir($qrcode_path);
+        $download_qrcode = $qrcode_path.'/download'.$player_id.'.png';
+        $qrCode->writeFile($download_qrcode);
+
+        //海报
+        $result['url'] = $this->createhaibao($download_qrcode,$player_id,$data);
+
+        $this->success('获取成功',$result);
     }
 
-    //生成视频分享海报
-    public function shareposter() {
-        $inviteimage = $this->inviteimage($this->auth->introcode);
+    public function createhaibao($download_qrcode,$player_id,$sub_data){
+        //二维码
+        $httpStr = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
+        $download_qrcode= $httpStr.'/'.$download_qrcode;
 
         $data = [
+
             [
-                "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" => "18px",
+                "top" => "410px",
+                "type" => "text",
+                "width" => "80px",
+                "height" => "24px",
+                "size" => "16px",
+                "color" => "#123354",
+                "content" => 'K歌社交'
             ],
             [
-                "left"=> "105px",
-                "top"=> "400px",
-                "type"=> "nickname",
-                "width"=> "166px",
-                "height"=> "38px",
-                "size"=> "11px",
-                "color"=> "#333333",
-                "content" => '邀请码:'.$this->auth->introcode,
+                "left" => "18px",
+                "top" => "445px",
+                "type" => "text",
+                "width" => "80px",
+                "height" => "24px",
+                "size" => "10px",
+                "color" => "#123354",
+                "content" => '更多金币奖励等你来拿'
             ],
             [
-                "left"=> "100px",
-                "top"=> "265px",
-                "type"=> "img",
-                "width"=> "130px",
-                "height"=> "130px",
-                "src"=> httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
-            ],
-
+                "left" => "210px",
+                "top" => "385px",
+                "type" => "img",
+                "width" => "95px",
+                "height" => "95px",
+                "src" => $download_qrcode//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
+            ]
         ];
 
-
         $data = json_encode($data, 320);
 
         $poster = [
-            'id' => 1,
-            'title' => '测试',
+            'id' => $player_id,
+            'title' => 'K歌',
             'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
-            'bg_image' => '/assets/img/posteruserbg.png',
+            'bg_image' => $sub_data['background'] ? cdnurl($sub_data['background']) : '/assets/img/inviteposter.png',
             'data' => $data,
             'status' => 'normal',
             'weigh' => 0,
@@ -102,11 +106,8 @@ class Userintro extends Api
         if (!$imgurl) {
             $this->error('生成海报出错');
         }
-        $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
-
-        //echo '<html><body><img src="'.$imgurl.'"></body></html>';
-
-        $this->success('', $imgurl);
+//        $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
+        return $httpStr.'/' . $imgurl;
     }
 
 

+ 2 - 2
application/extra/site.php

@@ -91,10 +91,10 @@ return [
         .'2、每个提现额度,每日可提现3次 '."\r\n"
         .'3、提现扣除手续费1‰ '."\r\n"
         .'4、相关额度会在1个工作日内审核发放,请注意查收',
-    'yaoqing_huodongjieshao' => '好友充值:'."\r\n"
+    'introsite_activeinfo' => '好友充值:'."\r\n"
         .'好友充值后获得充值额对应的10%金币奖励'."\r\n"
         .'好友收益:'."\r\n"
         .'好友产生收益后获得其收益额对应的10%金 币奖励',
-    'yaoqing_yaoqingguize' => '1、所有用户都可以参加邀请好友活动'."\r\n"
+    'introsite_introrule' => '1、所有用户都可以参加邀请好友活动'."\r\n"
         .'2、通过自己分享的活动页面地址下载注册成功,即发放注册奖励,若好友充值即奖励充值 金额的10%。',
 ];