Browse Source

Merge branch 'content'

zz 6 years ago
parent
commit
199a54170f

+ 2 - 0
app/Console/Commands/BookAfterSpider.php

@@ -2,6 +2,7 @@
 
 namespace App\Console\Commands;
 
+use App\Modules\Book\Services\ChapterService;
 use Illuminate\Console\Command;
 use App\Modules\Product\Services\ProductService;
 use App\Modules\Book\Models\BookConfig;
@@ -64,6 +65,7 @@ class BookAfterSpider extends Command
         $this->addbookConfig($bid);
         $this->bookChapterInfo($bid);
         $this->adjustSequentOne($bid);
+        ChapterService::splitContentAll($bid);
     }
 
     private function addproducts()

+ 100 - 63
app/Console/Commands/BookUpdate.php

@@ -8,6 +8,7 @@ use App\Modules\Book\Models\Book;
 use App\Modules\Book\Models\Chapter;
 use Log;
 use App\Modules\Book\Services\BookConfigService;
+
 class BookUpdate extends Command
 {
     /**
@@ -24,6 +25,8 @@ class BookUpdate extends Command
      */
     protected $description = '更新所有图书章节内容';
 
+    private $client;
+
     /**
      * Create a new command instance.
      *
@@ -32,7 +35,7 @@ class BookUpdate extends Command
     public function __construct()
     {
         parent::__construct();
-        $this->client = new Client(['timeout'  => 10.0,'allow_redirects'=>true]);
+        $this->client = new Client(['timeout' => 10.0, 'allow_redirects' => true]);
     }
 
     /**
@@ -48,12 +51,13 @@ class BookUpdate extends Command
     /**
      * 更新所有书的章节
      */
-    public function updateAll(){
+    public function updateAll()
+    {
         set_time_limit(0);
-        $exist_book = Book::where('ly_bid','!=','0')->where('status',0)->select('id','ly_bid')->get();
-        foreach ($exist_book as $v){
+        $exist_book = Book::where('ly_bid', '!=', '0')->where('status', 0)->select('id', 'ly_bid')->get();
+        foreach ($exist_book as $v) {
             //Log::info('updateAll bid is: '.$v->id.'$ly_bid is :'.$v->ly_bid.'----------------------------');
-            $this->updateOne($v->id,$v->ly_bid);
+            $this->updateOne($v->id, $v->ly_bid);
         }
     }
 
@@ -62,14 +66,27 @@ class BookUpdate extends Command
      * @param $bid
      * @return int|string
      */
-    public function updateOne($bid,$ly_bid)
+    public function updateOne($bid, $ly_bid)
     {
         set_time_limit(0);
-        $max_sequence = Chapter::where('bid', $bid)->max('sequence');
-        $max_sequence = $max_sequence ? $max_sequence : -1;
-        $max_sequence_chapter = Chapter::where('bid', $bid)->where('sequence', $max_sequence)->select('id')->first();
-        $max_sequence_chapter_id = isset($max_sequence_chapter->id) ? $max_sequence_chapter->id : 0;
-        $this->bookStatus($bid,$ly_bid);
+        //$max_sequence = Chapter::where('bid', $bid)->max('sequence');
+        //$max_sequence = $max_sequence ? $max_sequence : -1;
+        //$max_sequence_chapter = Chapter::where('bid', $bid)->where('sequence', $max_sequence)->select('id')->first();
+        //$max_sequence_chapter_id = isset($max_sequence_chapter->id) ? $max_sequence_chapter->id : 0;
+        $this->bookStatus($bid, $ly_bid);
+
+        $last_chapter = Chapter::where('bid', $bid)
+            ->select('id', 'name', 'sequence', 'prev_cid', 'next_cid')
+            ->orderBy('sequence', 'desc')
+            ->first();
+        $last_chapter_from_third = Chapter::where('bid', $bid)
+            ->where('ly_chapter_id', '>', 0)
+            ->select('id', 'name', 'sequence', 'prev_cid', 'next_cid', 'ly_chapter_id')
+            ->orderBy('sequence', 'desc')
+            ->first();
+        $max_sequence_chapter_id = isset($last_chapter->id) ? $last_chapter->id : 0;
+        $max_sequence = isset($last_chapter->sequence) ? $last_chapter->sequence : 0;
+
         try {
             $chapter_list_fromat = "http://www.leyuee.com/services/zwfx.aspx?method=chapterlist&bid=%s&token=sefaf23h7face";
             $res = $this->client->get(sprintf($chapter_list_fromat, $ly_bid));
@@ -80,20 +97,21 @@ class BookUpdate extends Command
         }
         if (!$res) return '';
         $res = json_decode($res, true);
-        if($res && isset($res['code']) && $res['code'] == 200){
+        if ($res && isset($res['code']) && $res['code'] == 200) {
 
-        }else{
+        } else {
             return '';
         }
         $j = 0;
 
-        $local_count = Chapter::where('bid', $bid)->count();
-        $remote_count = 0;
-        if(isset($res['data']) && $res['data'] && is_array($res['data'])){
-
-        }else{
+        if (isset($res['data']) && $res['data'] && is_array($res['data'])) {
+        } else {
             return '';
         }
+
+        $local_count = Chapter::where('bid', $bid)->where('ly_chapter_id', '>', 0)->count();
+        $remote_count = 0;
+
         foreach ($res['data'] as $item1) {
             $remote_count += count($item1['chapters']);
             $item1 = null;
@@ -101,71 +119,90 @@ class BookUpdate extends Command
         Log::info('$remote_count is: ' . $remote_count . '====$local_count :' . $local_count . '----');
         if ($remote_count == $local_count) return '';
         Log::info('$bid =: ' . $bid . '---is lack---');
+        $start = false;
+        if (!$last_chapter) {
+            $start = true;
+        }
+        $ly_last_chapter_id = 0;
+        if ($last_chapter_from_third && isset($last_chapter_from_third->ly_chapter_id)) {
+            $ly_last_chapter_id = $last_chapter_from_third->ly_chapter_id;
+        }
+
         foreach ($res['data'] as $v1) {
             foreach ($v1['chapters'] as $v) {
 
-            if ($v['chapter_order_number'] <= $max_sequence-1) {
-                continue;
-            }
+                /*if ($v['chapter_order_number'] <= $max_sequence-1) {
+                    continue;
+                }
 
-            if (Chapter::where('bid', $bid)->where('ly_chapter_id', $v['chapter_id'])->count()) {
-                continue;
-            }
+                if (Chapter::where('bid', $bid)->where('ly_chapter_id', $v['chapter_id'])->count()) {
+                    continue;
+                }*/
+                if (!$start) {
+                    if ($v['chapter_id'] != $ly_last_chapter_id) {
+                        continue;
+                    } else {
+                        \Log::info($v1);
+                        $start = true;
+                        continue;
+                    }
+                }
 
-            Log::info('bid: ' . $bid . '----ly_chapter_id: ' . $v['chapter_id']);
-            $chapter_fromat = "http://www.leyuee.com/services/zwfx.aspx?method=chapter&bid=%s&cid=%s&token=sefaf23h7face";
-            $cahpter_content_res = $this->client->get(sprintf($chapter_fromat, $ly_bid, $v['chapter_id']));
-            $cahpter_content = $cahpter_content_res->getBody()->getContents();
-
-            $temp = [
-                'bid' => $bid,
-                'name' => $v['chapter_name'],
-                'sequence' => $v['chapter_order_number']+1,
-                'is_vip' => $v['chapter_need_pay'],
-                'prev_cid' => $max_sequence_chapter_id,
-                'next_cid' => '',
-                'recent_update_at' => date('Y-m-d H:i:s', $v['chapter_last_update_time']),
-                'ly_chapter_id' => $v['chapter_id']
-            ];
-            if ($cahpter_content) {
-                $cahpter_content = json_decode($cahpter_content, true);
-                $temp['size'] = ceil(strlen($cahpter_content['data']['chapter_content']) / 3);
-                $temp['content'] = $cahpter_content['data']['chapter_content'];
+                Log::info('bid: ' . $bid . '----ly_chapter_id: ' . $v['chapter_id']);
+                $chapter_fromat = "http://www.leyuee.com/services/zwfx.aspx?method=chapter&bid=%s&cid=%s&token=sefaf23h7face";
+                $cahpter_content_res = $this->client->get(sprintf($chapter_fromat, $ly_bid, $v['chapter_id']));
+                $cahpter_content = $cahpter_content_res->getBody()->getContents();
+
+                $temp = [
+                    'bid' => $bid,
+                    'name' => $v['chapter_name'],
+                    'sequence' => ++$max_sequence,
+                    'is_vip' => $v['chapter_need_pay'],
+                    'prev_cid' => $max_sequence_chapter_id,
+                    'next_cid' => '',
+                    'recent_update_at' => date('Y-m-d H:i:s', $v['chapter_last_update_time']),
+                    'ly_chapter_id' => $v['chapter_id']
+                ];
+                if ($cahpter_content) {
+                    $cahpter_content = json_decode($cahpter_content, true);
+                    $temp['size'] = ceil(strlen($cahpter_content['data']['chapter_content']) / 3);
+                    $temp['content'] = $cahpter_content['data']['chapter_content'];
+                }
+                $insert_res = Chapter::create($temp);
+                Chapter::where('id', $max_sequence_chapter_id)->update(['next_cid' => $insert_res->id]);
+                $max_sequence_chapter_id = $insert_res->id;
+                $temp = null;
+                $j++;
             }
-            $insert_res = Chapter::create($temp);
-            Chapter::where('id', $max_sequence_chapter_id)->update(['next_cid' => $insert_res->id]);
-            $max_sequence_chapter_id = $insert_res->id;
-            $temp = null;
-            $j++;
         }
-    }
 
-        $chapter_count = Chapter::where('bid',$bid)->count();
-        $chapter_size = Chapter::where('bid',$bid)->sum('size');
-        if($j>0){
-            Book::where('id',$bid)->update(['chapter_count'=>$chapter_count,'last_cid'=>$max_sequence_chapter_id,'size'=>$chapter_size,'last_chapter'=>$v['chapter_name']]);
+        $chapter_count = Chapter::where('bid', $bid)->count();
+        $chapter_size = Chapter::where('bid', $bid)->sum('size');
+        if ($j > 0) {
+            Book::where('id', $bid)->update(['chapter_count' => $chapter_count, 'last_cid' => $max_sequence_chapter_id, 'size' => $chapter_size, 'last_chapter' => $v['chapter_name']]);
         }
         return $j;
     }
 
 
-    private function bookStatus($bid,$ly_bid){
+    private function bookStatus($bid, $ly_bid)
+    {
         $status = 0;
-        try{
-            $book_info_url_format =   "http://www.leyuee.com/services/zwfx.aspx?method=bookinfo&token=sefaf23h7face&bid=%s";
-            $res = $this->client->get(sprintf($book_info_url_format,$ly_bid));
+        try {
+            $book_info_url_format = "http://www.leyuee.com/services/zwfx.aspx?method=bookinfo&token=sefaf23h7face&bid=%s";
+            $res = $this->client->get(sprintf($book_info_url_format, $ly_bid));
             $res = $res->getBody()->getContents();
-            if($res){
-                $res = json_decode($res,true);
-                if(isset($res['data']) && isset($res['data']['book_state'])){
+            if ($res) {
+                $res = json_decode($res, true);
+                if (isset($res['data']) && isset($res['data']['book_state'])) {
                     $status = $res['data']['book_state'];
                 }
             }
-        }catch (\Exception $e){
+        } catch (\Exception $e) {
 
         }
-        if($status){
-            Book::where('id',$bid)->update(['status'=>$status]);
+        if ($status) {
+            Book::where('id', $bid)->update(['status' => $status]);
         }
     }
 }

+ 42 - 10
app/Console/Commands/BookUpdateOne.php

@@ -9,6 +9,7 @@ use App\Modules\Book\Models\Chapter;
 use App\Modules\Book\Services\ChapterService;
 use App\Modules\Book\Services\BookConfigService;
 use DB;
+use Log;
 
 class BookUpdateOne extends Command
 {
@@ -31,6 +32,8 @@ class BookUpdateOne extends Command
      */
     protected $description = '更新图书章节内容';
 
+    private $client;
+
     /**
      * Create a new command instance.
      *
@@ -73,11 +76,23 @@ class BookUpdateOne extends Command
         $book_info = Book::find($bid);
         if(empty($book_info) || empty($book_info->ly_bid)) return -1;
         $this->bookStatus($bid,$book_info->ly_bid);
-        $max_sequence = Chapter::where('bid',$bid)->max('sequence');
-        $max_sequence = $max_sequence?$max_sequence:-1;
-        $max_sequence_chapter = Chapter::where('bid',$bid)->where('sequence',$max_sequence)->select('id')->first();
-        $max_sequence_chapter_id = isset($max_sequence_chapter->id)?$max_sequence_chapter->id:0;
+        //$max_sequence = Chapter::where('bid',$bid)->max('sequence');
+        //$max_sequence = $max_sequence?$max_sequence:-1;
+        //$max_sequence_chapter = Chapter::where('bid',$bid)->where('sequence',$max_sequence)->select('id')->first();
+        //$max_sequence_chapter_id = isset($max_sequence_chapter->id)?$max_sequence_chapter->id:0;
 
+        $last_chapter = Chapter::where('bid',$bid)
+            ->select('id','name','sequence','prev_cid','next_cid')
+            ->orderBy('sequence','desc')
+            ->first();
+        $last_chapter_from_third = Chapter::where('bid',$bid)
+            ->where('ly_chapter_id','>',0)
+            ->select('id','name','sequence','prev_cid','next_cid','ly_chapter_id')
+            ->orderBy('sequence','desc')
+            ->first();
+        $max_sequence_chapter_id = isset($last_chapter->id)?$last_chapter->id:0;
+        $max_sequence = isset($last_chapter->sequence)?$last_chapter->sequence:0;
+        $from_sequence = $max_sequence;
         $chapter_list_fromat = "http://www.leyuee.com/services/zwfx.aspx?method=chapterlist&bid=%s&token=sefaf23h7face";
         $res = $this->client->get(sprintf($chapter_list_fromat,$book_info->ly_bid));
         $res = $res->getBody()->getContents();
@@ -86,7 +101,7 @@ class BookUpdateOne extends Command
         $res = json_decode($res,true);
         $j = 0;
         $size = 0;
-        $local_count = Chapter::where('bid',$bid)->count();
+        $local_count = Chapter::where('bid',$bid)->where('ly_chapter_id','>',0)->count();
         $remote_count = 0;
 
         foreach ($res['data'] as $item1) {
@@ -94,16 +109,32 @@ class BookUpdateOne extends Command
             $item1 = null;
         }
         if($remote_count == $local_count) return '';
+        $start = false;
+        if(!$last_chapter){
+            $start = true;
+        }
+        $ly_last_chapter_id = 0;
+        if($last_chapter_from_third && isset($last_chapter_from_third->ly_chapter_id)){
+            $ly_last_chapter_id = $last_chapter_from_third->ly_chapter_id;
+        }
 
         foreach ($res['data'] as $v1) {
             foreach ($v1['chapters'] as $v) {
-                if ($v['chapter_order_number'] <= $max_sequence-1) {
+                /*if ($v['chapter_order_number'] <= $max_sequence-1) {
                     continue;
+                }*/
+                if(!$start){
+                    if($v['chapter_id'] != $ly_last_chapter_id){
+                        continue;
+                    }else{
+                        \Log::info($v1);
+                        $start = true;
+                        continue;
+                    }
                 }
-
-                if (Chapter::where('bid', $bid)->where('ly_chapter_id', $v['chapter_id'])->count()) {
+                /*if (Chapter::where('bid', $bid)->where('ly_chapter_id', $v['chapter_id'])->count()) {
                     continue;
-                }
+                }*/
 
                 $chapter_fromat = "http://www.leyuee.com/services/zwfx.aspx?method=chapter&bid=%s&cid=%s&token=sefaf23h7face";
                 $cahpter_content_res = $this->client->get(sprintf($chapter_fromat, $book_info->ly_bid, $v['chapter_id']));
@@ -112,7 +143,7 @@ class BookUpdateOne extends Command
                 $temp = [
                     'bid' => $bid,
                     'name' => $v['chapter_name'],
-                    'sequence' => $v['chapter_order_number']+1,
+                    'sequence' => ++$max_sequence,
                     'is_vip' => $v['chapter_need_pay'],
                     'prev_cid' => $max_sequence_chapter_id,
                     'next_cid' => '',
@@ -143,6 +174,7 @@ class BookUpdateOne extends Command
                 'update_type'=>'add_chapter',
                 'channel_name'=>$book_info->category_id >=13 ? '女频':'男频'
             ]);
+            ChapterService::splitContentAll($bid,$from_sequence);
         }
         return $j;
     }

+ 4 - 0
app/Console/Commands/updateFromNewYunqi.php

@@ -74,6 +74,10 @@ class updateFromNewYunqi extends Command
     private function updateOne($zsy_bid,$zsy_count,$yq_bid,$name)
     {
         $yunqi_book_info = $this->yQbookInfo($yq_bid);
+        if(!$yunqi_book_info) {
+            Log::info( '$yq_bid is :'.$yq_bid.', not exists' );
+            return ;
+        }
         //Log::info($yunqi_book_info);
         if($yunqi_book_info->chapter_count <=$zsy_count) return ;
         $update_count = 0;

+ 137 - 0
app/Modules/Book/Services/ChapterService.php

@@ -8,6 +8,7 @@
 
 namespace App\Modules\Book\Services;
 
+use App\Modules\Book\Models\Book;
 use App\Modules\Book\Models\Chapter;
 use OSS\Core\OssException;
 use OSS\OssClient;
@@ -287,4 +288,140 @@ class ChapterService
         }
         return null;
     }
+
+    public static function splitContentAll($bid,$sequence=1){
+        $chapters = Chapter::where('bid',$bid)->where('size','>=',3300)
+            ->where('sequence','>=',$sequence)
+            ->select('id','sequence')
+            ->orderBy('sequence')->get();
+        $i = 0;
+        $count = 0;
+        $end_sequence = 0;
+        $start_sequence = 0;
+        foreach ($chapters as $k=>$chapter){
+            if($k == 0){
+                $start_sequence = $chapter->sequence;
+            }
+            $content = self::splitContent($chapter->id);
+            if(!$content) continue;
+            //\Log::info($chapter);
+            $count += self::createSplitContent($chapter->id,$content,false);
+            $end_sequence = $chapter->sequence;
+            $i++;
+        }
+        //\Log::info('$start_sequence is: '.$start_sequence);
+        //\Log::info('$end_sequence is: '.($end_sequence+$i+$count));
+        self::adjustSequent($bid,$start_sequence,$end_sequence+$i+$count);
+
+        return $count;
+    }
+
+
+    public static function splitContent($chapter_id)
+    {
+        $chapter = self::getChapterById($chapter_id);
+        if(!$chapter || $chapter->bid <0 || $chapter->size < 3300) return [];
+        $content_list = explode("\r\n",$chapter->content);
+        //print_r($content_list);
+        $count = 1;
+        $temp_size= 0;
+        $temp_content = '';
+        $data = [];
+        foreach ($content_list as $item){
+            if($temp_size >2500){
+                $count++;
+                $temp_content = '';
+                $temp_size = 0;
+            }
+            $temp_size += mb_strlen($item);
+            $temp_content .= $item.'\r\n';
+            $data[$count-1] = [
+                'bid'=>$chapter->bid,
+                'is_vip'=>$chapter->is_vip,
+                'name'=>sprintf('%s(%s)',$chapter->name,$count),
+                'sequence'=>$chapter->sequence+$count-1,
+                'size'=>$temp_size,
+                'prev_cid'=>0,
+                'next_cid'=>0,
+                'recent_update_at'=>$chapter->recent_update_at,
+                'content'=>$temp_content,
+            ];
+        }
+
+        if($data && $data[$count-1]['size'] <800){
+            $data[$count-2]['content'] = $data[$count-2]['content'].$data[$count-1]['content'];
+            $data[$count-2]['size'] = $data[$count-2]['size']+$data[$count-1]['size'];
+            unset($data[$count-1]);
+        }
+
+        return $data;
+    }
+
+    public static function createSplitContent($chapter_id,$data,$is_adjust = true)
+    {
+        if(count($data) <= 1){
+            return 0;
+        }
+        Chapter::where('bid',$data[0]['bid'])->where('sequence','>=',$data[0]['sequence']+1)->increment('sequence',count($data)-1);
+        Chapter::where('id',$chapter_id)->update([
+            'content'=>$data[0]['content'],
+            'size'=>$data[0]['size'],
+            'name'=>$data[0]['name']
+        ]);
+        $i = 0;
+        foreach ($data as $kye=>$item){
+            if($kye == 0) continue;
+            $i++;
+            self::createChapter($item);
+        }
+        if($is_adjust){
+            self::adjustSequent($data[0]['bid'],$data[0]['sequence'],$data[0]['sequence']+count($data)+5);
+        }
+
+        if(self::getChapterFromOss($data[0]['bid'],$chapter_id)){
+            $oss = self::ossObject();
+            $bucket = env('OSS_BUCKET','zhuishuyun');
+            $path_format = 'book/chapters/%s/%s.json';
+            $oss->deleteObject($bucket,sprintf($path_format, $data[0]['bid'], $chapter_id));
+        }
+        $key = sprintf('book_chapter_%s_%s', $data[0]['bid'], $chapter_id);
+        //Redis::connection('chapter')
+        try{
+            Redis::connection('chapter')->delete($key);
+        }catch (\Exception $e){}
+
+
+        $last = Chapter::where('bid',$data[0]['bid'])
+            ->select('id','bid','name','sequence')
+            ->orderBy('sequence','desc')
+            ->limit(1)
+            ->first();
+        Book::where('id',$data[0]['bid'])->update([
+            'chapter_count'=>$last->sequence,
+            'last_chapter'=>$last->name,
+            'last_cid'=>$last->id,
+        ]);
+        return $i;
+    }
+
+    public static function adjustSequent($bid,$start_sequence,$end_sequence){
+        $chapter_list = Chapter::where('bid',$bid);
+        if($start_sequence){
+            $chapter_list = $chapter_list->where('sequence','>=',$start_sequence);
+        }
+        if($end_sequence){
+            $chapter_list = $chapter_list->where('sequence','<=',$end_sequence);
+        }
+        $chapter_list = $chapter_list->orderBy('sequence')->select('id')->get();
+        $prev = 0;
+
+        foreach ($chapter_list as $chapter){
+            if($prev){
+                Chapter::where('id',$chapter->id)->update(['prev_cid'=>$prev]);
+                Chapter::where('id',$prev)->update(['next_cid'=>$chapter->id]);
+            }
+            $prev = $chapter->id;
+        }
+    }
+
 }

+ 8 - 6
resources/views/wap/signv2.blade.php

@@ -222,7 +222,7 @@
             top: 0;
             left: 50%;
             -webkit-transform: translate(-56%, 8%);
-            transform: translate(-56%, 8%);
+            transform: translate(-50%, 8%);
         }
 
         .sign-wrap .sign-list__wrap .sign-list__top,
@@ -246,6 +246,8 @@
             -webkit-box-direction: reverse;
             -ms-flex-direction: row-reverse;
             flex-direction: row-reverse;
+            width: 77%;
+            margin: 0 auto;
         }
 
         .sign-wrap .sign-list__wrap .sign-item {
@@ -428,7 +430,7 @@
             color: #c44444;
         }
 
-        .sign-wrap .read-today__wrap .book-wrap .other-book span {
+        .sign-wrap .read-today__wrap .book-wrap .other-book a.status {
             -webkit-box-flex: 1;
             -ms-flex: 1;
             flex: 1;
@@ -438,7 +440,7 @@
             color: #666;
         }
 
-        .sign-wrap .read-today__wrap .book-wrap .other-book span a {
+        .sign-wrap .read-today__wrap .book-wrap .other-book a span {
             color: #74aeff;
         }
 
@@ -587,7 +589,7 @@
             @endif
             @if($book2)
                 @foreach($book2 as $key=>$item)
-                        <p class="other-book"><i class="{{$key%2 == 0? 'one':'two'}}">{{$item->category_name}}</i><span>{{$item->desc}}<a href={{$item->url}}>点击阅读&gt;</a></span></p>
+                        <p class="other-book"><i class="{{$key%2 == 0? 'one':'two'}}">{{$item->category_name}}</i><a href={{$item->url}} class="status">{{$item->desc}}<span >点击阅读&gt;</span></a></p>
                 @endforeach
             @endif
         </div>
@@ -598,9 +600,9 @@
 <script>
     // 每天有对应的进度条进度
     var sign = {{$sign_count}}
-            sign = sign%7;
+            sign = sign % 7;
     if(sign == 0) sign = 7;
-    var dayWithProgress = [0,0, 0.13, 0.26, 0.39, 0.68, 0.85, 1];
+    var dayWithProgress = [0,0.05, 0.16, 0.28, 0.42, 0.68, 0.80, 1];
     // 可以把签到天数放入元素获取 或者直接js赋值
     var bar = new ProgressBar.Path("#fill", {
         easing: "easeInOut",