فهرست منبع

添加分类描述

赵启卫 2 سال پیش
والد
کامیت
8789b5a61e
2فایلهای تغییر یافته به همراه41 افزوده شده و 2 حذف شده
  1. 12 1
      application/wap/controller/Special.php
  2. 29 1
      application/wap/view/first/special/special_cate.html

+ 12 - 1
application/wap/controller/Special.php

xqd
@@ -1413,9 +1413,20 @@ class Special extends AuthController
     {
         $uid = $this->uid;
         $is_member = isset($this->userInfo['level']) ? $this->userInfo['level'] : 0;
-        return JsonService::successful(SpecialModel::getSpecialList(compact('grade_id', 'subject_id', 'search', 'page', 'limit', 'type', 'uid', 'is_member')));
+        $list = SpecialModel::getSpecialList(compact('grade_id', 'subject_id', 'search', 'page', 'limit', 'type', 'uid', 'is_member'));
+        return JsonService::successful($list);
     }
 
+    /**
+     * 获取分类详情
+     */
+
+     public function get_subject_info($id = 0){
+        $biginfo = SpecialSubject::get($id);
+        if ($biginfo) $biginfo = $biginfo->toArray();
+        return JsonService::successful($biginfo);
+     }
+
     /**
      * 获取拼团专题
      */

+ 29 - 1
application/wap/view/first/special/special_cate.html

xqd xqd xqd xqd
@@ -53,6 +53,9 @@
             </div>
         </div>
     </div>
+    <div v-if="bigcateco" style="margin: 10px; color: gray;">
+        {{bigcateco}}
+    </div>
     <div v-if="subjectCate.length" id="nav" class="nav">
         <div class="scroller">
             <ul>
@@ -65,6 +68,9 @@
             </ul>
         </div>
     </div>
+    <div v-if="bigcateco" style="margin: 10px; color: gray;">
+        {{smailcatco}}
+    </div>
     <div class="public_list_big goodList">
         <a v-for="item in updateSpecialList" :key="item.id" :href="item.is_light ? '{:url('special/single_details')}?id=' + item.id : '{:url('special/details')}?id=' + item.id" class="item acea-row">
             <div class="pictrue">
@@ -118,7 +124,9 @@
                 limit: 10,
                 loading: false,
                 loadend: false,
-                count: 0
+                count: 0,
+                bigcateco:'',
+                smailcatco:'',
             },
             computed: {
                 updateSpecialList: function () {
@@ -254,8 +262,28 @@
                     if (this.loading || this.loadend) {
                         return;
                     };
+                    that = this;
                     this.loading = true;
                     this.loadTitle = '';
+                    /* 获取主分类*/
+                    if (this.gradeId) {
+                        axios.get("{:url('special/get_subject_info')}", {
+                            params: {
+                                id: that.gradeId,
+                            }
+                        }).then(function(res) {
+                            that.bigcateco = res.data.data.co;
+                        });
+                    }
+                    if (this.subjectId) {
+                        axios.get("{:url('special/get_subject_info')}", {
+                            params: {
+                                id: that.subjectId,
+                            }
+                        }).then(function(res) {
+                            that.smailcatco = res.data.data.co;
+                        });
+                    }
                     axios.get("{:url('special/get_special_list')}", {
                         params: {
                             grade_id: this.gradeId,