lilei 2 lat temu
rodzic
commit
1d3cca6cc1
3 zmienionych plików z 58 dodań i 26 usunięć
  1. 1 1
      pages/index/index.vue
  2. 40 6
      pages/videos/detail.vue
  3. 17 19
      pages/videos/index.vue

+ 1 - 1
pages/index/index.vue

@@ -463,7 +463,7 @@
 				}
 				// 视频
 				if(row.activeType == 'VIDEO'){
-					uni.navigateTo({url:"/pagesA/videos/detail?sn="+row.promoActiveSn})
+					uni.navigateTo({url:"/pages/videos/detail?sn="+row.promoActiveSn})
 				}
 				// 链接
 				if(row.activeType == 'LINK'){

+ 40 - 6
pages/videos/detail.vue

@@ -1,22 +1,56 @@
 <template>
-	<view>
-		
+	<view class="content" v-if="detail">
+		<view class="acitve-content">
+			<video autoplay :src="content" style="width: 100%;height: 350px;" controls></video>
+		</view>
+		<view class="titles">{{detail.title}}</view>
 	</view>
 </template>
 
 <script>
+	import { promoTerminalDetail } from '@/api/video.js'
 	export default {
 		data() {
 			return {
-				
+				detail: null,
+				style: {
+					p: ''
+				},
+				promoActiveSn: null
 			}
 		},
+		computed: {
+			content() {
+				return this.detail && this.detail.content 
+			}
+		},
+		onLoad(opts) {
+			this.promoActiveSn = opts.sn
+			this.getDetail()
+		},
 		methods: {
-			
+			getDetail(){
+				promoTerminalDetail({sn:this.promoActiveSn}).then(res => {
+					this.detail = res.data
+					uni.setNavigationBarTitle({
+						title: res.data.name || '活动内容'
+					})
+				})
+			}
 		}
 	}
 </script>
 
-<style>
-
+<style lang="less">
+	.content{
+		.titles{
+			text-align: center;
+			padding: 20rpx;
+			border-top: 1px solid #eee;
+			font-weight: bold;
+		}
+		.acitve-content{
+			padding: 0;
+		}
+	}
 </style>

+ 17 - 19
pages/videos/index.vue

@@ -17,10 +17,10 @@
 								<view class="video-item">
 									<view>
 										<view class="play-btn" v-if="!item.showVideo&&item.contentType == 'VIDEO'">
-											<u-icon size="80" color="#d0d0d0" name="play-circle"></u-icon>
+											<u-icon size="24" color="#fff" name="play-right-fill"></u-icon>
 										</view>
 										<view class="pnums" v-if="!item.showVideo&&item.contentType == 'VIDEO'">
-											<u-icon size="24" color="#fff" name="play-right"></u-icon>
+											<u-icon size="30" color="#fff" name="eye-fill"></u-icon>
 											{{item.viewNum}}
 										</view>
 										<u-image v-if="!item.showVideo" :src="item.imageSet[0]" height="200px" width="100%"></u-image>
@@ -154,14 +154,15 @@
 			},
 			// 详细页
 			viewRow(item){
-				if(item.contentType == 'VIDEO'&&!item.showVideo){
+				if(item.contentType == 'VIDEO' && !item.showVideo){
 					item.showVideo = true
 					videoDetail({id: item.id}).then(res => {
 						if(res.data){
 							item.viewNum = res.data.viewNum
 						}
 					})
-				}else{
+				}
+				if(item.contentType == 'LINK'){
 					openWebView({url:item.content})
 				}
 			},
@@ -216,29 +217,26 @@
 		flex-direction: column;
 		.tab-body{
 			.check-list{
-				height: calc(100vh - 44px);
+				height: calc(100vh - 126px);
 			}
 			.check-order-list{
 				background: #ffffff;
-				padding: 10upx 20upx;
+				padding: 20upx;
 				margin: 25upx;
 				border-radius: 30upx;
 				box-shadow: 1px 1px 3px #EEEEEE;
 				.video-item{
 					> view{
 						&:first-child{
-							padding-top: 20rpx;
 							position: relative;
 							.play-btn{
-								width: 100rpx;
-								height: 100rpx;
-								background: rgba(0,0,0,0.5);
+								width: 40rpx;
+								height: 40rpx;
+								background: rgba(0,0,0,0.35);
 								border-radius: 150rpx;
 								position: absolute;
-								top: 50%;
-								left: 50%;
-								margin-left: -50rpx;
-								margin-top: -50rpx;
+								top: 20rpx;
+								right:30rpx;
 								z-index: 100;
 								display: flex;
 								align-items: center;
@@ -246,11 +244,11 @@
 							}
 							.pnums{
 								position: absolute;
-								width: 100%;
-								left:0;
-								bottom: 0;
-								background: rgba(0,0,0,0.2);
-								padding: 10rpx;
+								left:20rpx;
+								bottom: 20rpx;
+								background: rgba(0,0,0,0.35);
+								padding: 4rpx 10rpx;
+								border-radius: 50rpx;
 								display: flex;
 								align-items: center;
 								color:#fff;