Explorar o código

Merge branch 'master' into release

xielin %!s(int64=5) %!d(string=hai) anos
pai
achega
fb489f357d

+ 1 - 1
app/Helper/helper.php

@@ -139,7 +139,7 @@ function http($url, $param, $method = 'post')
 function subtext($text, $length)
 {
     if(mb_strlen($text, 'utf8') > $length) {
-        return mb_substr($text, 0, $length - 1, 'utf8');
+        return mb_substr($text, 0, $length - 1, 'utf8').'...';
     } else {
         return $text;
     }

+ 1 - 0
app/Http/Controllers/V2/ComplaintSuggestionsController.php

@@ -24,6 +24,7 @@ class ComplaintSuggestionsController extends BaseController
     {
         $validator = Validator::make($request->all(), [
             'content' => 'required|string',
+            'mobile' => 'nullable|mobile'
         ]);
         if ($validator->fails()) {
             return jsonError($validator->errors()->first());

+ 22 - 20
app/Repositories/PosterRepository.php

@@ -81,7 +81,7 @@ class PosterRepository
         }
         $title = subtext($title, 34);
         if(mb_strlen($title, 'utf8') > 17){
-            $title = mb_substr($title, 0, 17, 'utf8')."\n".mb_substr($title, 17, -1, 'utf8').' ...';
+            $title = mb_substr($title, 0, 17, 'utf8')."\n".mb_substr($title, 17, -1, 'utf8');
             $height = 380;
         }else{
             $height = 350;
@@ -156,12 +156,12 @@ class PosterRepository
         $main = ImageManagerStatic::make($mainImg);
 
         // U米数
-        $beanWidth = 194;
-        if(strlen($bean) == 4) $beanWidth = 182;
-        $main->text($bean, $beanWidth, 1060, function ($font) {
+        $beanWidth = 180;
+        if(strlen($bean) == 4) $beanWidth = 168;
+        $main->text($bean, $beanWidth, 1014, function ($font) {
             $font->file(public_path('font/PingFang Bold.ttf'));
-            $font->size(36);
-            $font->color('#C74A48');
+            $font->size(34);
+            $font->color('#0CD4C0');
             $font->align('left');
         });
 
@@ -173,28 +173,30 @@ class PosterRepository
             for($i=0;$i<6;$i++){
                 if($str[$i] != $strLower[$i]) $upperNumber++;
             }
-            $codeWidth = 212 - $upperNumber * 3;
-            $main->text($str, $codeWidth, 912, function ($font) {
-                $font->file(public_path('font/PingFang Regular.ttf'));
-                $font->size(28);
-                $font->color('#3C5852');
+            $codeWidth = 592 - $upperNumber * 3;
+            $main->text($str, $codeWidth, 892, function ($font) {
+                $font->file(public_path('font/PingFang Bold.ttf'));
+                $font->size(32);
+                $font->color('#0CD4C0');
                 $font->align('left');
             });
         }
 
         // 用户名称
         if($userInfo['username']){
-            $main->text(filter_Emoji($userInfo['username']), 30, 860, function ($font) {
-                $font->file(public_path('font/PingFang Regular.ttf'));
-                $font->size(28);
-                $font->color('#3C5852');
+            $userName = filter_Emoji($userInfo['username']);
+            $userName = subtext($userName, 9);
+            $main->text($userName, 40, 892, function ($font) {
+                $font->file(public_path('font/PingFang Bold.ttf'));
+                $font->size(32);
+                $font->color('#333333');
                 $font->align('left');
             });
         }
 
         // 用户头像
         if($userInfo['avatar']){
-            $avatar = Image::make($userInfo['avatar'])->resize(88,88);
+            $avatar = Image::make($userInfo['avatar'])->resize(100,100);
             $new= Image::canvas(750, 1346);
             $r=$avatar->width() /2;
             for($x=0;$x<$avatar->width();$x++) {
@@ -210,21 +212,21 @@ class PosterRepository
                 }
             }
 
-            $main->insert($new, 'top-left', 30, 717);
+            $main->insert($new, 'top-left', 40, 744);
         }
 
         $qrcode = Image::make(QrCode::format('png')->generate(config('customer.share_invite_h5url')."?invite_code={$userInfo['invite_code']}"));
 
-        $qrcode->resize(170,170);
+        $qrcode->resize(140,140);
 
-        $main->insert($qrcode,'top-left', 547, 944);
+        $main->insert($qrcode,'top-left', 570, 1164);
 
         // 存储图片
         $filename = date('Ym').'/'.time() . '_' . uniqid() . '.jpg';
         Storage::put($filename, (string)$main->encode('jpg'));
         $url = 'http://oss.caihongxingqiu.net/'.$filename;
         Redis::set($key, $url);
-        Redis::expire($key, 3600 * 24 * 3);
+//        Redis::expire($key, 3600 * 24 * 3);
 
         return jsonSuccess($url);
     }

BIN=BIN
public/image/invite/main.png


+ 9 - 7
routes/api.php

@@ -16,7 +16,8 @@ $api = app('Dingo\Api\Routing\Router');
 $api->version('v1', [
     'namespace' => 'App\Http\Controllers',
 ], function ($api) {
-
+//升级接口
+    $api->get('upgrade', 'UpgradeController@index');
     //登录
     $api->group(['middleware' => 'chxq_jwt_auth'], function ($api) {
         $api->post('upload', 'UploadController@uploadImage');
@@ -49,8 +50,7 @@ $api->version('v1', [
 
         //储存方式列表
         $api->get('/storeType/index', 'StoreTypeController@index');
-        //升级接口
-        $api->get('upgrade', 'UpgradeController@index');
+
     });
 
     //获取某自提点
@@ -66,10 +66,8 @@ $api->version('v1', [
     ], function ($api) {
         //根据多个ID获取banner
         $api->get('/bannerSet/lists', 'BannerController@lists');
-        $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
-            //活动内容详情
-            $api->get('activities', 'ActivitiesController@view');
-        });
+        //活动内容详情
+        $api->get('activities', 'ActivitiesController@view');
 
         //后院新闻列表
         $api->get('/starNews/lists', 'StarNewsController@index');
@@ -78,5 +76,9 @@ $api->version('v1', [
 
         //用户上传投诉建议
         $api->post('complaintSuggestions/add', 'ComplaintSuggestionsController@add');
+
+        $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
+
+        });
     });
 });

+ 1 - 1
routes/web.php

@@ -12,7 +12,7 @@
 */
 
 $router->get('/', function () use ($router) {
-    return $router->app->version();
+    return '欢迎来到由你';
 });