dever 3 years ago
parent
commit
3d2103f585
3 changed files with 33 additions and 10 deletions
  1. 1 1
      pages/dream/view.vue
  2. 24 6
      pages/dream/view/dream.vue
  3. 8 3
      pages/dream/view/pic.vue

+ 1 - 1
pages/dream/view.vue

@@ -88,7 +88,7 @@ export default{
 			show : false,
 			swiper : {
 				index : 0,
-				circular : false,
+				circular : true,
 			},
 			fetch: {
 				items : [],

+ 24 - 6
pages/dream/view/dream.vue

@@ -15,9 +15,9 @@
 		</view>
 		<!--多张图片-->
 		<view v-else-if="item.type == 11">
-			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000" :previous-margin="previous_margin" :next-margin="next_margin" @change="changes" circular="true">
 				<swiper-item v-for="(v, k) in item.data" :key="k">
-					<pic :index="index" :item="v" :control="control" :bottom="bottom"></pic>
+					<pic @setHeight="setHeight" :index="index" :pic_index="k" :item="v" :control="control" :bottom="bottom"></pic>
 				</swiper-item>
 			</swiper>
 		</view>
@@ -132,14 +132,26 @@ export default {
 			type    : Object,
 			value	: null
 		},
-		index : 0
+		index : {
+			type    : Number,
+			value	: 0
+		},
 	},
 	data() {
 		return {
-			
+			next_margin : '0px',
+			previous_margin : '0px',
 		}
 	},
-	methods:{
+	methods:{
+		setHeight : function(index, height) {
+			
+			if (index == 0) {
+				height = height + 20;
+				//this.next_margin = height + 'px';
+			}
+			console.info(index, height, this.next_margin);
+		},
 		getData : function(page) {
 			
 		},
@@ -152,7 +164,13 @@ export default {
 		},
 		handle : function(e) {
 			this.showDrawer(this.button[e.index].key);
-		}
+		},
+		changes : function(e) {
+			return;
+			var i = parseInt(e.detail.current);
+			this.next_margin = i*50;
+			this.next_margin = this.next_margin + 'px';
+		},
 	},
 	components:{
 		cover,news,pic,picGrid,vod,vodComment,vodShort,audioList,audioComment,liveComment,dialogue,linkView,webView,product,moment

+ 8 - 3
pages/dream/view/pic.vue

@@ -1,6 +1,6 @@
 <template name="pic">
 	<view class="cover cover-height">
-		<image @click="Dever.viewPic([item.pic], item.pic)" :src="item.pic" mode="widthFix" :class="['default', 'slide-image', 'slide-image-'+item.type]"  style="height:auto"></image>
+		<image @load="loadImg" @click="Dever.viewPic([item.pic], item.pic)" :src="item.pic" mode="widthFix" :class="['default', 'slide-image', 'slide-image-'+item.type]"  style="height:auto"></image>
 		<dever-position :item="item.text" :down="item.pic" :button="item.is_button"></dever-position>
 	</view>
 </template>
@@ -17,10 +17,15 @@ export default {
 		item : {
 			type    : Object,
 			value	: null
-		},
+		},
+		index : 0,
+		pic_index : 0,
 	},
 	methods:{
-		
+		loadImg : function(e) {
+			console.info(this.pic_index);
+			this.$emit('setHeight', this.pic_index, e.detail.height);
+		}
 	},
 	components:{
 		deverPosition