浏览代码

crm year activity and crm index page

zz 5 年之前
父节点
当前提交
409c36d496

+ 63 - 0
app/Http/Controllers/Wap/User/CoflController.php

@@ -217,6 +217,24 @@ class CoflController extends Controller
         return redirect()->to($default_ink);
     }
 
+    public function indexRoot(Request $request){
+        $openid = $request->get('openid');
+        //授权
+        $params = $request->except('_url');
+        if(empty($openid)){
+            $url = url()->current() . '?' . http_build_query($params);
+            $params['redirect_url'] = urlencode($url);
+            $app = new Application($this->auth($params));
+            return $app->oauth->redirect();
+        }
+        list($uid,$distribution_channel_id) = $this->getUsersV2($openid);
+        $link = $this->getLink($distribution_channel_id);
+        $crm = $request->get('crm','index');
+        $this->stats('index',$crm);
+        $this->statsDetail($uid,'index',0);
+        return redirect()->to($link);
+    }
+
     public function recent(Request $request){
         $openid = $request->get('openid');
         //授权
@@ -543,6 +561,30 @@ class CoflController extends Controller
         return redirect()->to($baselink);
     }
 
+    public function yearActivity(Request $request)
+    {
+        $openid = $request->get('openid');
+        //授权
+        $params = $request->except('_url');
+        if(empty($openid)){
+            $url = url()->current() . '?' . http_build_query($params);
+            $params['redirect_url'] = urlencode($url);
+            $app = new Application($this->auth($params));
+            return $app->oauth->redirect();
+        }
+        $user = $this->getUsersV2($openid);
+        if(!$user[0]){
+            $distribution_channel_id = 123;
+        }else{
+            $distribution_channel_id = $user[1];
+        }
+        $crm = $request->get('crm','crm_year_activity');
+        $this->stats('activity',$crm);
+        $this->statsDetail($user[0],'year_activity',0);
+        $baselink  = $this->getLink($distribution_channel_id).'activity/crmy?'.http_build_query($params);
+        return redirect()->to($baselink);
+    }
+
     public function guidePersonalAccount(Request $request,$channel_id){
         $uid = $request->get('uid',0);
 
@@ -623,4 +665,25 @@ class CoflController extends Controller
         //$img = collect($imgs)->random();
         return view($page,['img'=>$img,'name'=>$name]);
     }
+
+    public function r(Request $request,$number){
+        switch ($number){
+            case 1:
+                //首页
+                break;
+            case 2:
+                //阅读器
+                break;
+            case 3:
+                //阅读器
+                break;
+            case 4:
+                //个人中心
+                break;
+            case 5:
+                //最近阅读
+                break;
+            case 6:
+        }
+    }
 }

+ 34 - 0
app/Http/Controllers/Wap/Web/ActivityController.php

@@ -408,5 +408,39 @@ class ActivityController extends BaseController
 
         return view('pay.activity.summerHoliday', ['url' => $url, 'code' => 0]);
     }
+
+    public function crmYearActivity(Request $request)
+    {
+        $default_url = env('H5_SCHEME', 'https') . '://site' . $this->en_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
+
+        $token = $request->input('token');
+        if (!$token) {
+            return redirect()->to($default_url);
+        }
+        $activity_info = ActivityService::getById(11378);
+        if (!$activity_info) {
+            return redirect()->to($default_url);
+        }
+        $crm = $request->get('crm', 'crm_year_activity' );
+
+        $param = [
+            'uid' => $this->uid,
+            'distribution_channel_id' => $this->distribution_channel_id,
+            'product_id' => $activity_info->product_id,
+            'activity_id' => $activity_info->id,
+            'fromtype' => 'crm',
+            'pay_redirect_url' => $default_url . 'person',
+            'limit' => 100,
+            'crm'=>$crm
+        ];
+
+        $url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
+        $is_get = 0;
+        $discount_coupon = DB::table('discount_coupons')->where('uid', $this->uid)->where('activity_id', $activity_info->id)->count();
+        if($discount_coupon){
+            $is_get = 1;
+        }
+        return view('crm.crmYearActivity', ['url' => $url,'is_get'=>$is_get]);
+    }
     
 }

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

@@ -47,8 +47,10 @@ Route::group(['domain'=>env('share_domain'),'namespace'=>'App\Http\Controllers\W
 Route::group(['domain'=>env('FRIEND_LINK_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap'],function(){
     Route::get('friendlink','User\CoflController@index');
     Route::get('fl','User\CoflController@index');
+    Route::get('r/{number}','User\CoflController@r')->where('number','\d+');;
     Route::get('recent','User\CoflController@recent');
     Route::get('person','User\CoflController@person');
+    Route::get('index','User\CoflController@indexRoot');
     Route::get('sign','User\CoflController@sign');
     Route::get('wsign','User\CoflController@sign');
     Route::get('friendactivitylink','User\CoflController@activity');
@@ -58,6 +60,7 @@ Route::group(['domain'=>env('FRIEND_LINK_DOMAIN'),'namespace'=>'App\Http\Control
     Route::get('frocefreethrhcurrency','User\CoflController@freeCurrencyView');
     Route::post('freecurrency','User\CoflController@freeCurrencyPost');
     Route::get('activity','User\CoflController@longActivity');
+    Route::get('activity/year','User\CoflController@yearActivity');
 });
 
 Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap','middleware'=>'EnableCross'],function(){
@@ -262,6 +265,7 @@ Route::group(['domain'=>env('WAP_DOMAIN'),'namespace'=>'App\Http\Controllers\Wap
         Route::get('activity/summerholiday','Web\ActivityController@summerHoliday');
 
         Route::get('activity/ragonBoatActivity','Web\ActivityController@ragonBoatActivity');
+        Route::get('activity/crmy','Web\ActivityController@crmYearActivity');
 
         Route::get('welfare/giving','Web\WelfareController@giving');
 

+ 152 - 0
resources/views/crm/crmYearActivity.blade.php

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <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;
+        }
+
+        body {
+            background: #fef1eb;
+        }
+
+        .main_box {
+            font-size: 0.15rem;
+            position: relative;
+            text-align: center;
+            color: #c94918;
+            line-height: 0.11rem;
+        }
+
+        .main_box p:nth-child(2) {
+            font-weight: bold;
+        }
+
+        .main_box img {
+            width: 100%;
+        }
+
+        .content {
+            margin: 20px 0;
+        }
+
+        .content-img {
+            margin-bottom: 50px;
+        }
+
+        .bottom {
+            position: fixed;
+            bottom: 0px;
+            width: 100%;
+            height: 50px;
+            background-color: white;
+            line-height: 50px;
+            display: flex;
+            justify-content: space-between;
+            font-size: 0.15rem;
+        }
+
+        .bottom div {
+            padding: 0 20px;
+            color: #333;
+            display: flex;
+            position: relative;
+        }
+
+        .bottom div:nth-child(1) {
+            color: #f85530;
+            font-weight: bold;
+            font-size: 0.2rem;
+        }
+
+        .bottom div:nth-child(3) {
+            background-color: #f85530;
+            color: white;
+            font-weight: bold;
+        }
+
+        .sign {
+            color: white;
+            background-color: #f85530;
+            border-radius: 100%;
+            position: absolute;
+            top: 33%;
+            left: 0;
+            line-height: 0.13rem;
+            padding: 0.02rem 0.025rem;
+        }
+
+        .dialog {
+            position: fixed;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            background: rgba(0, 0, 0, 0.6);
+            z-index: 9999;
+        }
+
+        .dialog .dialog_content {
+            position: absolute;
+            top: 35%;
+            left: 50%;
+            transform: translate(-50%);
+            width: 80%;
+        }
+    </style>
+</head>
+
+<body>
+<main class="main_box">
+    <img src="https://cdn-novel.iycdm.com/h5/activity-crm/year-banner.jpg" alt="" />
+    <div class="content">
+        <p>原价365,领券立减80元,仅需285元</p>
+        <p>每天不到0.8元,全年免费看</p>
+    </div>
+    <img src="https://cdn-novel.iycdm.com/h5/activity-crm/year-80.png" alt="" />
+    <img src="https://cdn-novel.iycdm.com/h5/activity-crm/year-footer.jpg" class="content-img" alt="" />
+    <div class="bottom">
+        <div>¥285</div>
+        <div>
+            <span class="sign">√</span>
+            使用
+            <span style="color:#f85530;padding: 0">80</span>
+            元优惠券
+        </div>
+        <div><a href="{{$url}}">立即订购</a></div>
+    </div>
+    <div class="dialog">
+        <img src="https://cdn-novel.iycdm.com/h5/activity-crm/year-alert.png" class="dialog_content" />
+    </div>
+</main>
+</body>
+<script>
+    var is_get = {{$is_get}}
+            is_get = parseInt(is_get);
+    var dialogClose = document.querySelector(".dialog");
+    function dialogBehavior() {
+        dialogClose.addEventListener(
+                "click",
+                function() {
+                    dialogClose.style.display = "none";
+                },
+                false
+        );
+    }
+
+    function init() {
+        dialogBehavior();
+    }
+    if(!is_get){
+        init();
+    }
+</script>
+</html>