Browse Source

海报调整

lizhen_gitee 1 year ago
parent
commit
82b339c989

+ 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, 750);
+        $this->target = imagecreatetruecolor(640, 906);
 
         $white = imagecolorallocate($this->target, 255, 255, 255);
         imagefill($this->target, 0, 0, $white);

+ 44 - 0
application/admin/model/Poster.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class Poster extends Model
+{
+    // 表名
+    protected $name = 'poster';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text'
+    ];
+
+    public function getStatusList()
+    {
+        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
+    }
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+    
+    public function getDirs($poster_id = '')
+    {
+        if ($poster_id) {
+            $poster_id .= '/';
+        }
+        return 'uploads/poster/' . $poster_id;
+    }
+}

+ 29 - 0
application/admin/model/PosterLog.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class PosterLog extends Model
+{
+    // 表名
+    protected $name = 'poster_log';
+
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+    public function user()
+    {
+        return $this->belongsTo('user', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 18 - 9
application/api/controller/company/Package.php

@@ -6,7 +6,6 @@ use app\common\controller\Apic;
 use think\Db;
 use think\Exception;
 use GuzzleHttp\Client;
-
 /**
  * 套餐管理
  */
@@ -303,10 +302,20 @@ class Package extends Apic
 
         $inviteimage = $this->getMiniCode($id,$info,$this->auth->company_id);
 
+
+        $package_image = explode(',',$info['images'])[0];
         $data = [
             [
+                "left"=> "0px",
+                "top"=> "0px",
+                "type"=> "img",
+                "width"=> "320px",
+                "height"=> "290px",
+                "src"=> one_domain_image($package_image)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
+            ],
+            [
                 "left"=> "10px",
-                "top"=> "250px",
+                "top"=> "370px",
                 "type"=> "img",
                 "width"=> "45px",
                 "height"=> "45px",
@@ -314,7 +323,7 @@ class Package extends Apic
             ],
             [
                 "left"=> "10px",
-                "top"=> "205px",
+                "top"=> "330px",
                 "type"=> "nickname",
                 "width"=> "166px",
                 "height"=> "38px",
@@ -324,25 +333,25 @@ class Package extends Apic
             ],
             [
                 "left"=> "60px",
-                "top"=> "270px",
+                "top"=> "385px",
                 "type"=> "nickname",
                 "width"=> "166px",
                 "height"=> "38px",
                 "size"=> "10px",
                 "color"=> "#666666",
-                "content" => (iconv_strlen($this->auth->company->name, 'utf-8') <= 8 ? $this->auth->nickname : mb_substr($this->auth->nickname, 0, 8))
+                "content" => (iconv_strlen($this->auth->company->name, 'utf-8') <= 8 ? $this->auth->company->name : mb_substr($this->auth->company->name, 0, 8))
             ],
             [
-                "left"=> "200px",
-                "top"=> "190px",
+                "left"=> "195px",
+                "top"=> "300px",
                 "type"=> "img",
                 "width"=> "110px",
                 "height"=> "110px",
                 "src"=> httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
             ],
             [
-                "left"=> "205px",
-                "top"=> "300px",
+                "left"=> "200px",
+                "top"=> "420px",
                 "type"=> "nickname",
                 "width"=> "166px",
                 "height"=> "38px",

BIN
public/assets/img/posterbg.png