Browse Source

Merge branch 'master' into stabble

zz 6 years ago
parent
commit
7f7ea266ab

+ 20 - 1
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -806,6 +806,8 @@ class ChapterController extends BaseController
         $this->chapter->sign_days = 1;
         $this->chapter->sign_days = 1;
         $this->chapter->sign_status = 0;
         $this->chapter->sign_status = 0;
         $this->chapter->sign_reard = 0;
         $this->chapter->sign_reard = 0;
+        $this->chapter->sign_version = 'v1';
+        $this->chapter->sign_items = [];//只有v2签到才会用到的字段
         //#短篇推送长篇需求#
         //#短篇推送长篇需求#
         $this->chapter->next_jump = 0;
         $this->chapter->next_jump = 0;
         $this->chapter->next_jump_url = '';
         $this->chapter->next_jump_url = '';
@@ -819,6 +821,7 @@ class ChapterController extends BaseController
         //广告
         //广告
         $this->chapter->is_show_ad = 0;//可不可点击
         $this->chapter->is_show_ad = 0;//可不可点击
         $this->chapter->is_visiable_ad = 0;//可不可显示
         $this->chapter->is_visiable_ad = 0;//可不可显示
+
     }
     }
 
 
     private function sign()
     private function sign()
@@ -831,6 +834,11 @@ class ChapterController extends BaseController
                 $this->chapter->sign_status = $sign_status ? 1 : 0;
                 $this->chapter->sign_status = $sign_status ? 1 : 0;
                 $this->chapter->sign_reard = $sign_status;
                 $this->chapter->sign_reard = $sign_status;
                 $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
                 $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
+                if($this->chapter->sign_days && $this->chapter->sign_days>=8){
+                    $this->chapter->sign_items = $fee_pool = [50,50,120,50,50,50,150];
+                }else{
+                    $this->chapter->sign_items = $fee_pool = [30,50,120,50,50,50,150];
+                }
             }
             }
         } else {
         } else {
             $sign_status = $this->userSign($this->uid);
             $sign_status = $this->userSign($this->uid);
@@ -838,6 +846,11 @@ class ChapterController extends BaseController
             $this->chapter->sign_status = $sign_status ? 1 : 0;
             $this->chapter->sign_status = $sign_status ? 1 : 0;
             $this->chapter->sign_reard = $sign_status;
             $this->chapter->sign_reard = $sign_status;
             $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
             $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
+            if($this->chapter->sign_days && $this->chapter->sign_days>=8){
+                $this->chapter->sign_items = $fee_pool = [50,50,120,50,50,50,150];
+            }else{
+                $this->chapter->sign_items = $fee_pool = [30,50,120,50,50,50,150];
+            }
         }
         }
     }
     }
 
 
@@ -1016,7 +1029,13 @@ class ChapterController extends BaseController
             //签过到了
             //签过到了
             return 0;
             return 0;
         }
         }
-        if ($res = UserSignService::signToday($uid)) {
+        if(in_array($this->distribution_channel_id,explode(',',redisEnv('NEW_SIGN_CHANNELS','')))){
+            $version = UserSignService::getUserSignVersion($this->uid);
+        }else{
+            $version = 'v1';
+        }
+        $this->chapter->sign_version = $version;
+        if ($res = UserSignService::signToday($uid,$this->chapter->sign_version)) {
             //$sign_key = 'leyuee:wap:usersigni';
             //$sign_key = 'leyuee:wap:usersigni';
             //Redis::hset($sign_key, $uid, $res);
             //Redis::hset($sign_key, $uid, $res);
             return $res;
             return $res;

+ 2 - 0
app/Http/Controllers/Wap/Book/Transformers/ChapterTransformer.php

@@ -34,6 +34,8 @@ class ChapterTransformer
             'js_config'=>isset($chapter->js_config)?$chapter->js_config:'',
             'js_config'=>isset($chapter->js_config)?$chapter->js_config:'',
             'is_show_ad'=>isset($chapter->is_show_ad)?$chapter->is_show_ad:'',
             'is_show_ad'=>isset($chapter->is_show_ad)?$chapter->is_show_ad:'',
             'is_visiable_ad'=>isset($chapter->is_visiable_ad)?$chapter->is_visiable_ad:0,
             'is_visiable_ad'=>isset($chapter->is_visiable_ad)?$chapter->is_visiable_ad:0,
+            'sign_version'=>isset($chapter->sign_version)?$chapter->sign_version:'',
+            'sign_items'=>isset($chapter->sign_items)?$chapter->sign_items:'',
             //'is_had_subscribe'=>0
             //'is_had_subscribe'=>0
             //'is_need_subscirbe'   =>  $chapter->is_need_subscirbe,
             //'is_need_subscirbe'   =>  $chapter->is_need_subscirbe,
         ];
         ];

+ 76 - 0
app/Http/Controllers/Wap/User/UserController.php

@@ -2,7 +2,9 @@
 
 
 namespace App\Http\Controllers\Wap\User;
 namespace App\Http\Controllers\Wap\User;
 
 
+use App\Modules\Book\Services\BookConfigService;
 use App\Modules\Book\Services\BookUrgeUpdateService;
 use App\Modules\Book\Services\BookUrgeUpdateService;
+use App\Modules\Book\Services\SignBookService;
 use App\Modules\Statistic\Services\AdVisitStatService;
 use App\Modules\Statistic\Services\AdVisitStatService;
 use App\Modules\Subscribe\Services\OrderService;
 use App\Modules\Subscribe\Services\OrderService;
 use App\Modules\User\Services\ReadRecordService;
 use App\Modules\User\Services\ReadRecordService;
@@ -201,6 +203,80 @@ class UserController extends BaseController
         return response()->success($data);
         return response()->success($data);
     }
     }
 
 
+    /**
+     * @return string
+     */
+    public function signi()
+    {
+        if(in_array($this->distribution_channel_id,explode(',',redisEnv('NEW_SIGN_CHANNELS','')))){
+            $version = UserSignService::getUserSignVersion($this->uid);
+        }else{
+            $version = 'v1';
+        }
+
+        if($version == 'v1'){
+            $page = 'wap.sign';
+        }else{
+            $page = 'wap.signv2';
+        }
+        $book1= $book2 = null;
+        if($version == 'v2' ){
+            $sex = $this->_user_info->sex;
+            $sex = $sex?$sex:2;
+            $book1 = BookConfigService::getRandomOneHighQualityBook($sex);
+            $book1->url = sprintf('/reader?bid=%s&cid=%s&source=wechatmsg&fromtype=sign_recommend',Hashids::encode($book1->bid),$book1->first_cid);
+            $book2 = SignBookService::getRandomBook($sex);
+            \Log::info($book2);
+            foreach ($book2 as $item){
+                $item->url = sprintf('/reader?bid=%s&cid=%s&source=wechatmsg&fromtype=sign_recommend',Hashids::encode($item->bid),$item->first_cid);
+            }
+
+        }
+        $tomorrow_pool = $fee_pool = [0,30,50,120,50,50,50,150];
+        $day = [0,'一','二','三','四','五','六','七'];
+        list($sign,$sign_count) = ReadRecordService::getByMultiField($this->uid,'sign_day','sign_counts');
+        if ($sign && $sign == date('Y-m-d')) {
+            if($version == 'v1'){
+                $fee = $sign_count>=3 ? 50:30;
+            }else{
+                if ($sign_count % 7 == 1 && $sign_count<=7) {
+                    $fee = 30;
+                } elseif ($sign_count % 7 == 3) {
+                    $fee = 120;
+                } elseif ($sign_count % 7 == 0) {
+                    $fee = 150;
+                } else {
+                    $fee = 50;
+                }
+            }
+            if($sign_count >=8){
+                $fee_pool[1] = 50;
+            }
+
+            $tomorrow = (($sign_count+1) % 7 == 0? 7:($sign_count+1) % 7);
+            if($sign_count+1 >=8){
+                $tomorrow_pool[1] = 50;
+            }
+            //签过到了
+            $data = ['sign_count'=>$sign_count,'fee'=>$fee,'fee_pool'=>$fee_pool,'day'=>$day,'book1'=>$book1,'book2'=>$book2,'tomorrow_fee'=>$tomorrow_pool[$tomorrow]];
+            return view($page,$data);
+        }
+        $fee = UserSignService::signToday($this->uid,$version);
+        if(!$fee){
+            return response()->error('WAP_SYS_ERROR');
+        }
+        $sign_count = ReadRecordService::getSignCount($this->uid);
+        if($sign_count >=8){
+            $fee_pool[1] = 50;
+        }
+        if($sign_count+1 >=8){
+            $tomorrow_pool[1] = 50;
+        }
+        $tomorrow = (($sign_count+1) % 7 == 0? 7:($sign_count+1) % 7);
+        $data = ['sign_count'=>$sign_count,'fee'=>$fee,'fee_pool'=>$fee_pool,'day'=>$day,'book1'=>$book1,'book2'=>$book2,'tomorrow_fee'=>$tomorrow_pool[$tomorrow]];
+        return view($page,$data);
+    }
+
     public function recordShare(Request $request){
     public function recordShare(Request $request){
         if(!$this->checkUid()){
         if(!$this->checkUid()){
             return response()->error('NOT_LOGIN');
             return response()->error('NOT_LOGIN');

+ 2 - 0
app/Http/Routes/Wap/WapRoutes.php

@@ -264,6 +264,8 @@ Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap
         //用户强关信息页
         //用户强关信息页
         Route::any('subscribe/getFromUser','Subscribe\SubscribeController@getFromUser');
         Route::any('subscribe/getFromUser','Subscribe\SubscribeController@getFromUser');
 
 
+        Route::get('sign','User\UserController@signi');
+
         Route::any('{slug}','Web\WelcomeController@index')->where('slug', '(.*)?');
         Route::any('{slug}','Web\WelcomeController@index')->where('slug', '(.*)?');
 
 
     });
     });

+ 12 - 0
app/Modules/Book/Models/SignBook.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Modules\Book\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SignBook extends Model
+{
+    protected $table = 'sign_book';
+
+    protected $fillable = ['bid','name','desc'];
+}

+ 12 - 0
app/Modules/Book/Services/BookConfigService.php

@@ -415,4 +415,16 @@ class BookConfigService
 
 
     }
     }
 
 
+    public static function getRandomOneHighQualityBook($sex)
+    {
+       return BookConfig::join('books','books.id','=','book_configs.bid')
+           ->join('book_categories','books.category_id','=','book_categories.id')
+           ->select('books.intro','books.first_cid','book_configs.cover','book_configs.book_name','book_configs.bid')
+           ->where('book_configs.is_high_quality',1)
+           ->where('book_categories.pid',$sex)
+           ->orderBy('book_configs.bid')
+           ->get()
+           ->random(1)->first();
+    }
+
 }
 }

+ 23 - 0
app/Modules/Book/Services/SignBookService.php

@@ -0,0 +1,23 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: z-yang
+ * Date: 2019/6/14
+ * Time: 15:21
+ */
+
+namespace App\Modules\Book\Services;
+
+use App\Modules\Book\Models\SignBook;
+
+class SignBookService
+{
+    public static function getRandomBook($sex,$num=2){
+        $model = new SignBook();
+        return $model->join('books','sign_book.bid','=','books.id')
+            ->join('book_categories','books.category_id','=','book_categories.id')
+            ->select('sign_book.bid','sign_book.desc','sign_book.name','books.first_cid','book_categories.category_name')
+            ->get()
+            ->random($num);
+    }
+}

+ 23 - 1
app/Modules/User/Services/ReadRecordService.php

@@ -20,7 +20,7 @@ class ReadRecordService
     //阅读记录数
     //阅读记录数
     const RECORD_COUNT = 50;
     const RECORD_COUNT = 50;
 
 
-    private static $not_uid_key = ['last_read','send_order_id','sign_count','sign_counts','sign_info','sign_day','smart_push','inner_send_order_id','gxhp','property','bind_phone_status','ua'];
+    private static $not_uid_key = ['last_read','send_order_id','sign_count','sign_counts','sign_info','sign_day','smart_push','inner_send_order_id','gxhp','property','bind_phone_status','ua','sign_version'];
 
 
     /**
     /**
      * 获取
      * 获取
@@ -511,6 +511,14 @@ class ReadRecordService
         return '';
         return '';
     }
     }
 
 
+    public static function getByMultiField(int $uid,...$field){
+        try{
+            return Redis::hmget('book_read:' . $uid,$field);
+        }catch (\Exception $e){
+        }
+        return '';
+    }
+
     public static function setByField(int $uid,$field,$value){
     public static function setByField(int $uid,$field,$value){
         if(!in_array($field,self::$not_uid_key)){
         if(!in_array($field,self::$not_uid_key)){
             return false;
             return false;
@@ -521,6 +529,20 @@ class ReadRecordService
         return '';
         return '';
     }
     }
 
 
+    public static function setByMultiField(int $uid,$kv){
+        $keys = array_keys($kv);
+        foreach ($keys as $field){
+            if(!in_array($field,self::$not_uid_key)){
+                return false;
+            }
+        }
+        try{
+            return Redis::hmset('book_read:' . $uid,$kv);
+        }catch (\Exception $e){}
+        return '';
+    }
+
+
     private static function resetRecordFromDB($uid)
     private static function resetRecordFromDB($uid)
     {
     {
         if(self::getByField($uid,'last_read')){
         if(self::getByField($uid,'last_read')){

+ 215 - 97
app/Modules/User/Services/UserSignService.php

@@ -30,10 +30,10 @@ class UserSignService
         //return UserSign::isSign($uid, $day);
         //return UserSign::isSign($uid, $day);
         $sign_day = ReadRecordService::getSignDay($uid);
         $sign_day = ReadRecordService::getSignDay($uid);
         //异常
         //异常
-        if($sign_day == -1){
+        if ($sign_day == -1) {
             return true;
             return true;
         }
         }
-        if($sign_day && $sign_day == date('Y-m-d')){
+        if ($sign_day && $sign_day == date('Y-m-d')) {
             return true;
             return true;
         }
         }
         return false;
         return false;
@@ -46,20 +46,21 @@ class UserSignService
      * @param $day
      * @param $day
      * @return mixed
      * @return mixed
      */
      */
-    public static function isSigni($uid, $day){
-        $day_2 = date('Y-m-d',strtotime($day)-86400*2);
-        $sign_stat = UserSign::where('uid',$uid)->where('day','>=',$day_2)->select('day')->orderBy('id','desc')->limit(3)->get();
+    public static function isSigni($uid, $day)
+    {
+        $day_2 = date('Y-m-d', strtotime($day) - 86400 * 2);
+        $sign_stat = UserSign::where('uid', $uid)->where('day', '>=', $day_2)->select('day')->orderBy('id', 'desc')->limit(3)->get();
 
 
-        if(!$sign_stat->isEmpty()){
-            $day_1 = date('Y-m-d',strtotime($day)-86400);
+        if (!$sign_stat->isEmpty()) {
+            $day_1 = date('Y-m-d', strtotime($day) - 86400);
             $sign_day = [];
             $sign_day = [];
-            foreach ($sign_stat as $v){
+            foreach ($sign_stat as $v) {
                 $sign_day[] = $v->day;
                 $sign_day[] = $v->day;
             }
             }
-            if(in_array($day,$sign_day)){
+            if (in_array($day, $sign_day)) {
                 return 0;
                 return 0;
             }
             }
-            if( in_array($day_1,$sign_day) && in_array($day_2,$sign_day)){
+            if (in_array($day_1, $sign_day) && in_array($day_2, $sign_day)) {
                 return 50;
                 return 50;
             }
             }
             return 30;
             return 30;
@@ -70,7 +71,8 @@ class UserSignService
     /**
     /**
      * 用户签到记录
      * 用户签到记录
      */
      */
-    public static function getUserSignRecord($uid){
+    public static function getUserSignRecord($uid)
+    {
         return UserSign::getUserSignRecord($uid);
         return UserSign::getUserSignRecord($uid);
     }
     }
 
 
@@ -82,58 +84,170 @@ class UserSignService
      */
      */
     public static function sign($uid, $day)
     public static function sign($uid, $day)
     {
     {
-    	\Log::info('sign:uid:'.$uid.' day:'.$day);
+        \Log::info('sign:uid:' . $uid . ' day:' . $day);
         //查看签到日期
         //查看签到日期
         $sign_day = ReadRecordService::getSignDay($uid);
         $sign_day = ReadRecordService::getSignDay($uid);
-        if($sign_day == -1){
+        if ($sign_day == -1) {
             return false;
             return false;
         }
         }
         //已经签过到
         //已经签过到
-        if($sign_day == $day){
+        if ($sign_day == $day) {
             return false;
             return false;
         }
         }
 
 
         $count = ReadRecordService::getSignCountSimple($uid);
         $count = ReadRecordService::getSignCountSimple($uid);
         //记录签到日期
         //记录签到日期
-        if($sign_day && $sign_day == date('Y-m-d',time()-86400)){
+        if ($sign_day && $sign_day == date('Y-m-d', time() - 86400)) {
             $continue = true;
             $continue = true;
             //昨天有签过到
             //昨天有签过到
-            ReadRecordService::sign((int)$uid,true);
+            ReadRecordService::sign((int)$uid, true);
             $count += 1;
             $count += 1;
-        }else{
+        } else {
             $continue = false;
             $continue = false;
             //昨天没有签过到
             //昨天没有签过到
-            ReadRecordService::sign((int)$uid,false);
+            ReadRecordService::sign((int)$uid, false);
             $count = 1;
             $count = 1;
         }
         }
 
 
         $return_fee = $fee = 30;
         $return_fee = $fee = 30;
         //连续签到两天 50书币
         //连续签到两天 50书币
-        if($continue && $count>=3){
+        if ($continue && $count >= 3) {
             $return_fee = $fee = 50;
             $return_fee = $fee = 50;
         }
         }
-        if($count%15 == 7){
+        if ($count % 15 == 7) {
             $fee += 100;
             $fee += 100;
         }
         }
-        if($count%15 == 0){
+        if ($count % 15 == 0) {
             $fee += 150;
             $fee += 150;
         }
         }
         UserService::addBalance($uid, $fee, 0, $fee);
         UserService::addBalance($uid, $fee, 0, $fee);
         // 先扔到redis里面,异步更新user_sign表
         // 先扔到redis里面,异步更新user_sign表
         $use_redis_user_sign = true;
         $use_redis_user_sign = true;
-        if($use_redis_user_sign){
-        	$sign_data = ['uid'=>$uid,'price'=>$fee,'day'=>$day,'sign_time'=>time(),'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
-        	Redis::sadd('user_sign:uid',$uid);
-        	Redis::hset('user_sign:uid:info',$uid,json_encode($sign_data));
-            ReadRecordService::setSignInfo($uid,json_encode($sign_data));
-        }else{
-        	UserSign::sign($uid, $day,$fee);
+        if ($use_redis_user_sign) {
+            $sign_data = ['uid' => $uid, 'price' => $fee, 'day' => $day, 'sign_time' => time(), 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
+            Redis::sadd('user_sign:uid', $uid);
+            Redis::hset('user_sign:uid:info', $uid, json_encode($sign_data));
+            ReadRecordService::setSignInfo($uid, json_encode($sign_data));
+        } else {
+            UserSign::sign($uid, $day, $fee);
         }
         }
         return $return_fee;
         return $return_fee;
     }
     }
 
 
-    public static function signToday($uid){
-        return self::sign($uid,date('Y-m-d'));
+    public static function signV2($uid, $day)
+    {
+        \Log::info('signv2:uid:' . $uid . ' day:' . $day);
+        //查看签到日期
+        $sign_day = ReadRecordService::getSignDay($uid);
+        if ($sign_day == -1) {
+            return false;
+        }
+        //已经签过到
+        if ($sign_day == $day) {
+            return false;
+        }
+
+        $count = ReadRecordService::getSignCountSimple($uid);
+        //记录签到日期
+        if ($sign_day && $sign_day == date('Y-m-d', time() - 86400)) {
+            $continue = true;
+            //昨天有签过到
+            ReadRecordService::sign((int)$uid, true);
+            $count += 1;
+        } else {
+            $continue = false;
+            //昨天没有签过到
+            ReadRecordService::sign((int)$uid, false);
+            $count = 1;
+        }
+
+        $fee = 30;
+        if ($count % 7 == 1 && $count<=7) {
+            $fee = 30;
+        } elseif ($count % 7 == 3) {
+            $fee = 120;
+        } elseif ($count % 7 == 0) {
+            $fee = 150;
+        } else {
+            $fee = 50;
+        }
+        UserService::addBalance($uid, $fee, 0, $fee);
+        // 先扔到redis里面,异步更新user_sign表
+        $use_redis_user_sign = true;
+        if ($use_redis_user_sign) {
+            $sign_data = ['uid' => $uid, 'price' => $fee, 'day' => $day, 'sign_time' => time(), 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
+            Redis::sadd('user_sign:uid', $uid);
+            Redis::hset('user_sign:uid:info', $uid, json_encode($sign_data));
+            ReadRecordService::setSignInfo($uid, json_encode($sign_data));
+        } else {
+            UserSign::sign($uid, $day, $fee);
+        }
+        return $fee;
+    }
+
+    public static function getUserSignVersion($uid)
+    {
+        list($version, $sign_day, $count) = ReadRecordService::getByMultiField($uid, 'sign_version', 'sign_day', 'sign_counts');
+        if ($version == 'v2') {
+            return 'v2';
+        }
+        if ($version == 'v1') {
+            if ($sign_day == date('Y-m-d')) {
+                return $version;
+            }
+            if ($sign_day == date('Y-m-d', time() - 86400)) {
+                if ($count % 15 == 0 ) {
+                    ReadRecordService::setByMultiField($uid, ['sign_counts' => 0, 'sign_version' => 'v2']);
+                    return 'v2';
+                }
+                return $version;
+            }
+
+            ReadRecordService::setByMultiField($uid, ['sign_version' => 'v2']);
+            return 'v2';
+        }
+
+        if (!$count || !$sign_day) {
+            ReadRecordService::setByMultiField($uid, ['sign_version' => 'v2']);
+            return 'v2';
+        }
+
+        if ($sign_day == date('Y-m-d')) {
+            self::setUserSignVersion($uid, 'v1');
+            return 'v1';
+        }
+
+        if ($sign_day == date('Y-m-d', time() - 86400)) {
+            if ($count % 15 == 0) {
+                ReadRecordService::setByMultiField($uid, ['sign_counts' => 0, 'sign_version' => 'v2']);
+                return 'v2';
+            }
+            self::setUserSignVersion($uid, 'v1');
+            return 'v1';
+        }
+
+        self::setUserSignVersion($uid, 'v2');
+        return 'v2';
+    }
+
+    public static function setUserSignVersion($uid, $version)
+    {
+        ReadRecordService::setByField($uid, 'sign_version', $version);
+    }
+
+    public static function signToday($uid,$version='')
+    {
+        if(!$version){
+            $version = self::getUserSignVersion($uid);
+        }
+         if($version == 'v1'){
+             return self::sign($uid, date('Y-m-d'));
+         }
+
+        if($version == 'v2'){
+            return self::signV2($uid, date('Y-m-d'));
+        }
+        return 0;
     }
     }
 
 
 
 
@@ -144,28 +258,28 @@ class UserSignService
      * @param int $price
      * @param int $price
      * @return string
      * @return string
      */
      */
-    public static function userSignReturnContent3($openid,$distribution_channel_id='')
+    public static function userSignReturnContent3($openid, $distribution_channel_id = '')
     {
     {
         $content = '';
         $content = '';
         $day = date('Y-m-d');
         $day = date('Y-m-d');
         $user = ForceSubscribeUsers::getOneForceSubscribeUsersByOpenid($openid);
         $user = ForceSubscribeUsers::getOneForceSubscribeUsersByOpenid($openid);
         if ($user) {
         if ($user) {
-            $user_wechat = User::where('id',$user->uid)->first();
+            $user_wechat = User::where('id', $user->uid)->first();
             $new_user_activity_content = '';
             $new_user_activity_content = '';
-            if(!Order::where('uid',$user->uid)->where('status','PAID')->select('id')->first()){
+            if (!Order::where('uid', $user->uid)->where('status', 'PAID')->select('id')->first()) {
                 $new_user_activity_content = self::newUserActivity($user);
                 $new_user_activity_content = self::newUserActivity($user);
             }
             }
             $encode_distribution_channel_id = encodeDistributionChannelId($user->distribution_channel_id);
             $encode_distribution_channel_id = encodeDistributionChannelId($user->distribution_channel_id);
-            $attach_content = self::signCallBackPushActivityInfo($user->uid,$user->distribution_channel_id);
+            $attach_content = self::signCallBackPushActivityInfo($user->uid, $user->distribution_channel_id);
             $continueReadUrl = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/continue';
             $continueReadUrl = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/continue';
             $sign_url = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/sign';
             $sign_url = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/sign';
 
 
             $sign_stat = self::isSign($user->uid);
             $sign_stat = self::isSign($user->uid);
             if ($sign_stat) {
             if ($sign_stat) {
-                $content = '今日已经签到过了,明日继续签到得书币哦~' ;
+                $content = '今日已经签到过了,明日继续签到得书币哦~';
                 //$content .= '<a href=' . '"' . $continueReadUrl . '"' . '> ☞ 点我继续上次阅读</a>';
                 //$content .= '<a href=' . '"' . $continueReadUrl . '"' . '> ☞ 点我继续上次阅读</a>';
-            }else{
-                $content = '尊敬的会员:'.($user_wechat?$user_wechat->nickname:'')."\n\n"."<a href='".$sign_url."'>💰点击此处签到领书币</a>" ; 
+            } else {
+                $content = '尊敬的会员:' . ($user_wechat ? $user_wechat->nickname : '') . "\n\n" . "<a href='" . $sign_url . "'>💰点击此处签到领书币</a>";
                 //$content .= '继续阅读\n\n<a href=' . '"' . $continueReadUrl . '"' . '> ☞ 点我继续上次阅读</a>';
                 //$content .= '继续阅读\n\n<a href=' . '"' . $continueReadUrl . '"' . '> ☞ 点我继续上次阅读</a>';
             }
             }
 
 
@@ -191,7 +305,7 @@ class UserSignService
             }
             }
 
 
             $hot_book_num = 3;
             $hot_book_num = 3;
-            $recomm_books = BookConfigService::getSignRecommendBooks($read_bid_arr, $sign_recomm_bid_key,$hot_book_num);
+            $recomm_books = BookConfigService::getSignRecommendBooks($read_bid_arr, $sign_recomm_bid_key, $hot_book_num);
             $content .= "\n\n" . '热门书籍推荐';
             $content .= "\n\n" . '热门书籍推荐';
             if ($recomm_books) {
             if ($recomm_books) {
                 foreach ($recomm_books as $book) {
                 foreach ($recomm_books as $book) {
@@ -200,76 +314,79 @@ class UserSignService
                 }
                 }
             }
             }
             //$content .= "\n\n" . '为方便下次阅读,请置顶公众号';
             //$content .= "\n\n" . '为方便下次阅读,请置顶公众号';
-            $content .= "\n\n" . '为方便下次阅读,请<a href="'.'https://help.'. env('WECHAT_CUSTOM_HOST') .'.com/top.html"'.'>置顶公众号</a>';
+            $content .= "\n\n" . '为方便下次阅读,请<a href="' . 'https://help.' . env('WECHAT_CUSTOM_HOST') . '.com/top.html"' . '>置顶公众号</a>';
 
 
-            if($attach_content){
-                $content .= "\n\n" .$attach_content;
+            if ($attach_content) {
+                $content .= "\n\n" . $attach_content;
             }
             }
-            if($new_user_activity_content){
+            if ($new_user_activity_content) {
                 $content .= $new_user_activity_content;
                 $content .= $new_user_activity_content;
             }
             }
-        }
-        // 空用户推默认的文案
-        else{
-        	$encode_distribution_channel_id = encodeDistributionChannelId($distribution_channel_id);
-        	$url = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/sign';
-        	$content = "尊敬的会员:\n\n" . '<a href="' . $url . '"> 💰点击此处签到领书币</a>';
+        } // 空用户推默认的文案
+        else {
+            $encode_distribution_channel_id = encodeDistributionChannelId($distribution_channel_id);
+            $url = env('PROTOCOL') . '://site' . $encode_distribution_channel_id . '.' . env('WECHAT_CUSTOM_HOST') . '.com/sign';
+            $content = "尊敬的会员:\n\n" . '<a href="' . $url . '"> 💰点击此处签到领书币</a>';
         }
         }
         return $content;
         return $content;
     }
     }
 
 
-    private static function newUserActivity($user){
+    private static function newUserActivity($user)
+    {
         $content = '';
         $content = '';
         $status = self::newUserActivityStatus($user->uid);
         $status = self::newUserActivityStatus($user->uid);
         $record = [];
         $record = [];
         //新关未付费用户42小时后充推送活动 68元的活动 文案:全年免费看书
         //新关未付费用户42小时后充推送活动 68元的活动 文案:全年免费看书
-        if(strtotime($user->created_at)+42*3600 < time() &&
+        if (strtotime($user->created_at) + 42 * 3600 < time() &&
             $user->distribution_channel_id == 123 &&
             $user->distribution_channel_id == 123 &&
-            !in_array(1,$status)
-        ){
-            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/seYearActivity?fromtype=signcallback_forever&send_time='.time() ;
-            $content .=  "\n\n" .'<a href="' . $url . '"> 💰全年免费看书</a>';
-            $record[] = ['uid'=>$user->uid,'type'=>1,'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
+            !in_array(1, $status)
+        ) {
+            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/seYearActivity?fromtype=signcallback_forever&send_time=' . time();
+            $content .= "\n\n" . '<a href="' . $url . '"> 💰全年免费看书</a>';
+            $record[] = ['uid' => $user->uid, 'type' => 1, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
         }
         }
         //20小时的 文字链的文案:书币充值特惠
         //20小时的 文字链的文案:书币充值特惠
-        if(strtotime($user->created_at)+20*3600 < time() && !in_array(2,$status)){
-            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/newUserSale?fromtype=signcallback_newUserSale&send_time='.time() ;
-            $content .=  "\n\n" .'<a href="' . $url . '"> 💰书币充值特惠</a>';
-            $record[] = ['uid'=>$user->uid,'type'=>2,'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
+        if (strtotime($user->created_at) + 20 * 3600 < time() && !in_array(2, $status)) {
+            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/newUserSale?fromtype=signcallback_newUserSale&send_time=' . time();
+            $content .= "\n\n" . '<a href="' . $url . '"> 💰书币充值特惠</a>';
+            $record[] = ['uid' => $user->uid, 'type' => 2, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
         }
         }
         //36小时的。文案:充9.9送2000书币
         //36小时的。文案:充9.9送2000书币
-        if(strtotime($user->created_at)+36*3600 < time() && !in_array(3,$status)){
-            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/newUserActivity?fromtype=signcallback_newUserActivity&send_time='.time() ;
-            $content .=  "\n\n" .'<a href="' . $url . '"> 💰充9.9得2000书币</a>';
-            $record[] = ['uid'=>$user->uid,'type'=>3,'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
+        if (strtotime($user->created_at) + 36 * 3600 < time() && !in_array(3, $status)) {
+            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($user->distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com/sale/newUserActivity?fromtype=signcallback_newUserActivity&send_time=' . time();
+            $content .= "\n\n" . '<a href="' . $url . '"> 💰充9.9得2000书币</a>';
+            $record[] = ['uid' => $user->uid, 'type' => 3, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
         }
         }
         self::recordnewUserActivityPush($record);
         self::recordnewUserActivityPush($record);
         return $content;
         return $content;
     }
     }
 
 
-    private static function  newUserActivityStatus($uid){
+    private static function newUserActivityStatus($uid)
+    {
         $data = [-1];
         $data = [-1];
-        if(!$uid){
+        if (!$uid) {
             return $data;
             return $data;
         }
         }
-        $result = DB::table('user_sign_push_activity')->where('uid',$uid)->select('type')->get();
-        if($result){
-            foreach ($result as $v){
-                array_push($data,$v->type);
+        $result = DB::table('user_sign_push_activity')->where('uid', $uid)->select('type')->get();
+        if ($result) {
+            foreach ($result as $v) {
+                array_push($data, $v->type);
             }
             }
         }
         }
         return $data;
         return $data;
     }
     }
 
 
-    private static function recordnewUserActivityPush($data){
-        if($data){
-            try{
+    private static function recordnewUserActivityPush($data)
+    {
+        if ($data) {
+            try {
                 DB::table('user_sign_push_activity')->insert($data);
                 DB::table('user_sign_push_activity')->insert($data);
-            }catch (\Exception $e){
+            } catch (\Exception $e) {
 
 
             }
             }
         }
         }
     }
     }
+
     /**
     /**
      *
      *
      * @param $openid
      * @param $openid
@@ -291,17 +408,17 @@ class UserSignService
                     $content .= "\n\n" .$attach_content;
                     $content .= "\n\n" .$attach_content;
                 }*/
                 }*/
                 //return $content;
                 //return $content;
-            }else{
+            } else {
                 $sign_stat = self::sign($user->uid, $day);
                 $sign_stat = self::sign($user->uid, $day);
 
 
-                $content = '今日签到成功,赠送'.$sign_stat.'书币,明日继续签到得书币哦~' . "\n\n" . '<a href=' . '"' . $continueReadUrl . '"' . '> >>点我继续上次阅读</a>' . "\n\n" . '阅读记录:';
+                $content = '今日签到成功,赠送' . $sign_stat . '书币,明日继续签到得书币哦~' . "\n\n" . '<a href=' . '"' . $continueReadUrl . '"' . '> >>点我继续上次阅读</a>' . "\n\n" . '阅读记录:';
 
 
-                if($sign_stat == 30){
+                if ($sign_stat == 30) {
                     $content = '今日签到成功,赠送30书币,连续签到2日后,赠送书币增加至50哦~' . "\n\n" . '<a href=' . '"' . $continueReadUrl . '"' . '> >>点我继续上次阅读</a>' . "\n\n" . '阅读记录:';
                     $content = '今日签到成功,赠送30书币,连续签到2日后,赠送书币增加至50哦~' . "\n\n" . '<a href=' . '"' . $continueReadUrl . '"' . '> >>点我继续上次阅读</a>' . "\n\n" . '阅读记录:';
                 }
                 }
             }
             }
             $new_user_activity_content = '';
             $new_user_activity_content = '';
-            if(!Order::where('uid',$user->uid)->where('status','PAID')->select('id')->first()){
+            if (!Order::where('uid', $user->uid)->where('status', 'PAID')->select('id')->first()) {
                 $new_user_activity_content = self::newUserActivity($user);
                 $new_user_activity_content = self::newUserActivity($user);
             }
             }
             $res = ReadRecordService::getReadRecord($user->uid);
             $res = ReadRecordService::getReadRecord($user->uid);
@@ -334,48 +451,49 @@ class UserSignService
                 }
                 }
             }
             }
             //$content .= "\n\n" . '为方便下次阅读,请置顶公众号';
             //$content .= "\n\n" . '为方便下次阅读,请置顶公众号';
-            $content .= "\n\n" . '为方便下次阅读,请<a href="'.'https://help.leyuee.com/top.html"'.'>置顶公众号</a>';
+            $content .= "\n\n" . '为方便下次阅读,请<a href="' . 'https://help.leyuee.com/top.html"' . '>置顶公众号</a>';
 
 
 
 
-            if($attach_content){
-                $content .= "\n\n" .$attach_content;
+            if ($attach_content) {
+                $content .= "\n\n" . $attach_content;
             }
             }
 
 
-            if($new_user_activity_content){
-                $content .= "\n\n" .$new_user_activity_content;
+            if ($new_user_activity_content) {
+                $content .= "\n\n" . $new_user_activity_content;
             }
             }
         }
         }
         return $content;
         return $content;
     }
     }
 
 
-    public static function signCallBackPushActivityInfo($uid,$distribution_channel_id){
+    public static function signCallBackPushActivityInfo($uid, $distribution_channel_id)
+    {
 
 
         $activity_setting = ActivityService::getActivitySetting();
         $activity_setting = ActivityService::getActivitySetting();
-        if(!$activity_setting)
+        if (!$activity_setting)
             return false;
             return false;
-        $acyivity_id = isset($activity_setting['activity_id'])?$activity_setting['activity_id']:0;
-        $other = env('OTHER_ACTIVITY_ID',0);
-        if($acyivity_id == $other && !in_array($distribution_channel_id,explode(',', env('OTHER_ACTIVITY_CHANNEL', '1')))){
+        $acyivity_id = isset($activity_setting['activity_id']) ? $activity_setting['activity_id'] : 0;
+        $other = env('OTHER_ACTIVITY_ID', 0);
+        if ($acyivity_id == $other && !in_array($distribution_channel_id, explode(',', env('OTHER_ACTIVITY_CHANNEL', '1')))) {
             return false;
             return false;
         }
         }
-        if(!$acyivity_id)
+        if (!$acyivity_id)
             return false;
             return false;
-        $activity_title = isset($activity_setting['sign_call_back_text'])?$activity_setting['sign_call_back_text']:'';;
-        if(empty($activity_title))
+        $activity_title = isset($activity_setting['sign_call_back_text']) ? $activity_setting['sign_call_back_text'] : '';;
+        if (empty($activity_title))
             return false;
             return false;
         $activity_info = ActivityService::getById($acyivity_id);
         $activity_info = ActivityService::getById($acyivity_id);
-        if(empty($activity_info))
+        if (empty($activity_info))
             return false;
             return false;
 
 
-        if(time()< strtotime($activity_info->start_time) || time()> strtotime($activity_info->end_time)){
+        if (time() < strtotime($activity_info->start_time) || time() > strtotime($activity_info->end_time)) {
             return false;
             return false;
 
 
         }
         }
         $user = UserService::getById($uid);
         $user = UserService::getById($uid);
-        if(empty($user))
+        if (empty($user))
             return false;
             return false;
 
 
-        if(!ActivitySwitchService::isShowInPage($acyivity_id,$distribution_channel_id,'sign')){
+        if (!ActivitySwitchService::isShowInPage($acyivity_id, $distribution_channel_id, 'sign')) {
             return false;
             return false;
         }
         }
         /*
         /*
@@ -383,9 +501,9 @@ class UserSignService
         if($no_participate_activity && in_array($user->distribution_channel_id, explode(',',$no_participate_activity))){
         if($no_participate_activity && in_array($user->distribution_channel_id, explode(',',$no_participate_activity))){
             return false;
             return false;
         }*/
         }*/
-        if($user && isset($user->created_at) && (time() - strtotime($user->created_at)) >= 86400*2) {
-            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com'.$activity_info->activity_page . '&fromtype=signcallback' ;
-            return   '<a href="' . $url . '"> ' . $activity_title . '</a>';
+        if ($user && isset($user->created_at) && (time() - strtotime($user->created_at)) >= 86400 * 2) {
+            $url = env('PROTOCOL') . '://site' . encodeDistributionChannelId($distribution_channel_id) . '.' . env('CUSTOM_HOST') . '.com' . $activity_info->activity_page . '&fromtype=signcallback';
+            return '<a href="' . $url . '"> ' . $activity_title . '</a>';
         }
         }
 
 
         return false;
         return false;

+ 4 - 4
resources/views/wap/index.blade.php

@@ -9,7 +9,7 @@
     <script>window.VueRouter || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-router.min.js"><\/script>')</script>
     <script>window.VueRouter || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-router.min.js"><\/script>')</script>
     <script>(window.Vue && window.VueLazyload) || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-lazyload.js"><\/script>')</script>
     <script>(window.Vue && window.VueLazyload) || document.write('<script src="https://cdn-novel.iycdm.com/static/vue-lazyload.js"><\/script>')</script>
     <title>{{$title}}</title>
     <title>{{$title}}</title>
-    <link href=https://cdn-novel.iycdm.com/static2019-6-13/css/app.8eab20fbc8b62c5937739f9b32d2647a.css rel=stylesheet>
+    <link href=https://cdn-novel.iycdm.com/static2019-6-17/css/app.cdb7e4b51336b0efdd14319c5b6d0036.css rel=stylesheet>
 </head>
 </head>
 <body>
 <body>
 <div id=app></div>
 <div id=app></div>
@@ -32,8 +32,8 @@
     })();</script>
     })();</script>
 <script id=options>window.options = {!! $options!!};</script>
 <script id=options>window.options = {!! $options!!};</script>
 <script type=text/javascript
 <script type=text/javascript
-        src=https://cdn-novel.iycdm.com/static2019-6-13/js/manifest.344339a5f6cee861f2ed.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-6-13/js/vendor.171a7cafc999efe6724c.js></script>
-<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-6-13/js/app.56c451489351cfd3eee5.js></script>
+        src=https://cdn-novel.iycdm.com/static2019-6-17/js/manifest.1277b86a4f737251472a.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-6-17/js/vendor.171a7cafc999efe6724c.js></script>
+<script type=text/javascript src=https://cdn-novel.iycdm.com/static2019-6-17/js/app.b59986e44f6fb7f33d49.js></script>
 </body>
 </body>
 </html>
 </html>

+ 436 - 0
resources/views/wap/sign.blade.php

@@ -0,0 +1,436 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <meta
+            name="viewport"
+            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
+    />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <style>
+        html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
+        pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small,
+        strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
+        table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details,
+        figcaption, figure, footer, header, menu, nav, section, summary, time, mark, audio,
+        video {
+            margin: 0;
+            padding: 0;
+            border: 0;
+            outline: 0;
+            font-size: 100%;
+            vertical-align: baseline;
+            background: transparent;
+        }
+
+        html {
+            background: #fff;
+        }
+
+        body {
+            line-height: 1.5;
+            font-size: 0.24rem;
+            font-family: sans-serif, "Microsoft YaHei";
+            margin: auto;
+            max-width: 750px;
+            text-align: center;
+            -webkit-font-smoothing: antialiased;
+        }
+
+        :focus {
+            outline: 1;
+        }
+
+        article,
+        aside,
+        canvas,
+        details,
+        figcaption,
+        figure,
+        footer,
+        header,
+        hgroup,
+        menu,
+        nav,
+        section,
+        summary {
+            display: block;
+        }
+
+        ul {
+            list-style: none;
+        }
+
+        blockquote,
+        q {
+            quotes: none;
+        }
+
+        blockquote:before,
+        blockquote:after,
+        q:before,
+        q:after {
+            content: "";
+            content: none;
+        }
+
+        a {
+            margin: 0;
+            padding: 0;
+            border: 0;
+            font-size: 100%;
+            vertical-align: baseline;
+            background: transparent;
+            text-decoration: none;
+        }
+
+        ins {
+            background-color: #ff9;
+            color: #000;
+            text-decoration: none;
+        }
+
+        mark {
+            background-color: #ff9;
+            color: #000;
+            font-style: italic;
+            font-weight: bold;
+        }
+
+        del {
+            text-decoration: line-through;
+        }
+
+        abbr[title],
+        dfn[title] {
+            border-bottom: 1px dotted #000;
+            cursor: help;
+        }
+
+        table {
+            border-collapse: collapse;
+            border-spacing: 0;
+        }
+
+        hr {
+            display: block;
+            height: 1px;
+            border: 0;
+            border-top: 1px solid #cccccc;
+            margin: 0;
+            padding: 0;
+        }
+
+        input,
+        select {
+            vertical-align: middle;
+            padding: 0;
+            margin: 0;
+        }
+
+        input[type="button"],
+        input[type="submit"],
+        input[type="reset"] {
+            -webkit-appearance: none;
+        }
+
+        img {
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        i {
+            font-style: normal;
+        }
+
+        body.dialog-open {
+            position: fixed;
+            width: 100%;
+        }
+
+        input::-webkit-search-cancel-button {
+            display: none;
+        }
+        .sign-container {
+            font-size: 0;
+            position: relative;
+        }
+
+        .sign-bg {
+            width: 100%;
+        }
+
+        .sign-num__total {
+            position: absolute;
+            font-size: 22px;
+            top: 22%;
+            left: 50%;
+            -webkit-transform: translateX(-50%);
+            transform: translateX(-50%);
+            color: #fff;
+        }
+
+        .sign-result__box {
+            position: absolute;
+            font-size: 14px;
+            color: #333;
+            top: 28%;
+            left: 10%;
+            right: 10%;
+            text-align: center;
+            z-index: 9;
+        }
+
+        .sign-new_tips {
+            margin: 0.25rem 0;
+            padding: 0.35rem 0;
+            background-color: #fff2ef;
+            border: solid 1px #fe6138;
+            color: #fe6138;
+            text-align: justify;
+        }
+
+        .sign-new_tips p {
+            padding: 0 0.5rem;
+        }
+
+        .sign-new_tips p:nth-child(1) {
+            font-weight: bold;
+            letter-spacing: 2px;
+        }
+
+        .sign-new_tips p:nth-child(2) {
+            font-size: 13px;
+        }
+
+        .sign-day__list {
+            margin-top: 10px;
+        }
+
+        .day-box {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-align: center;
+            -ms-flex-align: center;
+            align-items: center;
+            -webkit-box-orient: horizontal;
+            -webkit-box-direction: normal;
+            -ms-flex-direction: row;
+            flex-direction: row;
+            -webkit-box-pack: justify;
+            -ms-flex-pack: justify;
+            justify-content: space-between;
+        }
+
+        .day-box .day-item {
+            width: 15%;
+            margin-bottom: 10px;
+            font-size: 12px;
+            color: #999;
+        }
+
+        .day-box .day-item img {
+            width: 100%;
+        }
+
+        .day-box .day-item.nmr {
+            margin-right: 0;
+        }
+
+        .day-item .sign-img {
+            position: relative;
+        }
+
+        .day-item .sign-img::after {
+            content: "";
+            position: absolute;
+            right: -52%;
+            top: 50%;
+            -webkit-transform: translateY(-50%);
+            transform: translateY(-50%);
+            height: 2px;
+            width: 62%;
+            background: #ff4400;
+            z-index: -1;
+        }
+
+        .day-item .sign-img.line-v::after {
+            width: 2px;
+            height: 110%;
+            left: 50%;
+            -webkit-transform: translateX(-50%);
+            transform: translateX(-50%);
+            top: 77%;
+        }
+
+        .even-box .sign-img::after {
+            right: 0;
+            left: -52%;
+        }
+
+        .day-box .day-item:not(:last-child) {
+            margin-right: 0.2rem;
+        }
+
+        .even-box {
+            -webkit-box-orient: horizontal;
+            -webkit-box-direction: reverse;
+            -ms-flex-direction: row-reverse;
+            flex-direction: row-reverse;
+        }
+
+        .even-box .day-item:first-child {
+            margin-right: 0px;
+        }
+
+        .even-box .day-item:not(:last-child) {
+            margin-right: 0px;
+        }
+
+        .to-sign__record {
+            display: block;
+            text-align: right;
+            color: #999;
+            font-size: 12px;
+        }
+
+        .to-read {
+            font-size: 0;
+            margin-top: 10px;
+        }
+
+        .to-read img {
+            width: 100%;
+        }
+
+        .sign-status {
+            text-align: center;
+        }
+
+        .sign-status img {
+            width: 60%;
+            margin: 10px 0;
+        }
+
+    </style>
+    <title>签到</title>
+</head>
+<body>
+<main class="sign-page">
+    <div class="sign-container">
+        <img
+                class="sign-bg"
+                src="https://cdn-novel.iycdm.com/h5/sign/20190613_sign_bg.jpg"
+                alt=""
+        />
+        <p class="sign-num__total">连续签到{{$sign_count}}天</p>
+        <div class="sign-result__box">
+            <p class="sign-notice" id="sign-notice"></p>
+            <div class="sign-new_tips">
+                <p>亲爱的读者们:</p>
+                <p>为了确保更好的奖励体验,签到活动即将改版哦,敬请关注!</p>
+            </div>
+            <div class="sign-day__list">
+                <!-- even-box -->
+                <!-- 每行一个day-box 偶数个添加even-box -->
+                <div class="day-box">
+                    @for($i = 1;$i <=5;$i++)
+                        <div class="day-item">
+                            <div class="sign-img {{$i == 5?'line-v':''}}">
+                                @if(($i <= $sign_count% 15) || $sign_count% 15 == 0 )
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_pass.png" alt="" />
+                                @elseif($i == $sign_count % 15)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_today.png" alt="" />
+                                @else
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_coin.png" alt="" />
+                                @endif
+
+                            </div>
+                            <span>第{{$i}}天</span>
+                        </div>
+                    @endfor
+
+                </div>
+                <div class="day-box even-box">
+                    @for($j = 6;$j <=10;$j++)
+                        <div class="day-item">
+                            <div class="sign-img {{$j == 10?'line-v':''}}">
+                                @if(($j <= $sign_count % 15 || $sign_count% 15 == 0) && $j != 7)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_pass.png" alt="" />
+                                @elseif($j == $sign_count % 15)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_today.png" alt="" />
+                                @elseif($j == 7)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_7.png" alt="" />
+                                @else
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_coin.png" alt="" />
+                                @endif
+                            </div>
+                            <span>第{{$j}}天</span>
+                        </div>
+                    @endfor
+                </div>
+                <div class="day-box">
+                    @for($k = 11;$k <=15;$k++)
+                        <div class="day-item">
+                            <div class="{{$k == 15?'line-v':'sign-img'}}">
+                                @if(($k < $sign_count % 15 || $sign_count % 15 == 0 ) && $k != 15)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_pass.png" alt="" />
+                                @elseif($k == $sign_count % 15 && $k != 15)
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_today.png" alt="" />
+                                    @elseif($k == 15)
+                                        <img src="https://cdn-novel.iycdm.com/h5/sign/sign_15.png" alt="" />
+                                @else
+                                    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_coin.png" alt="" />
+                                @endif
+
+                            </div>
+                            <span>第{{$k}}天</span>
+                        </div>
+                    @endfor
+                </div>
+            </div>
+            <a href="/record/sign" class="to-sign__record">签到记录 &gt;</a>
+            <a href="/continue" class="to-read">
+                <img src="https://cdn-novel.iycdm.com/h5/sign/to_read.png" alt="" />
+            </a>
+    </div>
+    </div>
+    </main>
+    </body>
+    <script>
+    // 根据签到时间的不同 显示不同的文案
+    var signDay = {{$sign_count}}
+            signDay = parseInt(signDay)
+    var signCoin = {{$fee}}
+        signCoin = parseInt(signCoin)
+    function getNoticeText(signDay, signCoin) {
+        var html = "";
+        switch (signDay) {
+            case 1:
+            case 2:
+                html =
+                        "今天签到赠送" +
+                        signCoin +
+                        "书币,连续签到每日可领50书币,最高月送2000书币~";
+                break;
+            case 6:
+                html = "今天签到赠送" + signCoin +"书币,明日签到可以领取小礼包哦~";
+                break;
+            case 7:
+                html = "今天签到赠送" + signCoin + "书币,签到已满7日,额外送您100书币大礼包~";
+                break;
+            case 14:
+                html = "今天签到赠送" + signCoin + "书币,明日签到可以领取大礼包哦~";
+                break;
+            case 15:
+                html = "今天签到赠送" + signCoin + "书币,签到已满15日,送您150书币大礼包~";
+                break;
+            default:
+                html = "今天签到赠送" + signCoin + "书币,额外连续签到最高月送2000书币~";
+        }
+        return html;
+    }
+
+    document.querySelector("#sign-notice").innerHTML = getNoticeText(signDay, signCoin);
+</script>
+</html>

+ 612 - 0
resources/views/wap/signv2.blade.php

@@ -0,0 +1,612 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <meta
+            name="viewport"
+            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
+    />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <style>
+        html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
+        pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small,
+        strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
+        table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details,
+        figcaption, figure, footer, header, menu, nav, section, summary, time, mark, audio,
+        video {
+            margin: 0;
+            padding: 0;
+            border: 0;
+            outline: 0;
+            font-size: 100%;
+            vertical-align: baseline;
+            background: transparent;
+        }
+
+        html {
+            background: #fff;
+        }
+
+        body {
+            line-height: 1.5;
+            font-size: 0.24rem;
+            font-family: sans-serif, "Microsoft YaHei";
+            margin: auto;
+            max-width: 750px;
+            text-align: center;
+            -webkit-font-smoothing: antialiased;
+        }
+
+        :focus {
+            outline: 1;
+        }
+
+        article,
+        aside,
+        canvas,
+        details,
+        figcaption,
+        figure,
+        footer,
+        header,
+        hgroup,
+        menu,
+        nav,
+        section,
+        summary {
+            display: block;
+        }
+
+        ul {
+            list-style: none;
+        }
+
+        blockquote,
+        q {
+            quotes: none;
+        }
+
+        blockquote:before,
+        blockquote:after,
+        q:before,
+        q:after {
+            content: "";
+            content: none;
+        }
+
+        a {
+            margin: 0;
+            padding: 0;
+            border: 0;
+            font-size: 100%;
+            vertical-align: baseline;
+            background: transparent;
+            text-decoration: none;
+        }
+
+        ins {
+            background-color: #ff9;
+            color: #000;
+            text-decoration: none;
+        }
+
+        mark {
+            background-color: #ff9;
+            color: #000;
+            font-style: italic;
+            font-weight: bold;
+        }
+
+        del {
+            text-decoration: line-through;
+        }
+
+        abbr[title],
+        dfn[title] {
+            border-bottom: 1px dotted #000;
+            cursor: help;
+        }
+
+        table {
+            border-collapse: collapse;
+            border-spacing: 0;
+        }
+
+        hr {
+            display: block;
+            height: 1px;
+            border: 0;
+            border-top: 1px solid #cccccc;
+            margin: 0;
+            padding: 0;
+        }
+
+        input,
+        select {
+            vertical-align: middle;
+            padding: 0;
+            margin: 0;
+        }
+
+        input[type="button"],
+        input[type="submit"],
+        input[type="reset"] {
+            -webkit-appearance: none;
+        }
+
+        img {
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        i {
+            font-style: normal;
+        }
+
+        body.dialog-open {
+            position: fixed;
+            width: 100%;
+        }
+
+        html {
+            background: #f7f7f7;
+        }
+
+        .sign-wrap {
+            font-size: 0;
+        }
+
+        .sign-wrap .sign-banner {
+            position: absolute;
+            top: 0;
+            left: 0;
+        }
+
+        .sign-wrap .every-day__get {
+            position: absolute;
+            top: 7.5%;
+            left: 50%;
+            -webkit-transform: translate(-50%, 0%);
+            transform: translate(-50%, 0%);
+            font-size: 18px;
+            color: #fff;
+        }
+
+        .sign-wrap .every-day__get i {
+            font-weight: bold;
+        }
+
+        .sign-wrap .wrap-box {
+            margin: 0 10px;
+            background: white;
+            -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);
+            box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);
+            border-radius: 10px;
+            font-size: 13px;
+            padding: 20px;
+            position: relative;
+        }
+
+        .sign-wrap .wrap-box .wrap-box__banner {
+            position: absolute;
+            top: 0%;
+            left: 50%;
+            -webkit-transform: translate(-50%, -56%);
+            transform: translate(-50%, -56%);
+            width: 70%;
+        }
+
+        .sign-wrap .sign-week__wrap {
+            margin-top: 30%;
+        }
+
+        .sign-wrap .sign-week__wrap .title-text {
+            margin-top: 9px;
+            font-size: 13px;
+            color: #666;
+        }
+
+        .sign-wrap .sign-week__wrap .title-text i {
+            font-size: 14px;
+            color: #74aeff;
+            font-weight: bold;
+        }
+
+        .sign-wrap .sign-week__wrap .sign-progress__wrap {
+            position: relative;
+            padding-bottom: 50px;
+        }
+
+        .sign-wrap .sign-list__wrap {
+            position: absolute;
+            width: 100%;
+            top: 0;
+            left: 50%;
+            -webkit-transform: translate(-56%, 8%);
+            transform: translate(-56%, 8%);
+        }
+
+        .sign-wrap .sign-list__wrap .sign-list__top,
+        .sign-wrap .sign-list__wrap .sign-list__bottom {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -ms-flex-pack: distribute;
+            justify-content: space-around;
+            -webkit-box-align: start;
+            -ms-flex-align: start;
+            align-items: flex-start;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-list__top {
+            margin-bottom: 6%;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-list__bottom {
+            -webkit-box-orient: horizontal;
+            -webkit-box-direction: reverse;
+            -ms-flex-direction: row-reverse;
+            flex-direction: row-reverse;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item {
+            width: 24%;
+            font-size: 0;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item img {
+            width: 22px;
+            height: 22px;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item .day-send,
+        .sign-wrap .sign-list__wrap .sign-item .day-text {
+            display: block;
+            font-size: 11px;
+            color: #999;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item .day-send {
+            width: 55px;
+            margin: 10% auto 0;
+            border: 1px solid #74aeff;
+            color: #74aeff;
+            border-radius: 2px;
+            position: relative;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item .day-send::before, .sign-wrap .sign-list__wrap .sign-item .day-send::after {
+            content: "";
+            width: 0;
+            height: 0;
+            border-style: solid;
+            border-width: 6px;
+            border-color: transparent transparent #74aeff transparent;
+            position: absolute;
+            top: 0%;
+            left: 50%;
+            -webkit-transform: translate(-50%, -100%);
+            transform: translate(-50%, -100%);
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item .day-send::after {
+            border-width: 5px;
+            border-color: transparent transparent #fff transparent;
+            -webkit-transform: translate(-50%, -93%);
+            transform: translate(-50%, -93%);
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item.cur .day-send {
+            background: #74aeff;
+            color: #fff;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item.cur .day-send::after {
+            border-color: transparent transparent #74aeff transparent;
+        }
+
+        .sign-wrap .sign-list__wrap .sign-item.cur .day-text {
+            color: #74aeff;
+            font-weight: bold;
+        }
+
+        .sign-wrap .sign-to__read {
+            position: relative;
+        }
+
+        .sign-wrap .sign-to__read .to-read {
+            display: block;
+            text-align: center;
+            width: 55%;
+            margin: 0 auto;
+            line-height: 35px;
+            background: #74aeff;
+            color: #fff;
+            border-radius: 18px;
+            font-size: 14px;
+            font-weight: bold;
+        }
+
+        .sign-wrap .sign-to__read .sign-record {
+            position: absolute;
+            color: currentColor;
+            right: 0;
+            top: 50%;
+            -webkit-transform: translateY(-50%);
+            transform: translateY(-50%);
+            color: #999;
+            font-size: 12px;
+        }
+
+        .sign-wrap img {
+            width: 100%;
+        }
+
+        @media screen and (max-width: 320px) {
+            .sign-wrap .sign-list__wrap .sign-list__top {
+                margin-bottom: 0%;
+            }
+        }
+
+        @media screen and (min-width: 414px) {
+            .sign-wrap .sign-list__wrap .sign-list__top {
+                margin-bottom: 8%;
+            }
+        }
+
+        .sign-wrap .read-today__wrap {
+            margin-top: 10px;
+            margin-bottom: 10px;
+        }
+
+        .sign-wrap .read-today__wrap h3 {
+            font-size: 16px;
+            color: #333;
+            text-align: left;
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-pack: start;
+            -ms-flex-pack: start;
+            justify-content: flex-start;
+            -webkit-box-align: center;
+            -ms-flex-align: center;
+            align-items: center;
+            margin-bottom: 14px;
+        }
+
+        .sign-wrap .read-today__wrap h3::before {
+            content: "";
+            width: 3px;
+            height: 16px;
+            background: #74aeff;
+            border-radius: 1px;
+            margin-right: 4px;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .book-name {
+            font-size: 16px;
+            color: #333;
+            margin-bottom: 12px;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .book-intro {
+            -webkit-line-clamp: 3;
+            display: -webkit-box;
+            -webkit-box-orient: vertical;
+            overflow: hidden;
+            color: #999;
+            font-size: 13px;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-pack: start;
+            -ms-flex-pack: start;
+            justify-content: flex-start;
+            -webkit-box-align: start;
+            -ms-flex-align: start;
+            align-items: flex-start;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book .one,
+        .sign-wrap .read-today__wrap .book-wrap .other-book .two {
+            font-size: 12px;
+            display: block;
+            padding: 0.06rem 0.12rem;
+            border-radius: 3px;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book .one {
+            background: #ffe08d;
+            color: #846a23;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book .two {
+            background: #ffb8b8;
+            color: #c44444;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book span {
+            -webkit-box-flex: 1;
+            -ms-flex: 1;
+            flex: 1;
+            text-align: left;
+            margin-left: 6px;
+            font-size: 13px;
+            color: #666;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book span a {
+            color: #74aeff;
+        }
+
+        .sign-wrap .read-today__wrap .book-wrap .other-book:not(:last-child) {
+            margin: 16px auto;
+        }
+
+        .sign-wrap .x-book__multi {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-align: center;
+            -ms-flex-align: center;
+            align-items: center;
+            -webkit-box-orient: horizontal;
+            -webkit-box-direction: normal;
+            -ms-flex-direction: row;
+            flex-direction: row;
+            -webkit-box-pack: justify;
+            -ms-flex-pack: justify;
+            justify-content: space-between;
+        }
+
+        .sign-wrap .x-book__coverbox {
+            position: relative;
+        }
+
+        .sign-wrap .x-book__cover {
+            -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
+            box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
+            border-radius: 3px;
+            display: block;
+            border: 0.05px solid #fff;
+            -webkit-transition: 0.6s;
+            transition: 0.6s;
+            width: 77px;
+            height: 103px;
+        }
+
+        .sign-wrap .x-book__text--multi {
+            -webkit-box-sizing: border-box;
+            box-sizing: border-box;
+            padding-left: 20px;
+            position: relative;
+            text-align: left;
+            width: calc(100% - 77px);
+            height: 103px;
+        }
+
+    </style>
+    <title>签到</title>
+</head>
+<body>
+<main class="sign-wrap">
+    <img src="https://cdn-novel.iycdm.com/h5/sign/sign_banner.jpg" alt="" class="sign-banner" />
+    <span class="every-day__get">获得<i>{{$fee}}</i>书币</span>
+    <div class="wrap-box sign-week__wrap">
+        <img src="https://cdn-novel.iycdm.com/h5/sign/sign_hf.png" alt="" class="wrap-box__banner" />
+        <p class="title-text">
+            您已连续签到<i>{{$sign_count}}</i>天,明天签到获得<i>{{$tomorrow_fee}}</i>书币
+        </p>
+        <div class="sign-progress__wrap">
+            <svg
+                    xmlns="http://www.w3.org/2000/svg"
+                    version="1.1"
+                    x="0px"
+                    y="0px"
+                    viewBox="0 0 305 130"
+            >
+                <path
+                        id="base"
+                        fill="#fff"
+                        stroke="#f1f7ff"
+                        stroke-width="3"
+                        opacity="0.5"
+                        d="m14,25.4375l278,-0.4375l0,83l-259,0"
+                />
+                <path
+                        id="fill"
+                        fill="#fff"
+                        stroke="#4895ff"
+                        stroke-width="3"
+                        opacity="0.5"
+                        d="m14,25.4375l278,-0.4375l0,83l-259,0"
+                />
+            </svg>
+            <div class="sign-list__wrap">
+                <div class="sign-list__top">
+                    <!-- 说明: 图片三天使用sign_3 七天使用sign_5 -->
+                    <!-- 已签到过的item上加入cur的class -->
+                    @for($i =1;$i<=4;$i++)
+                        <div class="sign-item {{($sign_count %7 >=$i) || $sign_count %7 == 0 ? 'cur':''}}">
+                            @if($i == 3)
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_3.png" alt="" />
+                                @elseif($i ==7)
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_7.png" alt="" />
+                                @else
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_c.png" alt="" />
+                            @endif
+                            <span class="day-send">{{$fee_pool[$i]}}书币</span>
+                            <span class="day-text">第{{$day[$i]}}天</span>
+                        </div>
+                    @endfor
+                </div>
+                <div class="sign-list__bottom">
+                    @for($j =5;$j<=7;$j++)
+                        <div class="sign-item {{($sign_count %7 >=$j) || ($sign_count %7 ==0 ) ? 'cur':''}}">
+                            @if($j == 3)
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_3.png" alt="" />
+                            @elseif($j ==7)
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_5.png" alt="" />
+                            @else
+                                <img src="https://cdn-novel.iycdm.com/h5/sign/sign_c.png" alt="" />
+                            @endif
+                            <span class="day-send">{{$fee_pool[$j]}}书币</span>
+                            <span class="day-text">第{{$day[$j]}}天</span>
+                        </div>
+                    @endfor
+                </div>
+            </div>
+        </div>
+        <div class="sign-to__read">
+            <a href="/continue" class="to-read">继续看书&gt;&gt;</a>
+            <a href="/record/sign" class="sign-record">签到记录&gt;</a>
+        </div>
+    </div>
+    <div class="wrap-box read-today__wrap">
+        <h3>今日必读</h3>
+        <div class="book-wrap">
+            @if($book1)
+                <div class="x-book">
+                    <div class="x-book__multi">
+                        <div class="x-book__coverbox">
+                            <a href="{{$book1->url}}"><img src="{{$book1->cover}}" class="x-book__cover"/></a>
+                        </div>
+                        <div class="x-book__text--multi">
+                            <a href="{{$book1->url}}">
+                            <p class="book-name">{{$book1->book_name}}</p>
+                            <p class="book-intro">
+                                {{$book1->intro}}
+                            </p>
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            @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>
+                @endforeach
+            @endif
+        </div>
+    </div>
+</main>
+</body>
+<script src="https://cdn.bootcss.com/progressbar.js/1.0.1/progressbar.min.js"></script>
+<script>
+    // 每天有对应的进度条进度
+    var sign = {{$sign_count}}
+            sign = sign%7;
+    if(sign == 0) sign = 7;
+    var dayWithProgress = [0,0, 0.13, 0.26, 0.39, 0.68, 0.85, 1];
+    // 可以把签到天数放入元素获取 或者直接js赋值
+    var bar = new ProgressBar.Path("#fill", {
+        easing: "easeInOut",
+        duration: 1400
+    });
+    bar.set(0);
+    bar.animate(dayWithProgress[sign]);
+</script>
+</html>