Jacob
4 天以前 bf50dc43351d1a9781a84faf775913e813ea6ecb
pages/zone/index.vue
....@@ -29,6 +29,24 @@
2929 <view class="head_img">
3030 <image :src="info.image"></image>
3131 </view>
32
+ <view v-if="info.zoneType == 8 && info.info" class="rich-content">
33
+ <rich-text :nodes="info.info"></rich-text>
34
+ </view>
35
+ <view v-if="info.zoneType == 8 && info.uploadVideo" class="video-wrap">
36
+ <view v-show="!videoControls" style="width:100%;height:750rpx">
37
+ <video id="zoneVideo" :src='info.uploadVideo' objectFit="contain" controls
38
+ style="width:100%;height:100%" show-center-play-btn="true" show-mute-btn="true" muted="true"
39
+ show-fullscreen-btn="true" auto-pause-if-navigate :custom-cache="false"
40
+ :enable-progress-gesture="true" show-progress="false"
41
+ :poster="info.uploadVideoImg || info.image" @pause="zoneVideoPause"></video>
42
+ </view>
43
+ <view class="video-poster" v-show="videoControls">
44
+ <image class="image" :src="info.uploadVideoImg || info.image"></image>
45
+ </view>
46
+ <view class="video-stop" v-show="videoControls" @tap="bindZoneVideoPlay">
47
+ <image class="image" src="https://ossacmall.bluedeer.com.cn/app/static/images/stop.png"></image>
48
+ </view>
49
+ </view>
3250 <view class="tag-wrap-container" :style="'top:' + (marTop) + 'px;'" v-if="info.zoneType == 7">
3351 <view class="tag-wrap">
3452 <!-- 标签列表 -->
....@@ -599,6 +617,8 @@
599617 isYueyangZone: false,
600618 isOpen: false, // 默认收起,false收起/true展开
601619 currentIndex: -1, // 默认选中第一个【全部】
620
+ videoControls: true, // 专区活动视频是否显示海报+播放按钮
621
+ zoneVideoContext: '', // 活动视频播放上下文
602622 partitionList: [],
603623 partitionProject: {},
604624 tagList: [],
....@@ -838,6 +858,17 @@
838858 }
839859 },
840860 methods: {
861
+ /**
862
+ * 专区活动视频:点击海报播放按钮后播放
863
+ */
864
+ bindZoneVideoPlay() {
865
+ if (!this.zoneVideoContext) {
866
+ this.zoneVideoContext = uni.createVideoContext('zoneVideo', this);
867
+ }
868
+ this.$set(this, 'videoControls', false);
869
+ this.zoneVideoContext.play();
870
+ },
871
+ zoneVideoPause() { },
841872 handleCouponRule() {
842873 this.$refs.personalAndShareCouponRuleRef.show(this.info.ruleContentText)
843874 },
....@@ -1456,6 +1487,7 @@
14561487 console.log('专区详情入参::', params)
14571488 getZoneDetail(that.id, params).then(res => {
14581489 that.info = res.data;
1490
+ //that.info.zoneType=8;
14591491 that.updateZoneShareMenu();
14601492 if (res.data.zoneType == 6) {
14611493 that.setYueyangZone()
....@@ -1871,6 +1903,48 @@
18711903 }
18721904 }
18731905
1906
+.rich-content {
1907
+ padding: 24rpx 30rpx;
1908
+ background-color: #fff;
1909
+}
1910
+
1911
+.video-wrap {
1912
+ position: relative;
1913
+ width: 100%;
1914
+ height: 750rpx;
1915
+ background-color: #000;
1916
+}
1917
+
1918
+.video-wrap .video-poster {
1919
+ position: absolute;
1920
+ top: 0;
1921
+ left: 0;
1922
+ width: 100%;
1923
+ height: 750rpx;
1924
+ z-index: 9;
1925
+}
1926
+
1927
+.video-wrap .video-poster .image {
1928
+ width: 100%;
1929
+ height: 100%;
1930
+}
1931
+
1932
+.video-wrap .video-stop {
1933
+ position: absolute;
1934
+ top: 50%;
1935
+ left: 50%;
1936
+ width: 136rpx;
1937
+ height: 136rpx;
1938
+ margin-top: -68rpx;
1939
+ margin-left: -68rpx;
1940
+ z-index: 9;
1941
+}
1942
+
1943
+.video-wrap .video-stop .image {
1944
+ width: 100%;
1945
+ height: 100%;
1946
+}
1947
+
18741948 .toolbarList {
18751949 width: 750rpx;
18761950 position: -webkit-sticky;