dever 5 年之前
父節點
當前提交
79ee7f9c5d
共有 3 個文件被更改,包括 23 次插入14 次删除
  1. 9 3
      pages/dream/view.vue
  2. 4 0
      pages/dream/view/cate.vue
  3. 10 11
      pages/dream/view/community.vue

+ 9 - 3
pages/dream/view.vue

@@ -10,13 +10,13 @@
 			</swiper>
 			<graceDrawer :show="cate_drawer.show" :zIndex="cate_drawer.index" padding="cate_drawer.padding" :top="cate_drawer.top" direction="left" width="100%" v-on:closeDrawer="closeCate">
 				<view slot="links">
-					<cate ref="cate" @goIndex="goIndex" :index="index" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id"></cate>
+					<cate ref="cate" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id"></cate>
 				</view>
 			</graceDrawer>
 			
 			<graceDrawer :show="community_drawer.show" :zIndex="community_drawer.index" padding="community_drawer.padding" :top="community_drawer.top" direction="right" width="100%" v-on:closeDrawer="closeCommunity">
 				<view slot="links">
-					<community ref="community" @goIndex="goIndex" :index="index" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id"></community>
+					<community ref="community" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id"></community>
 				</view>
 			</graceDrawer>
 		</view>
@@ -32,7 +32,8 @@ export default{
 		return {
 			id : 1,
 			page_id : 1,
-			index : 0,
+			index : 0,
+			content_id : 0,
 			swiper : {
 				index : 0,
 				circular : false,
@@ -109,17 +110,22 @@ export default{
 			dream.setShow();
 		},
 		cate : function() {
+			this.getContentId();
 			this.cate_drawer.show = !this.cate_drawer.show;
 		},
 		closeCate : function() {
 			this.cate_drawer.show = false;
 		},
 		community : function() {
+			this.getContentId();
 			this.community_drawer.show = !this.community_drawer.show;
 		},
 		closeCommunity : function() {
 			this.community_drawer.show = false;
 		},
+		getContentId : function() {
+			this.content_id = this.fetch.items[this.swiper.index].id;
+		}
 		
 	},
 	components:{

+ 4 - 0
pages/dream/view/cate.vue

@@ -50,6 +50,10 @@ export default {
 			type : String,
 			value : null
 		},
+		content_id : {
+			type : String,
+			value : null
+		},
 		page_id : {
 			type : String,
 			value : null

+ 10 - 11
pages/dream/view/community.vue

@@ -3,7 +3,7 @@
 		<view class="card-bottom">
 			<!-- 顶部分页栏 -->
 			<view class="top-tab">
-				<view :class="['tab-item flex-center', activeTab == index ? 'active' : '']" @tap="handleTab(index)" v-for="(item, index) in tabList" :key="index">{{ item.title }}</view>
+				<view :class="['tab-item flex-center', activeTab == k ? 'active' : '']" @tap="handleTab(k)" v-for="(v, k) in fetch.cate" :key="k">{{ v.name }}</view>
 			</view>
 			<view class="scroll-wrapper">
 				<!-- 漂流瓶 -->
@@ -34,6 +34,10 @@ export default {
 			type : String,
 			value : null
 		},
+		content_id : {
+			type : String,
+			value : null
+		},
 		page_id : {
 			type : String,
 			value : null
@@ -46,17 +50,12 @@ export default {
 	},
 	data() {
 		return {
+			fetch : {
+				cate : [],
+				info : [],
+			},
 			startNum: 0,
 			activeTab: 0,
-			// tab的名称
-			tabList: [
-				{
-					title: '漂流瓶'
-				},
-				{
-					title: '聚集岛'
-				}
-			],
 			cardList: [{
 						id: 2,
 						time: '06-17',
@@ -138,7 +137,7 @@ export default {
 			})
 		},
 		getData : function(type) {
-			
+			this.Dever.get(this, 'app/community/?l=api.category', {info_id:this.info_id, page_id:this.page_id, content_id:this.content_id});
 		},
 		//下拉刷新
 		onPulldownReresh : function() {