| | |
| | | <FormItem label="视频"> |
| | | <video style="width: 150px;height: 150px" |
| | | controls |
| | | @loadedmetadata="getVideoDuration" |
| | | :poster="uploadVideoForm.showCoverUrl" |
| | | :autoplay="false" |
| | | id="remoteVideo" :src="uploadVideoForm.showVideoUrl" |
| | |
| | | @on-selection-change="showSelect" |
| | | > |
| | | <template slot-scope="{ row, index }" slot="typeList"> |
| | | <div v-for="(tag, index) in row.typeList" :key="'tag' + index" style="margin-top: 5px"> |
| | | <Tag color="red">{{ tag.typeName }}</Tag> |
| | | <div style="display: flex;flex-wrap: wrap"> |
| | | <div v-for="(tag, index) in row.typeList" :key="'tag' + index" style="margin-top: 5px"> |
| | | <Tag color="red">{{ tag.typeName }}</Tag> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | <template slot-scope="{ row, index }" slot="videoFileKey"> |
| | | <div class="play-text" @click="playVideo(row.videoFileKey, row.title)">点击播放</div> |
| | |
| | | <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> |
| | | |
| | | </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 |
| | | :current="searchForm.pageNumber" |
| | |
| | | ></Page> |
| | | </Row> |
| | | </Card> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import COS from 'cos-js-sdk-v5'; |
| | | import {getFileKey} from "@/utils/file.js"; |
| | | import {getKitchenTypeAllList} from "@/api/kitchen"; |
| | | import vueQr from "vue-qr"; |
| | | |
| | | export default { |
| | | name: "VideoList", |
| | | components: {Editor}, |
| | | components: {Editor,"vue-qr": vueQr}, |
| | | data() { |
| | | return { |
| | | showGeneralQrCode:false, |
| | | codeUrl: this.QRcodeBaseUrl+ '/scanpage/cook', |
| | | QRCodeUrl:'', |
| | | |
| | | videoDownForm: { |
| | | id: '', |
| | | reason: '' |
| | |
| | | checkKitchenType: [ |
| | | { |
| | | required: true, |
| | | message: '请选择厨神标签', |
| | | message: '请选择厨神标签且不能超过5个', |
| | | trigger: 'blur', |
| | | validator: (rule, value, callback) => { |
| | | console.log('验证值:-------------->', value, '类型:', typeof value); |
| | |
| | | { |
| | | title: "视频分类", |
| | | key: "typeList", |
| | | width: 180, |
| | | width: 310, |
| | | slot: "typeList", |
| | | }, |
| | | { |
| | |
| | | slot: "action", |
| | | align: "center", |
| | | width: 200, |
| | | fixed: "right", |
| | | }, |
| | | ], |
| | | data: [], // 表单数据 |
| | |
| | | this.getTypes('') |
| | | }, |
| | | methods: { |
| | | closeGeneralQrCode(){ |
| | | this.showGeneralQrCode = false; |
| | | }, |
| | | |
| | | generalQrCode(row){ |
| | | console.log(row) |
| | | this.QRCodeUrl = ''; |
| | | this.showGeneralQrCode = true |
| | | console.log('-------------------->',row); |
| | | //shareType可能会是动态的,会加判断视频来源 |
| | | |
| | | this.QRCodeUrl = this.codeUrl + '?shareType=cook' + '&videoId='+ row.id + '&source=' + 'system'; |
| | | //TODO 根据视频信息中的 ,作者id获得用户 判断 来源 ,用户作者的uniid为null则是系统上传,不为空则是用户上传 |
| | | console.log(this.QRCodeUrl) |
| | | // console.log(this.QRCodeUrl) |
| | | }, |
| | | |
| | | // 秒转x分x秒 |
| | | formatSeconds(seconds) { |
| | | if (isNaN(seconds) || seconds < 0) return '0秒'; |
| | |
| | | this.$set(this.uploadVideoForm, 'showCoverUrl', ''); |
| | | this.$set(this.uploadVideoForm, 'temp', new Date().getTime()); |
| | | }, |
| | | calculateVideoFit(width, height) { |
| | | const videoRatio = width / height; |
| | | // 规则2:竖屏视频(如9:16) |
| | | if (videoRatio < 0.8) return 'cover'; |
| | | return 'contain'; |
| | | }, |
| | | //重新上传视频 |
| | | clearVideo() { |
| | | this.clearCoverImage(); |
| | |
| | | this.$set(this.uploadVideoForm, 'temp', new Date().getTime()); |
| | | console.log(this.uploadVideoForm) |
| | | }, |
| | | 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); |
| | | }, |
| | | // 视频上架 |
| | | videoUp(row) { |
| | | this.$Modal.confirm({ |