1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view>
-
-
- <view class="diy_video acea-row row-center-wrapper" :style="[boxStyle]">
- <video :src="link" :show-mute-btn="pageGesture" :poster="cover" controls :autoplay="false" loop
- objectFit="cover"></video>
- </view>
-
-
-
- <view class="diy_video acea-row row-center-wrapper" :style="[boxStyle]">
- <iframe :onload="onloadCode" style="width:100%;height:100%;"></iframe>
- </view>
-
- </view>
- </template>
- <script>
-
-
-
-
-
-
-
-
-
- export default {
- name: 'pictureCube',
- props: {
- dataConfig: {
- type: Object,
- default: () => {}
- },
- },
- data() {
- return {
- pageGesture: true,
- onloadCode: ''
- };
- },
- created() {
-
- this.onloadCode =
- `this.contentWindow.document.body.innerHTML = '<video style="width: 100%;height: 100%" objectFit="cover" controls="controls" loop show-mute-btn="${this.pageGesture}" poster="${this.cover}" src="${this.link}"></video>';`
-
- },
- computed: {
-
- cover() {
- return this.dataConfig.cover.url
- },
-
- link() {
- if (this.dataConfig.tabConfig.tabVal === 0) {
- return this.dataConfig.uploadVideo.url
- } else {
- return this.dataConfig.link.val
- }
- },
-
- boxStyle() {
- return {
- borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
- background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
- margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
- ' ' + 0,
- padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + 0 + ' ' + this.dataConfig.downConfig.val *
- 2 + 'rpx'
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .diy_video {
- iframe {
- border: none;
- body {
- margin: 0;
- }
- }
- video {
- width: 100%;
- height: 340rpx;
- border-radius: 14rpx;
- }
- }
- </style>
|