heyujie
2021-06-07 8f8155aa4c83f7c2577ac123add550766b6a7ce3
pages/detail/detail.vue
@@ -2,8 +2,8 @@
   <view class="content">
      <uni-nav-bar left-icon="back" left-text="返回" @clickLeft="goBack" title="详情" statusBar="true"></uni-nav-bar>
      <view class="video-box">
         <video id="myVideo" :src=" 'http://192.168.20.10:7009'        +'/httpImage/' +videoUrl"></video>
      <view class="video-box" v-show="showVideo">
         <video id="myVideo" :src=" 'http://'+ getResourceUrl() +'/httpImage/' +videoUrl"></video>
      </view>
      <view class="desc-box">
         <view class="first">
@@ -21,11 +21,10 @@
            来自:{{curInfo.pos}}
         </view>
      </view>
      <!-- <image src="../../static/pic3.jpg" mode=""></image> -->
      <button type="default" @tap="showImg">查看大图</button>
      <imagePopper :show="showImgPopper.show" :imgSrc="showImgPopper.imgSrc" @hideImgPopper="hideImgPopper">
      </imagePopper>
      <view class="tui-actionsheet-mask" :class="[showImgPopper.show?'tui-mask-show':'']" @tap="handleClickMask">
      <!-- <imagePopper :show="showImgPopper.show" :imgSrc="showImgPopper.imgSrc" @hideImgPopper="hideImgPopper">
      </imagePopper> -->
      <view class="tui-actionsheet-mask" :class="[showImgPopper.show?'tui-mask-show':'']" @tap="handleClickCancel">
         <image :src="showImgPopper.imgSrc" mode=""></image>
      </view>
   </view>
@@ -45,7 +44,8 @@
               imgSrc: ""
            },
            curInfo: {},
            videoUrl: ""
            videoUrl: "",
            showVideo:true
         }
      },
      onBackPress(e) {
@@ -53,17 +53,16 @@
         uni.navigateTo({
            url: '/pages/index/index'
         })
         // return true
      },
      mounted() {
         this.curInfo = getApp().globalData.curPageDetail
         uni.request({
            url: "http://192.168.20.10:9000/video/" + this.curInfo.id,
            url: "http://" + getApp().globalData.requestVideoUrl+ "/video/" + this.curInfo.id,
            success: (res) => {
               console.log('request success', res.data.data.videoUrl);
               this.videoUrl = res.data.data.videoUrl;
            }
         })
         })
      },
      methods: {
         goBack() {
@@ -72,17 +71,16 @@
            })
         },
         showImg() {
            this.showVideo=false
            this.showImgPopper.show = true;
            this.showImgPopper.imgSrc = 'http://192.168.20.10:7009' + '/httpImage/' + this.curInfo.imgUrl
            this.showImgPopper.imgSrc = 'http://' + this.getResourceUrl() + '/httpImage/' + this.curInfo.imgUrl
         },
         hideImgPopper() {
            this.showImgPopper.show = false;
         },
         handleClickMask() {
            this.handleClickCancel();
         getResourceUrl(){
            return getApp().globalData.resourseUrl
         },
         handleClickCancel() {
            this.showImgPopper.show = false;
            this.showVideo=true
         }
      }
   }
@@ -92,7 +90,6 @@
   uni-video {
      width: 100%;
      height: 290px;
      /* height: -webkit-fill-available; */
      display: inline-block;
      line-height: 0;
      overflow: hidden;
@@ -174,13 +171,13 @@
      visibility: hidden;
      uni-image {
         width: 340px;
         height: 240px;
         width: 100%;
         // height: 240px;
         display: inline-block;
         overflow: hidden;
         position: absolute;
         top: 45%;
         left: 8%;
         top: 35%;
         // left: 8%;
         z-index: 999999999;
      }
   }