dever 5 năm trước cách đây
mục cha
commit
7a9fc3ba90

+ 11 - 3
App.vue

@@ -21,12 +21,20 @@ export default {
 /* #endif */
 /* #ifdef APP-PLUS-NVUE */
 @import './lib/graceUI/graceWeex.css';
-.grace-icons {
-	font-family: graceIconfont; 
-}
 /* #endif */
 @import './lib/dever/dever.css';
 page{background-color: #ECEEF7;}
+.grace-icons {
+	font-family: graceIconfont; 
+}
+image {
+	will-change: transform;
+	height: auto;
+}
+video {
+	will-change: transform;
+	position: relative;
+}
 /* 重写showModal样式 */
 uni-modal .uni-modal__hd {padding:30rpx 0;}
 uni-modal .uni-modal__title {font-size: 28rpx;color: #666666;}

+ 27 - 27
pages/dream/view/pos.vue → lib/dever/components/position.vue

@@ -1,30 +1,30 @@
-<template name="pos">
+<template name="position">
 	<view>
-		<block v-for="(v, k) in item.text">
-			<view :class="['abs-tag', position[v.text-1]]" v-if="v.name">
-				<view v-for="(v1, k1) in v.name_array">
+		<block v-for="(v, k) in item" :key="k">
+			<view :class="['position-tag', position[v.text-1]]" v-if="v.name">
+				<view v-for="(v1, k1) in v.name_array" :key="k1">
 					<text v-bind:style="{backgroundColor:(v.bgcolor || 'transparent'),color:v.color,fontSize:v.size+'px'}" v-if="v1">{{v1}}</text>
 				</view>
 			</view>
 		</block>
-		<view class="btn-save-img" :data-url="down" @click="download" v-if="item.is_button == 1"></view>
+		<view class="position-save" :data-url="down" @click="download" v-if="button == 1"></view>
 	</view>
 </template>
 
 <script>
 export default {
-	name: "pic",
+	name: "position",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		button : {
+			type : String,
+			value : null
 		},
 		down : {
 			type : String,
 			value : null,
 		},
 		item : {
-			type    : Object,
+			type    : Array,
 			value	: null
 		},
 	},
@@ -45,14 +45,14 @@ export default {
 						uni.saveImageToPhotosAlbum({
 							filePath: res.tempFilePath,
 							success: function() {
-								self.alert('保存成功');
+								self.Dever.alert('保存成功');
 							},
 							fail: function() {
-								self.alert('保存失败,请稍后重试');
+								self.Dever.alert('保存失败,请稍后重试');
 							}
 						});
 					} else {
-						self.alert('下载失败');
+						self.Dever.alert('下载失败');
 					}
 				}
 			});
@@ -62,17 +62,17 @@ export default {
 </script>
 
 <style>
-.abs-tag {
+.position-tag {
   position: fixed;
   color: #fff;
   display: flex;
   flex-direction: column;
 }
-.abs-tag view{
+.position-tag view{
   line-height: 1em;
   overflow: hidden;
 }
-.abs-tag text {
+.position-tag text {
   background-color: #000;
   margin-bottom: 10rpx;
   font-size: 28rpx;
@@ -80,62 +80,62 @@ export default {
   padding: 0 2rpx;
 }
 
-.abs-tag.tl {
+.position-tag.tl {
   top: 88rpx;
   left: 30rpx;
 }
 
-.abs-tag.tr {
+.position-tag.tr {
   top: 88rpx;
   right: 30rpx;
   text-align: right;
 }
 
-.abs-tag.tc {
+.position-tag.tc {
   top: 88rpx;
   left: 50%;
   transform: translate(-50%, 0);
   text-align: center;
 }
 
-.abs-tag.cl {
+.position-tag.cl {
   top: 50%;
   transform: translate(0, -50%);
   left: 30rpx;
 }
 
-.abs-tag.cc {
+.position-tag.cc {
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
 }
 
-.abs-tag.cr {
+.position-tag.cr {
   top: 50%;
   transform: translate(0, -50%);
   right: 30rpx;
   text-align: right;
 }
 
-.abs-tag.bl {
+.position-tag.bl {
   bottom: 125rpx;
   left: 30rpx;
 }
 
-.abs-tag.br {
+.position-tag.br {
   bottom: 125rpx;
   right: 30rpx;
   text-align: right;
 }
 
-.abs-tag.bc {
+.position-tag.bc {
   bottom: 125rpx;
   left: 50%;
   transform: translate(-50%, 0);
   text-align: center;
 }
 
-.btn-save-img {
+.position-save {
   position: absolute;
   bottom: 30rpx;
   left: 135rpx;
@@ -143,7 +143,7 @@ export default {
   position: fixed;
   left: 30rpx;
   bottom: 30rpx;
-  background: url(@/static/icon/ico-download.png) no-repeat;
+  background: url(@/static/icon/position-save.png) no-repeat;
   background-size: 80rpx 80rpx;
   width: 80rpx;
   height: 80rpx;

+ 39 - 14
lib/dever/components/video.nvue

@@ -5,10 +5,10 @@
 				:src="src"
 				preload
 				autoplay
-				:muted="!play"
+				:muted="muted"
 				:show-play-btn="true"
 				:show-center-play-btn="false"
-				:controls="false"
+				:controls="control"
 				:loop="true"
 				:id="id()"
 				:objectFit="objectFit"
@@ -24,16 +24,16 @@
 			</video>
 		</view>
 		<view class="control" @click="open">
-			<cover-image v-if="poster" class="poster" :src="pic">
+			<cover-image v-if="poster && pic" class="poster" :src="pic">
 			</cover-image>
 			
 			<cover-image
-			class="ico-video-play" v-if="!play"></cover-image>
+			class="ico-video-play" v-if="!playButton"></cover-image>
 			
-			<pos :item="item" :down="src" v-if="item"></pos>
+			<position :item="position_item" :down="src" :button="position_save" v-if="position_item"></position>
 			
 			<cover-view class="cover-view-right" v-if="showInfo">
-				<cover-image :src="item[0].pic"
+				<cover-image :src="pic"
 				 class="avater img" 
 				 @click.stop="tapAvater"></cover-image>
 				
@@ -61,14 +61,10 @@
 </template>
 
 <script>
-import pos from "@/pages/dream/view/pos.vue";
+import position from "@/lib/dever/components/position.vue";
 export default {
 	name: "dever-video",
 	props: {
-		item : {
-			type    : Object,
-			value	: null
-		},
 		src : {
 			type    : String,
 			value	: null
@@ -85,11 +81,29 @@ export default {
 			type    : String,
 			value	: null
 		},
+		auto : {
+			type    : Boolean,
+			value	: false
+		},
+		control : {
+			type    : Boolean,
+			value	: false
+		},
+		position_item : {
+			type    : Array,
+			value	: null
+		},
+		position_save : {
+			type    : String,
+			value	: null
+		},
 	},
 	data() {
 		return {
 			objectFit : 'fill',
 			play : false,
+			playButton : false,
+			muted : true,
 			poster : true,
 			video : false,
 			showInfo : false,
@@ -97,6 +111,9 @@ export default {
 	},
 	mounted() {
 		this.video = uni.createVideoContext(this.id(), this);
+		if (this.auto) {
+			this.start();
+		}
 	},
 	methods:{
 		//获取video_id
@@ -106,19 +123,27 @@ export default {
 		start : function()  {
 			this.poster = false;
 			this.video.play();
-			this.video.currentTime = 0 + '';
+			this.video.currentTime = 1 + '';
 			this.play = true;
+			this.playButton = true;
+			this.muted = false;
 		},
 		stop : function(state) {
 			var self = this;
 			//this.poster = true;
 			if (state) {
-				self.video.pause();
+				if (this.play) {
+					self.video.pause();
+				}
+				this.playButton = false;
 			} else {
+				/*
 				setTimeout(function() {
 					self.video.pause();
 				}, 1000);
+				*/
 			}
+			this.muted = true;
 			this.play = false;
 		},
 		open : function()  {
@@ -130,7 +155,7 @@ export default {
 		},
 	},
 	components:{
-		pos
+		position
 	}
 }
 </script>

+ 28 - 23
lib/dever/index.js

@@ -1064,29 +1064,34 @@ var dever = {
 				res.downloadUrl = res.iosUrl;
 			}
 			self.data('dever_update_link', res.downloadUrl);
-			if (plus.runtime.versionCode < res.versionCode) {
-				//强制更新
-				var txt = '正在为您下载更新,下载完成将重启应用';
-				if (res.forceUpdate == true) {
-					self.down(res, res.downloadUrl, txt, type);
-				} else if(call) {
-					call(res, txt, type);
-				} else {
-					uni.showModal({
-					    title: '发现新版本',
-					    content: '有新版本可用 (版本号:' + res.versionName + '),请问您是否更新?',
-					    success: (t) => {
-					        if (t.confirm) {
-								if (path) {
-									self.location(path);
-								} else {
-									self.down(res, res.downloadUrl, txt, type);
-								}
-					        }
-					    }
-					})
-				}
-			}
+			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
+				var version = widgetInfo.versionCode;
+				var state = false;
+				state = widgetInfo.versionCode < res.versionCode;
+				if (state) {
+					//强制更新
+					var txt = '正在为您下载更新,下载完成将重启应用';
+					if (res.forceUpdate == true) {
+						self.down(res, res.downloadUrl, txt, type);
+					} else if(call) {
+						call(res, txt, type);
+					} else {
+						uni.showModal({
+							title: '发现新版本',
+							content: '有新版本可用 (版本号:' + res.versionName + '),请问您是否更新?',
+							success: (t) => {
+								if (t.confirm) {
+									if (path) {
+										self.location(path);
+									} else {
+										self.down(res, res.downloadUrl, txt, type);
+									}
+								}
+							}
+						})
+					}
+				}
+			});
 		});
 	},
 	uploadCall : function(config, type, packgePath) {

+ 2 - 2
pages/dream/index.vue

@@ -2,7 +2,7 @@
 	<gracePage :customHeader="false">
 		<view class="container" slot="gBody">
 			<swiper class="swiper" @change="change" :circular="swiper.circular">
-				<swiper-item v-for="(v, k) in fetch.items">
+				<swiper-item v-for="(v, k) in fetch.items" :key="k">
 					<view class="default">
 						<image :src="v.pic" mode="widthFix"></image>
 					</view>
@@ -11,7 +11,7 @@
 			
 			<view class="btn">
 				<view class='dots'>
-				  <text :class="swiper.index == k ? 'cur' : ''" v-for="(v, k) in fetch.items"></text>
+				  <text :class="swiper.index == k ? 'cur' : ''" v-for="(v, k) in fetch.items" :key="k"></text>
 				</view>
 				
 				<view class="grace-flex-center">

+ 18 - 22
pages/dream/videoPlay.vue

@@ -1,21 +1,18 @@
 <template>
-	<view>
-		<video
-			:src="video" 
-			preload 
-			autoplay 
-			show-play-btn="false"
-			controls="false"
-			loop="true"
-			ref="video_url"
-			play-btn-position="center"
-			class="video"
-			:posters="pic">
-		</video>
+	<view>
+		<dever-video
+		:src="video" 
+		:auto="true"
+		:index="0" 
+		:vid="1" 
+		ref="video"
+		>
+		</dever-video>
 	</view>
 </template>
 
-<script>
+<script>
+import deverVideo from '@/lib/dever/components/video.nvue';
 export default{
 	data() {
 		return {
@@ -25,20 +22,19 @@ export default{
 	},
 	onLoad() {
 		this.video = this.Dever.data('video');
-		this.pic = this.Dever.data('pic');
+		this.pic = this.Dever.data('pic');
+		
+		this.$refs.video.start();
 	},
 	methods:{
 		
 	},
+	components:{
+		deverVideo
+	}
 }
 </script>
 
 <style>
-video{
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  top: 0;
-  left: 0;
-}
+
 </style>

+ 9 - 33
pages/dream/view.vue

@@ -2,10 +2,9 @@
 	<gracePage :customHeader="false">
 		<view class="container" slot="gBody">
 			<swiper class="swiper" @change="change" :circular="swiper.circular">
-				<swiper-item v-for="(v, k) in fetch.items" v-if="v.data">
+				<swiper-item v-for="(v, k) in fetch.items"  :key="k" v-if="v.data">
 					<scroll-view scroll-y="true" scroll-x="true" class="scroll-height">
-						<dream :item="v" :config="config" class="item"></dream>
-						<view class="page-num" v-if="swiper.index != -1">P{{swiper.index+1}}</view>
+						<dream ref="dream" :index="k" :item="v" :control="control" class="item"></dream>
 					</scroll-view>
 				</swiper-item>
 			</swiper>
@@ -28,12 +27,7 @@ export default{
 			fetch: {
 				items : []
 			},
-			config : {
-				//记录当前第几页
-				page : 1,
-				//记录哪个页面需要停止
-				stop : [],
-			}
+			control : {}
 		}
 	},
 	onLoad(option) {
@@ -51,14 +45,13 @@ export default{
 	methods:{
 		change : function(e) {
 			this.swiper.index = e.detail.current;
-			this.config.page = this.swiper.index + 1;
-			if (this.config.stop.length) {
+			if (this.control) {
 				var i = 0;
-				for (i in this.config.stop) {
-					if (this.config.page == i) {
-						this.config.stop[i].start();
+				for (i in this.control) {
+					if (this.swiper.index == i && this.control[i].load) {
+						this.control[i].start();
 					} else {
-						this.config.stop[i].stop();
+						this.control[i].stop();
 					}
 				}
 			}
@@ -96,22 +89,5 @@ swiper-item image{
 }
 .scroll-height {
 	height:100%;
-}
-
-.page-num {
-  position: fixed;
-  right: 30rpx;
-  bottom: 30rpx;
-  width: 80rpx;
-  height: 80rpx;
-  background-color: rgba(0, 0, 0, 0.75);
-  border-radius: 80rpx;
-  color: #fff;
-  font-size: 30rpx;
-  line-height: 80rpx;
-  text-align: center;
-  z-index: 200;
-}
-
-
+}
 </style>

+ 94 - 62
pages/dream/view/dream.vue

@@ -1,61 +1,65 @@
-<template name="dream">
-	<!--文章-->
-	<view v-if="item.type == 1">
-		<news :item="item.data" :config="config"></news>
-	</view>
-	<!--普通图片-->
-	<view v-else-if="item.type == 10">
-		<pic :item="item.data" :config="config"></pic>
-	</view>
-	<!--多张图片-->
-	<view v-else-if="item.type == 11">
-		<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
-			<swiper-item v-for="(v, k) in item.data">
-				<pic :item="v" :config="config"></pic>
-			</swiper-item>
-		</swiper>
-	</view>
-	
-	<!--四宫格图片-->
-	<view v-else-if="item.type == 12">
-		<picGrid :item="item.data" :config="config"></picGrid>
-	</view>
-	
-	<!--多张四宫格图片-->
-	<view v-else-if="item.type == 13">
-		<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
-			<swiper-item v-for="(v, k) in item.data">
-				<picGrid :item="v" :config="config"></picGrid>
-			</swiper-item>
-		</swiper>
-	</view>
-	
-	
-	<!--视频-->
-	<view v-else-if="item.type == 20">
-		<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
-			<swiper-item v-for="(v, k) in item.data">
-				<vod :item="v" :config="config"></vod>
-			</swiper-item>
-		</swiper>
-	</view>
-	<!--短视频-->
-	<view v-else-if="item.type == 21">
-		<vodShort :item="item.data" :config="config"></vodShort>
-	</view>
-	<!--留言视频-->
-	<view v-else-if="item.type == 22">
-		<vodComment :item="item.data" :config="config"></vodComment>
-	</view>
-	
-	<!--单个链接-->
-	<view v-else-if="item.type == 80">
-		<linkView :item="item.data" :config="config"></linkView>
-	</view>
-	
-	<!--单页面-->
-	<view v-else-if="item.type == 82">
-		<webView :item="item.data" :config="config"></webView>
+<template name="dream">
+	<view class="dream">
+		<!--文章-->
+		<view v-if="item.type == 1">
+			<news :index="index" :item="item.data" :control="control"></></news>
+		</view>
+		<!--普通图片-->
+		<view v-else-if="item.type == 10">
+			<pic :index="index" :item="item.data" :control="control"></></pic>
+		</view>
+		<!--多张图片-->
+		<view v-else-if="item.type == 11">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+				<swiper-item v-for="(v, k) in item.data" :key="k">
+					<pic :index="index" :item="v" :control="control"></pic>
+				</swiper-item>
+			</swiper>
+		</view>
+		
+		<!--四宫格图片-->
+		<view v-else-if="item.type == 12">
+			<picGrid :index="index" :item="item.data" :control="control"></></picGrid>
+		</view>
+		
+		<!--多张四宫格图片-->
+		<view v-else-if="item.type == 13">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+				<swiper-item v-for="(v, k) in item.data" :key="k">
+					<picGrid :index="index" :item="v" :control="control"></picGrid>
+				</swiper-item>
+			</swiper>
+			
+		</view>
+		
+		
+		<!--视频-->
+		<view v-else-if="item.type == 20">
+			<swiper class="swiper" autoplay="false" vertical="true" interval="990000">
+				<swiper-item v-for="(v, k) in item.data" :key="k">
+					<vod :index="index" :item="v" :control="control"></vod>
+				</swiper-item>
+			</swiper>
+		</view>
+		<!--短视频-->
+		<view v-else-if="item.type == 21">
+			<vodShort :index="index" :item="item.data" :control="control"></vodShort>
+		</view>
+		<!--留言视频-->
+		<view v-else-if="item.type == 22">
+			<vodComment :index="index" :item="item.data" :control="control"></></vodComment>
+		</view>
+		
+		<!--单个链接-->
+		<view v-else-if="item.type == 80">
+			<linkView :index="index" :item="item.data" :control="control"></></linkView>
+		</view>
+		
+		<!--单页面-->
+		<view v-else-if="item.type == 82">
+			<webView :index="index" :item="item.data" :control="control"></></webView>
+		</view>
+		<view class="page-num" v-if="index != -1">P{{index+1}}</view>
 	</view>
 </template>
 
@@ -71,13 +75,17 @@ import webView from "@/pages/dream/view/webView.vue";
 export default {
 	name: "dream",
 	props: {
-		config : {
+		control : {
 			type : Object,
 			value : null
 		},
 		item : {
 			type    : Object,
 			value	: null
+		},
+		index : {
+			type    : Number,
+			value	: null
 		},
 	},
 	methods:{
@@ -89,12 +97,36 @@ export default {
 }
 </script>
 
-<style>
+<style>
+.dream {
+	width: 100vw;
+	height: 100vh;	
+	position: relative;
+	top: 0;
+	left: 0;
+	z-index: 1;
+}
 .swiper{
 	width: 100vw;
 	height: 100vh;	
-	position: fixed;
+	position: relative;
 	top: 0;
-	left: 0;
+	left: 0;
+	z-index: 1;
 }
+.page-num {
+  position: fixed;
+  right: 30rpx;
+  bottom: 30rpx;
+  width: 80rpx;
+  height: 80rpx;
+  background-color: rgba(0, 0, 0, 0.75);
+  border-radius: 80rpx;
+  color: #fff;
+  font-size: 30rpx;
+  line-height: 80rpx;
+  text-align: center;
+  z-index: 2000;
+}
+
 </style>

+ 8 - 5
pages/dream/view/linkView.vue

@@ -8,9 +8,9 @@
 export default {
 	name: "linkView",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Object,
@@ -18,8 +18,11 @@ export default {
 		},
 	},
 	methods:{
-		stopFun : function() {
-			return false;
+		start : function() {
+			
+		},
+		stop : function() {
+			
 		}
 	},
 }

+ 12 - 3
pages/dream/view/news.vue

@@ -31,14 +31,23 @@
 export default {
 	name: "news",
 	props: {
-		graceSkeleton : true,
+		graceSkeleton : true,
+		control : {
+			type : Object,
+			value : null
+		},
 		item : {
 			type    : Object,
 			value	: null
 		},
 	},
-	methods:{
-		stopFun : function(){return false;}
+	methods:{
+		start : function() {
+			
+		},
+		stop : function() {
+			
+		}
 	},
 }
 </script>

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

@@ -1,18 +1,18 @@
 <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-'+item.type]"></image>
-		<pos :item="item" :down="item.pic"></pos>
+		<position :item="item.text" :down="item.pic" :button="item.is_button"></position>
 	</view>
 </template>
 
 <script>
-import pos from "@/pages/dream/view/pos.vue";
+import position from "@/lib/dever/components/position.vue";
 export default {
 	name: "pic",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Object,
@@ -23,7 +23,7 @@ export default {
 		
 	},
 	components:{
-		pos
+		position
 	}
 }
 </script>

+ 4 - 4
pages/dream/view/picGrid.vue

@@ -1,6 +1,6 @@
 <template name="picGrid">
 	<view class="pics4-view">
-		<image v-for="(v, k) in item.text" v-if="v.pic" class="default slide-image" :src="v.pic" mode="aspectFill" @click="Dever.viewPic(item.text, v.pic, 'pic')"></image>
+		<image v-for="(v, k) in item.text" :key="k" v-if="v.pic" class="default slide-image" :src="v.pic" mode="aspectFill" @click="Dever.viewPic(item.text, v.pic, 'pic')"></image>
 	</view>
 </template>
 
@@ -8,9 +8,9 @@
 export default {
 	name: "picGrid",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Object,

+ 3 - 3
pages/dream/view/vod.vue

@@ -9,9 +9,9 @@
 export default {
 	name: "vod",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Object,

+ 72 - 126
pages/dream/view/vodComment.vue

@@ -1,35 +1,15 @@
 <template name="vodComment">
 	<view>
-		<view class="topbanner">
-			<video
-				:src="item.video"
-				preload="auto"
-				:show-play-btn="true"
-				:show-center-play-btn="false"
-				:controls="true"
-				:loop="true"
-				:id="id()"
-				objectFit="fill"
-				:enable-progress-gesture="false"
-				@click="start"
-				ref="video_url"
-				play-btn-position="center"
-				class="video"
-				:x5-playsinline="true"
-				:playsinline="true"
-				:webkit-playsinline="true"
-				:x5-video-can-play-with-audio="true"
-				x5-video-orientation="portraint"
-				>
-			</video>
-			
-			<cover-image v-if="show_play_poster" class="poster" :src="item.pic">
-			</cover-image>
-			
-			<cover-image
-			class="ico-video-play" v-if="show_play" 
-			@tap="start"></cover-image>
-			
+		<view class="topbanner">
+			<dever-video
+			:src="item.video" 
+			:pic="item.pic" 
+			:control="true"
+			:index="0" 
+			:vid="item.id" 
+			ref="video"
+			>
+			</dever-video>
 		</view>
 		<view class='msgs-tabs'>
 		  <view class='tit'>{{item.name}}</view>
@@ -37,7 +17,7 @@
 		</view>
 		<view class="living">
 		  <scroll-view class="message" bindscrolltolower="loadmore" scroll-y>
-			<view class="item" v-for="(v, k) in comments">
+			<view class="item" v-for="(v, k) in comments" :key="k">
 			  <view class="user">
 				<image :src="v.avatar"></image>
 			  </view>
@@ -55,28 +35,31 @@
 	</view>
 </template>
 
-<script>
+<script>
+import deverVideo from '@/lib/dever/components/video.nvue';
 export default {
 	name: "vodComment",
 	props: {
-		config : {
-			type : Object,
-			value : null
-		},
-		item : {
-			type    : Object,
-			value	: null
+		control : {
+			type : Object,
+			value : null
+		},
+		item : {
+			type    : Object,
+			value	: null
+		},
+		index : {
+			type    : Number,
+			value	: null
 		},
 	},
 	data() {
-		return {
-			show_play_poster: true,
-			show_play: true,
-			videoCtx : false,
+		return {
+			load : false,
 			comments: [
 				{
 					id : 1,
-					avatar : 'https://yt3.ggpht.com/a/AATXAJxSSAfjWzxQAkDei2MeIPc6WqlO2FG-gOSpZQ=s48-c-k-c0xffffffff-no-rj-mo',
+					avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
 					username : 'rabin',
 					content : 'dfdfdfdf',
 				},
@@ -89,61 +72,64 @@ export default {
 			],
 			loading: false
 		}
+	},
+	mounted() {
+		this.control[this.index] = this;
 	},
 	methods:{
-		id : function()  {
-			var video_id = this.item.id;
-			return 'video_comment_' + video_id;
-		},
-		start : function()  {
-			this.show_play_poster = false;
-			this.config.stop[this.config.page] = this;
-			var id = this.id();
-			if (!this.videoCtx) {
-				this.videoCtx = uni.createVideoContext(id, this);
-			}
-			if (this.show_play) {
-				this.videoCtx.play();
-				this.show_play = false;
-			} else {
-				this.videoCtx.pause();
-				this.show_play = true;
-			}
+		start : function() {
+			this.$refs.video.start();
+		},
+		stop : function() {
+			this.load = true;
+			this.$refs.video.stop(true);
 		},
-		stop : function()  {
-			var id = this.id();
-			if (!this.videoCtx) {
-				this.videoCtx = uni.createVideoContext(id, this);
-			}
-			this.videoCtx.pause();
-			this.show_play = true;
-		},
-	},
+	},
+	components:{
+		deverVideo
+	}
 }
 </script>
 
 <style>
 .topbanner{
   position: relative;
-}
-.topbanner image,.topbanner video,.topbanner live-player{
   width: 750rpx;
   height: 422rpx;
   display: block;
-}
-.topbanner .media-cover,.topbanner video,.topbanner live-player{
-  height: 422rpx;
 }
+.msgs-tabs{
+  line-height: 88rpx;
+  display: flex;
+  height: 88rpx;
+  justify-content: space-between;
+  box-sizing: border-box;
+  padding: 0 30rpx;
+  border-bottom: 1rpx solid #ccc;
+}
+.msgs-tabs .tit{
+  font-size: 30rpx;
+  color: #000;
+  display: flex;
+  align-items: center;
+  overflow: hidden;
+}
+.msgs-tabs .tit:before{
+  content: '';
+  display: inline-block;
+  width: 6rpx;
+  height: 30rpx;
+  margin-right: 10rpx;
+  background-color: #000;
+}
+.msgs-tabs .num{
+  font-size: 22rpx;
+  color: #999;
+  overflow: hidden;
+}
+
 .living{
   margin-bottom:50rpx;
-}
-.poster{
-	background-size: cover;
-	position: absolute;
-	left: 0;
-	top: 0;
-	width: 100%;
-	height: 100%;
 }
 .living-tabs{
   display: flex;
@@ -189,6 +175,7 @@ export default {
 }
 .living .message .item{
   padding:20rpx 35rpx 0;
+  display: flex;
 }
 .living .message .user{
   float:left;
@@ -230,35 +217,6 @@ export default {
   border: solid 14rpx transparent;
   border-top: solid 12rpx #eee;
   content:'';
-}
-.msgs-tabs{
-  line-height: 88rpx;
-  display: flex;
-  height: 88rpx;
-  justify-content: space-between;
-  box-sizing: border-box;
-  padding: 0 30rpx;
-  border-bottom: 1rpx solid #ccc;
-}
-.msgs-tabs .tit{
-  font-size: 30rpx;
-  color: #000;
-  display: flex;
-  align-items: center;
-  overflow: hidden;
-}
-.msgs-tabs .tit:before{
-  content: '';
-  display: inline-block;
-  width: 6rpx;
-  height: 30rpx;
-  margin-right: 10rpx;
-  background-color: #000;
-}
-.msgs-tabs .num{
-  font-size: 22rpx;
-  color: #999;
-  overflow: hidden;
 }
 .living{
   margin-bottom: 0;
@@ -267,9 +225,6 @@ export default {
   padding:0;
   border-bottom: 0;
 }
-.console{
-  z-index: 5;
-}
 .living .message{
   position: absolute;
   bottom: 120rpx;
@@ -278,16 +233,6 @@ export default {
   width: 100%;
   height: auto;
 }
-.ico-video-play{
-  background: url(@/static/icon/ico-video-play.png) no-repeat;
-  background-size: cover;
-  width: 100rpx;
-  height: 100rpx;
-  position: absolute;
-  left: 50%;
-  top: 50%;
-  transform: translate3d(-50%,-50%,0);
-}
 
 .console{
   position: fixed;
@@ -296,6 +241,7 @@ export default {
   width:750rpx;
   height:98rpx;
   padding-top:20rpx;
+  z-index: 5;
 }
 .console .comment{
   position: absolute;

+ 36 - 13
pages/dream/view/vodShort.vue

@@ -1,18 +1,17 @@
 <template name="vodShort">
 	<view>
 		<swiper class="swiper" autoplay="false" vertical="true" interval="990000" @change="changeVod">
-			<swiper-item v-for="(v, k) in item">
-				
+			<swiper-item v-for="(v, k) in item" :key="k">
 				<dever-video
-				:item="v"
 				:src="v.video" 
 				:pic="v.pic" 
 				:index="k" 
 				:vid="v.id" 
+				:position_item="v.text"
+				:position_save="v.is_button"
 				ref="video"
 				>
-				</dever-video>
-				
+				</dever-video>
 			</swiper-item>
 		</swiper>
 	</view>
@@ -24,17 +23,22 @@ var play = true;
 export default {
 	name: "vodShort",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Array,
 			value	: null
+		},
+		index : {
+			type    : Number,
+			value	: null
 		},
 	},
 	data() {
-		return {
+		return {
+			load : false,
 			current_index: 0,
 		};
 	},
@@ -42,21 +46,40 @@ export default {
 		
 	},
 	mounted() {
-		this.config.stop[this.config.page] = this;
+		this.control[this.index] = this;
 	},
 	methods:{
 		start : function() {
 			this.$refs.video[this.current_index].start();
 		},
 		stop : function() {
-			this.$refs.video[this.current_index].stop(false);
+			this.load = true;
+			this.$refs.video[this.current_index].stop(true);
 		},
 		changeVod : function(e)  {
 			var self = this;
 			self.$nextTick(()=>{
-				self.stop();
-				self.current_index = e.detail.current;
+				this.$refs.video[this.current_index].stop(false);
+				this.current_index = e.detail.current;
 				self.start();
+				/*
+				for (var i in this.$refs.video) {
+					if (i == e.detail.current) {
+						this.current_index = i;
+						this.$refs.video[i].start();
+					} else {
+						var j = i - e.detail.current;
+						if (j < 0) {
+							j = j*-1;
+						}
+						if (j > 20) {
+							this.$refs.video[i].stop(true);
+						} else {
+							this.$refs.video[i].stop(false);
+						}
+					}
+				}
+				*/
 			});
 					
 		},

+ 3 - 3
pages/dream/view/webView.vue

@@ -10,9 +10,9 @@
 export default {
 	name: "webView",
 	props: {
-		config : {
-			type : Object,
-			value : null
+		control : {
+			type : Object,
+			value : null
 		},
 		item : {
 			type    : Object,

+ 0 - 0
static/icon/ico-download.png → static/icon/position-save.png