|
|
@@ -6,6 +6,24 @@
|
|
|
width="600px"
|
|
|
v-loading="loading"
|
|
|
>
|
|
|
+ <!-- 分享课程链接 -->
|
|
|
+ <div class="sc_formUrl" v-show="form.shareUrl" style="margin-top: 20px;">
|
|
|
+ <!-- <div class="shareTitle">{{ lang.ssShareCourse }}</div> -->
|
|
|
+ <el-input
|
|
|
+ class="sc_fu_input"
|
|
|
+ style="color: black"
|
|
|
+ disabled
|
|
|
+ v-model="form.shareUrl"
|
|
|
+ >
|
|
|
+ <template slot="append"
|
|
|
+ ><div class="sc_fu_copyBtn" @click.stop="copyShareUrl()">
|
|
|
+ {{ lang.ssShareCourseLink }}
|
|
|
+ </div></template
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <div class="qrcodeTip">{{ lang.ssShareCourseTip }}</div>
|
|
|
+ </div>
|
|
|
+ <!-- 授课识别码 -->
|
|
|
<div class="sc_formUrl" v-show="form.url">
|
|
|
<el-input
|
|
|
class="sc_fu_input"
|
|
|
@@ -15,7 +33,7 @@
|
|
|
>
|
|
|
<template slot="append"
|
|
|
><div class="sc_fu_copyBtn" @click.stop="copyUrl()">
|
|
|
- {{ lang.ssCopyLink }}
|
|
|
+ {{ lang.ssTeachCode }}
|
|
|
</div></template
|
|
|
>
|
|
|
</el-input>
|
|
|
@@ -49,7 +67,8 @@ export default {
|
|
|
setDownload: false,
|
|
|
download: "1",
|
|
|
setHomeWorkUpload: false,
|
|
|
- url: ""
|
|
|
+ url: "",
|
|
|
+ shareUrl: ""
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
@@ -71,11 +90,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- open(courseId, classid) {
|
|
|
- this.courseId = courseId;
|
|
|
- this.classId = classid;
|
|
|
- this.dialogVisible = true;
|
|
|
- this.form.id = "default";
|
|
|
+ getBaseUrl() {
|
|
|
let url = 'https://beta.cloud.cocorobo.cn'
|
|
|
if (window.location.href.includes('beta')) {
|
|
|
url = url
|
|
|
@@ -89,7 +104,16 @@ export default {
|
|
|
else if (this.lang.lang === 'com') {
|
|
|
url = 'https://cloud.cocorobo.com'
|
|
|
}
|
|
|
+ return url;
|
|
|
+ },
|
|
|
+ open(courseId, classid) {
|
|
|
+ this.courseId = courseId;
|
|
|
+ this.classId = classid;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.form.id = "default";
|
|
|
+ const url = this.getBaseUrl();
|
|
|
this.form.url = `${url}/admin.html?orgnum=${this.courseId}&classcode=${this.classId}`;
|
|
|
+ this.form.shareUrl = `${url}/#/?shareCourseId=${this.$route.query.courseId}&type=prievew`;
|
|
|
// this.getData();
|
|
|
},
|
|
|
close() {
|
|
|
@@ -104,7 +128,8 @@ export default {
|
|
|
setDownload: false,
|
|
|
download: "1",
|
|
|
setHomeWorkUpload: false,
|
|
|
- url: ""
|
|
|
+ url: "",
|
|
|
+ shareUrl: ""
|
|
|
};
|
|
|
this.date = "0";
|
|
|
this.courseId = "";
|
|
|
@@ -224,6 +249,26 @@ export default {
|
|
|
return this.$message.success(this.lang.ssCopySuccess);
|
|
|
}
|
|
|
},
|
|
|
+ copyShareUrl() {
|
|
|
+ if (!this.form.shareUrl) {
|
|
|
+ return this.$message.info(this.lang.ssPleaseGenerateLink);
|
|
|
+ }
|
|
|
+ const input = document.createElement("input");
|
|
|
+ input.style.opacity = 0;
|
|
|
+ input.style.position = "fixed";
|
|
|
+ input.style.left = "-100%";
|
|
|
+ input.style.top = "-100%";
|
|
|
+ input.value = this.form.shareUrl;
|
|
|
+ document.body.appendChild(input);
|
|
|
+ input.select();
|
|
|
+ const success = document.execCommand("copy");
|
|
|
+ document.body.removeChild(input);
|
|
|
+ if (!success) {
|
|
|
+ return this.$message.error(this.lang.ssCopyFailed);
|
|
|
+ } else {
|
|
|
+ return this.$message.success(this.lang.ssCopySuccess);
|
|
|
+ }
|
|
|
+ },
|
|
|
getData() {
|
|
|
this.form = {
|
|
|
setPassword: false,
|
|
|
@@ -235,7 +280,8 @@ export default {
|
|
|
setDownload: false,
|
|
|
download: "1",
|
|
|
setHomeWorkUpload: false,
|
|
|
- url: ""
|
|
|
+ url: "",
|
|
|
+ shareUrl: ""
|
|
|
};
|
|
|
this.date = "0";
|
|
|
this.loading = true;
|
|
|
@@ -250,6 +296,9 @@ export default {
|
|
|
if (_data.length == 0) return (this.loading = false);
|
|
|
let jsonData = _data[0].json ? JSON.parse(_data[0].json) : {};
|
|
|
this.form = { ...jsonData, id: _data[0].id };
|
|
|
+ // 后端 jsonData 不含 shareUrl,重新生成
|
|
|
+ const baseUrl = this.getBaseUrl();
|
|
|
+ this.form.shareUrl = `${baseUrl}/#/?shareCourseId=${this.courseId}&type=prievew`;
|
|
|
this.date = _data[0].time;
|
|
|
this.loading = false;
|
|
|
})
|
|
|
@@ -363,4 +412,11 @@ export default {
|
|
|
color: #7f7f7f;
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
+
|
|
|
+.shareTitle{
|
|
|
+ font-size: 14px;
|
|
|
+ color: #303133;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
</style>
|