| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <popup v-if="show" :key="Math.random()" :zIdx="'1100'">
- <div
- class="ui-message ui-message-confirm"
- :class="{
- dark
- }"
- >
- <div class="ui-message-header">
- <span>{{work_preview}}</span>
- <span @click="$emit('close')">
- <i class="iconfont icon_close"></i>
- </span>
- </div>
- <div class="ui-message-main">
- <iframe :src="ifr" frameborder="0"></iframe>
- </div>
- <div class="ui-message-footer">
- <button
- class="ui-button ui-button-rect"
- :class="{
- deepcancel: dark,
- }"
- @click="$emit('close')"
- >
- {{cancel}}
- </button>
- <button class="ui-button submit ui-button-rect" @click="copy">{{copy_link}}</button>
- <button class="ui-button submit ui-button-rect" @click="openBlank">{{new_blank}}</button>
- </div>
- </div>
- </popup>
- </template>
- <script>
- import Popup from "@/components/shared/popup";
- import {i18n} from "@/lang"
- export default {
- props: {
- show: {
- },
- ifr: {
- },
- name: {
- },
- dark: {
- type: Boolean,
- default: true
- }
- },
- components:{
- Popup,
- },
- data(){
- return {
- copy_link: i18n.t("material.works.copy_link"),
- work_preview: i18n.t("material.works.work_preview"),
- new_blank: i18n.t("material.works.new_blank"),
- cancel: i18n.t("material.works.cancel"),
- }
- },
- methods:{
- copy() {
- var textArea = document.createElement("textarea");
- textArea.style.position = "fixed";
- textArea.style.top = 0;
- textArea.style.left = 0;
- textArea.style.width = "2em";
- textArea.style.height = "2em";
- textArea.style.padding = 0;
- textArea.style.border = "none";
- textArea.style.outline = "none";
- textArea.style.boxShadow = "none";
- textArea.style.background = "transparent";
- textArea.value = new URL(this.ifr, location.href);
- document.body.appendChild(textArea);
- textArea.select();
- try {
- document.execCommand("copy")
- ? this.$msg.success(this.$i18n.t('gather.scene_link_copy_tips'))
- : this.$msg.error(this.$i18n.t('gather.scene_link_copy_failed'))
- } catch (err) {
- this.$msg.error(this.$i18n.t('gather.scene_link_copy_failed'))
- }
- document.body.removeChild(textArea);
- },
- openBlank(){
- window.open(this.ifr,'_blank')
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .ui-message-confirm{
- width: 1250px;
- height: 838px;
- border-radius: 4px;
- .icon_close{
- color: #969799;
- }
- .ui-message-header{
- font-size: 18px;
- margin-bottom: 40px;
- }
- .ui-message-main{
- width: 100%;
- height: 646px;
- margin-bottom: 40px;
- iframe{
- width: 100%;
- height: 100%;
- }
- }
- .ui-message-footer{
- display: flex;
- justify-content: center;
- }
- }
- </style>
|