dever 3 gadi atpakaļ
vecāks
revīzija
527a7e97f6

+ 8 - 0
lib/dever/index.js

@@ -153,6 +153,14 @@ var http = {
 						self.setToken('');
 						dever.location('index/index', 'go');
 						reject(response.data)
+					} else if (response.data.code == '-2') {
+						//跳转到登录页面
+						dever.checkLogin();
+						/*
+						self.setToken('');
+						dever.location('index/index', 'go');
+						reject(response.data)
+						*/
 					} else {
 						reject(response.data)
 					}

+ 4 - 4
pages/dream/func/cate.vue

@@ -24,7 +24,7 @@
 						<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" v-if="v.content">
-								<view class="product-item" v-for="(v1,k1) in v.content" :key="k1" @click="go(k1,v1.page_id,fetch.num)">
+								<view class="product-item" v-for="(v1,k1) in v.content" :key="k1" @click="go(k1,v.page_id, v1.page_id,fetch.num)">
 									<image class="product-img" :src="v1.pic"></image>
 									<text class="product-title">{{v1.name}}</text>
 								</view>
@@ -89,15 +89,15 @@ export default {
 				}
 			}
 		}, 
-		go : function(index, page_id, num) {
-			index = parseInt(index) + parseInt(num);
+		go : function(index, parent_page_id, page_id, num) {
 			if (this.page_id != page_id) {
 				var self = this;
-				this.Dever.post('app/collection/?l=api.getCodeByPage', {code:this.Dever.config.code,page_id:page_id,index:index}, function(t) {
+				this.Dever.post('app/collection/?l=api.getCodeByPage', {code:this.Dever.config.code,parent_page_id:parent_page_id,page_id:page_id,index:index}, function(t) {
 					self.Dever.location('dream/view?code=' + t.code + '&name=' + self.Dever.config.name);
 				})
 				//this.Dever.location('dream/view?id=' + this.info_id + '&page_id='+page_id+'&index=' + index);
 			} else {
+				index = parseInt(index) + parseInt(num);
 				this.$emit('goIndex', index);
 			}
 		},

+ 2 - 1
pages/dream/view.vue

@@ -167,7 +167,8 @@ export default{
 		//this.Dever.checkLogin();
 		this.login = this.Dever.getToken();
 		this.Dever.config.name = option.name;
-		this.Dever.config.code = option.code;
+		this.Dever.config.code = option.code;
+		this.Dever.config.system = uni.getSystemInfoSync();
 		this.getData();
 	},
 	// 重新加载

+ 1 - 1
pages/dream/view/audioList.vue

@@ -44,7 +44,7 @@ export default {
 	data() {
 		return {
 			recycle : true,
-			circular : false,
+			circular : true,
 			load : false,
 			current_index: 0,
 			total : 0,

+ 23 - 15
pages/dream/view/dream.vue

@@ -15,8 +15,8 @@
 		</view>
 		<!--多张图片-->
 		<view v-else-if="item.type == 11">
-			<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">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000" :previous-margin="previous_margin" :next-margin="next_margin" @change="setMargin" circular="true">
+				<swiper-item v-for="(v, k) in item.data" :key="k" style="overflow: unset;">
 					<pic @setHeight="setHeight" :index="index" :pic_index="k" :item="v" :control="control" :bottom="bottom"></pic>
 				</swiper-item>
 			</swiper>
@@ -29,7 +29,7 @@
 		
 		<!--多张四宫格图片-->
 		<view v-else-if="item.type == 13">
-			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000" circular="true">
 				<swiper-item v-for="(v, k) in item.data" :key="k">
 					<picGrid :index="index" :item="v" :control="control" :bottom="bottom"></picGrid>
 				</swiper-item>
@@ -40,7 +40,7 @@
 		
 		<!--视频-->
 		<view v-else-if="item.type == 20">
-			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000" circular="true">
 				<swiper-item v-for="(v, k) in item.data" :key="k">
 					<vod :index="index" :item="v" :control="control" :bottom="bottom"></vod>
 				</swiper-item>
@@ -139,18 +139,20 @@ export default {
 	},
 	data() {
 		return {
+			item_height : {},
 			next_margin : '0px',
 			previous_margin : '0px',
 		}
 	},
+	mounted() {
+		this.item_height[this.index] = [];
+	},
 	methods:{
-		setHeight : function(index, height) {
-			
-			if (index == 0) {
-				height = height + 20;
-				//this.next_margin = height + 'px';
+		setHeight : function(index, height) {
+			this.item_height[this.index][index] = height;
+			if (index == 0) {
+				this.setMargin(false, index);
 			}
-			console.info(index, height, this.next_margin);
 		},
 		getData : function(page) {
 			
@@ -165,11 +167,17 @@ 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';
+		setMargin : function(e, i) {
+			var index = i >= 0 ? i : e.detail.current;
+			if (this.item_height[this.index].length > 0 && this.item_height[this.index][index]) {
+				var height = this.item_height[this.index][index];
+				var windowHeight = this.Dever.config.system.windowHeight;
+				if (windowHeight > height) {
+					height = windowHeight-height-3;
+					this.next_margin = height + 'px';
+					console.info(this.next_margin)
+				}
+			}
 		},
 	},
 	components:{

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

@@ -22,9 +22,9 @@ export default {
 		pic_index : 0,
 	},
 	methods:{
-		loadImg : function(e) {
-			console.info(this.pic_index);
-			this.$emit('setHeight', this.pic_index, e.detail.height);
+		loadImg : function(e) {
+			var height = e.detail.height / (e.detail.width / this.Dever.config.system.windowWidth);
+			this.$emit('setHeight', this.pic_index, height);
 		}
 	},
 	components:{
@@ -36,7 +36,6 @@ export default {
 <style>
 .cover{
   position: relative;
-  overflow: hidden;
   width: 100%;
   height: 100%;
 }

+ 1 - 1
pages/dream/view/vodShort.vue

@@ -1,6 +1,6 @@
 <template name="vodShort">
 	<view>
-		<swiper class="swiper" autoplay="false" vertical="true" interval="990000" @change="changeVod">
+		<swiper class="swiper" autoplay="false" vertical="true" interval="990000" @change="changeVod" circular="true">
 			<swiper-item v-for="(v, k) in item" :key="k">
 				<dever-video
 				:src="v.video"