index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <el-dialog
  3. title="英语口语"
  4. :visible.sync="EnglishVoiceDialog"
  5. :append-to-body="true"
  6. width="100%"
  7. :before-close="handleClose"
  8. class="dialog_diy"
  9. >
  10. <div class="engBox" v-if="diaType == '0'">
  11. <div
  12. class="leftBox"
  13. :class="boxClick == '0' ? 'clickBox leftBox' : 'leftBox'"
  14. @click="boxClick = '0'"
  15. >
  16. <div class="fChoose">
  17. <img src="../../../assets/icon/englishVoice/fChoose.png" alt="" />
  18. </div>
  19. <div>自然交流场景</div>
  20. <div>
  21. 自然交流场景说明自然交流场景说明自然交流场景说明自然交流场景说(最多展示两行)
  22. </div>
  23. <div class="goButton" @click="diaType = '1'" v-if="boxClick == '0'">
  24. <div>去创建</div>
  25. <div class="right">
  26. <img src="../../../assets/icon/englishVoice/right.png" alt="" />
  27. </div>
  28. </div>
  29. </div>
  30. <div
  31. class="rightBox"
  32. :class="boxClick == '1' ? 'clickBox rightBox' : 'rightBox'"
  33. @click="boxClick = '1'"
  34. >
  35. <div class="sChoose">
  36. <img src="../../../assets/icon/englishVoice/sChoose.png" alt="" />
  37. </div>
  38. <div>口语题目场景</div>
  39. <div>
  40. 口语题目场景说明口语题目场景说明口语题目场景说明口语题目场景说明(最多展示两行)
  41. </div>
  42. <div class="goButton" @click="diaType = '1'" v-if="boxClick == '1'">
  43. <div>去创建</div>
  44. <div class="right">
  45. <img src="../../../assets/icon/englishVoice/right.png" alt="" />
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <check
  51. :checkJson="checkJson"
  52. @setCheckJson="setCheckJson"
  53. :diaType="diaType"
  54. :oid="oid"
  55. :org="org"
  56. v-if="diaType == '1'"
  57. ></check>
  58. <talkPreview
  59. :talkPreviewDialog.sync="talkPreviewDialog"
  60. :checkJson="checkJson"
  61. :oid="oid"
  62. :org="org"
  63. ></talkPreview>
  64. <span slot="footer" class="dialog-footer" v-if="diaType == '0'">
  65. <el-button type="primary" @click="close()">确 认</el-button>
  66. <el-button @click="close()">关 闭</el-button>
  67. </span>
  68. <span
  69. slot="footer"
  70. class="dialog-footer checkFooter"
  71. v-if="diaType == '1' || talkPreviewDialog"
  72. >
  73. <div @click="diaType = '0'">上一步</div>
  74. <div @click="talkPreview">对话预览</div>
  75. <div
  76. @click="confirm()"
  77. style="background: #3681fc; color: #fff; border: none"
  78. >
  79. 确认上传
  80. </div>
  81. </span>
  82. </el-dialog>
  83. </template>
  84. <script>
  85. import check from "./component/check";
  86. import talkPreview from "./component/talkPreview.vue";
  87. export default {
  88. components: {
  89. check,
  90. talkPreview,
  91. },
  92. props: {
  93. EnglishVoiceDialog: {
  94. type: Boolean,
  95. default: false,
  96. },
  97. oid: {
  98. type: String,
  99. },
  100. org: {
  101. type: String,
  102. },
  103. englishVoiceJson: {
  104. type: Object,
  105. },
  106. },
  107. data() {
  108. return {
  109. checkJson: {
  110. time: "",
  111. class: "",
  112. difficulty: 0,
  113. topic: "",
  114. isShow: false,
  115. eva: 0,
  116. aiEva: {
  117. isAiEva: false,
  118. aiEvaChoose: [],
  119. },
  120. allfType: [],
  121. englishJson: {},
  122. },
  123. diaType: "0",
  124. boxClick: "0",
  125. talkPreviewDialog: false,
  126. };
  127. },
  128. methods: {
  129. handleClose(done) {
  130. this.close();
  131. done();
  132. },
  133. close() {
  134. this.diaType = "0";
  135. this.$emit("update:EnglishVoiceDialog", false);
  136. },
  137. setCheckJson(checkJson) {
  138. this.checkJson = checkJson;
  139. },
  140. confirm() {
  141. this.$emit(
  142. "setEnglishVoiceJson",
  143. JSON.parse(JSON.stringify(this.checkJson))
  144. );
  145. this.close();
  146. },
  147. talkPreview() {
  148. if (this.checkJson.time == "") {
  149. this.$message.error("请选择练习时长!");
  150. return;
  151. } else if (this.checkJson.class == "") {
  152. this.$message.error("请选择年级!");
  153. return;
  154. } else if (this.checkJson.topic == "") {
  155. this.$message.error("请选择话题!");
  156. return;
  157. }
  158. this.talkPreviewDialog = true;
  159. },
  160. },
  161. watch: {
  162. EnglishVoiceDialog: {
  163. handler: function (newVal, oldVal) {
  164. if (newVal) {
  165. // this.setVoiceJson(this.englishVoiceJson);
  166. this.checkJson = JSON.parse(JSON.stringify(this.englishVoiceJson));
  167. }
  168. },
  169. deep: true,
  170. },
  171. },
  172. mounted() {
  173. // this.setVoiceJson(this.englishVoiceJson);
  174. },
  175. };
  176. </script>
  177. <style scoped>
  178. .dialog_diy >>> .el-dialog {
  179. background: #f0f2f5;
  180. height: 100%;
  181. margin: 0vh auto !important;
  182. }
  183. .dialog_diy >>> .el-dialog__header {
  184. background: #454545 !important;
  185. padding: 15px 20px;
  186. }
  187. .dialog_diy >>> .el-dialog__body {
  188. height: calc(100% - 124px);
  189. box-sizing: border-box;
  190. padding: 0px;
  191. }
  192. .dialog_diy >>> .el-dialog__title {
  193. color: #fff;
  194. }
  195. .dialog_diy >>> .el-dialog__headerbtn {
  196. top: 19px;
  197. }
  198. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  199. color: #fff;
  200. }
  201. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  202. color: #fff;
  203. }
  204. .dialog_diy >>> .el-dialog__body,
  205. .dialog_diy >>> .el-dialog__footer {
  206. background: #f0f2f5;
  207. overflow: hidden;
  208. }
  209. .engBox {
  210. width: 100%;
  211. height: 100%;
  212. display: flex;
  213. flex-direction: row;
  214. flex-wrap: nowrap;
  215. align-items: center;
  216. justify-content: center;
  217. }
  218. .leftBox,
  219. .rightBox {
  220. display: flex;
  221. flex-direction: column;
  222. flex-wrap: nowrap;
  223. align-items: center;
  224. width: 400px;
  225. padding: 20px;
  226. background: #fff;
  227. border-radius: 5px;
  228. cursor: pointer;
  229. position: relative;
  230. }
  231. .clickBox {
  232. border: 2px solid #78aafc;
  233. box-shadow: 0px 1px 10px 2px #e0e0e0;
  234. }
  235. .leftBox {
  236. margin: 0 50px 0 0;
  237. }
  238. .leftBox > div:nth-child(2),
  239. .rightBox > div:nth-child(2) {
  240. font-weight: bold;
  241. font-size: 20px;
  242. margin: 10px 0;
  243. }
  244. .leftBox > div:nth-child(3),
  245. .rightBox > div:nth-child(3) {
  246. text-align: center;
  247. }
  248. .fChoose,
  249. .sChoose {
  250. width: 300px;
  251. height: 250px;
  252. cursor: pointer;
  253. }
  254. .fChoose > img,
  255. .sChoose > img {
  256. width: 100%;
  257. height: 100%;
  258. object-fit: cover;
  259. }
  260. .checkFooter {
  261. display: flex;
  262. flex-direction: row;
  263. flex-wrap: nowrap;
  264. align-items: center;
  265. justify-content: flex-end;
  266. }
  267. .checkFooter > div {
  268. min-width: 100px;
  269. width: 100px;
  270. text-align: center;
  271. border-radius: 5px;
  272. background: #ffffff;
  273. color: #3681fc;
  274. border: 1px solid #3681fc;
  275. height: 35px;
  276. line-height: 35px;
  277. margin-right: 10px;
  278. font-size: 12px;
  279. cursor: pointer;
  280. }
  281. .checkFooter > div:first-child {
  282. background: #f0f2f5 !important;
  283. color: #000 !important;
  284. }
  285. .goButton {
  286. display: flex;
  287. flex-direction: row;
  288. flex-wrap: nowrap;
  289. align-items: center;
  290. position: absolute;
  291. bottom: -70px;
  292. width: 100px;
  293. text-align: center;
  294. background: #3681fc;
  295. color: #fff;
  296. height: 35px;
  297. line-height: 35px;
  298. justify-content: center;
  299. border-radius: 5px;
  300. cursor: pointer;
  301. }
  302. .right {
  303. width: 20px;
  304. margin-left: 5px;
  305. line-height: 15px;
  306. }
  307. .right > img {
  308. width: 100%;
  309. height: 100%;
  310. }
  311. </style>