dever 4 years ago
parent
commit
bbabf56257

+ 28 - 7
lib/dever/components/seat.vue

@@ -4,9 +4,11 @@
 			<movable-area :style="'height:'+(seatRow*40+350)+'rpx;width: 100vw;tops:'+(rpxNum*132)+'px'" class="pt-f left-0">
 				<movable-view :style="'width: 100vw;height:'+(seatRow*40+350)+'rpx;'" :inertia="true" :scale="true" :scale-min="0.95"
 				 :scale-max="2" direction="all" @change="onMove" @scale="onScale">
-					<view class="Stage dp-f jc-c ai-c fz-22 color-333" style="margin-top:10rpx">
-						{{fetch.hall}}号厅
-					</view>
+					 <picker @change="openHall" :value="hall_index" :range="hall_data" v-if="hall_state">
+						<view class="Stage dp-f jc-c ai-c fz-22 color-333" style="margin-top:10rpx">
+							{{hall_data[hall_index]}}
+						</view>
+					 </picker>
 					<view style="height: 30rpx;margin-top: 30rpx;margin-bottom: 30rpx;" class="m-0-a mt-48 dp-f jc-c ai-c fz-22 color-999 br-5">{{item.name}}</view>
 					<view v-for="(item,index) in seatArray" :key="index" class="dp-f jc-c mt-20" :style="'width:'+boxWidth+'px;height:'+seatSize+'px'">
 						<view v-for="(seat,col) in item" :key="col" class="dp-ib" :style="'width:'+seatSize+'px;height:'+seatSize+'px'"
@@ -41,7 +43,7 @@
 					</view>
 					<view style="width: 566rpx;height: 90rpx;" class="dp-f jc-c ai-c br-10 fz-34 color-fff" :class="SelectNum>0?'bg-red-1':'bg-unbtn'"
 					 @click="buySeat">
-						<text>{{SelectNum>0?('¥ '+aPrice+' 确认座位'):'选座位'}}</text>
+						<text>{{SelectNum>0?('¥ '+aPrice+' 确认座位'):'选座位后才能观看'}}</text>
 					</view>
 				</view>
 			</view>
@@ -96,6 +98,7 @@
 				fetch : {
 					user : {},
 					hall : 1,
+					play : false,
 				},
 				show : false,
 				api : 'app/community/?l=api.addTips',
@@ -107,11 +110,14 @@
 				play : false,
 				playtime : 0,
 				tipsTimeData : {},
+				hall_state : false,
+				hall_data : [],
+				hall_index : 0,
 			};
 		},
 		computed: {
 			aPrice() {
-				return this.SelectNum - 1 * this.price
+				return (this.SelectNum - 1) * this.price
 			},
 			rpxNum() {
 				return this.boxWidth / 750
@@ -124,6 +130,13 @@
 			if (this.item.title) {
 				this.title = this.item.title;
 			}
+			this.price = parseFloat(this.item.seat_price);
+			var hall = parseInt(this.item.hall_num);
+			this.hall_index = 0;
+			for (var i=0; i<hall ; i++) {
+				this.hall_data[i] = (i+1) + '号厅';
+			}
+			this.hall_state = true;
 			//获取宽度
 			uni.getSystemInfo({
 				success: function(e) {
@@ -136,9 +149,12 @@
 			this.initData(1)
 		},
 		methods: {
+			openHall : function() {
+				
+			},
 			showTips : function(tipsid, id, tips, code, user) {
 				if (!this.play && this.playtime == 0) {
-					this.Dever.alert('播放时才能发送');
+					this.Dever.alert('播放时才能发送消息');
 					return;
 				}
 				this.seat_table = tips;
@@ -150,6 +166,9 @@
 				this.show = false;
 				this.$emit('start');
 			},
+			setDisabled : function() {
+				this.$emit('setDisabled', this.fetch.play);
+			},
 			tips : function(id, content) {
 				var id = '#tips_' + this.type_id + '_' + id;
 				if (this.tipsData[id]) {
@@ -172,6 +191,7 @@
 			initData: function(hall) {
 				var self = this;
 				this.Dever.get(this, 'app/user/?l=api.seat', {code:this.Dever.config.code,noloading:1, content_id : this.type_id, hall : hall}, function(t) {
+					self.setDisabled();
 					let arr = t.seat
 					//数据说明:SeatCode座位编号,RowNum-行号,ColumnNum-纵号,YCoord-Y坐标,XCoord-X坐标,Status-状态
 					let row = 0
@@ -205,7 +225,7 @@
 			},
 			time : function(time) {
 				this.playtime = time;
-				console.info(time);
+				//console.info(time);
 				if (this.tipsTimeData[time]) {
 					this.handle(this.tipsTimeData[time]);
 				}
@@ -358,6 +378,7 @@
 				this.Dever.confirm('确定购买座位吗?公测期间免费~', function() {
 					self.Dever.post('app/user/?l=api.seatSave', {code:self.Dever.config.code, seat:seat, content_id : self.type_id}, function(t) {
 						self.Dever.alert('选座成功,您可以点击头像发布内容~');
+						self.resetSeat();
 						self.initData(self.fetch.hall);
 					});
 				})

+ 8 - 0
lib/dever/components/video.nvue

@@ -88,6 +88,10 @@ export default {
 		control : {
 			type    : Boolean,
 			value	: false
+		},
+		disabled : {
+			type    : Boolean,
+			value	: false
 		},
 		position_item : {
 			type    : Array,
@@ -129,6 +133,10 @@ export default {
 			return 'video_' + this.vid + '_' + this.index;
 		},
 		start : function()  {
+			if (!this.disabled) {
+				this.Dever.alert('无权限播放');
+				return;
+			}
 			this.$emit('update:load', true);
 			this.$emit('play', 'start');
 			this.poster = false;

+ 2 - 2
pages/dream/func/community.vue

@@ -161,8 +161,8 @@ view {
 .margin-bottom {
 	padding-bottom: 0rpx;
 	background-color: #ddd;
-	border: 1px solid #bababa;
-	box-shadow: 2px 2px 10px #bababa;
+	border: 1px solid #f3eeee;
+	box-shadow: 2px 2px 10px #f3eeee;
 }
 .home {
 	padding-top: 120rpx;

+ 7 - 1
pages/dream/view/vodComment.vue

@@ -8,6 +8,7 @@
 			:index="0" 
 			:vid="item.id" 
 			:load.sync="load"
+			:disabled="disabled"
 			@play="play"
 			ref="video"
 			>
@@ -17,7 +18,7 @@
 			<dever-comment ref="comment" :item="item" :type="`content/video_comment`" :type_id="item.id"></dever-comment>
 		</block>
 		<block v-if="item.type == 1">
-			<dever-seat ref="seat" :item="item" :type="`content/video_comment`" :type_id="item.id" @start="start" @stop="stop"></dever-seat>
+			<dever-seat ref="seat" :item="item" :type="`content/video_comment`" :type_id="item.id" @start="start" @stop="stop" @setDisabled="setDisabled"></dever-seat>
 		</block>
 	</view>
 </template>
@@ -42,6 +43,8 @@ export default {
 	data() {
 		return {
 			load : false,
+			//默认不能播放
+			disabled : true,
 		}
 	},
 	mounted() {
@@ -54,6 +57,9 @@ export default {
 		stop : function() {
 			this.$refs.video.stop(true);
 		},
+		setDisabled : function(value) {
+			this.disabled = value;
+		},
 		play : function(state, time) {
 			if (this.item.type == 1) {
 				var method = 'seat';