index.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341
  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. async toggleRecording() {
  264. return new Promise(async resolve => {
  265. if (this.recordedForm.status == 1) {
  266. // 检查录音时间是否至少为5秒
  267. const now = new Date(await this.getServerTime());
  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. console.log('recordingEndTime',this.recordingEndTime)
  310. const now = new Date(await this.getServerTime());
  311. console.log('now', now)
  312. const duration = (now - new Date(this.recordingEndTime)) / 1000;
  313. if (duration < 5) {
  314. this.$message.warning(this.lang.ssRecordingTimeAtLeast5Seconds);
  315. return;
  316. }
  317. this.onStartRecordWithMicrosoft();
  318. resolve(true)
  319. }
  320. })
  321. // })
  322. },
  323. // ============ start 微软录音转译
  324. async onStartRecordWithMicrosoft() {
  325. let iiframe = this.$refs["iiframe"];
  326. iiframe.contentWindow.window.document.getElementById(
  327. "languageOptions"
  328. ).selectedIndex = this.languageRadio;
  329. // 录音开始
  330. let flag = true;
  331. console.log("开始录音", iiframe);
  332. this.recordedForm.status = 1;
  333. // 记录开始录音时间
  334. this.recordingStartTime = await this.getServerTime();
  335. iiframe.contentWindow.window.onRecognizedResult = e => {
  336. console.log("onRecognizedResult", e);
  337. this.recordedForm.endTime = this.recordedForm.timeDuration;
  338. if (flag) {
  339. this.controlsStatus = 1;
  340. this.showIndexPage = false;
  341. this.pageStatus = 2;
  342. this.editorBarData.type = "0";
  343. flag = false;
  344. this.uploadFileLoading = false;
  345. this.transcriptionData.content = "";
  346. this.editorBarData.content = "";
  347. this.recordedForm.textList = [];
  348. }
  349. this.showGetTextLoading = true;
  350. let privText = e.privText;
  351. let privSpeakerId = e.privSpeakerId;
  352. let _copyPrivSpeakerId = privSpeakerId;
  353. console.log("👇转译对象👇");
  354. console.log(e);
  355. console.log("👇转译结果👇");
  356. console.log(privText);
  357. if (!privText || !privSpeakerId || privSpeakerId == "Unknown") {
  358. return;
  359. }
  360. const newItem = {
  361. value: privText,
  362. role: "",
  363. startTime: this.updateRecordedTime({
  364. duration: this.recordedForm.startTime
  365. }),
  366. endTime: this.updateRecordedTime({
  367. duration: this.recordedForm.endTime
  368. }),
  369. time: this.updateRecordedTime({
  370. duration: this.recordedForm.endTime - this.recordedForm.startTime
  371. })
  372. };
  373. this.recordedForm.textList.push(newItem);
  374. this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
  375. this.transcriptionData.content +=
  376. _copyPrivSpeakerId + ":" + privText + "\n";
  377. this.onRecordAddLine(newItem);
  378. };
  379. iiframe.contentWindow.ConversationTranscriber();
  380. setTimeout(() => {
  381. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
  382. if (permissionStatus.state !== "granted") {
  383. // 没有开启录音权限,直接确定停止录音
  384. this.recordedForm.status = "0";
  385. let iframe = this.$refs["iiframe"];
  386. iframe.contentWindow.onSessionStopped = null;
  387. iframe.contentWindow.window.onRecognizedResult = null;
  388. this.$message.success(this.lang.ssNoPermStop);
  389. return;
  390. }
  391. })
  392. }, 10000)
  393. },
  394. async onFinishRecordWithMicrosoft() {
  395. return new Promise(resolve => {
  396. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
  397. if (permissionStatus.state !== "granted") {
  398. // 没有开启录音权限,直接确定停止录音
  399. this.recordedForm.status = "0";
  400. let iframe = this.$refs["iiframe"];
  401. iframe.contentWindow.onSessionStopped = null;
  402. iframe.contentWindow.window.onRecognizedResult = null;
  403. this.$message.success(this.lang.ssNoPermStop);
  404. return;
  405. }
  406. if (this.recordedForm.status == 1) {
  407. //正在录音时
  408. let iiframe = this.$refs["iiframe"];
  409. iiframe.contentWindow.window.document
  410. .getElementById("scenarioStopButton")
  411. .click();
  412. // 录音借宿
  413. iiframe.contentWindow.onSessionStopped = async (s, e) => {
  414. this.recordedForm.status = 0;
  415. this.controlsStatus = 2;
  416. this.showGetTextLoading = false;
  417. // this.$message.success("已结束录音");
  418. console.log("结束录音👇");
  419. console.log("结束录音", e);
  420. this.recordedForm.audioBlob.push(e.preaudio);
  421. let blob = new Blob(this.recordedForm.audioBlob, {
  422. type: "audio/wav"
  423. });
  424. let file = new File([blob], "recordedFile.wav", {
  425. type: "audio/wav"
  426. });
  427. // 存储文件和文本到全局对象
  428. await this.storeRecordingData(file);
  429. // 记录结束录音时间
  430. this.recordingEndTime = await this.getServerTime()
  431. // 调用 addPPTClass 接口
  432. this.addPPTClass(file);
  433. iiframe.contentWindow.onSessionStopped = null;
  434. iiframe.contentWindow.window.onRecognizedResult = null;
  435. resolve(true)
  436. };
  437. } else if (this.recordedForm.status == 2) {
  438. //暂停录音时
  439. this.recordedForm.status = 0;
  440. this.controlsStatus = 2;
  441. this.showGetTextLoading = false;
  442. let blob = new Blob(this.recordedForm.audioBlob, {
  443. type: "audio/wav"
  444. });
  445. let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
  446. // 存储文件和文本到全局对象
  447. await this.storeRecordingData(file);
  448. // 记录结束录音时间
  449. this.recordingEndTime = await this.getServerTime()
  450. // 调用 addPPTClass 接口
  451. this.addPPTClass(file);
  452. resolve(true)
  453. }
  454. })
  455. })
  456. },
  457. storeRecordingData(file) {
  458. // 配置全局 window 对象存储录音数据
  459. return new Promise((resolve) => {
  460. if (!window.recordingData) {
  461. window.recordingData = {};
  462. }
  463. window.recordingData.file = file;
  464. window.recordingData.text = this.transcriptionData.content;
  465. window.recordingData.textList = this.recordedForm.textList;
  466. // 将录音文件转为base64并存入localStorage
  467. // const reader = new FileReader();
  468. // reader.onload = function(e) {
  469. // const base64data = e.target.result;
  470. // try {
  471. // localStorage.setItem("recordedFileBase64", base64data);
  472. // localStorage.setItem('recordedFileName', file.name);
  473. // localStorage.setItem('recordedFileType', file.type);
  474. resolve(true)
  475. // console.log("录音数据已存储到全局对象:", window.recordingData);
  476. // } catch (err) {
  477. // resolve(false)
  478. // console.error("localStorage存储base64文件失败:", err);
  479. // }
  480. // };
  481. // reader.readAsDataURL(file);
  482. })
  483. },
  484. openObserveDialog(pptid, file) {
  485. // this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  486. // this.showObserveDialog = true;
  487. const url = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  488. const _pageWindow = window.open(url, '_blank');
  489. // if(!_pageWindow){
  490. // alert('浏览器弹窗被拦截,请允许弹窗后重试');
  491. // return;
  492. // }
  493. const sendData = {
  494. type: 'fileData',
  495. file,
  496. }
  497. const sendMessageToVue3 = () => {
  498. _pageWindow.postMessage(
  499. sendData,
  500. '*' // targetOrigin:必须是Vue3的实际域名,不要用*(安全)
  501. );
  502. };
  503. const handleVue3Ready = (e) => {
  504. // 校验消息来源(安全:只处理Vue3域名的消息)
  505. // 校验消息类型(确认是Vue3的就绪通知)
  506. if (e.data.type === 'READY') {
  507. console.log('已就绪,开始发送数据');
  508. sendMessageToVue3();
  509. }
  510. // 校验Vue3的"接收成功"确认(可选,进一步确保送达)
  511. if (e.data.type === 'DATA_RECEIVED') {
  512. console.log('数据已被接收');
  513. // 收到确认后移除监听,避免内存泄漏
  514. window.removeEventListener('message', handleVue3Ready);
  515. }
  516. };
  517. window.addEventListener('message', handleVue3Ready);
  518. const timeoutTimer = setTimeout(() => {
  519. console.log('未收到就绪通知,主动发送数据');
  520. sendMessageToVue3();
  521. // 移除监听(兜底后清理)
  522. window.removeEventListener('message', handleVue3Ready);
  523. }, 5000);
  524. const checkWinClosed = setInterval(() => {
  525. if (_pageWindow.closed) {
  526. clearTimeout(timeoutTimer);
  527. clearInterval(checkWinClosed);
  528. window.removeEventListener('message', handleVue3Ready);
  529. }
  530. }, 1000);
  531. // 优化:仅通过轮询方式检查窗口是否加载完成并发送消息,被打开页面无需做任何处理
  532. // const sendFileData = () => {
  533. // if (_pageWindow && !_pageWindow.closed) {
  534. // _pageWindow.postMessage(
  535. // {
  536. // type: 'fileData',
  537. // file,
  538. // },
  539. // '*'
  540. // );
  541. // }
  542. // };
  543. // let checkCount = 0;
  544. // const checkLoadedInterval = setInterval(() => {
  545. // if (!_pageWindow || _pageWindow.closed) {
  546. // clearInterval(checkLoadedInterval);
  547. // return;
  548. // }
  549. // try {
  550. // if (_pageWindow.document && _pageWindow.document.readyState === 'complete') {
  551. // clearInterval(checkLoadedInterval);
  552. // sendFileData();
  553. // }
  554. // } catch (err) {
  555. // // 跨域下直接尝试发送
  556. // clearInterval(checkLoadedInterval);
  557. // sendFileData();
  558. // }
  559. // if (++checkCount > 20) {
  560. // // 最多检测2秒(20次)
  561. // clearInterval(checkLoadedInterval);
  562. // sendFileData();
  563. // }
  564. // }, 100);
  565. setTimeout(() => {
  566. window.focus()
  567. }, 100)
  568. function openPageWindow() {
  569. _pageWindow.focus()
  570. }
  571. 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>`)
  572. },
  573. addPPTClass(file) {
  574. let params = {
  575. pptid: this.id,
  576. cid: this.tcid,
  577. st: this.recordingStartTime,
  578. et: this.recordingEndTime
  579. };
  580. this.ajax
  581. .post(this.$store.state.api + "addPPTClass", [params])
  582. .then(res => {
  583. console.log("addPPTClass", res);
  584. let id = res.data[0][0].id;
  585. this.openObserveDialog(id, file);
  586. })
  587. .catch(err => {
  588. console.error(err);
  589. this.$message.error("保存录音信息失败");
  590. });
  591. },
  592. updateRecordedTime({ duration }) {
  593. // 格式化录音时间
  594. const minutes = Math.floor(duration / 60);
  595. const seconds = Math.floor(duration % 60);
  596. return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  597. },
  598. onRecordAddLine(item) {
  599. // 添加录音文本行
  600. console.log("添加录音文本行:", item);
  601. // 这里可以根据需要添加更多处理逻辑
  602. },
  603. getCourseDetail() {
  604. this.pageLoading = true;
  605. let params = {
  606. courseId: this.id
  607. };
  608. this.ajax
  609. .get(this.$store.state.api + "selectCourseDetail3", params)
  610. .then(res => {
  611. console.log("getCourseDetail", res);
  612. this.courseDetail = res.data[0][0];
  613. this.courseDetail.chapters = JSON.parse(this.courseDetail.chapters);
  614. this.tcid = this.arrayToArray(
  615. this.courseDetail.juri ? this.courseDetail.juri.split(",") : [],
  616. this.tcid2 ? this.tcid2.split(",") : []
  617. )[0] || "";
  618. console.log('tcid', this.tcid)
  619. console.log('tcid2', this.tcid2)
  620. if (this.tcid && res.data[1].length) {
  621. let _inviteA = [];
  622. for (var ik = 0; ik < res.data[1].length; ik++) {
  623. _inviteA.push({
  624. cid: res.data[1][ik].classid,
  625. ic: res.data[1][ik].code,
  626. });
  627. }
  628. for (var ik = 0; ik < _inviteA.length; ik++) {
  629. if (
  630. this.arrayToArray(
  631. _inviteA[ik].cid.split(","),
  632. this.tcid.split(",")
  633. ).length
  634. ) {
  635. this.inviteCode = _inviteA[ik].ic;
  636. break;
  637. }
  638. }
  639. }
  640. this.setPptIframe()
  641. this.classList = res.data[2]
  642. if(!this.tcid2 && this.tType == '1'){
  643. this.$refs.selectTeachingClassDialogRef.open({classList:this.classList})
  644. }
  645. this.pageLoading = false;
  646. })
  647. .catch(err => {
  648. console.log(err);
  649. this.$message.error(this.lang.ssGetCourseDataFail);
  650. this.pageLoading = false;
  651. });
  652. },
  653. setPptIframe() {
  654. this.showIframe = false;
  655. this.$nextTick(() => {
  656. let api = 'https://beta.ppt.cocorobo.cn'
  657. if (this.$region == 'beta') {
  658. api = 'https://beta.ppt.cocorobo.cn'
  659. } else if (this.$region == 'hk') {
  660. api = 'https://ppt.cocorobo.hk'
  661. } else if (this.$region == 'com') {
  662. api = 'https://ppt.cocorobo.com'
  663. } else {
  664. api = 'https://ppt.cocorobo.cn'
  665. }
  666. let _url = api + `/?mode=student&courseid=${this.id}&userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.tcid}&type=${this.tType}`;
  667. this.iframeSrc = _url;
  668. this.showIframe = true;
  669. });
  670. },
  671. arrayToArray(arrayo, arrayt) {
  672. let array1 = arrayo;
  673. let array2 = arrayt;
  674. let commonElements = [];
  675. for (let i = 0; i < array1.length; i++) {
  676. for (let j = 0; j < array2.length; j++) {
  677. if (array1[i] === array2[j]) {
  678. commonElements.push(array1[i]);
  679. }
  680. }
  681. }
  682. return commonElements;
  683. },
  684. async getClassName() {
  685. let courseGrade = await this.ajax.get(this.$store.state.api + "getClassById", { id: this.tcid2 });
  686. this.className = courseGrade.data[0][0].grade;
  687. },
  688. back() {
  689. // if (this.tType != 2) {
  690. // this.goTo(
  691. // '/courseDetail?userid=' +
  692. // this.userid +
  693. // '&oid=' +
  694. // this.oid +
  695. // '&org=' +
  696. // this.org +
  697. // '&cid=' +
  698. // this.classId +
  699. // '&courseId=' +
  700. // this.id +
  701. // '&tType=' +
  702. // this.tType +
  703. // '&screenType=' +
  704. // this.screenType
  705. // )
  706. // } else {
  707. this.goTo(
  708. '/index?userid=' +
  709. this.userid +
  710. '&oid=' +
  711. this.oid +
  712. '&org=' +
  713. this.org +
  714. '&cid=' +
  715. this.classId +
  716. '&tType=' +
  717. this.tType +
  718. '&screenType=' +
  719. this.screenType
  720. )
  721. // }
  722. },
  723. gotoCourseManage(){
  724. this.doSyncClassData(2);
  725. },
  726. afterClass() {
  727. if (this.recordedForm.status == 1) {
  728. this.toggleRecording().then((flag) => {
  729. if (flag) {
  730. this.$refs.confirmInstructionRef.open({
  731. title: this.lang.ssPrompt,
  732. message: this.lang.ssEndClassConfirm,
  733. cancelText: this.lang.ssCancel,
  734. submitText: this.lang.ssConfirm,
  735. submitCallback: () => {
  736. this.isTimeOutPan = false;
  737. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  738. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  739. setTimeout(() => {
  740. this.tcid2 = ""
  741. this.refreshCourse()
  742. if(this.screenType != 2){
  743. this.back()
  744. }else if(this.screenType == 2){
  745. this.gotoCourseManage()
  746. }
  747. }, 1000)
  748. },
  749. cancelCallback: () => {
  750. this.isTimeOutPan = false;
  751. console.log("取消")
  752. }
  753. })
  754. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  755. // confirmButtonText: this.lang.ssConfirm,
  756. // cancelButtonText: this.lang.ssCancel,
  757. // type: 'warning'
  758. // }).then(() => {
  759. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  760. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  761. // setTimeout(() => {
  762. // this.tcid2 = ""
  763. // this.refreshCourse()
  764. // }, 1000)
  765. // }).catch(() => { });
  766. }
  767. })
  768. } else {
  769. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  770. // confirmButtonText: this.lang.ssConfirm,
  771. // cancelButtonText: this.lang.ssCancel,
  772. // type: 'warning'
  773. // }).then(() => {
  774. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  775. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  776. // setTimeout(() => {
  777. // this.tcid2 = ""
  778. // this.refreshCourse()
  779. // }, 1000)
  780. // }).catch(() => { });
  781. this.$refs.confirmInstructionRef.open({
  782. title: this.lang.ssPrompt,
  783. message: this.lang.ssEndClassConfirm,
  784. cancelText: this.lang.ssCancel,
  785. submitText: this.lang.ssConfirm,
  786. submitCallback: () => {
  787. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  788. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  789. setTimeout(() => {
  790. this.tcid2 = ""
  791. this.refreshCourse()
  792. if(this.screenType != 2){
  793. this.back()
  794. }else if(this.screenType == 2){
  795. this.gotoCourseManage()
  796. }
  797. }, 1000)
  798. },
  799. cancelCallback: () => {
  800. console.log("取消")
  801. }
  802. })
  803. }
  804. },
  805. afterClass2(){
  806. this.$refs.confirmInstructionRef.open({
  807. title: this.lang.ssPrompt,
  808. message: this.lang.ssConfirmExit,
  809. cancelText: this.lang.ssCancel,
  810. submitText: this.lang.ssConfirm,
  811. submitCallback: () => {
  812. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout2();
  813. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  814. },
  815. cancelCallback: () => {
  816. console.log("取消")
  817. }
  818. })
  819. },
  820. onFreeBrowseChange(value) {
  821. this.freeBrowse = value;
  822. console.log('自由浏览模式已切换为1:', this.freeBrowse);
  823. this.$refs.ppt.contentWindow.PPTistStudent.toggleFollowMode()
  824. },
  825. onIsCanChange(value) {
  826. this.isCan = value;
  827. for(var i = 0; i < this.isResultArray.length; i++){
  828. let item = this.isResultArray[i];
  829. if(value && item.isTool){
  830. item.can = true
  831. }else if(item.isTool){
  832. item.can = false
  833. item.like = false
  834. }
  835. }
  836. this.$refs.ppt.contentWindow.PPTistStudent.setCan(this.isResultArray)
  837. },
  838. setOperationTime() {
  839. let _this = this;
  840. if (_this.opertimer) {
  841. clearInterval(_this.opertimer);
  842. _this.opertimer = null;
  843. }
  844. _this.opertimer = setInterval(() => {
  845. _this.setoTime("600");
  846. }, 600000);
  847. },
  848. async setoTime(time) {
  849. this.startTime = await this.getServerTime()
  850. this.doSyncClassData();
  851. let params = [
  852. {
  853. uid: this.userid,
  854. cid: this.id + (this.tcid2 || ''),
  855. type: "2",
  856. time: time,
  857. },
  858. ];
  859. this.ajax
  860. .post(this.$store.state.api + "addOperationTimeT2", params)
  861. .then((res) => { })
  862. .catch((err) => {
  863. console.error(err);
  864. });
  865. },
  866. getAIJ() {
  867. this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
  868. let a = res.data[4];
  869. console.log(a)
  870. let Array = [];
  871. a.forEach(i => Array.push(i.oid))
  872. this.jArray = Array;
  873. })
  874. },
  875. async doSyncClassData(type) {
  876. let userArray = ['6fbc6471-1d48-11ed-8c78-005056b86db5','333d0dfc-1cd9-11ef-bee5-005056b86db5','6fbce5ef-1d48-11ed-8c78-005056b86db5','66feffcc-ad35-11ed-b13d-005056b86db5']
  877. if (this.courseDetail.userid == this.userid && (this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840' || userArray.includes(this.userid))) {
  878. let endTime = await this.getServerTime()
  879. let courseTime = Math.max(1, Math.ceil((new Date(endTime) - new Date(this.startTime)) / (1000 * 60)))
  880. this.syncClassData({
  881. courseId: this.id,
  882. title: this.courseDetail.title,
  883. ctitle: this.courseDetail.copyTitle || this.courseDetail.title,
  884. courseGrade: this.tcid2 ? this.tcid2 : '',
  885. courseTime: courseTime,
  886. startTime: this.startTime,
  887. endTime: endTime,
  888. }, 'selectUser', ()=>{
  889. type == 2 ? parent.setCourseUrl() : '';
  890. })
  891. console.log('同步数据')
  892. } else {
  893. type == 2 ? parent.setCourseUrl() : '';
  894. }
  895. },
  896. // 直接上传录制音频/视频
  897. uploadVoiceBtn() {
  898. const input = document.createElement('input');
  899. input.type = 'file';
  900. input.accept = '.m4a,.mp4,.mov,.mp3,.wav';
  901. input.click();
  902. input.onchange = (e) => {
  903. const fileList = e.target.files;
  904. const file = fileList[0]
  905. this.recordingStartTime = new Date(window.recordingStartTime ? window.recordingStartTime : new Date()).toLocaleString("zh-CN", {
  906. hour12: false,
  907. timeZone: "Asia/Shanghai"
  908. }).replace(/\//g, "-");
  909. this.recordingEndTime = new Date(window.recordingEndTime ? window.recordingEndTime : new Date()).toLocaleString("zh-CN", {
  910. hour12: false,
  911. timeZone: "Asia/Shanghai"
  912. }).replace(/\//g, "-");
  913. this.addPPTClass(file)
  914. // 判断文件类型并获取音频或视频时长
  915. // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
  916. // const url = URL.createObjectURL(file);
  917. // let media;
  918. // if (file.type.startsWith('audio/')) {
  919. // media = new Audio();
  920. // } else {
  921. // media = document.createElement('video');
  922. // }
  923. // media.preload = 'metadata';
  924. // media.src = url;
  925. // media.onloadedmetadata = () => {
  926. // const duration = media.duration;
  927. // console.log('文件时长(秒):', duration);
  928. // // 这里可以赋值或者进一步处理时长 duration
  929. // URL.revokeObjectURL(url);
  930. // };
  931. // media.onerror = () => {
  932. // console.error('无法读取文件时长');
  933. // URL.revokeObjectURL(url);
  934. // };
  935. // }
  936. }
  937. },
  938. // 打开分享弹窗
  939. openShareDialog() {
  940. let code = this.userJson.oidCode || this.userJson.orgCode
  941. this.$refs.shareDialogRef.open(code, this.inviteCode)
  942. },
  943. resetIdleOp(){
  944. if(this.courseDetail.userId == this.userid){
  945. this.isTimeOutPan = true;
  946. this.afterClass()
  947. setTimeout(() => {
  948. if(this.isTimeOutPan){
  949. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  950. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  951. setTimeout(() => {
  952. this.tcid2 = ""
  953. this.refreshCourse()
  954. }, 1000)
  955. }
  956. }, 5000);
  957. }
  958. // console.log('resetIdleOp','重置空闲定时器')
  959. }
  960. },
  961. destroyed() {
  962. clearInterval(this.opertimer);
  963. this.opertimer = null;
  964. clearTimeout(this.timeoutPan);
  965. this.timeoutPan = null;
  966. this.doSyncClassData();
  967. this.stopIdleDetection(this.resetIdleOp);
  968. },
  969. async mounted() {
  970. this.setoTime("1");
  971. this.startTime = await this.getServerTime()
  972. console.log('this.startTime', this.startTime)
  973. this.timeoutPan = setTimeout(() => {
  974. this.startIdleDetection(this.resetIdleOp);
  975. }, 40 * 60 * 1000)
  976. // this.startIdleDetection(this.resetIdleOp);
  977. this.getClassName()
  978. this.getAIJ();
  979. this.getCourseDetail();
  980. this.setOperationTime();
  981. window.onFreeBrowseChange = (value) => {
  982. this.freeBrowse = value;
  983. console.log('自由浏览模式已切换为:', this.freeBrowse);
  984. }
  985. window.setIsResultArray = (value) => {
  986. this.isResultArray = value;
  987. // 判断数组中isTool为true的项的can是否都为true
  988. const toolItems = value.filter(item => item.isTool);
  989. if (toolItems.length > 0) {
  990. const allCanTrue = toolItems.every(item => item.can === true);
  991. const allCanFalse = toolItems.every(item => item.can === false);
  992. if (allCanTrue) {
  993. this.isCan = true;
  994. } else if (allCanFalse) {
  995. this.isCan = false;
  996. }
  997. }
  998. }
  999. if (!this.userJson || !this.userJson.accountNumber) {
  1000. let res = await this.ajax.get(this.$store.state.api + "selectUser", {
  1001. userid: this.$route.query.userid
  1002. });
  1003. this.userJson = res.data[0][0]
  1004. }
  1005. setTimeout(() => {
  1006. this.doSyncClassData();
  1007. }, 1000);
  1008. }
  1009. };
  1010. </script>
  1011. <style scoped>
  1012. .pptEasyClass {
  1013. width: 100vw;
  1014. height: 100vh;
  1015. display: flex;
  1016. flex-direction: column;
  1017. overflow: hidden;
  1018. box-sizing: border-box;
  1019. background-color: #f2f2f2;
  1020. min-height: unset;
  1021. }
  1022. .pec_main {
  1023. width: 100%;
  1024. height: 100%;
  1025. background-color: #fff;
  1026. }
  1027. .pec_header {
  1028. width: 100%;
  1029. height: 60px;
  1030. background: #FCCF00;
  1031. box-sizing: border-box;
  1032. display: flex;
  1033. align-items: center;
  1034. justify-content: space-between;
  1035. position: relative;
  1036. box-shadow: 0px 4px 12px 0px #3648601F;
  1037. padding: 0 10px;
  1038. box-sizing: border-box;
  1039. }
  1040. .pec_h_left {
  1041. width: auto;
  1042. height: 100%;
  1043. display: flex;
  1044. align-items: center;
  1045. gap: 25px;
  1046. /* 保持左侧靠左 */
  1047. }
  1048. .pec_h_center {
  1049. position: absolute;
  1050. left: 50%;
  1051. top: 0;
  1052. height: 100%;
  1053. display: flex;
  1054. align-items: center;
  1055. transform: translateX(-50%);
  1056. z-index: 1;
  1057. }
  1058. .pec_h_l_title {
  1059. font-weight: bold;
  1060. font-size: 20px;
  1061. color: #0e1e33;
  1062. overflow: hidden;
  1063. white-space: nowrap;
  1064. max-width: 500px;
  1065. text-overflow: ellipsis;
  1066. }
  1067. .pec_h_right {
  1068. width: auto;
  1069. height: 100%;
  1070. display: flex;
  1071. align-items: center;
  1072. }
  1073. .pec_h_r_btnArea {
  1074. display: flex;
  1075. align-items: center;
  1076. justify-content: center;
  1077. }
  1078. .pec_h_r_btnArea>div {
  1079. width: auto;
  1080. height: auto;
  1081. display: flex;
  1082. align-items: center;
  1083. justify-content: center;
  1084. padding: 10px 20px;
  1085. background-color: #f0f4fa;
  1086. border-radius: 4px;
  1087. cursor: pointer;
  1088. font-size: 14px;
  1089. font-weight: 400;
  1090. color: #000;
  1091. border: 1px solid #cad1dc;
  1092. }
  1093. .pec_h_r_btnArea>div+div {
  1094. margin-left: 10px;
  1095. }
  1096. .pec_h_r_btnArea>div>img {
  1097. width: 15px;
  1098. height: 15px;
  1099. margin-right: 5px;
  1100. }
  1101. .pec_h_center>.pec_h_r_btn_refresh {
  1102. color: #fff;
  1103. /* background-color: #0061ff;
  1104. border-color: #0061ff; */
  1105. padding: 9px 10px;
  1106. margin-right: 15px;
  1107. border-radius: 26px;
  1108. display: flex;
  1109. align-items: center;
  1110. justify-content: center;
  1111. gap: 5px;
  1112. background: #FFF7F5;
  1113. color: #000000;
  1114. font-weight: 400;
  1115. cursor: pointer;
  1116. fill: #666666;
  1117. }
  1118. .pec_h_center>.pec_h_r_btn_refresh>svg {
  1119. width: 1rem;
  1120. height: 1rem;
  1121. }
  1122. .pec_h_center>.pec_h_r_btn_refresh.recording {
  1123. /* background-color: #F53F3F;
  1124. border-color: #F53F3F; */
  1125. background: #FFF7E8;
  1126. fill: #FF9300;
  1127. animation: pulse 1.5s infinite;
  1128. }
  1129. @keyframes pulse {
  1130. 0% {
  1131. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.4);
  1132. }
  1133. 70% {
  1134. box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
  1135. }
  1136. 100% {
  1137. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
  1138. }
  1139. }
  1140. .pec_h_r_btnArea>.pec_h_r_btn_afterClass {
  1141. border-color: #F0E1DD;
  1142. background-color: #FFF7F5;
  1143. color: #F53F3F;
  1144. }
  1145. .pec_h_r_btn_uploadVoiceBtn {
  1146. border-color: #F0E1DD;
  1147. background-color: #FFF7F5;
  1148. color: #000;
  1149. }
  1150. .backBtn {
  1151. width: 15px;
  1152. height: 15px;
  1153. display: flex;
  1154. align-items: center;
  1155. justify-content: center;
  1156. cursor: pointer;
  1157. }
  1158. .backBtn img {
  1159. width: 100%;
  1160. height: 100%;
  1161. }
  1162. .shareBtn {
  1163. width: 25px;
  1164. height: 25px;
  1165. display: flex;
  1166. align-items: center;
  1167. justify-content: center;
  1168. cursor: pointer;
  1169. }
  1170. .shareBtn img {
  1171. width: 100%;
  1172. height: 100%;
  1173. }
  1174. .class-info-group {
  1175. display: flex;
  1176. align-items: center;
  1177. gap: 10px;
  1178. }
  1179. .class-label {
  1180. font-size: 18px;
  1181. font-weight: bold;
  1182. color: #222;
  1183. margin-right: 5px;
  1184. }
  1185. .class-value {
  1186. font-size: 16px;
  1187. color: #222;
  1188. background: #FFFFFF3D;
  1189. border: 1px solid #00000080;
  1190. border-radius: 5px;
  1191. padding: 5px 18px;
  1192. min-width: 60px;
  1193. text-align: center;
  1194. display: inline-block;
  1195. box-sizing: border-box;
  1196. display: flex;
  1197. align-items: center;
  1198. }
  1199. .class-value2 {
  1200. cursor: pointer;
  1201. background: #fff;
  1202. }
  1203. .class-value > svg{
  1204. width: 13px;
  1205. height: 13px;
  1206. margin-left: 8px;
  1207. }
  1208. .pec_content {
  1209. width: 100%;
  1210. height: calc(100% - 60px);
  1211. border-radius: 0 0 12px 12px;
  1212. background-color: #fff;
  1213. }
  1214. .free-browse-switch {
  1215. display: flex;
  1216. align-items: center;
  1217. padding: 9px 10px;
  1218. background: #FFF7F5;
  1219. border-radius: 26px;
  1220. margin-left: 15px;
  1221. gap: 5px;
  1222. }
  1223. .switch-label {
  1224. /* background: linear-gradient(to right, #F53F3F, #FCCF00); */
  1225. /* -webkit-background-clip: text; */
  1226. color: #000;
  1227. }
  1228. .refresh_icon {
  1229. width: 35px;
  1230. height: 35px;
  1231. display: flex;
  1232. align-items: center;
  1233. justify-content: center;
  1234. background-color: #fff7f5;
  1235. border-radius: 45%;
  1236. cursor: pointer;
  1237. margin-right: 15px;
  1238. padding: 0 3px;
  1239. }
  1240. .refresh_icon img {
  1241. width: 16px;
  1242. height: 16px;
  1243. }
  1244. .name_box {
  1245. background: unset !important;
  1246. border: none !important;
  1247. cursor: unset !important;
  1248. }
  1249. .observe-dialog>>>.el-dialog__header {
  1250. padding: 0;
  1251. }
  1252. .observe-dialog>>>.el-dialog__body {
  1253. padding: 0;
  1254. }
  1255. .observe-dialog>>>.el-dialog__headerbtn {
  1256. top: 22px;
  1257. right: 20px;
  1258. z-index: 100;
  1259. }
  1260. </style>