zxl
7 小时以前 9797e46619f64bddb78d4b4eaa03d53069ac2ba4
manager/src/views/health/HealthVideoList.vue
@@ -112,6 +112,7 @@
              <FormItem label="视频">
                <video style="width: 150px;height: 150px"
                       controls
                       @loadedmetadata="getVideoDuration"
                       :poster="uploadVideoForm.showCoverUrl"
                       :autoplay="false"
                       id="remoteVideo" :src="uploadVideoForm.showVideoUrl"
@@ -284,8 +285,30 @@
          <Button type="success" size="small" style="margin-right: 5px"
                  @click="deleteHealthVideo(row)">删除
          </Button>
          <Button type="error" size="small" style="margin-right: 5px" v-if="row.status === '1'"
                  @click="generalQrCode(row)">生成二维码
          </Button>
        </template>
      </Table>
      <Modal
        v-model="showGeneralQrCode"
        title="二维码"
        width="800"
        :mask-closable="false"
      >
        <vue-qr
          :text="QRCodeUrl"
          :margin="0"
          colorDark="#000"
          colorLight="#fff"
          :size="150"
        ></vue-qr>
        <div slot="footer">
          <Button type="text" @click="closeGeneralQrCode">关闭</Button>
          <!--          <Button type="primary" @click="generalQrCode">确认</Button>-->
        </div>
      </Modal>
      <Row type="flex" justify="end" class="mt_10">
        <Page
@@ -313,12 +336,18 @@
import Editor from '@/components/editor/index.vue'
import COS from 'cos-js-sdk-v5';
import {getFileKey} from "@/utils/file.js";
import vueQr from "vue-qr";
export default {
  name: "VideoList",
  components: {Editor},
  components: {Editor,"vue-qr": vueQr},
  data() {
    return {
      showGeneralQrCode:false,
      codeUrl: this.QRcodeBaseUrl+ '/scanpage/health',
      QRCodeUrl:'',
      videoDownForm: {
        id: '',
        reason: ''
@@ -520,6 +549,22 @@
    this.getTags('')
  },
  methods: {
    closeGeneralQrCode(){
      this.showGeneralQrCode = false;
    },
    generalQrCode(row){
      this.QRCodeUrl = '';
      this.showGeneralQrCode = true;
      console.log('-------------------->',row);
      //shareType可能会是动态的,会加判断视频来源
      this.QRCodeUrl = this.codeUrl + '?shareType=health' + '&videoId='+ row.id  + '&source=' + 'system';
      //TODO 根据视频信息中的 ,作者id获得用户 判断 来源 ,用户作者的uniid为null则是系统上传,不为空则是用户上传;
      // console.log(this.QRCodeUrl)
    },
    // 秒转x分x秒
    formatSeconds(seconds) {
      if (isNaN(seconds) || seconds < 0) return '0秒';
@@ -661,6 +706,12 @@
      this.detail = {}
      this.auditingShow = false
    },
    calculateVideoFit(width, height) {
      const videoRatio = width / height;
      // 规则2:竖屏视频(如9:16)
      if (videoRatio < 0.8) return 'cover';
      return 'contain';
    },
    // 打开审核弹窗
    openAuditing(row) {
      this.auditingShow = true
@@ -671,6 +722,17 @@
        this.auditingLoading = false
      })
    },
    getVideoDuration(e){
      const duration = this.$refs.healthVideoInfo.duration;
      const videoWidth = this.$refs.healthVideoInfo.videoWidth;
      const videoHeight = this.$refs.healthVideoInfo.videoHeight;
      // 根据宽高比选择视频填充模式
     const fitType = this.calculateVideoFit(videoWidth, videoHeight)
      this.uploadVideoForm.videoFit = fitType
      console.log('------视频信息3------------>', videoWidth,videoHeight,fitType)
      this.uploadVideoForm.videoDuration = Math.floor(duration);
    },
    // 打开编辑弹窗
    deleteHealthVideo(row) {
      console.log('删除测试', row)