浏览代码

Merge branch 'stabble' of iqiyoo:zhuishuyun_wap into stabble

songdb 6 年之前
父节点
当前提交
6a9034baa5

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

@@ -1869,7 +1869,7 @@ class ChapterController extends BaseController
         $crm = Cookie::get('crm');
         $crm = Cookie::get('crm');
         if(!$crm)return ;
         if(!$crm)return ;
         try{
         try{
-            CrmChapterOrderDetailService::create($this->uid,$fee);
+            CrmChapterOrderDetailService::create($this->uid,$fee,$this->book_info->bid,$crm);
         }catch (\Exception $e){}
         }catch (\Exception $e){}
 
 
     }
     }

+ 37 - 1
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -861,12 +861,13 @@ class OrdersController extends Controller
                     DB::rollback();
                     DB::rollback();
                     return 'Order not exist.';
                     return 'Order not exist.';
                 }
                 }
+
                 $this->successPayPushMsg($uid, $product, $order->id);
                 $this->successPayPushMsg($uid, $product, $order->id);
                 $this->orderStatistical($order);
                 $this->orderStatistical($order);
                 $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id:' . $distribution_channel_id;
                 $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id:' . $distribution_channel_id;
                 Redis::hdel($key, $uid);
                 Redis::hdel($key, $uid);
                 DB::commit();
                 DB::commit();
-
+                $this->huaweiActivity($order->activity_id,$uid,$product_id);
                 // 注册动作-》回调订单
                 // 注册动作-》回调订单
                 $action_type = 'CallBackOrder';
                 $action_type = 'CallBackOrder';
                 $param = [
                 $param = [
@@ -1022,6 +1023,7 @@ class OrdersController extends Controller
                     $this->orderStatistical($order);
                     $this->orderStatistical($order);
                     DB::commit();
                     DB::commit();
                     $this->userProperty($uid);
                     $this->userProperty($uid);
+                    $this->huaweiActivity($order->activity_id,$uid,$product_id);
                     //redis 删除未支付的uid
                     //redis 删除未支付的uid
                     try {
                     try {
                         $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id:' . $distribution_channel_id;
                         $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id:' . $distribution_channel_id;
@@ -1132,6 +1134,7 @@ class OrdersController extends Controller
                 $this->orderStatistical($order);
                 $this->orderStatistical($order);
                 DB::commit();
                 DB::commit();
                 $this->userProperty($uid);
                 $this->userProperty($uid);
+                $this->huaweiActivity($order->activity_id,$uid,$product_id);
                 //redis 删除未支付的uid
                 //redis 删除未支付的uid
                 $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id' . $distribution_channel_id;
                 $key = 'leyuee:to_send_not_pay_uid:distribution_channel_id' . $distribution_channel_id;
                 Redis::hdel($key, $uid);
                 Redis::hdel($key, $uid);
@@ -1264,6 +1267,7 @@ class OrdersController extends Controller
                     UserService::PushUserActionToQueue($action_type, $distribution_channel_id, $param);
                     UserService::PushUserActionToQueue($action_type, $distribution_channel_id, $param);
 
 
                     $this->userProperty($uid);
                     $this->userProperty($uid);
+                    $this->huaweiActivity($order->activity_id,$uid,$product_id);
 
 
                 }
                 }
             } else {
             } else {
@@ -1610,6 +1614,13 @@ class OrdersController extends Controller
                 $template_type = 'pay_channel_change';
                 $template_type = 'pay_channel_change';
                 $param = ['pay_id' => $pay_merchant_id, 'new_pay_id' => $change_pay_id];
                 $param = ['pay_id' => $pay_merchant_id, 'new_pay_id' => $change_pay_id];
             }
             }
+
+            $last_alert_time = Redis::hget('autopayalert',$pay_merchant_id);
+            if($last_alert_time && (time() -$last_alert_time) <= 3600 ){
+                return ;
+            }
+
+            Redis::hset('autopayalert',$pay_merchant_id,time());
             foreach ($phone_arr as $phone) {
             foreach ($phone_arr as $phone) {
                 AliSMS::send($phone, $template_type, $param);
                 AliSMS::send($phone, $template_type, $param);
             }
             }
@@ -1703,4 +1714,29 @@ class OrdersController extends Controller
         }catch (\Exception $e){}
         }catch (\Exception $e){}
 
 
     }
     }
+
+    private function huaweiActivity($activity_id,$uid,$product_id){
+        $huawei_activity_id = redisEnv('HUAWEI_ACTIVITY_ID');
+
+        if($huawei_activity_id &&  $activity_id && $activity_id == $huawei_activity_id){
+            $product_id_relate_lottery_count = ['6117'=>1,'6118'=>2,'6119'=>4,'6120'=>8];
+            if(isset($product_id_relate_lottery_count[$product_id])){
+                $info = DB::table('huaweilottery_user_counts')->where('uid',$uid)->select('count')->first();
+                if($info){
+                    DB::table('huaweilottery_user_counts')->where('uid',$uid)->update([
+                        'uid'=>$uid,
+                        'count'=>$info->count+$product_id_relate_lottery_count[$product_id],
+                        'updated_at'=>date('Y-m-d H:i:s')
+                    ]);
+                }else{
+                    DB::table('huaweilottery_user_counts')->insert([
+                        'uid'=>$uid,
+                        'count'=>$product_id_relate_lottery_count[$product_id],
+                        'updated_at'=>date('Y-m-d H:i:s'),
+                        'created_at'=>date('Y-m-d H:i:s')
+                    ]);
+                }
+            }
+        }
+    }
 }
 }

+ 1 - 1
app/Http/Controllers/Wap/User/CoflController.php

@@ -360,7 +360,7 @@ class CoflController extends Controller
             }
             }
         }
         }
         //按订阅章节数最多的筛选
         //按订阅章节数最多的筛选
-        $users_select = ['id'=>0,'count'=>0,'user'=>null];
+        $users_select = ['id'=>0,'count'=>0,'user'=>null,'create_time'=>0];
         foreach ($users as $each){
         foreach ($users as $each){
             $table_prefix = ($each->id)%512;
             $table_prefix = ($each->id)%512;
             $chapter_count = DB::connection('chapter_order_mysql')
             $chapter_count = DB::connection('chapter_order_mysql')

+ 133 - 3
app/Http/Controllers/Wap/Web/ActivityController.php

@@ -4,10 +4,12 @@ namespace App\Http\Controllers\Wap\Web;
 
 
 use App\Modules\Activity\Services\ActivityService;
 use App\Modules\Activity\Services\ActivityService;
 use App\Modules\Product\Services\ProductService;
 use App\Modules\Product\Services\ProductService;
+use App\Modules\User\Services\UserService;
 use Illuminate\Http\Request;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Wap\BaseController;
 use App\Http\Controllers\Wap\BaseController;
 use Redis;
 use Redis;
 use DB;
 use DB;
+use Log;
 
 
 class ActivityController extends BaseController
 class ActivityController extends BaseController
 {
 {
@@ -139,6 +141,55 @@ class ActivityController extends BaseController
         return view('crm.crmActivity', ['url' => $url, 'img' => $img['button'], 'fee' => $fee]);
         return view('crm.crmActivity', ['url' => $url, 'img' => $img['button'], 'fee' => $fee]);
     }
     }
 
 
+
+    public function huaweiActivity(Request $request)
+    {
+        $encode_distribution_channel_id = encodeDistributionChannelId($this->distribution_channel_id);
+        $activity_id = redisEnv('HUAWEI_ACTIVITY_ID', 0);
+        $activity_info = ActivityService::getById($activity_id);
+        if ($activity_info && isset($activity_info->setting) && empty(!$activity_info->setting)) {
+            $from = $request->input('fromtype', 'main');
+            $display_dialog = $request->input('display_dialog', 'none');
+            $uv_key_format = 'activity:%s:distribution_channel_id:%s:date:%s:uv';
+            $pv_key_format = 'activity:%s:distribution_channel_id:%s:pv';
+            $uv_key = sprintf($uv_key_format, $activity_info->id, $this->distribution_channel_id, date('Y-m-d'));
+            $pv_key = sprintf($pv_key_format, $activity_info->id, $this->distribution_channel_id);
+            if (time() > strtotime($activity_info->start_time) && time() < strtotime($activity_info->end_time)) {
+                Redis::sadd($uv_key, $this->uid);
+                Redis::hincrby($pv_key, date('Y-m-d'), 1);
+                $products = explode(',', $activity_info->setting);
+                $url = [];
+                $request_param = $request->except('_url');
+                $request_param['display_dialog'] = 'block';
+                $count_info = DB::table('huaweilottery_user_counts')->where('uid', $this->uid)->select('count')->first();
+                $count = 0;
+                if ($count_info && $count_info->count) {
+                    $count = $count_info->count;
+                }
+                $default_url = env('H5_SCHEME', 'https') . '://site' . $this->en_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com';
+                foreach ($products as $v) {
+                    $param = [
+                        'uid' => $this->uid,
+                        'distribution_channel_id' => $this->distribution_channel_id,
+                        'product_id' => $v,
+                        'activity_id' => $activity_info->id,
+                        'fromtype' => $from,
+                        'pay_redirect_url' => $default_url . '/activity/huaweiActivity?' . http_build_query($request_param),
+                        'limit' => 100,
+                    ];
+                    $url[] = env('CREATE_PAY_URL') . '?' . http_build_query($param);
+                }
+                return view('pay.activity.huaweiActivity', ['url' => $url, 'code' => 0, 'display_dialog' => $display_dialog, 'count' => $count, 'end_time' => date('n月d日',strtotime($activity_info->end_time))]);
+            } else if (time() <= strtotime($activity_info->start_time)) {
+                return view('pay.activity.huaweiActivity', ['url' => [], 'code' => 1, 'display_dialog' => 'none', 'count' => 0, 'end_time' => date('n月d日',strtotime($activity_info->end_time))]);
+            } else {
+                return view('pay.activity.huaweiActivity', ['url' => [], 'code' => 2, 'display_dialog' => 'none', 'count' => 0, 'end_time' => date('n月d日',strtotime($activity_info->end_time))]);
+            }
+        }
+        $default_url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
+        return redirect()->to($default_url);
+    }
+
     //端午活动
     //端午活动
     public function ragonBoatActivity(Request $request)
     public function ragonBoatActivity(Request $request)
     {
     {
@@ -184,9 +235,9 @@ class ActivityController extends BaseController
                 }
                 }
                 return view('pay.activity.ragonBoatInnerActivity', ['url' => $url, 'code' => 0]);
                 return view('pay.activity.ragonBoatInnerActivity', ['url' => $url, 'code' => 0]);
             } elseif (time() <= strtotime($activity_info->start_time)) {
             } elseif (time() <= strtotime($activity_info->start_time)) {
-                return view('pay.activity.ragonBoatInnerActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)','javascript:void(0)'], 'code' => 1]);
+                return view('pay.activity.ragonBoatInnerActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)', 'javascript:void(0)'], 'code' => 1]);
             } else {
             } else {
-                return view('pay.activity.ragonBoatInnerActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)','javascript:void(0)'], 'code' => 2]);
+                return view('pay.activity.ragonBoatInnerActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)', 'javascript:void(0)'], 'code' => 2]);
             }
             }
         } else {
         } else {
             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)) {
@@ -202,7 +253,7 @@ class ActivityController extends BaseController
                         'activity_id' => $activity_info->id,
                         'activity_id' => $activity_info->id,
                         'fromtype' => $from,
                         'fromtype' => $from,
                         'pay_redirect_url' => $redirect_url,
                         'pay_redirect_url' => $redirect_url,
-                        'limit' => 100,
+                        'limit' => 100
                     ];
                     ];
                     $url[] = env('CREATE_PAY_URL') . '?' . http_build_query($param);
                     $url[] = env('CREATE_PAY_URL') . '?' . http_build_query($param);
                 }
                 }
@@ -213,6 +264,85 @@ class ActivityController extends BaseController
                 return view('pay.activity.ragonBoatActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => 2]);
                 return view('pay.activity.ragonBoatActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => 2]);
             }
             }
         }
         }
+    }
 
 
+    public function huaweiLotteryView()
+    {
+        $count_info = DB::table('huaweilottery_user_counts')->where('uid', $this->uid)->select('count')->first();
+        $total = DB::table('huaweilottery_record')->sum('price');
+        $left_total = 5000000 - ($total ? $total : 0);
+        $count = 0;
+        if ($count_info && $count_info->count) {
+            $count = $count_info->count;
+        }
+        $activity_id = redisEnv('HUAWEI_ACTIVITY_ID', 0);
+
+        $activity_info = ActivityService::getById($activity_id);
+        \Log::info($activity_info);
+        if (!$activity_info) {
+            $diff = 0;
+        } else {
+            $diff = strtotime($activity_info->end_time) - time();
+            $diff = $diff > 0 ? $diff : 0;
+        }
+        $list = DB::table('huaweilottery_record')
+            ->where('uid', $this->uid)
+            ->where('price', '>', 0)
+            ->select('created_at', 'price')
+            ->get();
+        return view('pay.activity.huaweiLottery', ['count' => $count, 'time_diff' => $diff, 'list' => $list, 'total' => $left_total]);
+    }
+
+    public function huaweiLottery()
+    {
+        $count_info = DB::table('huaweilottery_user_counts')->where('uid', $this->uid)->select('count')->first();
+        $rest_count = 0;
+        if ($count_info && $count_info->count) {
+            $rest_count = $count_info->count;
+        }
+        $count = random_int(6, 10);
+        if ($rest_count <= 0) {
+            //Log::info('--------------------------');
+            return response()->success(['rotate' => 20 + 45 * 2 + 360 * $count]);
+        }
+
+
+        DB::table('huaweilottery_user_counts')->where('uid', $this->uid)->update([
+            'count' => $rest_count - 1,
+            'updated_at' => date('Y-m-d H:i:s')
+        ]);
+
+        $code = random_int(1, 1000);
+        if ($code <= 20) {
+            //Log::info('00000000000000000000000');
+            // 1000书币
+            $point = 20 + 45 * 7;
+            $price = 1000;
+        } elseif ($code <= 200) {
+            //100
+            $point = 20 + 45;
+            $price = 100;
+            //Log::info('11111111111111111111');
+        } elseif ($code <= 700) {
+            //50
+            $point = 20 + 45 * 3;
+            $price = 50;
+            //Log::info('2222222222222222222222222');
+        } else {
+            $point = 20 + 45 * 2;
+            $price = 0;
+            //Log::info('333333333333333333333333');
+        }
+        $rotate = $point + 360 * $count;
+        if ($price > 0) {
+            UserService::addBalance($this->uid, $price, 0, $price);
+        }
+        DB::table('huaweilottery_record')->insert([
+            'uid' => $this->uid,
+            'price' => $price,
+            'created_at' => date('Y-m-d H:i:s'),
+            'updated_at' => date('Y-m-d H:i:s'),
+        ]);
+        return response()->success(compact('rotate', 'price'));
     }
     }
 }
 }

+ 2 - 2
app/Http/Controllers/Wap/Web/WelcomeController.php

@@ -424,14 +424,14 @@ class WelcomeController extends BaseController
                 (time() - strtotime($user->created_at)) >= 86400 * 2
                 (time() - strtotime($user->created_at)) >= 86400 * 2
             ) {
             ) {
                 $activity_img = isset($activity_setting['wap_bottom_img']) ? $activity_setting['wap_bottom_img'] : '';
                 $activity_img = isset($activity_setting['wap_bottom_img']) ? $activity_setting['wap_bottom_img'] : '';
-                if (in_array($this->distribution_channel_id, [123, 211, 146, 155, 255, 256, 691, 722, 4364, 4427, 695, 4174, 4025, 4593, 4426, 4889, 4891, 4742, 4053, 4334, 4487, 5611, 6122, 6123, 6124, 8, 5, 160, 4236, 4237, 4241, 273, 148, 266, 202, 271])){
+                /*if (in_array($this->distribution_channel_id, [123, 211, 146, 155, 255, 256, 691, 722, 4364, 4427, 695, 4174, 4025, 4593, 4426, 4889, 4891, 4742, 4053, 4334, 4487, 5611, 6122, 6123, 6124, 8, 5, 160, 4236, 4237, 4241, 273, 148, 266, 202, 271])){
                     $activity_pool = [
                     $activity_pool = [
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner.jpg',
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner.jpg',
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner2.jpg',
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner2.jpg',
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner3.jpg'
                         'https://cdn-novel.iycdm.com/h5/activity-2019-06-05/reader-banner3.jpg'
                     ];
                     ];
                     $activity_img = collect($activity_pool)->random();
                     $activity_img = collect($activity_pool)->random();
-                }
+                }*/
                 $url = $h5_scheme . '://' . _domain() . $activity_info->activity_page . '&fromtype=reader';
                 $url = $h5_scheme . '://' . _domain() . $activity_info->activity_page . '&fromtype=reader';
                 $activity_title = isset($activity_setting['activity_title']) ? $activity_setting['activity_title'] : '';
                 $activity_title = isset($activity_setting['activity_title']) ? $activity_setting['activity_title'] : '';
                 $status = ActivitySwitchService::isShowInPage($activity_id, $this->distribution_channel_id);
                 $status = ActivitySwitchService::isShowInPage($activity_id, $this->distribution_channel_id);

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

@@ -192,6 +192,8 @@ Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap
         Route::get('complaints/getComplaintTags','Other\ComplaintsController@getComplaintTags');
         Route::get('complaints/getComplaintTags','Other\ComplaintsController@getComplaintTags');
         Route::post('complaints/add','Other\ComplaintsController@Complaints');
         Route::post('complaints/add','Other\ComplaintsController@Complaints');
 
 
+        Route::post('activity/huaweiLottery','Web\ActivityController@huaweiLottery');
+
     });
     });
 
 
     //授权回掉
     //授权回掉
@@ -247,6 +249,10 @@ Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap
         Route::get('activity/channel','Web\ActivityController@channelCustomActivity');
         Route::get('activity/channel','Web\ActivityController@channelCustomActivity');
         Route::get('activity/common','Web\ActivityController@commonActivity');
         Route::get('activity/common','Web\ActivityController@commonActivity');
         Route::get('activity/crm','Web\ActivityController@crmActivity');
         Route::get('activity/crm','Web\ActivityController@crmActivity');
+
+        Route::get('activity/huaweiLottery','Web\ActivityController@huaweiLotteryView');
+        Route::get('activity/huaweiActivity','Web\ActivityController@huaweiActivity');
+
         Route::get('activity/ragonBoatActivity','Web\ActivityController@ragonBoatActivity');
         Route::get('activity/ragonBoatActivity','Web\ActivityController@ragonBoatActivity');
 
 
         Route::get('welfare/giving','Web\WelfareController@giving');
         Route::get('welfare/giving','Web\WelfareController@giving');

+ 1 - 1
app/Modules/Subscribe/Models/CrmChapterOrderDetail.php

@@ -8,5 +8,5 @@ class CrmChapterOrderDetail extends Model
 {
 {
     protected $table = 'crm_chapter_order_detail';
     protected $table = 'crm_chapter_order_detail';
 
 
-    protected $fillable = ['uid','day','fee'];
+    protected $fillable = ['uid','day','fee','crm_param','bid'];
 }
 }

+ 9 - 7
app/Modules/Subscribe/Services/CrmChapterOrderDetailService.php

@@ -12,13 +12,15 @@ use App\Modules\Subscribe\Models\CrmChapterOrderDetail;
 
 
 class CrmChapterOrderDetailService
 class CrmChapterOrderDetailService
 {
 {
-    public static function create($uid, $fee)
+    public static function create($uid, $fee,$bid,$crm)
     {
     {
-        CrmChapterOrderDetail::create([
-                'uid' => $uid,
-                'fee' => $fee,
-                'day' => date('Y-m-d')
-            ]
-        );
+            CrmChapterOrderDetail::create([
+                    'uid' => $uid,
+                    'fee' => $fee,
+                    'bid'=>$bid,
+                    'crm_param'=>$crm,
+                    'day' => date('Y-m-d')
+                ]
+            );
     }
     }
 }
 }

+ 335 - 0
resources/views/pay/activity/huaweiActivity.blade.php

@@ -0,0 +1,335 @@
+<!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" />
+    <title>抽奖大礼包</title>
+    <style>
+        html,
+        body {
+            margin: 0 auto;
+            padding: 0;
+            max-width: 450px;
+            font-size: 100px;
+        }
+
+        html {
+            background: #fff;
+        }
+
+        a {
+            text-decoration: none;
+            color: currentColor;
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        p {
+            margin: 0;
+        }
+
+        i {
+            font-style: normal;
+        }
+
+        .main_box {
+            font-size: 0;
+            position: relative;
+        }
+
+        .main_box img {
+            width: 100%;
+        }
+
+        .main_box .banner-box {
+            font-size: 0;
+            position: relative;
+        }
+
+        .main_box .banner-box .click-area {
+            position: absolute;
+            bottom: 6%;
+            left: 50%;
+            -webkit-transform: translateX(-50%);
+            transform: translateX(-50%);
+            width: 1rem;
+            height: 0.35rem;
+        }
+
+        .main_box .activity-time {
+            font-size: 0.12rem;
+            color: #97643e;
+            text-align: center;
+            margin-top: 0.1rem;
+        }
+
+        .main_box .recharge-list__wrap {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-pack: justify;
+            -ms-flex-pack: justify;
+            justify-content: space-between;
+            -webkit-box-align: center;
+            -ms-flex-align: center;
+            align-items: center;
+            -webkit-box-orient: horizontal;
+            -webkit-box-direction: normal;
+            -ms-flex-flow: row wrap;
+            flex-flow: row wrap;
+            width: 90%;
+            margin: 0.14rem auto 0;
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item {
+            padding: 0.14rem 0 0.12rem;
+            width: 1.51rem;
+            font-size: 0.12rem;
+            color: #97643e;
+            text-align: center;
+            border: 1px solid #97643e;
+            border-radius: 5px;
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item .pay {
+            font-size: 0.25rem;
+            font-weight: bold;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item .get {
+            font-weight: bold;
+            color: #f35a0a;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item.cur {
+            border-color: transparent;
+            background-image: -webkit-gradient(linear, left bottom, left top, from(#e2c18c), to(#f2d8aa));
+            background-image: linear-gradient(0deg, #e2c18c 0%, #f2d8aa 100%);
+            -webkit-box-shadow: 0px 0px 0.18rem 0px rgba(188, 142, 91, 0.5);
+            box-shadow: 0px 0px 0.18rem 0px rgba(188, 142, 91, 0.5);
+            color: #6f4518;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item.cur .get {
+            color: #6f4518;
+        }
+
+        .main_box .recharge-list__wrap .recharge-item:nth-of-type(1), .main_box .recharge-list__wrap .recharge-item:nth-of-type(2) {
+            margin-bottom: 0.15rem;
+        }
+
+        .main_box .to-recharge {
+            width: 90%;
+            margin: 0.16rem auto 0;
+            display: block;
+            text-align: center;
+            color: #6f4518;
+            font-size: 0.18rem;
+            line-height: 50px;
+            background-image: -webkit-gradient(linear, right top, left top, from(#e2c18c), to(#f2d8aa));
+            background-image: linear-gradient(-90deg, #e2c18c 0%, #f2d8aa 100%);
+            -webkit-box-shadow: 0px 0px 0.18rem 0px rgba(188, 142, 91, 0.5);
+            box-shadow: 0px 0px 0.18rem 0px rgba(188, 142, 91, 0.5);
+            border-radius: 25px;
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        .rule-box .rule-line {
+            border-top: 1px solid #edc7ab;
+            height: 0px;
+            width: 80%;
+            margin: 0.23rem auto;
+            position: relative;
+        }
+
+        .rule-box .rule-line::after {
+            content: "活动说明";
+            position: absolute;
+            font-size: 0.13rem;
+            font-weight: bold;
+            color: #97643e;
+            left: 50%;
+            top: 50%;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            background: #fff;
+            width: 100px;
+            text-align: center;
+        }
+
+        .rule-box .rule-items {
+            width: 80%;
+            margin: 0 auto;
+            font-size: 0.12rem;
+            color: #97643e;
+            line-height: 2;
+        }
+
+        .dialog-wrap {
+            position: fixed;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            background: rgba(0, 0, 0, 0.3);
+        }
+
+        .dialog-wrap .dialog-content {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 90%;
+            -webkit-transform: translate(-50%, -60%);
+            transform: translate(-50%, -60%);
+        }
+
+        .dialog-wrap .bg-wrap {
+            font-size: 0;
+        }
+
+        .dialog-wrap .content {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            -webkit-transform: translate(-50%, -36%);
+            transform: translate(-50%, -36%);
+            width: 100%;
+        }
+
+        .dialog-wrap .content .text {
+            font-size: 0.2rem;
+            color: #7c5429;
+            font-weight: bold;
+            text-align: center;
+        }
+
+        .dialog-wrap .content .text i {
+            font-size: 0.28rem;
+            color: #d13600;
+            font-weight: bold;
+        }
+
+        .dialog-wrap .content .to-cj {
+            display: block;
+            width: 1.3rem;
+            line-height: 0.38rem;
+            background-color: #d13600;
+            -webkit-box-shadow: 0px 2px 27px 0px rgba(233, 64, 16, 0.58);
+            box-shadow: 0px 2px 27px 0px rgba(233, 64, 16, 0.58);
+            border-radius: 38px;
+            font-size: 0.15rem;
+            color: #fff;
+            font-weight: bold;
+            text-align: center;
+            margin: 0.2rem auto 0;
+            -webkit-tap-highlight-color: transparent;
+        }
+
+        .dialog-wrap .area-close {
+            position: absolute;
+            bottom: 0;
+            left: 50%;
+            -webkit-transform: translateX(-50%);
+            transform: translateX(-50%);
+            width: .4rem;
+            height: .4rem;
+        }
+
+        .dialog-wrap img {
+            width: 100%;
+        }
+
+    </style>
+</head>
+
+<body>
+<main class="main_box">
+    <div class="banner-box">
+        <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/banner1.jpg" alt="抽奖大礼包">
+        @if($code == 0)
+            <a href="/activity/huaweiLottery" class="click-area"></a>
+        @else
+            <a href="#" class="click-area"></a>
+        @endif
+    </div>
+    <p class="activity-time">活动有效期:6月13日-{{$end_time}}</p>
+    <div class="recharge-list__wrap">
+        <div class="recharge-item cur" data-href="{{isset($url[0])? $url[0]:''}}">
+            <p class="pay">30元</p>
+            <span class="send">3000书币</span>
+            <p class="get">获得1次抽奖机会</p>
+        </div>
+        <div class="recharge-item" data-href="{{isset($url[1])? $url[1]:''}}">
+            <p class="pay">50元</p>
+            <span class="send">5000+4000书币</span>
+            <p class="get">获得2次抽奖机会</p>
+        </div>
+        <div class="recharge-item" data-href="{{isset($url[2])? $url[2]:''}}">
+            <p class="pay">100元</p>
+            <span class="send">10000+9000书币</span>
+            <p class="get">获得4次抽奖机会</p>
+        </div>
+        <div class="recharge-item" data-href="{{isset($url[3])? $url[3]:''}}">
+            <p class="pay">200元</p>
+            <span class="send">20000+20000书币</span>
+            <p class="get">获得8次抽奖机会</p>
+        </div>
+    </div>
+    @if($code == 0)
+        <a href="{{isset($url[0])? $url[0]:'#'}}" class="to-recharge" id="pay">充值后即可参与抽奖</a>
+    @else
+        <a href="#" class="to-recharge" >充值后即可参与抽奖</a>
+    @endif
+
+</main>
+<div class="rule-box">
+    <p class="rule-line"></p>
+    <div class="rule-items">
+        <p class="item">1、充值成功即获得抽奖机会;</p>
+        <p class="item">2、此充值为书币充值,1元=100书币;</p>
+        <p class="item">3、书币为虚拟物品,一经充值不得退款;</p>
+        <p class="item">4、活动期间不限充值次数;</p>
+    </div>
+</div>
+<div class="dialog-wrap" style="display: {{$display_dialog}}">
+    <div class="dialog-content">
+        <div class="bg-wrap">
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/dialog.png" alt="" />
+            <div class="content">
+                <p class="text">恭喜获得<i>{{$count}}次</i>抽奖机会</p>
+                <a href="/activity/huaweiLottery" class="to-cj">立即抽奖</a>
+            </div>
+        </div>
+        <span class="area-close"></span>
+    </div>
+</div>
+</body>
+<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
+<script>
+    $(".recharge-list__wrap").delegate(".recharge-item", "click", function() {
+        $(".recharge-item").removeClass("cur");
+        $(this).addClass("cur");
+        $('#pay').attr('href',$(this).data('href'))
+    })
+
+    $(".main_box").delegate(".to-recharge", "click", function() {
+        //$(".dialog-wrap").css("display", "");
+    });
+
+    $(".dialog-content").click(function(e) {
+        e.stopPropagation();
+    });
+
+    [".area-close"].forEach(function(item) {
+        $(item).click(function(e) {
+            e.preventDefault();
+            $(".dialog-wrap").css("display", "none");
+        })
+    });
+</script>
+</html>

+ 673 - 0
resources/views/pay/activity/huaweiLottery.blade.php

@@ -0,0 +1,673 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <meta
+            name="viewport"
+            content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
+    />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <title>抽大奖</title>
+    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
+    <style>
+        html,
+        body {
+            height: 100%;
+            width: 100%;
+            font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue",
+            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
+            Arial, sans-serif;
+            padding: 0;
+            margin: 0;
+            background-color: #ba3d26;
+            font-size: 100px;
+        }
+
+        .main_box {
+            position: relative;
+        }
+
+        .bg {
+            width: 100%;
+        }
+
+        .index .slider #slider {
+            width: 100%;
+            height: 0.3rem;
+            position: absolute;
+            top: 16%;
+            left: 0;
+            right: 0;
+            overflow: hidden;
+            font-size: 0.14rem;
+            text-align: center;
+            line-height: 0.3rem;
+            color: #590700;
+        }
+
+        .index .slider #slider .slider-img {
+            background: #ffffff;
+            width: 3rem;
+            height: 100%;
+            position: absolute;
+            -webkit-transform: translateX(-50%);
+            transform: translateX(-50%);
+            left: 50%;
+            top: 0;
+            z-index: -1;
+            border-radius: 15px;
+            opacity: 0.72;
+        }
+
+        .index .slider #slider .slider-img.active {
+            z-index: auto;
+        }
+
+        .index .slider #slider .slider-nav-list {
+            position: absolute;
+            bottom: 5%;
+            left: 50%;
+            transform: translateX(-50%);
+            -webkit-transform: translateX(-50%);
+            list-style: none;
+            margin: 0;
+            padding: 0;
+        }
+
+        .index .slider #slider .slider-nav-list .nav-item {
+            width: 8px;
+            height: 8px;
+            border-radius: 50%;
+            background: #fff;
+            display: inline-block;
+            margin: 0 8px;
+            cursor: pointer;
+            -webkit-transition: all 0.5s linear;
+            transition: all 0.5s linear;
+        }
+
+        .index .slider #slider .slider-nav-list .nav-item.active {
+            margin-bottom: -1px;
+            width: 10px;
+            height: 10px;
+            background: #ff9800;
+        }
+
+        .index .time {
+            position: absolute;
+            top: 22%;
+            width: 50%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-pack: justify;
+            -ms-flex-pack: justify;
+            justify-content: space-between;
+            font-size: 0.12rem;
+            font-weight: bold;
+        }
+
+        .index .time div {
+            color: #ffffff;
+            padding: 0.05rem 0;
+        }
+
+        .index .time span {
+            background-color: #ffffff;
+            color: #c13b22;
+            padding: 0.05rem;
+            border-radius: 0.05rem;
+        }
+
+        .index .zp_out {
+            position: absolute;
+            top: 28%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            width: 63.5%;
+        }
+
+        .index .zp_out .zp {
+            width: 100%;
+            -webkit-transition: -webkit-transform 5s ease;
+            transition: -webkit-transform 5s ease;
+            transition: transform 5s ease;
+            transition: transform 5s ease, -webkit-transform 5s ease;
+        }
+
+        .index .zz {
+            position: absolute;
+            top: 35%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            font-size: 0.16rem;
+        }
+
+        .index .zz img {
+            width: 1rem;
+        }
+
+        .index .zz span {
+            position: absolute;
+            top: 38%;
+            left: 55%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            width: 0.4rem;
+            color: white;
+        }
+        .index .zz .quantity {
+            position: absolute;
+            top: 38%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            width: 45%;
+            color: white;
+            text-align: center;
+        }
+        .index .button {
+            font-size: 0.25rem;
+            color: #9b1800;
+            position: absolute;
+            top: 61%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+        }
+        #lottery_button{
+            display: inline-block;
+            width: 100%;
+            text-align: center;
+        }
+
+        .index .button img {
+            width: 3rem;
+            height: 0.5rem;
+        }
+
+        .index .button div {
+            position: absolute;
+            text-align: center;
+            font-weight: bold;
+            line-height: 0.5rem;
+            width: 3rem;
+            top: 0;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+        }
+
+        .index .remaining {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            position: absolute;
+            top: 69%;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            font-size: 0.15rem;
+            color: #ffd264;
+            white-space: nowrap;
+        }
+
+        .index .remaining .rmb {
+            background-color: #ffd264;
+            padding: 0.03rem 0.05rem;
+            border-radius: 100px;
+            color: #ba3d26;
+            margin-right: 0.1rem;
+            font-weight: bold;
+        }
+
+        .index .remaining .remaining-rmb {
+            line-height: 0.25rem;
+        }
+
+        .index .rule {
+            position: absolute;
+            top: 75%;
+            width: 100%;
+        }
+
+        .index .rule .rule_title {
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            -webkit-box-pack: justify;
+            -ms-flex-pack: justify;
+            justify-content: space-between;
+            padding: 0 0.77rem;
+            font-size: 0.15rem;
+            color: #fabbaf;
+        }
+
+        .index .rule .rule_title div {
+            padding: 0 0.1rem;
+        }
+
+        .index .rule .rule_title .rule_title_active {
+            padding-bottom: 0.1rem;
+            border-bottom: 0.02rem solid #fabbaf;
+        }
+
+        .index .rule .rule_content {
+            padding: 0 0.325rem;
+            font-size: 0.12rem;
+            color: #fabbaf;
+            overflow-y: scroll;
+            height: 1.25rem;
+        }
+
+        .dialog {
+            position: fixed;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            background: rgba(0, 0, 0, 0.6);
+            z-index: 9999;
+        }
+
+        .dialog .content {
+            position: fixed;
+            width: 90%;
+            height: 3.5rem;
+            top: 45%;
+            left: 50%;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            background: top/cover url(https://cdn-novel.iycdm.com/h5/activity-2019-05-30/get.png) no-repeat;
+            font-size: 0;
+            border-radius: 6px;
+        }
+
+        .dialog .content .winning-content {
+            top: 2rem;
+            font-size: 0.24rem;
+            font-weight: bold;
+            position: absolute;
+            left: 50%;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            white-space: nowrap;
+            color: white;
+        }
+
+        .dialog .content .winning-content span {
+            color: #ffdc80;
+        }
+
+        .dialog .content .dialog_button {
+            width: 3rem;
+            height: 0.5rem;
+            position: relative;
+            top: 2.6rem;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+        }
+
+        .dialog .content .dialog_close {
+            position: relative;
+            top: 3.3rem;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            width: 0.3rem;
+        }
+
+        .wei-dialog {
+            position: fixed;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            background: rgba(0, 0, 0, 0.6);
+            z-index: 9999;
+        }
+
+        .wei-dialog .content {
+            position: fixed;
+            width: 90%;
+            height: 2.4rem;
+            top: 50%;
+            left: 50%;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            background: top/cover url(https://cdn-novel.iycdm.com/h5/activity-2019-05-30/failure.png) no-repeat;
+            font-size: 0;
+            border-radius: 6px;
+        }
+
+        .wei-dialog .content .wei-dialog_button {
+            width: 3rem;
+            height: 0.5rem;
+            position: relative;
+            top: 1.55rem;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+        }
+
+        .wei-dialog .content .wei-dialog_close {
+            position: relative;
+            top: 2.5rem;
+            left: 50%;
+            -webkit-transform: translate(-50%);
+            transform: translate(-50%);
+            width: 0.3rem;
+        }
+
+
+        .hide{
+            display: none;
+        }
+    </style>
+</head>
+
+<body>
+<main class="main_box">
+    <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/bg1.jpg" class="bg" />
+    <div class="index">
+        <div class="slider">
+            <div id="slider">
+                <div class="slider-img active">香草姑娘  6月13日   11:14 获得 1000书币</div>
+                <div class="slider-img">雨过天琴   6月13日   11: 01获得 年费vip会员</div>
+                {{--<div class="slider-img">培训师钮维娜 5月22日 10:05 获得 500元京东卡</div>
+                <div class="slider-img">香草姑娘 5月22日 6:11 获得1000书币</div>
+                <div class="slider-img">liwenwen 5月22日 14:48 获得1000书币</div>--}}
+                <!-- <ul class="slider-nav-list">
+                  <li class="nav-item active"></li>
+                  <li class="nav-item"></li>
+                  <li class="nav-item"></li>
+                </ul> -->
+            </div>
+        </div>
+        <div class="time">
+            <span>活动倒计时</span>
+            <span id="hour">00</span>
+            <div>:</div>
+            <span id="minute">00</span>
+            <div>:</div>
+            <span id="second">00</span>
+        </div>
+        <div class="zp_out">
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/plate.png" class="zp" />
+        </div>
+        <div class="zz">
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/point.png" />
+            <div class="quantity">
+                <div>剩余</div>
+                <div id="left_count">{{$count}}次</div>
+            </div>
+        </div>
+        <div class="button">
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/button.png" />
+            @if($count >0)
+                <div id="lottery_button">立即抽奖</div>
+            @else
+                <div id="lottery_button">充值后才可抽奖</div>
+            @endif
+
+        </div>
+        <div class="remaining">
+            <div class="rmb">¥</div>
+            <div class="remaining-rmb">奖金池剩余:{{$total}}书币</div>
+        </div>
+        <div class="rule">
+            <div class="rule_title">
+                <div class="rule_title_bt rule_title_active" data-toggle="role">活动规则</div>
+                <div class="rule_title_bt" data-toggle="record">中奖记录</div>
+            </div>
+            <div class="rule_content" >
+                <p>1、书币奖品实时到账;</p>
+                <p>
+                    2、抽到实物奖品用户需先填手机号和身份证信息,客服
+                    确认信息后将会在7个工作日寄出;
+                </p>
+                <p>
+                    3、抽奖机会必须在活动充值页面成功充值后获得,其余
+                    充值页面充值不会获得抽奖机会;
+                </p>
+            </div>
+        </div>
+    </div>
+    <div class="dialog" style="display:none">
+        <div class="content">
+            <div class="winning-content">恭喜您抽中<span id="price">0书币</span></div>
+            <div class="dialog_button"></div>
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/close.png" class="dialog_close" />
+        </div>
+    </div>
+    <div class="wei-dialog" style="display:none">
+        <div class="content">
+            <div class="wei-dialog_button"></div>
+            <img src="https://cdn-novel.iycdm.com/h5/activity-2019-05-30/close.png" class="wei-dialog_close" />
+        </div>
+    </div>
+</main>
+<div class="hide" id="record">
+    @foreach($list as $item)
+        <p>{{$item->created_at}}------------------ {{$item->price}}书币</p>
+    @endforeach
+</div>
+<div class="hide" id="role">
+    <p>1、书币奖品实时到账;</p>
+    <p>
+        2、抽到实物奖品用户需先填手机号和身份证信息,客服
+        确认信息后将会在7个工作日寄出;
+    </p>
+    <p>
+        3、抽奖机会必须在活动充值页面成功充值后获得,其余
+        充值页面充值不会获得抽奖机会;
+    </p>
+</div>
+</body>
+<script>
+    //轮播
+    function carousel() {
+        var interval = 3000; //间隔多久轮换一次
+        var duration = 3000; //轮换动画的持续时间
+        var cur = 0; //当前图片的下标
+        var next = 1; //下一个图片的下标
+
+        //   var li_list = $(".nav-item");
+        var img_list = $(".slider-img");
+        setInterval(function() {
+            sliderImg();
+        }, interval);
+
+        function sliderImg() {
+            //轮换导航
+            // li_list
+            //   .eq(next)
+            //   .addClass("active")
+            //   .siblings()
+            //   .removeClass("active");
+            //轮换图片
+            img_list.eq(cur).animate(
+                    {
+                        left: "-150%"
+                    },
+                    duration,
+                    function() {
+                        $(this).removeClass("active");
+                    }
+            );
+
+            img_list
+                    .eq(next)
+                    .addClass("active")
+                    .css("left", "150%")
+                    .animate({ left: "50%" }, duration);
+
+            cur = next;
+            next++;
+            if (next >= img_list.length) {
+                next = 0;
+            }
+        }
+    }
+    carousel();
+
+    var time_diff = {{$time_diff}}
+    time_diff = parseInt(time_diff);
+    var oHour = document.querySelector('#hour');
+    var oMinute = document.querySelector('#minute');
+    var oSecond = document.querySelector('#second');
+    function times() {
+        time_diff--;
+        day = Math.floor(time_diff/86400);
+        hour = Math.floor((time_diff-day*86400)/3600)+day*24;
+        minute = Math.floor((time_diff - hour * 3600) / 60);
+        second = time_diff - hour * 3600 - minute * 60;
+        oHour.innerHTML = hour<10?hour:hour;
+        oMinute.innerHTML = minute<10?minute:minute;
+        oSecond.innerHTML = second<10?second:second;
+    }
+
+    times();
+
+    var timeInterval = setInterval(function () {
+        if(time_diff<=0){
+            clearInterval(timeInterval);
+        }else{
+            times()
+        }
+    },1000)
+
+    //活动规则点击
+    $(function() {
+        $(".rule_title_bt").click(function(event) {
+            $(this)
+                    .addClass("rule_title_bt")
+                    .addClass("rule_title_active");
+            $(this)
+                    .siblings()
+                    .removeClass("rule_title_active");
+            if($(this).data('toggle') == 'role'){
+                $('.rule_content').html( $('#role').html() );
+            }else{
+                $('.rule_content').html( $('#record').html() );
+            }
+        });
+    });
+
+    var lasttime; //第一次点击时间
+    var rotatesize = 0; //旋转角度
+    var count = {{$count}}
+        count = parseInt(count);
+    //活动规则点击
+    var canClick = true;
+    $(function() {
+        $(".button").click(function(event) {
+            if(count <=0){
+                location.href='/activity/huaweiActivity';
+                return ;
+            }
+            if(time_diff<=0){
+                console.log('time_diff<=0---');
+                return ;
+            }
+            if(!canClick) return ;
+            canClick = false;
+            $.ajax({
+                'url':'/api/activity/huaweiLottery',
+                'type':'post',
+                 'success':function(res){
+                     if (lasttime && Date.parse(new Date()) - lasttime <= 5000) {
+                         //旋转时间5S在样式中修改后再修改间隔时间
+                         console.log("还在旋转");
+                         return;
+                     } else {
+                         lasttime = Date.parse(new Date());
+                         //点击时间赋值
+                         var m = res.data.rotate;
+                         var price = res.data.price;
+                         price = parseInt(price);
+                         //获取旋转角度  逆时针旋转
+                         $(".zp").css({ transform: "rotate(" + m + "deg)" });
+                         //旋转
+                         setTimeout(() => {
+                             if(price >0){
+                               $('#price').html(price+'书币');
+                                document.querySelector(".dialog").style.display = "";
+                             }else{
+                                document.querySelector(".wei-dialog").style.display = "";
+                            }
+                            //旋转完毕后弹窗
+                            console.log('over');
+                            count--;
+                            $('#left_count').html(count+'次');
+                            if(count<=0){
+                                $('#lottery_button').html('充值后才可抽奖');
+                            }
+                         canClick = true;
+                     }, 5000);
+                     }
+                 }
+            })
+
+        });
+    });
+    //获取旋转角度(随机数)
+    function getnub(x, y) {
+        /*//角度需大于x小于y
+        var m = Math.ceil(Math.random() * 10000);
+        var n = rotatesize + m;
+        var angle = n % 360;
+        if (m < 5000 || (angle < x + 10 || angle > y - 10)) {
+            return this.getnub(x, y);
+        } else {
+            rotatesize = n;
+            return n;
+        }*/
+    }
+
+    function resetPoint() {
+        $(".zp").css({transition:"none", transform: "rotate(0deg)" });
+        setTimeout(()=>{
+            $(".zp").css({transition:"transform 5s ease, -webkit-transform 5s ease"});
+        },200);
+    }
+    //奖励弹窗点击关闭
+    $(function() {
+        $(".dialog_button").click(function(event) {
+            document.querySelector(".dialog").style.display = "none";
+            //transition: transform 5s ease, -webkit-transform 5s ease;
+            $('#price').html('0书币');
+            resetPoint()
+        });
+    });
+
+    $(function() {
+        $(".dialog_close").click(function(event) {
+            document.querySelector(".dialog").style.display = "none";
+            $('#price').html('0书币');
+            resetPoint()
+
+        });
+    });
+
+    $(function() {
+        $(".wei-dialog_button").click(function(event) {
+            document.querySelector(".wei-dialog").style.display = "none";
+            resetPoint()
+        });
+    });
+    $(function() {
+        $(".wei-dialog_close").click(function(event) {
+            document.querySelector(".wei-dialog").style.display = "none";
+            resetPoint()
+        });
+    });
+
+</script>
+</html>

文件差异内容过多而无法显示
+ 27 - 4
resources/views/wap/index.blade.php