qiushang 11 months ago
parent
commit
04971446c0
3 changed files with 87 additions and 0 deletions
  1. 20 0
      app/Http/Home/HelpController.php
  2. 66 0
      resources/views/home/http/help2.blade.php
  3. 1 0
      routes/web.php

+ 20 - 0
app/Http/Home/HelpController.php

@@ -38,6 +38,26 @@ class HelpController extends HttpBaseController
         return view('home/http/help', ['data' => $data]);
     }
 
+    public function capture()
+    {
+        $data = [];
+        $categoryList = $this->getNewsCategory();
+        foreach ($categoryList as $row) {
+            $categoryId = $row->id;
+            $productId = $row->product_id;
+            unset($row->id);
+
+            $productInfo = DB::table('product')->select(['id', 'title', 'logo'])->where('id', $productId)->first();
+
+            $data[] = [
+                'product' => $productInfo,
+                'category' => $row,
+                'news' => $this->getNewsList($categoryId)
+            ];
+        }
+        return view('home/http/help2', ['data' => $data]);
+    }
+
     public function category($cid = '')
     {
         $size = 15;

+ 66 - 0
resources/views/home/http/help2.blade.php

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>帮助中心-星优办公软件</title>
+    @include('home.http.common.head')
+</head>
+
+<body>
+    <div class="header">
+        @include('home.http.common.header')
+    </div>
+
+    <!--- 首頁輪播 --->
+    <div class="index-banner">
+        <div class="swiper-container">
+            <div class="swiper-wrapper">
+                <div class="swiper-slide">
+                    <a href="https://xy.xingyousoft.com/soft/XYEbook/XYEbook_XY.exe">
+                        <div class="banner-bg" style="background-image: url('/static/images/ebook-banner.jpg');"></div>
+                    </a>
+                </div>
+            </div>
+            <!-- 如果需要分页器 -->
+            <div class="swiper-pagination"></div>
+        </div>
+    </div>
+
+    <div class="container">
+        <!--- 解决方案 --->
+        <div class="index-about">
+            <div class="width-1200">
+                <div class="index-title">
+                    <div class="name">常见问题-使用技巧</div>
+                </div>
+                @foreach ($data as $item)
+                    @if($item['product'] ->id == 12)
+                    <div class="flex-between qa-item">
+                        <div class="qa-soft flex-start">
+                            <img src="{{ $item['product']->logo }}" class="qa-soft-img" />
+                            <div>
+                                <div class="qa-title">{{ $item['category']->name }}</div>
+                                <a href="{{ '/news/category/' . $item['category']->mid }}">
+                                    <div class="qa-more">查看全部</div>
+                                </a>
+                            </div>
+                        </div>
+                        <div class="qa-list flex-between">
+                            @foreach ($item['news'] as $key => $row)
+                                <div class="question-item overflow">
+                                    <a
+                                        href="{{ '/news/detail/' . $row->mid }}">{{ $key + 1 }}、{{ $row->title }}</a>
+                                </div>
+                            @endforeach
+                        </div>
+                    </div>
+                    @endif
+                @endforeach
+            </div>
+        </div>
+    </div>
+
+    @include('home.http.common.footer')
+</body>
+
+</html>

+ 1 - 0
routes/web.php

@@ -38,6 +38,7 @@ include('common/watermark.php');
 Route::get('/', 'IndexController@index');
 Route::get('/buy', 'BuyController@index');
 Route::get('/help', 'HelpController@index');
+Route::get('/help2', 'HelpController@capture');
 Route::get('/detail', 'HelpController@index');
 Route::get('/about', 'AboutController@index');
 Route::get('/news/category/{cid?}', 'HelpController@category');