studyReportNew.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <div class="m-containers">
  3. <img :src="imgList.topBanner" width="100%" class="topBanner" alt />
  4. <div class="paddingWrap">
  5. <div class="topCard">
  6. <img :src="imgList.note1" class="topNote" width="100%" alt />
  7. <p class="title">
  8. <img :src="imgList.squrt" class="squrts" alt />
  9. 授课内容
  10. </p>
  11. <div class="chioseList">
  12. <div class="theoryCell">
  13. <div class="left">
  14. <img :src="imgList.theoryIcon" class="theoryIcon" alt />
  15. 乐理
  16. </div>
  17. <div class="right">
  18. <div class="theoryItem" v-for="(item,index) in hasTheory" :key="index">
  19. <van-field
  20. readonly
  21. clickable
  22. :label="subjectName"
  23. placeholder="请选择乐理"
  24. :value="item.str"
  25. @click="item.show = true"
  26. />
  27. <van-popup
  28. v-model="item.show"
  29. position="bottom"
  30. :overlay="true"
  31. get-container="#app"
  32. >
  33. <van-picker
  34. show-toolbar
  35. :columns="theoryList"
  36. @cancel="item.show = false"
  37. @confirm="(val)=>{ onConfirm(val,item)}"
  38. />
  39. </van-popup>
  40. <div class="iconWrap" v-if="index== 0" @click="addTheory(hasTheory)">
  41. <img :src="imgList.addIcon" class="smallIcon" alt />
  42. </div>
  43. <div class="iconWrap" v-else>
  44. <img
  45. :src="imgList.deteleIcon"
  46. class="smallIcon"
  47. alt
  48. @click="removeTheory(hasTheory,index)"
  49. />
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="musicCell">
  55. <div class="left">
  56. <img :src="imgList.muiscIcon" class="muiscIcon" alt />
  57. 曲子
  58. </div>
  59. <div class="right">
  60. <van-field v-model="testMusic" rows="1" autosize type="textarea" placeholder="请输入曲子" />
  61. </div>
  62. </div>
  63. <div class="theoryCell teachingCell">
  64. <div class="left">
  65. <img :src="imgList.bookIcon" class="bookIcon" alt />
  66. 教材
  67. </div>
  68. <div class="right">
  69. <div class="theoryItem" v-for="(item,index) in teaching" :key="index">
  70. <van-field
  71. readonly
  72. clickable
  73. :label="subjectName"
  74. placeholder="请选择教材"
  75. :value="item.str"
  76. @click="item.show = true"
  77. />
  78. <van-popup v-model="item.show" position="bottom" get-container="#app">
  79. <van-picker
  80. show-toolbar
  81. :columns="teachingList"
  82. @cancel="item.show = false"
  83. @confirm="(val)=>{ onTeacherConfirm(val,item)}"
  84. />
  85. </van-popup>
  86. <div class="iconWrap" v-if="index== 0" @click="addTheory(teaching)">
  87. <img :src="imgList.addIcon" class="smallIcon" alt />
  88. </div>
  89. <div class="iconWrap" v-else>
  90. <img
  91. :src="imgList.deteleIcon"
  92. class="smallIcon"
  93. alt
  94. @click="removeTheory(teaching,index)"
  95. />
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="nextCard">
  103. <img :src="imgList.note2" class="topNote" width="100%" alt />
  104. <p class="title">
  105. <img :src="imgList.squrt" class="squrts" alt />
  106. 必选项
  107. </p>
  108. <div class="chioseList">
  109. <p class="subTitle">1.{{subjectJson[1].title}}</p>
  110. <div class="cell" :class="one==1?'activce':''" @click="one=1">
  111. <img :src="imgList.excellent" class="icons" alt />
  112. <p>{{subjectJson[1][1] }}</p>
  113. </div>
  114. <div class="cell" :class="one==2?'activce':''" @click="one=2">
  115. <img :src="imgList.good" class="icons" alt />
  116. <p>{{subjectJson[1][2] }} </p>
  117. </div>
  118. <div class="cell" :class="one==3?'activce':''" @click="one=3">
  119. <img :src="imgList.normal" class="icons" alt />
  120. <p>{{subjectJson[1][3] }}</p>
  121. </div>
  122. </div>
  123. <img :src="imgList.line" alt width="100%" />
  124. <div class="chioseList">
  125. <p class="subTitles">2.{{subjectJson[2].title}}</p>
  126. <div class="cell" :class="two==1?'activce':''" @click="two=1">
  127. <img :src="imgList.excellent" class="icons" alt />
  128. <p>{{subjectJson[2][1] }}</p>
  129. </div>
  130. <div class="cell" :class="two==2?'activce':''" @click="two=2">
  131. <img :src="imgList.good" class="icons" alt />
  132. <p>{{subjectJson[2][2] }}</p>
  133. </div>
  134. <div class="cell" :class="two==3?'activce':''" @click="two=3">
  135. <img :src="imgList.normal" class="icons" alt />
  136. <p>{{subjectJson[2][3] }}</p>
  137. </div>
  138. </div>
  139. <img :src="imgList.line" alt width="100%" />
  140. <div class="chioseList">
  141. <p class="subTitles">3.{{subjectJson[3].title}}</p>
  142. <div class="cell" :class="three==1?'activce':''" @click="three=1">
  143. <img :src="imgList.excellent" class="icons" alt />
  144. <p>{{subjectJson[3][1] }}</p>
  145. </div>
  146. <div class="cell" :class="three==2?'activce':''" @click="three=2">
  147. <img :src="imgList.good" class="icons" alt />
  148. <p> {{subjectJson[3][2] }}</p>
  149. </div>
  150. <div class="cell" :class="three==3?'activce':''" @click="three=3">
  151. <img :src="imgList.normal" class="icons" alt />
  152. <p>{{subjectJson[3][3] }}</p>
  153. </div>
  154. </div>
  155. <img :src="imgList.line" alt width="100%" />
  156. <div class="chioseList">
  157. <p class="subTitles">4.{{subjectJson[4].title}}</p>
  158. <div class="cell" :class="four==1?'activce':''" @click="four=1">
  159. <img :src="imgList.excellent" class="icons" alt />
  160. <p> {{subjectJson[4][1] }}</p>
  161. </div>
  162. <div class="cell" :class="four==2?'activce':''" @click="four=2">
  163. <img :src="imgList.good" class="icons" alt />
  164. <p> {{subjectJson[4][2] }}</p>
  165. </div>
  166. <div class="cell" :class="four==3?'activce':''" @click="four=3">
  167. <img :src="imgList.normal" class="icons" alt />
  168. <p>{{subjectJson[4][3] }}</p>
  169. </div>
  170. </div>
  171. <img :src="imgList.line" alt width="100%" />
  172. <div class="chioseList">
  173. <p class="subTitles">5.{{subjectJson[5].title}}</p>
  174. <div class="cell" :class="five==1?'activce':''" @click="five=1">
  175. <img :src="imgList.excellent" class="icons" alt />
  176. <p>{{subjectJson[5][1] }}</p>
  177. </div>
  178. <div class="cell" :class="five==2?'activce':''" @click="five=2">
  179. <img :src="imgList.normal" class="icons" alt />
  180. <p>{{subjectJson[5][2] }}</p>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="nextCard">
  185. <img :src="imgList.note2" class="topNote" width="100%" alt />
  186. <p class="title">
  187. <img :src="imgList.squrt" class="squrts" alt />
  188. 可选项
  189. </p>
  190. <div class="chioseList">
  191. <p class="subTitle">1.{{subjectJson[6].title}}</p>
  192. <div class="cell" :class="six==1?'activce':''" @click="six=1">
  193. <img :src="imgList.excellent" class="icons" alt />
  194. <p>{{subjectJson[6][1] }}</p>
  195. </div>
  196. <div class="cell" :class="six==2?'activce':''" @click="six=2">
  197. <img :src="imgList.normal" class="icons" alt />
  198. <p> {{subjectJson[6][2] }}</p>
  199. </div>
  200. </div>
  201. <img :src="imgList.line" alt width="100%" />
  202. <div class="chioseList">
  203. <p class="subTitles">2.{{subjectJson[7].title}}</p>
  204. <div class="cell" :class="seven==1?'activce':''" @click="seven=1">
  205. <img :src="imgList.excellent" class="icons" alt />
  206. <p>{{subjectJson[7][1] }}</p>
  207. </div>
  208. <div class="cell" :class="seven==2?'activce':''" @click="seven=2">
  209. <img :src="imgList.normal" class="icons" alt />
  210. <p>{{subjectJson[7][2] }}</p>
  211. </div>
  212. </div>
  213. <img :src="imgList.line" alt width="100%" />
  214. <div class="chioseList">
  215. <p class="subTitles">3.{{subjectJson[8].title}}</p>
  216. <div class="cell" :class="eight==1?'activce':''" @click="eight=1">
  217. <img :src="imgList.excellent" class="icons" alt />
  218. <p>{{subjectJson[8][1] }}</p>
  219. </div>
  220. <div class="cell" :class="eight==2?'activce':''" @click="eight=2">
  221. <img :src="imgList.good" class="icons" alt />
  222. <p>{{subjectJson[8][2] }}</p>
  223. </div>
  224. <div class="cell" :class="eight==3?'activce':''" @click="eight=3">
  225. <img :src="imgList.normal" class="icons" alt />
  226. <p>{{subjectJson[8][3] }}</p>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="nextCard">
  231. <p class="title commitTitle">
  232. <img :src="imgList.squrt" class="squrts" alt />
  233. 老师评语
  234. </p>
  235. <div class="commitWrap">
  236. <van-field v-model="comment" rows="3" autosize type="textarea" placeholder="学员表现的怎么样?填写评语能让学员更清楚自己 的优点和美中不足的地方哦~" />
  237. </div>
  238. </div>
  239. </div>
  240. <div class="submit" @click="submietInfo">
  241. <img :src="imgList.btn" width="100%" alt />
  242. </div>
  243. <div class="bottomBox"></div>
  244. </div>
  245. </template>
  246. <script>
  247. import { subjectJson } from "@/utils/questionJson";
  248. import { browser } from "@/common/common";
  249. import { findTeacherClassGroupInfo, addStudyReport1 } from "@/api/teacher";
  250. export default {
  251. data() {
  252. return {
  253. imgList: {
  254. topBanner: require("@/assets/images/start/topBanner.png"),
  255. note1: require("@/assets/images/start/note1.png"),
  256. note2: require("@/assets/images/start/note2.png"),
  257. squrt: require("@/assets/images/start/squrt.png"),
  258. theoryIcon: require("@/assets/images/start/theory-icon.png"),
  259. muiscIcon: require("@/assets/images/start/muisc-icon.png"),
  260. bookIcon: require("@/assets/images/start/book-icon.png"),
  261. addIcon: require("@/assets/images/start/add-icon.png"),
  262. deteleIcon: require("@/assets/images/start/detele-icon.png"),
  263. excellent: require("@/assets/images/start/excellent.png"),
  264. good: require("@/assets/images/start/good.png"),
  265. normal: require("@/assets/images/start/normal.png"),
  266. line: require("@/assets/images/start/line.png"),
  267. btn: require("@/assets/images/start/button.png")
  268. },
  269. theoryList: ["一级", "二级", "三级", "四级"],
  270. teachingList: [
  271. {
  272. values: ["一级", "二级", "三级", "四级"],
  273. defaultIndex: 2
  274. },
  275. {
  276. values: [],
  277. defaultIndex: 1
  278. }
  279. ],
  280. hasTheory: [{ str: "", show: false }],
  281. teaching: [{ str: "", show: false }],
  282. testMusic: "",
  283. showPicker: false,
  284. lessArr: [],
  285. subjectJson: subjectJson,
  286. one: "",
  287. two: "",
  288. three: "",
  289. four: "",
  290. five: "",
  291. six: "",
  292. seven: "",
  293. eight: "",
  294. subjectName: null,
  295. id: "",
  296. comment:''
  297. };
  298. },
  299. created() {
  300. for (let i = 0; i < 17; i++) {
  301. this.teachingList[1].values.push(` lesson${i + 1} `);
  302. }
  303. this.classGroupId = this.$route.query.classGroupId;
  304. this.id = this.$route.query.id;
  305. this.token = localStorage.getItem("Authorization");
  306. // if (!this.token || !this.classGroupId) {
  307. // this.onAppBack();
  308. // return;
  309. // }
  310. findTeacherClassGroupInfo({ classGroupId: this.classGroupId }).then(res => {
  311. if (res.data.code == 200) {
  312. this.subjectName = res.data.data.subjectNames;
  313. }
  314. });
  315. },
  316. methods: {
  317. onConfirm(val, item) {
  318. item.str = val;
  319. item.show = false;
  320. },
  321. onTeacherConfirm(val, item) {
  322. item.str = val[0] + val[1];
  323. item.show = false;
  324. },
  325. addTheory(arr) {
  326. arr.push({ str: "", show: false });
  327. },
  328. removeTheory(arr, index) {
  329. arr.splice(index, 1);
  330. },
  331. submietInfo() {
  332. // console.log(this.one)
  333. // console.log(this.json.one[this.one])
  334. if (!this.one || !this.two || !this.three || !this.four || !this.five) {
  335. this.$toast("请认真选择必选项");
  336. return;
  337. }
  338. if (!this.hasTheory[0].str || !this.teaching[0].str) {
  339. this.$toast("必须选择乐理和教材");
  340. return;
  341. }
  342. if (!this.testMusic) {
  343. this.$toast("请输入练习曲目");
  344. return;
  345. }
  346. this.item = {
  347. one: this.one,
  348. two: this.two,
  349. three: this.three,
  350. four: this.four,
  351. five: this.five,
  352. six: this.six,
  353. seven: this.seven,
  354. eight: this.eight
  355. };
  356. let id = this.id || null;
  357. let comment = this.comment || null;
  358. addStudyReport1({
  359. classGroupId: this.classGroupId,
  360. item: this.item,
  361. song: this.testMusic,
  362. musicTheory: this.hasTheory,
  363. teachingMaterial: this.teaching,
  364. version: 2,
  365. comment:this.comment,
  366. id
  367. }).then(res => {
  368. if (res.data.code == 200) {
  369. this.$toast("提交成功");
  370. setTimeout(() => {
  371. this.onAppBack();
  372. }, 2000);
  373. } else {
  374. this.$toast(res.data.msg);
  375. // setTimeout(() => {
  376. // // this.$router.push({
  377. // // path: "/studyReport",
  378. // // query: { classGroupId: this.classGroupId }
  379. // // });
  380. // }, 2000);
  381. }
  382. });
  383. },
  384. onAppBack() {
  385. if (browser().android) {
  386. DAYA.postMessage(JSON.stringify({ api: "back" }));
  387. } else if (browser().iPhone) {
  388. window.webkit.messageHandlers.DAYA.postMessage(
  389. JSON.stringify({ api: "back" })
  390. );
  391. }
  392. }
  393. }
  394. };
  395. </script>
  396. <style lang="less" scoped>
  397. div {
  398. box-sizing: border-box;
  399. }
  400. .m-containers {
  401. background: url("../../assets/images/start/bg.png") no-repeat;
  402. // background-size: 100% 100%;
  403. position: relative;
  404. width: 100%;
  405. min-height: 16.97rem;
  406. display: flex;
  407. flex-direction: column;
  408. align-items: center;
  409. background-color: #5ed5d4;
  410. padding-bottom: 0.2rem;
  411. z-index: 0;
  412. .topBanner {
  413. z-index: 10;
  414. }
  415. .paddingWrap {
  416. position: relative;
  417. z-index: 2;
  418. padding: 0 0.2rem 0.26rem;
  419. .topCard,
  420. .nextCard {
  421. position: relative;
  422. border-radius: 15px;
  423. top: -0.08rem;
  424. background-color: #fff;
  425. display: flex;
  426. flex-direction: column;
  427. justify-content: center;
  428. padding-bottom: 0.24rem;
  429. .commitTitle {
  430. position: relative!important;
  431. margin-bottom:.17rem!important;
  432. }
  433. .commitWrap {
  434. padding: 0.1rem;
  435. }
  436. .topNote {
  437. z-index: 1;
  438. }
  439. .title {
  440. z-index: 5;
  441. position: absolute;
  442. top: 0.21rem;
  443. left: 0.15rem;
  444. display: flex;
  445. flex-direction: row;
  446. justify-content: flex-start;
  447. font-size: 0.18rem;
  448. height: 0.22rem;
  449. line-height: 0.22rem;
  450. margin-bottom: 0.365rem;
  451. color: #808080;
  452. font-weight: bold;
  453. .squrts {
  454. width: 0.05rem;
  455. height: 0.22rem;
  456. margin-right: 0.1rem;
  457. position: relative;
  458. z-index: 5;
  459. }
  460. }
  461. .chioseList {
  462. position: relative;
  463. top: -0.1rem;
  464. z-index: 3;
  465. padding: 0 0.17rem;
  466. .theoryCell,
  467. .musicCell {
  468. display: flex;
  469. flex-direction: row;
  470. justify-content: flex-start;
  471. background: rgba(255, 255, 255, 1);
  472. box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.14);
  473. border-radius: 10px;
  474. min-height: 0.44rem;
  475. padding: 0 0.07rem;
  476. .left {
  477. color: #666;
  478. font-size: 0.15rem;
  479. line-height: 0.44rem;
  480. margin-right: 6px;
  481. .theoryIcon {
  482. width: 0.17rem;
  483. height: 0.17rem;
  484. position: relative;
  485. top: 0.04rem;
  486. }
  487. .muiscIcon {
  488. width: 0.17rem;
  489. height: 0.19rem;
  490. position: relative;
  491. top: 0.04rem;
  492. }
  493. .bookIcon {
  494. width: 0.16rem;
  495. height: 0.19rem;
  496. position: relative;
  497. top: 0.04rem;
  498. }
  499. }
  500. .right {
  501. .theoryItem {
  502. display: flex;
  503. flex-direction: row;
  504. justify-content: space-between;
  505. width: 2.28rem;
  506. .van-cell {
  507. // width: 1.6rem;
  508. // border-bottom:none;
  509. }
  510. .van-field__label {
  511. width: 0.8rem;
  512. }
  513. .iconWrap {
  514. position: absolute;
  515. right: 0.2rem;
  516. width: 0.42rem;
  517. height: 0.42rem;
  518. display: flex;
  519. flex-direction: column;
  520. align-items: center;
  521. .smallIcon {
  522. margin-top: 0.15rem;
  523. width: 0.15rem;
  524. height: 0.15rem;
  525. }
  526. }
  527. }
  528. }
  529. }
  530. .musicCell,
  531. .teachingCell {
  532. margin-top: 0.25rem;
  533. }
  534. .subTitle,
  535. .subTitles {
  536. position: relative;
  537. top: -0.2rem;
  538. font-size: 0.18rem;
  539. color: #00696a;
  540. font-weight: bold;
  541. }
  542. .subTitles {
  543. top: 0 !important;
  544. padding: 0.27rem 0 0.24rem;
  545. font-weight: bold;
  546. }
  547. }
  548. }
  549. .nextCard {
  550. margin-top: 0.23rem;
  551. }
  552. }
  553. .cell.activce {
  554. border: 1px solid #28babd;
  555. color: #28babd;
  556. }
  557. .cell {
  558. width: 3.05rem;
  559. padding: 0.1rem 0.15rem 0.1rem 0;
  560. line-height: 0.2rem;
  561. display: flex;
  562. flex-direction: row;
  563. border-radius: 10px;
  564. box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.14);
  565. background-color: #fff;
  566. font-size: 0.14rem;
  567. margin-bottom: 0.245rem;
  568. border: 1px solid transparent;
  569. p {width: 2.41rem;}
  570. .icons {
  571. width: 0.26rem;
  572. height: 0.26rem;
  573. margin: 0 0.105rem;
  574. display: block;
  575. }
  576. }
  577. .submit {
  578. width: 3.2rem;
  579. position: relative;
  580. z-index: 2;
  581. }
  582. .bottomBox {
  583. background: url("../../assets/images/start/bottom.png") no-repeat;
  584. // background-size: 100% 100%;
  585. position: absolute;
  586. width: 100%;
  587. height: 3.45rem;
  588. left: 0;
  589. bottom: 0;
  590. z-index: 1;
  591. }
  592. }
  593. .van-overflow-hidden {
  594. z-index: 0;
  595. position: relative;
  596. }
  597. .van-field__control::-webkit-input-placeholder { /* WebKit browsers */
  598. font-size: .14rem;
  599. line-height: .20rem!important;
  600. color: #999;
  601. }
  602. .van-field__control::-moz-placeholder { /* Mozilla Firefox 19+ */
  603. font-size: .14rem;
  604. line-height: .20rem!important;
  605. color: #999
  606. }
  607. .van-field__control::-ms-input-placeholder { /* Internet Explorer 10+ */
  608. font-size: .14rem;
  609. line-height: .20rem!important;
  610. color: #999
  611. }
  612. </style>