indexPS.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339
  1. <template>
  2. <div class="pptEasyClass">
  3. <div class="pec_main" v-loading="pageLoading">
  4. <!-- 录音转文字 -->
  5. <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="iframeSrcop" ref="iiframe"
  6. v-show="false"></iframe>
  7. <div class="pec_header">
  8. <div class="pec_h_left">
  9. <!-- || tType == 1 -->
  10. <div @click.stop="back" class="backBtn" v-if="screenType != 2">
  11. <img src="../../assets/icon/newIcon/return.svg" alt="" />
  12. </div>
  13. <div @click.stop="gotoCourseManage" class="backBtn" v-if="screenType == 2 && tType == 1">
  14. <img src="../../assets/icon/newIcon/return.svg" alt="" />
  15. </div>
  16. <div v-if="tcid" class="class-info-group">
  17. <span class="class-label">{{ lang.ssClass }}</span>
  18. <span class="class-value class-value2" @click="openSelectClass">
  19. {{ className }}
  20. <svg t="1776672009773" class="xia-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
  21. p-id="4735" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12">
  22. <path
  23. d="M562.5 771c-14.3 14.3-33.7 27.5-52 23.5-18.4 3.1-35.7-11.2-50-23.5L18.8 327.3c-22.4-22.4-22.4-59.2 0-81.6s59.2-22.4 81.6 0L511.5 668l412.1-422.3c22.4-22.4 59.2-22.4 81.6 0s22.4 59.2 0 81.6L562.5 771z"
  24. p-id="4736" fill="currentColor"></path>
  25. </svg>
  26. </span>
  27. </div>
  28. <div v-if="tcid" class="class-info-group">
  29. <span class="class-label" v-if="inviteCode">{{ lang.ssInviteCode }}</span>
  30. <span class="class-value" v-if="inviteCode">{{ inviteCode }}</span>
  31. </div>
  32. <div @click.stop="openShareDialog" class="shareBtn" v-if="tcid && tType == 1">
  33. <img src="../../assets/share.svg" alt="" />
  34. </div>
  35. </div>
  36. <div class="pec_h_center">
  37. <el-tooltip effect="dark" :content="lang.ssRefresh" placement="bottom">
  38. <div class="refresh_icon" @click="refreshCourse">
  39. <img src="../../assets/icon/course/refresh-2.svg" />
  40. </div>
  41. </el-tooltip>
  42. <el-tooltip class="item" effect="dark"
  43. :content="recordedForm.status == 1 ? lang.ssFinishClassRecording : lang.ssBeginClassRecording"
  44. placement="bottom"
  45. v-show="(jArray.includes(oid) || jArray.includes(org)) && courseDetail.userid == userid && tcid">
  46. <div class="pec_h_r_btn_refresh" :class="{ 'recording': recordedForm.status == 1 }"
  47. @click="toggleRecording">
  48. <svg t="1772588344140" viewBox="0 0 1024 1024" p-id="1693" width="200" height="200">
  49. <path
  50. d="M512 1024a512.568889 512.568889 0 0 1-512-512 512.625778 512.625778 0 0 1 512-512 512.568889 512.568889 0 0 1 512 512 512.568889 512.568889 0 0 1-512 512zM512 73.329778c-241.948444 0-438.670222 196.835556-438.670222 438.670222S270.051556 950.670222 512 950.670222s438.670222-196.835556 438.670222-438.670222S753.948444 73.329778 512 73.329778z m0 686.592a245.191111 245.191111 0 1 1 0-490.382222 245.191111 245.191111 0 0 1 0 490.382222z"
  51. p-id="1694"></path>
  52. </svg>
  53. <span>{{ recordedForm.status == 1 ? lang.ssStopRecording2 : lang.ssRecord }}</span>
  54. </div>
  55. </el-tooltip>
  56. <el-tooltip effect="dark" :content="courseDetail.title" placement="bottom">
  57. <div class="pec_h_l_title">
  58. <span>{{ courseDetail.title }}</span>
  59. </div>
  60. </el-tooltip>
  61. <div class="free-browse-switch" v-if="courseDetail.userid == userid">
  62. <el-switch v-model="freeBrowse" :active-value="false" :inactive-value="true" class="custom-switch"
  63. active-color="#03ae2b" inactive-color="#d8d8d8" @change="onFreeBrowseChange"></el-switch>
  64. <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
  65. lang.ssFollowMode }}</span>
  66. </div>
  67. <!-- <div class="free-browse-switch" v-if="courseDetail.userid == userid">
  68. <el-switch v-model="isCan" :active-value="true" :inactive-value="false" class="custom-switch"
  69. active-color="#03ae2b" inactive-color="#d8d8d8" @change="onIsCanChange"></el-switch>
  70. <span class="switch-label" :class="{ active: isCan }">{{ isCan ? lang.ssShowResult : lang.ssHideResult }}</span>
  71. </div> -->
  72. <div class="free-browse-switch" v-if="tType == 2">
  73. <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
  74. lang.ssFollowMode }}</span>
  75. </div>
  76. </div>
  77. <div class="pec_h_right">
  78. <div class="pec_h_r_btnArea">
  79. <!-- openObserveDialog -->
  80. <!-- toggleRecording -->
  81. <div class="pec_h_r_btn_uploadVoiceBtn" @click="uploadVoiceBtn" v-if="courseDetail.userid == userid"
  82. v-show="false">
  83. <span>{{ lang.ssUploadRecordingFile }}</span>
  84. </div>
  85. <div class="pec_h_r_btn_afterClass" @click="afterClass" v-if="courseDetail.userid == userid">
  86. <img src="../../assets/icon/newIcon/afterClass.svg" alt="" />
  87. <span>{{ lang.ssEndClass }}</span>
  88. </div>
  89. <div class="name_box" v-if="tType == 2">
  90. {{ userJson.username }}
  91. </div>
  92. <div class="pec_h_r_btn_afterClass" v-if="tType == 2" @click="afterClass2">
  93. {{ lang.ssExit }}
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="pec_content">
  99. <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read"
  100. webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="no" border="0" :src="iframeSrc"
  101. v-if="showIframe" style="width: 100%; height: 100%; border: none" ref="ppt"></iframe>
  102. </div>
  103. </div>
  104. <!-- 课堂观察弹窗 -->
  105. <el-dialog :visible.sync="showObserveDialog" :close-on-click-modal="false" :close-on-press-escape="false"
  106. :show-close="true" width="90%" top="5vh" class="observe-dialog">
  107. <iframe v-if="showObserveDialog" :src="observeDialogUrl" frameborder="0"
  108. style="width: 100%; height: 85vh; border: none;"></iframe>
  109. </el-dialog>
  110. <selectTeachingClassDialog :courseDetail="courseDetail" :userId="userid" ref="selectTeachingClassDialogRef" @success="selectClassSuccess" @changeClassList="changeClassList"/>
  111. <!-- 消息提示组件 -->
  112. <messageInstruction ref="messageInstructionRef"></messageInstruction>
  113. <!-- 确认提示组件 -->
  114. <confirmInstruction ref="confirmInstructionRef"></confirmInstruction>
  115. <!-- 分享弹窗 -->
  116. <shareDialog ref="shareDialogRef"></shareDialog>
  117. </div>
  118. </template>
  119. <script>
  120. import { myMixin } from '../../mixins/mixin';
  121. import selectTeachingClassDialog from "../dialog/selectTeachingClassDialog2.vue";
  122. import messageInstruction from '../components/messageInstruction.vue';
  123. import confirmInstruction from '../components/confirmInstruction.vue';
  124. import shareDialog from './shareDialog.vue';
  125. export default {
  126. mixins: [myMixin],
  127. components: {
  128. messageInstruction,
  129. confirmInstruction,
  130. selectTeachingClassDialog,
  131. shareDialog
  132. },
  133. data() {
  134. return {
  135. id: this.$route.query.courseId,
  136. userid: this.$route.query.userid,
  137. classId: this.$route.query.cid,
  138. role: this.$route.query.role,
  139. oid: this.$route.query.oid,
  140. org: this.$route.query.org,
  141. tType: this.$route.query.tType,
  142. courseType: this.$route.query.type,
  143. screenType: this.$route.query.screenType,
  144. tcid2: this.$route.query.tcid,
  145. classList: [],
  146. tcid: "",
  147. className: "",
  148. showIframe: false,
  149. iframeSrc: "",
  150. courseDetail: {},
  151. pageLoading: false,
  152. inviteCode: "",
  153. startTime: "",
  154. freeBrowse: true, // 默认自由浏览
  155. opertimer: null, // 定时器
  156. jArray: [],
  157. // 录音相关变量
  158. languageRadio: 2, // 语言选择
  159. recordedForm: {
  160. status: 0, // 0: 未开始, 1: 录音中, 2: 暂停, 3: 结束
  161. startTime: 0,
  162. endTime: 0,
  163. timeDuration: 0,
  164. textList: [],
  165. audioBlob: []
  166. },
  167. controlsStatus: 0, // 控制状态
  168. showIndexPage: true, // 显示索引页
  169. pageStatus: 1, // 页面状态
  170. editorBarData: {
  171. type: "0",
  172. content: ""
  173. },
  174. uploadFileLoading: false, // 上传文件加载状态
  175. transcriptionData: {
  176. content: ""
  177. },
  178. showGetTextLoading: false, // 显示获取文本加载状态
  179. // 弹窗相关
  180. showObserveDialog: false, // 显示课堂观察弹窗
  181. observeDialogUrl: "", // 课堂观察链接
  182. // 录音时间记录
  183. recordingStartTime: "", // 开始录音时间
  184. recordingEndTime: "", // 结束录音时间
  185. isResultArray: [],
  186. isCan: false,
  187. timeoutPan: null,
  188. isTimeOutPan: false,
  189. };
  190. },
  191. computed: {
  192. iframeSrcop() {
  193. if (this.$region == 'hk') {
  194. return `https://cloud.cocorobo.hk/browser/public/index.html`;
  195. } else if (this.$region == 'com') {
  196. return `https://cloud.cocorobo.com/browser/public/index.html`;
  197. } else {
  198. return `https://beta.cloud.cocorobo.cn/browser/public/index.html`;
  199. }
  200. }
  201. },
  202. methods: {
  203. openSelectClass(){
  204. this.$refs.selectTeachingClassDialogRef.open({classList:this.classList}, this.tcid2)
  205. },
  206. addInviteCodeOne(cid) {
  207. return new Promise((resolve)=>{
  208. let params = [
  209. {
  210. courseId: this.id,
  211. inviteCode: cid,
  212. },
  213. ];
  214. this.ajax
  215. .post(this.$store.state.api + "add_courseInviteCode2", params)
  216. .then((res) => {
  217. console.log(res.data)
  218. resolve(res.data)
  219. })
  220. .catch((err) => {
  221. resolve(err.messages)
  222. console.error(err);
  223. });
  224. })
  225. },
  226. async selectClassSuccess(classId){
  227. if(classId){
  228. let data = await this.addInviteCodeOne(classId)
  229. console.log("addInviteCodeOne",data)
  230. this.tcid2 = classId
  231. this.getClassName()
  232. this.getCourseDetail();
  233. }else if(this.tcid2){
  234. this.ticd2 = ''
  235. this.getCourseDetail();
  236. }
  237. // this.gotoCourse(classId);
  238. this.$refs.selectTeachingClassDialogRef.close();
  239. this.setoTime("1");
  240. },
  241. async changeClassList(data){
  242. this.classList = JSON.parse(JSON.stringify(data))
  243. let params = [{
  244. cid:this.id,
  245. juri:this.classList.map(i=>i.id).join(',')
  246. }]
  247. this.ajax.post(this.$store.state.api+"update_CourseJuriById",params).then(res=>{
  248. if(res.data==1){
  249. console.log(this.lang.ssModifySuccess)
  250. }
  251. })
  252. //this.inviteCodeFn();
  253. },
  254. goTo(path) {
  255. this.$router.push(path);
  256. },
  257. refreshCourse() {
  258. this.getCourseDetail();
  259. },
  260. audioStart() {
  261. this.onStartRecordWithMicrosoft();
  262. },
  263. toggleRecording() {
  264. return new Promise(resolve => {
  265. if (this.recordedForm.status == 1) {
  266. // 检查录音时间是否至少为5秒
  267. const now = new Date();
  268. const duration = (now - new Date(this.recordingStartTime)) / 1000;
  269. if (duration < 5) {
  270. this.$message.warning(this.lang.ssRecordingTimeAtLeast5Seconds);
  271. return;
  272. }
  273. this.$refs.confirmInstructionRef.open({
  274. title: this.lang.ssStopRecordingConfirm,
  275. message: this.lang.ssStopRecordingNotice,
  276. cancelText: this.lang.ssCancel,
  277. submitText: this.lang.ssConfirm,
  278. submitCallback: () => {
  279. console.log("确定")
  280. this.onFinishRecordWithMicrosoft().then(() => {
  281. resolve(true)
  282. });
  283. },
  284. cancelCallback: () => {
  285. console.log("取消")
  286. resolve(false)
  287. },
  288. })
  289. // this.$confirm(this.lang.ssStopRecordingNotice, this.lang.ssStopRecordingConfirm, {
  290. // confirmButtonText: this.lang.ssConfirm,
  291. // cancelButtonText: this.lang.ssCancel,
  292. // confirmButtonClass: "pptEasyClassConfirmButtonText",
  293. // cancelButtonClass: "pptEasyClassCancelButtonText"
  294. // }).then(() => {
  295. // console.log("确定")
  296. // // this.$message({
  297. // // dangerouslyUseHTMLString: true,
  298. // // customClass:"pptEasyClassMessage",
  299. // // message: '已停止录制 <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank">查看结果</p>'
  300. // // });
  301. // this.onFinishRecordWithMicrosoft().then(() => {
  302. // resolve(true)
  303. // });
  304. // }).catch(() => {
  305. // console.log("取消")
  306. // resolve(false)
  307. // });
  308. } else {
  309. const now = new Date();
  310. const duration = (now - new Date(this.recordingEndTime)) / 1000;
  311. if (duration < 5) {
  312. this.$message.warning('录音时间至少间距5秒');
  313. return;
  314. }
  315. this.onStartRecordWithMicrosoft();
  316. resolve(true)
  317. }
  318. })
  319. // })
  320. },
  321. // ============ start 微软录音转译
  322. onStartRecordWithMicrosoft() {
  323. let iiframe = this.$refs["iiframe"];
  324. iiframe.contentWindow.window.document.getElementById(
  325. "languageOptions"
  326. ).selectedIndex = this.languageRadio;
  327. // 录音开始
  328. let flag = true;
  329. console.log("开始录音", iiframe);
  330. this.recordedForm.status = 1;
  331. // 记录开始录音时间
  332. this.recordingStartTime = new Date().toLocaleString("zh-CN", {
  333. hour12: false,
  334. timeZone: "Asia/Shanghai"
  335. }).replace(/\//g, "-");
  336. iiframe.contentWindow.window.onRecognizedResult = e => {
  337. console.log("onRecognizedResult", e);
  338. this.recordedForm.endTime = this.recordedForm.timeDuration;
  339. if (flag) {
  340. this.controlsStatus = 1;
  341. this.showIndexPage = false;
  342. this.pageStatus = 2;
  343. this.editorBarData.type = "0";
  344. flag = false;
  345. this.uploadFileLoading = false;
  346. this.transcriptionData.content = "";
  347. this.editorBarData.content = "";
  348. this.recordedForm.textList = [];
  349. }
  350. this.showGetTextLoading = true;
  351. let privText = e.privText;
  352. let privSpeakerId = e.privSpeakerId;
  353. let _copyPrivSpeakerId = privSpeakerId;
  354. console.log("👇转译对象👇");
  355. console.log(e);
  356. console.log("👇转译结果👇");
  357. console.log(privText);
  358. if (!privText || !privSpeakerId || privSpeakerId == "Unknown") {
  359. return;
  360. }
  361. const newItem = {
  362. value: privText,
  363. role: "",
  364. startTime: this.updateRecordedTime({
  365. duration: this.recordedForm.startTime
  366. }),
  367. endTime: this.updateRecordedTime({
  368. duration: this.recordedForm.endTime
  369. }),
  370. time: this.updateRecordedTime({
  371. duration: this.recordedForm.endTime - this.recordedForm.startTime
  372. })
  373. };
  374. this.recordedForm.textList.push(newItem);
  375. this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
  376. this.transcriptionData.content +=
  377. _copyPrivSpeakerId + ":" + privText + "\n";
  378. this.onRecordAddLine(newItem);
  379. };
  380. iiframe.contentWindow.ConversationTranscriber();
  381. setTimeout(() => {
  382. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
  383. if (permissionStatus.state !== "granted") {
  384. // 没有开启录音权限,直接确定停止录音
  385. this.recordedForm.status = "0";
  386. let iframe = this.$refs["iiframe"];
  387. iframe.contentWindow.onSessionStopped = null;
  388. iframe.contentWindow.window.onRecognizedResult = null;
  389. this.$message.success(this.lang.ssNoPermStop);
  390. return;
  391. }
  392. })
  393. }, 10000)
  394. },
  395. async onFinishRecordWithMicrosoft() {
  396. return new Promise(resolve => {
  397. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
  398. if (permissionStatus.state !== "granted") {
  399. // 没有开启录音权限,直接确定停止录音
  400. this.recordedForm.status = "0";
  401. let iframe = this.$refs["iiframe"];
  402. iframe.contentWindow.onSessionStopped = null;
  403. iframe.contentWindow.window.onRecognizedResult = null;
  404. this.$message.success(this.lang.ssNoPermStop);
  405. return;
  406. }
  407. if (this.recordedForm.status == 1) {
  408. //正在录音时
  409. let iiframe = this.$refs["iiframe"];
  410. iiframe.contentWindow.window.document
  411. .getElementById("scenarioStopButton")
  412. .click();
  413. // 录音借宿
  414. iiframe.contentWindow.onSessionStopped = async (s, e) => {
  415. this.recordedForm.status = 0;
  416. this.controlsStatus = 2;
  417. this.showGetTextLoading = false;
  418. // this.$message.success("已结束录音");
  419. console.log("结束录音👇");
  420. console.log("结束录音", e);
  421. this.recordedForm.audioBlob.push(e.preaudio);
  422. let blob = new Blob(this.recordedForm.audioBlob, {
  423. type: "audio/wav"
  424. });
  425. let file = new File([blob], "recordedFile.wav", {
  426. type: "audio/wav"
  427. });
  428. // 存储文件和文本到全局对象
  429. await this.storeRecordingData(file);
  430. // 记录结束录音时间
  431. this.recordingEndTime = await this.getServerTime()
  432. // 调用 addPPTClass 接口
  433. this.addPPTClass(file);
  434. iiframe.contentWindow.onSessionStopped = null;
  435. iiframe.contentWindow.window.onRecognizedResult = null;
  436. resolve(true)
  437. };
  438. } else if (this.recordedForm.status == 2) {
  439. //暂停录音时
  440. this.recordedForm.status = 0;
  441. this.controlsStatus = 2;
  442. this.showGetTextLoading = false;
  443. let blob = new Blob(this.recordedForm.audioBlob, {
  444. type: "audio/wav"
  445. });
  446. let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
  447. // 存储文件和文本到全局对象
  448. await this.storeRecordingData(file);
  449. // 记录结束录音时间
  450. this.recordingEndTime = await this.getServerTime()
  451. // 调用 addPPTClass 接口
  452. this.addPPTClass(file);
  453. resolve(true)
  454. }
  455. })
  456. })
  457. },
  458. storeRecordingData(file) {
  459. // 配置全局 window 对象存储录音数据
  460. return new Promise((resolve) => {
  461. if (!window.recordingData) {
  462. window.recordingData = {};
  463. }
  464. window.recordingData.file = file;
  465. window.recordingData.text = this.transcriptionData.content;
  466. window.recordingData.textList = this.recordedForm.textList;
  467. // 将录音文件转为base64并存入localStorage
  468. // const reader = new FileReader();
  469. // reader.onload = function(e) {
  470. // const base64data = e.target.result;
  471. // try {
  472. // localStorage.setItem("recordedFileBase64", base64data);
  473. // localStorage.setItem('recordedFileName', file.name);
  474. // localStorage.setItem('recordedFileType', file.type);
  475. resolve(true)
  476. // console.log("录音数据已存储到全局对象:", window.recordingData);
  477. // } catch (err) {
  478. // resolve(false)
  479. // console.error("localStorage存储base64文件失败:", err);
  480. // }
  481. // };
  482. // reader.readAsDataURL(file);
  483. })
  484. },
  485. openObserveDialog(pptid, file) {
  486. // this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  487. // this.showObserveDialog = true;
  488. const url = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  489. const _pageWindow = window.open(url, '_blank');
  490. // if(!_pageWindow){
  491. // alert('浏览器弹窗被拦截,请允许弹窗后重试');
  492. // return;
  493. // }
  494. const sendData = {
  495. type: 'fileData',
  496. file,
  497. }
  498. const sendMessageToVue3 = () => {
  499. _pageWindow.postMessage(
  500. sendData,
  501. '*' // targetOrigin:必须是Vue3的实际域名,不要用*(安全)
  502. );
  503. };
  504. const handleVue3Ready = (e) => {
  505. // 校验消息来源(安全:只处理Vue3域名的消息)
  506. // 校验消息类型(确认是Vue3的就绪通知)
  507. if (e.data.type === 'READY') {
  508. console.log('已就绪,开始发送数据');
  509. sendMessageToVue3();
  510. }
  511. // 校验Vue3的"接收成功"确认(可选,进一步确保送达)
  512. if (e.data.type === 'DATA_RECEIVED') {
  513. console.log('数据已被接收');
  514. // 收到确认后移除监听,避免内存泄漏
  515. window.removeEventListener('message', handleVue3Ready);
  516. }
  517. };
  518. window.addEventListener('message', handleVue3Ready);
  519. const timeoutTimer = setTimeout(() => {
  520. console.log('未收到就绪通知,主动发送数据');
  521. sendMessageToVue3();
  522. // 移除监听(兜底后清理)
  523. window.removeEventListener('message', handleVue3Ready);
  524. }, 5000);
  525. const checkWinClosed = setInterval(() => {
  526. if (_pageWindow.closed) {
  527. clearTimeout(timeoutTimer);
  528. clearInterval(checkWinClosed);
  529. window.removeEventListener('message', handleVue3Ready);
  530. }
  531. }, 1000);
  532. // 优化:仅通过轮询方式检查窗口是否加载完成并发送消息,被打开页面无需做任何处理
  533. // const sendFileData = () => {
  534. // if (_pageWindow && !_pageWindow.closed) {
  535. // _pageWindow.postMessage(
  536. // {
  537. // type: 'fileData',
  538. // file,
  539. // },
  540. // '*'
  541. // );
  542. // }
  543. // };
  544. // let checkCount = 0;
  545. // const checkLoadedInterval = setInterval(() => {
  546. // if (!_pageWindow || _pageWindow.closed) {
  547. // clearInterval(checkLoadedInterval);
  548. // return;
  549. // }
  550. // try {
  551. // if (_pageWindow.document && _pageWindow.document.readyState === 'complete') {
  552. // clearInterval(checkLoadedInterval);
  553. // sendFileData();
  554. // }
  555. // } catch (err) {
  556. // // 跨域下直接尝试发送
  557. // clearInterval(checkLoadedInterval);
  558. // sendFileData();
  559. // }
  560. // if (++checkCount > 20) {
  561. // // 最多检测2秒(20次)
  562. // clearInterval(checkLoadedInterval);
  563. // sendFileData();
  564. // }
  565. // }, 100);
  566. setTimeout(() => {
  567. window.focus()
  568. }, 100)
  569. function openPageWindow() {
  570. _pageWindow.focus()
  571. }
  572. this.$refs.messageInstructionRef.pptMessage(`${this.lang.ssStoppedRecording} <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank" onClick="(${openPageWindow.toString()})()">${this.lang.ssViewRecordingResult}</p>`)
  573. },
  574. addPPTClass(file) {
  575. let params = {
  576. pptid: this.id,
  577. cid: this.tcid,
  578. st: this.recordingStartTime,
  579. et: this.recordingEndTime
  580. };
  581. this.ajax
  582. .post(this.$store.state.api + "addPPTClass", [params])
  583. .then(res => {
  584. console.log("addPPTClass", res);
  585. let id = res.data[0][0].id;
  586. this.openObserveDialog(id, file);
  587. })
  588. .catch(err => {
  589. console.error(err);
  590. this.$message.error("保存录音信息失败");
  591. });
  592. },
  593. updateRecordedTime({ duration }) {
  594. // 格式化录音时间
  595. const minutes = Math.floor(duration / 60);
  596. const seconds = Math.floor(duration % 60);
  597. return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  598. },
  599. onRecordAddLine(item) {
  600. // 添加录音文本行
  601. console.log("添加录音文本行:", item);
  602. // 这里可以根据需要添加更多处理逻辑
  603. },
  604. getCourseDetail() {
  605. this.pageLoading = true;
  606. let params = {
  607. courseId: this.id
  608. };
  609. this.ajax
  610. .get(this.$store.state.api + "selectCourseDetail3", params)
  611. .then(res => {
  612. console.log("getCourseDetail", res);
  613. this.courseDetail = res.data[0][0];
  614. this.courseDetail.chapters = JSON.parse(this.courseDetail.chapters);
  615. this.tcid = this.arrayToArray(
  616. this.courseDetail.juri ? this.courseDetail.juri.split(",") : [],
  617. this.tcid2 ? this.tcid2.split(",") : []
  618. )[0] || "";
  619. console.log('tcid', this.tcid)
  620. console.log('tcid2', this.tcid2)
  621. if (this.tcid && res.data[1].length) {
  622. let _inviteA = [];
  623. for (var ik = 0; ik < res.data[1].length; ik++) {
  624. _inviteA.push({
  625. cid: res.data[1][ik].classid,
  626. ic: res.data[1][ik].code,
  627. });
  628. }
  629. for (var ik = 0; ik < _inviteA.length; ik++) {
  630. if (
  631. this.arrayToArray(
  632. _inviteA[ik].cid.split(","),
  633. this.tcid.split(",")
  634. ).length
  635. ) {
  636. this.inviteCode = _inviteA[ik].ic;
  637. break;
  638. }
  639. }
  640. }
  641. this.setPptIframe()
  642. this.classList = res.data[2]
  643. if(!this.tcid2 && this.tType == '1'){
  644. this.$refs.selectTeachingClassDialogRef.open({classList:this.classList})
  645. }
  646. this.pageLoading = false;
  647. })
  648. .catch(err => {
  649. console.log(err);
  650. this.$message.error(this.lang.ssGetCourseDataFail);
  651. this.pageLoading = false;
  652. });
  653. },
  654. setPptIframe() {
  655. this.showIframe = false;
  656. this.$nextTick(() => {
  657. let api = 'https://psyy.cocorobo.cn/'
  658. // if (this.$region == 'beta') {
  659. // api = 'https://beta.ppt.cocorobo.cn'
  660. // } else if (this.$region == 'hk') {
  661. // api = 'https://ppt.cocorobo.hk'
  662. // } else if (this.$region == 'com') {
  663. // api = 'https://ppt.cocorobo.com'
  664. // } else {
  665. // api = 'https://ppt.cocorobo.cn'
  666. // }
  667. let _url = api + `/?mode=student&courseid=${this.id}&userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.tcid}&type=${this.tType}`;
  668. this.iframeSrc = _url;
  669. this.showIframe = true;
  670. });
  671. },
  672. arrayToArray(arrayo, arrayt) {
  673. let array1 = arrayo;
  674. let array2 = arrayt;
  675. let commonElements = [];
  676. for (let i = 0; i < array1.length; i++) {
  677. for (let j = 0; j < array2.length; j++) {
  678. if (array1[i] === array2[j]) {
  679. commonElements.push(array1[i]);
  680. }
  681. }
  682. }
  683. return commonElements;
  684. },
  685. async getClassName() {
  686. let courseGrade = await this.ajax.get(this.$store.state.api + "getClassById", { id: this.tcid2 });
  687. this.className = courseGrade.data[0][0].grade;
  688. },
  689. back() {
  690. // if (this.tType != 2) {
  691. // this.goTo(
  692. // '/courseDetail?userid=' +
  693. // this.userid +
  694. // '&oid=' +
  695. // this.oid +
  696. // '&org=' +
  697. // this.org +
  698. // '&cid=' +
  699. // this.classId +
  700. // '&courseId=' +
  701. // this.id +
  702. // '&tType=' +
  703. // this.tType +
  704. // '&screenType=' +
  705. // this.screenType
  706. // )
  707. // } else {
  708. this.goTo(
  709. '/index?userid=' +
  710. this.userid +
  711. '&oid=' +
  712. this.oid +
  713. '&org=' +
  714. this.org +
  715. '&cid=' +
  716. this.classId +
  717. '&tType=' +
  718. this.tType +
  719. '&screenType=' +
  720. this.screenType
  721. )
  722. // }
  723. },
  724. gotoCourseManage(){
  725. this.doSyncClassData();
  726. parent.setCourseUrl();
  727. },
  728. afterClass() {
  729. if (this.recordedForm.status == 1) {
  730. this.toggleRecording().then((flag) => {
  731. if (flag) {
  732. this.$refs.confirmInstructionRef.open({
  733. title: this.lang.ssPrompt,
  734. message: this.lang.ssEndClassConfirm,
  735. cancelText: this.lang.ssCancel,
  736. submitText: this.lang.ssConfirm,
  737. submitCallback: () => {
  738. this.isTimeOutPan = false;
  739. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  740. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  741. setTimeout(() => {
  742. this.tcid2 = ""
  743. this.refreshCourse()
  744. if(this.screenType != 2){
  745. this.back()
  746. }else if(this.screenType == 2){
  747. this.gotoCourseManage()
  748. }
  749. }, 1000)
  750. },
  751. cancelCallback: () => {
  752. this.isTimeOutPan = false;
  753. console.log("取消")
  754. }
  755. })
  756. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  757. // confirmButtonText: this.lang.ssConfirm,
  758. // cancelButtonText: this.lang.ssCancel,
  759. // type: 'warning'
  760. // }).then(() => {
  761. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  762. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  763. // setTimeout(() => {
  764. // this.tcid2 = ""
  765. // this.refreshCourse()
  766. // }, 1000)
  767. // }).catch(() => { });
  768. }
  769. })
  770. } else {
  771. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  772. // confirmButtonText: this.lang.ssConfirm,
  773. // cancelButtonText: this.lang.ssCancel,
  774. // type: 'warning'
  775. // }).then(() => {
  776. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  777. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  778. // setTimeout(() => {
  779. // this.tcid2 = ""
  780. // this.refreshCourse()
  781. // }, 1000)
  782. // }).catch(() => { });
  783. this.$refs.confirmInstructionRef.open({
  784. title: this.lang.ssPrompt,
  785. message: this.lang.ssEndClassConfirm,
  786. cancelText: this.lang.ssCancel,
  787. submitText: this.lang.ssConfirm,
  788. submitCallback: () => {
  789. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  790. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  791. setTimeout(() => {
  792. this.tcid2 = ""
  793. this.refreshCourse()
  794. if(this.screenType != 2){
  795. this.back()
  796. }else if(this.screenType == 2){
  797. this.gotoCourseManage()
  798. }
  799. }, 1000)
  800. },
  801. cancelCallback: () => {
  802. console.log("取消")
  803. }
  804. })
  805. }
  806. },
  807. afterClass2(){
  808. this.$refs.confirmInstructionRef.open({
  809. title: this.lang.ssPrompt,
  810. message: this.lang.ssConfirmExit,
  811. cancelText: this.lang.ssCancel,
  812. submitText: this.lang.ssConfirm,
  813. submitCallback: () => {
  814. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout2();
  815. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  816. },
  817. cancelCallback: () => {
  818. console.log("取消")
  819. }
  820. })
  821. },
  822. onFreeBrowseChange(value) {
  823. this.freeBrowse = value;
  824. console.log('自由浏览模式已切换为1:', this.freeBrowse);
  825. this.$refs.ppt.contentWindow.PPTistStudent.toggleFollowMode()
  826. },
  827. onIsCanChange(value) {
  828. this.isCan = value;
  829. for(var i = 0; i < this.isResultArray.length; i++){
  830. let item = this.isResultArray[i];
  831. if(value && item.isTool){
  832. item.can = true
  833. }else if(item.isTool){
  834. item.can = false
  835. item.like = false
  836. }
  837. }
  838. this.$refs.ppt.contentWindow.PPTistStudent.setCan(this.isResultArray)
  839. },
  840. setOperationTime() {
  841. let _this = this;
  842. if (_this.opertimer) {
  843. clearInterval(_this.opertimer);
  844. _this.opertimer = null;
  845. }
  846. _this.opertimer = setInterval(() => {
  847. _this.setoTime("600");
  848. }, 600000);
  849. },
  850. setoTime(time) {
  851. this.doSyncClassData();
  852. let params = [
  853. {
  854. uid: this.userid,
  855. cid: this.id + (this.tcid2 || ''),
  856. type: "2",
  857. time: time,
  858. },
  859. ];
  860. this.ajax
  861. .post(this.$store.state.api + "addOperationTimeT2", params)
  862. .then((res) => { })
  863. .catch((err) => {
  864. console.error(err);
  865. });
  866. },
  867. getAIJ() {
  868. this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
  869. let a = res.data[4];
  870. console.log(a)
  871. let Array = [];
  872. a.forEach(i => Array.push(i.oid))
  873. this.jArray = Array;
  874. })
  875. },
  876. async doSyncClassData() {
  877. let userArray = ['6fbc6471-1d48-11ed-8c78-005056b86db5','333d0dfc-1cd9-11ef-bee5-005056b86db5','6fbce5ef-1d48-11ed-8c78-005056b86db5','66feffcc-ad35-11ed-b13d-005056b86db5']
  878. if (this.courseDetail.userid == this.userid && (this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840' || userArray.includes(this.userid))) {
  879. let endTime = await this.getServerTime()
  880. let courseTime = Math.floor((new Date(endTime) - new Date(this.startTime)) / (1000 * 60))
  881. this.syncClassData({
  882. courseId: this.id,
  883. title: this.courseDetail.title,
  884. ctitle: this.courseDetail.copyTitle || this.courseDetail.title,
  885. courseGrade: this.tcid2 ? this.tcid2 : '',
  886. courseTime: courseTime,
  887. startTime: this.startTime,
  888. endTime: endTime,
  889. })
  890. console.log('同步数据')
  891. }
  892. },
  893. // 直接上传录制音频/视频
  894. uploadVoiceBtn() {
  895. const input = document.createElement('input');
  896. input.type = 'file';
  897. input.accept = '.m4a,.mp4,.mov,.mp3,.wav';
  898. input.click();
  899. input.onchange = (e) => {
  900. const fileList = e.target.files;
  901. const file = fileList[0]
  902. this.recordingStartTime = new Date(window.recordingStartTime ? window.recordingStartTime : new Date()).toLocaleString("zh-CN", {
  903. hour12: false,
  904. timeZone: "Asia/Shanghai"
  905. }).replace(/\//g, "-");
  906. this.recordingEndTime = new Date(window.recordingEndTime ? window.recordingEndTime : new Date()).toLocaleString("zh-CN", {
  907. hour12: false,
  908. timeZone: "Asia/Shanghai"
  909. }).replace(/\//g, "-");
  910. this.addPPTClass(file)
  911. // 判断文件类型并获取音频或视频时长
  912. // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
  913. // const url = URL.createObjectURL(file);
  914. // let media;
  915. // if (file.type.startsWith('audio/')) {
  916. // media = new Audio();
  917. // } else {
  918. // media = document.createElement('video');
  919. // }
  920. // media.preload = 'metadata';
  921. // media.src = url;
  922. // media.onloadedmetadata = () => {
  923. // const duration = media.duration;
  924. // console.log('文件时长(秒):', duration);
  925. // // 这里可以赋值或者进一步处理时长 duration
  926. // URL.revokeObjectURL(url);
  927. // };
  928. // media.onerror = () => {
  929. // console.error('无法读取文件时长');
  930. // URL.revokeObjectURL(url);
  931. // };
  932. // }
  933. }
  934. },
  935. // 打开分享弹窗
  936. openShareDialog() {
  937. let code = this.userJson.oidCode || this.userJson.orgCode
  938. this.$refs.shareDialogRef.open(code, this.inviteCode)
  939. },
  940. resetIdleOp(){
  941. if(this.courseDetail.userId == this.userid){
  942. this.isTimeOutPan = true;
  943. this.afterClass()
  944. setTimeout(() => {
  945. if(this.isTimeOutPan){
  946. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  947. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  948. setTimeout(() => {
  949. this.tcid2 = ""
  950. this.refreshCourse()
  951. }, 1000)
  952. }
  953. }, 5000);
  954. }
  955. // console.log('resetIdleOp','重置空闲定时器')
  956. }
  957. },
  958. destroyed() {
  959. clearInterval(this.opertimer);
  960. this.opertimer = null;
  961. clearTimeout(this.timeoutPan);
  962. this.timeoutPan = null;
  963. this.doSyncClassData();
  964. this.stopIdleDetection(this.resetIdleOp);
  965. },
  966. async mounted() {
  967. this.setoTime("1");
  968. this.startTime = await this.getServerTime()
  969. console.log('this.startTime', this.startTime)
  970. this.timeoutPan = setTimeout(() => {
  971. this.startIdleDetection(this.resetIdleOp);
  972. }, 40 * 60 * 1000)
  973. // this.startIdleDetection(this.resetIdleOp);
  974. this.getClassName()
  975. this.getAIJ();
  976. this.getCourseDetail();
  977. this.setOperationTime();
  978. window.onFreeBrowseChange = (value) => {
  979. this.freeBrowse = value;
  980. console.log('自由浏览模式已切换为:', this.freeBrowse);
  981. }
  982. window.setIsResultArray = (value) => {
  983. this.isResultArray = value;
  984. // 判断数组中isTool为true的项的can是否都为true
  985. const toolItems = value.filter(item => item.isTool);
  986. if (toolItems.length > 0) {
  987. const allCanTrue = toolItems.every(item => item.can === true);
  988. const allCanFalse = toolItems.every(item => item.can === false);
  989. if (allCanTrue) {
  990. this.isCan = true;
  991. } else if (allCanFalse) {
  992. this.isCan = false;
  993. }
  994. }
  995. }
  996. if (!this.userJson || !this.userJson.accountNumber) {
  997. let res = await this.ajax.get(this.$store.state.api + "selectUser", {
  998. userid: this.$route.query.userid
  999. });
  1000. this.userJson = res.data[0][0]
  1001. }
  1002. setTimeout(() => {
  1003. this.doSyncClassData();
  1004. }, 1000);
  1005. }
  1006. };
  1007. </script>
  1008. <style scoped>
  1009. .pptEasyClass {
  1010. width: 100vw;
  1011. height: 100vh;
  1012. display: flex;
  1013. flex-direction: column;
  1014. overflow: hidden;
  1015. box-sizing: border-box;
  1016. background-color: #f2f2f2;
  1017. min-height: unset;
  1018. }
  1019. .pec_main {
  1020. width: 100%;
  1021. height: 100%;
  1022. background-color: #fff;
  1023. }
  1024. .pec_header {
  1025. width: 100%;
  1026. height: 60px;
  1027. background: #FCCF00;
  1028. box-sizing: border-box;
  1029. display: flex;
  1030. align-items: center;
  1031. justify-content: space-between;
  1032. position: relative;
  1033. box-shadow: 0px 4px 12px 0px #3648601F;
  1034. padding: 0 10px;
  1035. box-sizing: border-box;
  1036. }
  1037. .pec_h_left {
  1038. width: auto;
  1039. height: 100%;
  1040. display: flex;
  1041. align-items: center;
  1042. gap: 25px;
  1043. /* 保持左侧靠左 */
  1044. }
  1045. .pec_h_center {
  1046. position: absolute;
  1047. left: 50%;
  1048. top: 0;
  1049. height: 100%;
  1050. display: flex;
  1051. align-items: center;
  1052. transform: translateX(-50%);
  1053. z-index: 1;
  1054. }
  1055. .pec_h_l_title {
  1056. font-weight: bold;
  1057. font-size: 20px;
  1058. color: #0e1e33;
  1059. overflow: hidden;
  1060. white-space: nowrap;
  1061. max-width: 500px;
  1062. text-overflow: ellipsis;
  1063. }
  1064. .pec_h_right {
  1065. width: auto;
  1066. height: 100%;
  1067. display: flex;
  1068. align-items: center;
  1069. }
  1070. .pec_h_r_btnArea {
  1071. display: flex;
  1072. align-items: center;
  1073. justify-content: center;
  1074. }
  1075. .pec_h_r_btnArea>div {
  1076. width: auto;
  1077. height: auto;
  1078. display: flex;
  1079. align-items: center;
  1080. justify-content: center;
  1081. padding: 10px 20px;
  1082. background-color: #f0f4fa;
  1083. border-radius: 4px;
  1084. cursor: pointer;
  1085. font-size: 14px;
  1086. font-weight: 400;
  1087. color: #000;
  1088. border: 1px solid #cad1dc;
  1089. }
  1090. .pec_h_r_btnArea>div+div {
  1091. margin-left: 10px;
  1092. }
  1093. .pec_h_r_btnArea>div>img {
  1094. width: 15px;
  1095. height: 15px;
  1096. margin-right: 5px;
  1097. }
  1098. .pec_h_center>.pec_h_r_btn_refresh {
  1099. color: #fff;
  1100. /* background-color: #0061ff;
  1101. border-color: #0061ff; */
  1102. padding: 9px 10px;
  1103. margin-right: 15px;
  1104. border-radius: 26px;
  1105. display: flex;
  1106. align-items: center;
  1107. justify-content: center;
  1108. gap: 5px;
  1109. background: #FFF7F5;
  1110. color: #000000;
  1111. font-weight: 400;
  1112. cursor: pointer;
  1113. fill: #666666;
  1114. }
  1115. .pec_h_center>.pec_h_r_btn_refresh>svg {
  1116. width: 1rem;
  1117. height: 1rem;
  1118. }
  1119. .pec_h_center>.pec_h_r_btn_refresh.recording {
  1120. /* background-color: #F53F3F;
  1121. border-color: #F53F3F; */
  1122. background: #FFF7E8;
  1123. fill: #FF9300;
  1124. animation: pulse 1.5s infinite;
  1125. }
  1126. @keyframes pulse {
  1127. 0% {
  1128. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.4);
  1129. }
  1130. 70% {
  1131. box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
  1132. }
  1133. 100% {
  1134. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
  1135. }
  1136. }
  1137. .pec_h_r_btnArea>.pec_h_r_btn_afterClass {
  1138. border-color: #F0E1DD;
  1139. background-color: #FFF7F5;
  1140. color: #F53F3F;
  1141. }
  1142. .pec_h_r_btn_uploadVoiceBtn {
  1143. border-color: #F0E1DD;
  1144. background-color: #FFF7F5;
  1145. color: #000;
  1146. }
  1147. .backBtn {
  1148. width: 15px;
  1149. height: 15px;
  1150. display: flex;
  1151. align-items: center;
  1152. justify-content: center;
  1153. cursor: pointer;
  1154. }
  1155. .backBtn img {
  1156. width: 100%;
  1157. height: 100%;
  1158. }
  1159. .shareBtn {
  1160. width: 25px;
  1161. height: 25px;
  1162. display: flex;
  1163. align-items: center;
  1164. justify-content: center;
  1165. cursor: pointer;
  1166. }
  1167. .shareBtn img {
  1168. width: 100%;
  1169. height: 100%;
  1170. }
  1171. .class-info-group {
  1172. display: flex;
  1173. align-items: center;
  1174. gap: 10px;
  1175. }
  1176. .class-label {
  1177. font-size: 18px;
  1178. font-weight: bold;
  1179. color: #222;
  1180. margin-right: 5px;
  1181. }
  1182. .class-value {
  1183. font-size: 16px;
  1184. color: #222;
  1185. background: #FFFFFF3D;
  1186. border: 1px solid #00000080;
  1187. border-radius: 5px;
  1188. padding: 5px 18px;
  1189. min-width: 60px;
  1190. text-align: center;
  1191. display: inline-block;
  1192. box-sizing: border-box;
  1193. display: flex;
  1194. align-items: center;
  1195. }
  1196. .class-value2 {
  1197. cursor: pointer;
  1198. background: #fff;
  1199. }
  1200. .class-value > svg{
  1201. width: 13px;
  1202. height: 13px;
  1203. margin-left: 8px;
  1204. }
  1205. .pec_content {
  1206. width: 100%;
  1207. height: calc(100% - 60px);
  1208. border-radius: 0 0 12px 12px;
  1209. background-color: #fff;
  1210. }
  1211. .free-browse-switch {
  1212. display: flex;
  1213. align-items: center;
  1214. padding: 9px 10px;
  1215. background: #FFF7F5;
  1216. border-radius: 26px;
  1217. margin-left: 15px;
  1218. gap: 5px;
  1219. }
  1220. .switch-label {
  1221. /* background: linear-gradient(to right, #F53F3F, #FCCF00); */
  1222. /* -webkit-background-clip: text; */
  1223. color: #000;
  1224. }
  1225. .refresh_icon {
  1226. width: 35px;
  1227. height: 35px;
  1228. display: flex;
  1229. align-items: center;
  1230. justify-content: center;
  1231. background-color: #fff7f5;
  1232. border-radius: 45%;
  1233. cursor: pointer;
  1234. margin-right: 15px;
  1235. padding: 0 3px;
  1236. }
  1237. .refresh_icon img {
  1238. width: 16px;
  1239. height: 16px;
  1240. }
  1241. .name_box {
  1242. background: unset !important;
  1243. border: none !important;
  1244. cursor: unset !important;
  1245. }
  1246. .observe-dialog>>>.el-dialog__header {
  1247. padding: 0;
  1248. }
  1249. .observe-dialog>>>.el-dialog__body {
  1250. padding: 0;
  1251. }
  1252. .observe-dialog>>>.el-dialog__headerbtn {
  1253. top: 22px;
  1254. right: 20px;
  1255. z-index: 100;
  1256. }
  1257. </style>