|
@@ -28,7 +28,7 @@
|
|
|
请在电脑浏览器中打开以上链接进行直播
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div class="shareBtn" @click="copyText">复制分享内容</div>
|
|
|
+ <div class="shareBtn shareText" @click="copyText">复制分享内容</div>
|
|
|
</div>
|
|
|
<div class="codeWrap" v-if="form.shareType == 2">
|
|
|
<div class="shareWrap">
|
|
@@ -46,7 +46,8 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { toPng } from "html-to-image";
|
|
|
-import copy from "copy-to-clipboard";
|
|
|
+// import copy from "copy-to-clipboard";
|
|
|
+import Clipboard from "clipboard";
|
|
|
import preview from "./preview";
|
|
|
import groupChat from "./groupChat";
|
|
|
import { shareGroup } from "../api";
|
|
@@ -63,9 +64,13 @@ export default {
|
|
|
content: "",
|
|
|
url: "",
|
|
|
Teacherurl: "",
|
|
|
+ clipboard:null
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.clipboard = new Clipboard(".shareText",{
|
|
|
+ target:this.copyText()
|
|
|
+ });
|
|
|
this.url =
|
|
|
vaildStudentUrl() + `/#/liveClassTransfer?roomUid=${this.row.roomUid}`;
|
|
|
let domain = window.location.domain;
|
|
@@ -90,12 +95,21 @@ export default {
|
|
|
}\n直播地址:${this.url}\n`;
|
|
|
}
|
|
|
|
|
|
- if (text) {
|
|
|
- copy(text);
|
|
|
- this.$message.success("复制成功");
|
|
|
- this.$emit("close");
|
|
|
- }
|
|
|
+ // if (text) {
|
|
|
+
|
|
|
+ // console.log(clipboard)
|
|
|
+ // clipboard.on("success", function (e) {
|
|
|
+ // console.info("Action:", e.action);
|
|
|
+ // console.info("Text:", e.text);
|
|
|
+ // console.info("Trigger:", e.trigger);
|
|
|
+ // this.$message.success("复制成功");
|
|
|
+ // this.$emit("close");
|
|
|
+ // e.clearSelection();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ return text
|
|
|
},
|
|
|
+
|
|
|
shareImage() {
|
|
|
var node = document.getElementById("preview");
|
|
|
toPng(node)
|