dever 5 years ago
parent
commit
069462cc8b
4 changed files with 30 additions and 11 deletions
  1. 9 2
      pages/dream/cate.vue
  2. 1 1
      pages/dream/index.vue
  3. 10 3
      pages/dream/view.vue
  4. 10 5
      pages/dream/view/dream.vue

+ 9 - 2
pages/dream/cate.vue

@@ -22,12 +22,16 @@
 					<view class="product-wrapper">
 						<view class="category-item" :id="'list'+v.id" v-for="(v,k) in fetch.child" :key="k" v-if="fetch.show[v.page_id] == 1">
 							<view class="category-title">{{v.name}}</view>
-							<view class="category-content">
-								<view class="product-item" v-for="(v1,k1) in v.content" :key="k1" @click="go(v1.id,v1.page_id)">
+							<view class="category-content" v-if="v.content">
+								<view class="product-item" v-for="(v1,k1) in v.content" :key="k1" @click="go(k1,v1.page_id)">
 									<image class="product-img" :src="v1.pic"></image>
 									<text class="product-title">{{v1.name}}</text>
 								</view>
 							</view>
+							
+							<view class="category-content" v-if="!v.content">
+								录入中...
+							</view>
 						</view>
 					</view>
 				</view>
@@ -79,6 +83,9 @@
 </script>
 
 <style lang="less">
+	.category-content {
+		margin-bottom: 20rpx;
+	}
 	.category {
 
 		.category-wrapper {

+ 1 - 1
pages/dream/index.vue

@@ -11,7 +11,7 @@
 			
 			<view class="btn">
 				<view class='dots'>
-				  <text :class="swiper.index == k ? 'cur' : ''" v-for="(v, k) in fetch.items" :key="k"></text>
+					<text :class="swiper.index == k ? 'cur' : ''" v-for="(v, k) in fetch.items" :key="k"></text>
 				</view>
 				
 				<view class="grace-flex-center">

+ 10 - 3
pages/dream/view.vue

@@ -1,7 +1,7 @@
 <template>
 	<gracePage :customHeader="false">
 		<view class="container" slot="gBody">
-			<swiper class="swiper" @change="change" :circular="swiper.circular">
+			<swiper class="swiper" @change="change" :circular="swiper.circular" :current="index">
 				<swiper-item v-for="(v, k) in fetch.items"  v-if="v.data" :key="k" >
 					<scroll-view scroll-y="true" scroll-x="true" class="scroll-height">
 						<dream ref="dream" :index="k" :item="v" :control="control" class="item"></dream>
@@ -19,7 +19,9 @@ var graceRichText = require("@/lib/graceUI/jsTools/richText.js");
 export default{
 	data() {
 		return {
-			id : 1,
+			id : 1,
+			page_id : 1,
+			index : 0,
 			swiper : {
 				index : 0,
 				circular : false,
@@ -32,6 +34,8 @@ export default{
 	},
 	onLoad(option) {
 		this.id = option.id;
+		this.page_id = option.page_id;
+		this.index = option.index;
 		this.getData();
 	},
 	// 下拉刷新
@@ -58,13 +62,16 @@ export default{
 						}
 					}
 				}
+			}
+			if (this.swiper.index == this.fetch.items.length - 1) {
+				this.$refs.dream[this.swiper.index].setSelectShow(true);
 			}
 		},
 		view : function() {
 			this.Dever.location('dream/view?id=1');
 		},
 		getData : function() {
-			this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id});
+			this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id});
 		}
 	},
 	components:{

+ 10 - 5
pages/dream/view/dream.vue

@@ -84,9 +84,9 @@
 		<view v-else-if="item.type == 82">
 			<webView :index="index" :item="item.data" :control="control"></webView>
 		</view>
-		<view v-if="show">
-			<view class="page-num comment">评</view>
-			<view class="page-num select" @click="select">选</view>
+		<view>
+			<view class="page-num comment" v-if="comment_show">评</view>
+			<view class="page-num select" v-if="select_show" @click="select">选</view>
 		</view>
 		
 		<view class="page-num" @click="setShow" v-if="index != -1">P{{index+1}}</view>
@@ -125,12 +125,17 @@ export default {
 	},
 	data() {
 		return {
-			show : false,
+			comment_show : false,
+			select_show : false,
 		}
 	},
 	methods:{
 		setShow : function() {
-			this.show = !this.show;
+			this.select_show = !this.comment_show;
+			this.comment_show = !this.comment_show;
+		},
+		setSelectShow : function(state) {
+			this.select_show = state;
 		},
 		select : function() {
 			this.Dever.location('dream/cate?id=' + this.item.info_id + '&parent_page=' + this.item.parent_page_id);