App.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <template>
  2. <div id="app" :class="{appNoHeight: $route.path == '/liveProjectDetail',GMBg: $route.path == '/worksGM'}">
  3. <!-- <div class="app_head" :class="{ stuWidth: $route.path == '/student' }">
  4. <div class="logo" @click="goTo('/')"></div>
  5. <div class="app_right">
  6. <div class="box_right_three">
  7. <div class="pic_img"><img src="./assets/myProject.png" alt="" /></div>
  8. <div @click="goTo('/project')">我的课程</div>
  9. </div>
  10. <div class="box_right_three">
  11. <div class="pic_img"><img src="./assets/myMessage.png" alt="" /></div>
  12. <div @click="goTo('/mine')">个人中心</div>
  13. </div>
  14. <div class="box_right_three">
  15. <div class="pic_img"><img src="./assets/mine.png" alt="" /></div>
  16. <div>
  17. {{
  18. this.$store.state.studentInfo
  19. ? this.$store.state.studentInfo.name
  20. : "用户"
  21. }}
  22. </div>
  23. </div>
  24. <div class="user_head" @click="exit">
  25. <div>
  26. <i class="exitI"></i>
  27. <el-button type="text" style="color: white">退出</el-button>
  28. </div>
  29. </div>
  30. </div>
  31. </div> -->
  32. <div :class="{ liveCss: $route.path == '/liveProjectDetail', oHeight: panRouter.includes($route.path) }">
  33. <!-- main 内容 -->
  34. <keep-alive v-if="$route.meta.keepAlive">
  35. <!-- 这里是会被缓存的视图组件 -->
  36. <router-view
  37. v-if="$route.meta.keepAlive"
  38. :class="{ pb_body: isShowNav }"
  39. />
  40. </keep-alive>
  41. <!-- 这里是不被缓存的视图组件 -->
  42. <router-view
  43. v-if="!$route.meta.keepAlive"
  44. :class="{ pb_body: isShowNav }"
  45. />
  46. <!-- 底部导航 -->
  47. <!-- <footer-nav
  48. v-if="isShowNav"
  49. :luyou="this.$store.state.luyou"
  50. ></footer-nav> -->
  51. </div>
  52. <!-- <div class="bottom">
  53. <div class="bottom_flex">
  54. <div class="left_bottom_flex">
  55. <div class="left_title">联系我们</div>
  56. <div class="left_content">
  57. <div>地址:深圳市南山区</div>
  58. <div>手机:13418906754</div>
  59. <div>邮箱:win.wu@qichuangxin.com</div>
  60. <div>电话:0755-84658992</div>
  61. <div>邮编:518129</div>
  62. </div>
  63. </div>
  64. <div class="right_bottom_flex">
  65. <img src="./assets/logo2.png" alt="" />
  66. </div>
  67. </div>
  68. </div> -->
  69. </div>
  70. </template>
  71. <script>
  72. import { Message } from "element-ui";
  73. export default {
  74. // name: "App",
  75. data() {
  76. return {
  77. isShowNav: true, // 是否显示导航 Tab
  78. panRouter: ['/studystudentE2','/studystudentE3','/studyStudent','/studySutdentClass']
  79. };
  80. },
  81. components: {},
  82. created: function () {
  83. // this.isLogin();
  84. // this.getnCount();
  85. setInterval(() => {
  86. // this.getnCount();
  87. }, 60000);
  88. },
  89. methods: {
  90. goTo(path) {
  91. this.$router.push(path);
  92. },
  93. isLogin() {
  94. const loading = this.$loading.service({
  95. background: "rgba(255, 255, 255)",
  96. target: document.querySelector("body"),
  97. });
  98. var _isLogin = this.$cookies.get("slogin");
  99. var studentInfo = this.$cookies.get("studentInfo");
  100. if (_isLogin == "1" && studentInfo) {
  101. loading.close();
  102. this.$store.commit("update", ["isLogin", true]);
  103. // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
  104. this.$store.commit("update", ["studentInfo", studentInfo]);
  105. let router_path = this.$route.path;
  106. if (router_path == "/") {
  107. this.$router.push("/index");
  108. }
  109. }
  110. // else {
  111. // this.$store.commit("update", ["isLogin", false]);
  112. // Message({
  113. // message: "未登录,请登录",
  114. // type: "warning",
  115. // });
  116. // setTimeout(() => {
  117. // loading.close();
  118. // this.$router.push("/login");
  119. // }, 2000);
  120. // }
  121. },
  122. getnCount() {
  123. let params = {
  124. bid: this.$store.state.studentInfo.userid,
  125. };
  126. this.ajax
  127. .get(this.$store.state.api + "getNcount", params)
  128. .then((res) => {
  129. console.log(res);
  130. if (res.data[0].length > 0) {
  131. this.$store.commit("update", ["nCount", res.data[0][0].num]);
  132. } else {
  133. this.$store.commit("update", ["nCount", 0]);
  134. }
  135. })
  136. .catch((err) => {
  137. console.error(err);
  138. });
  139. },
  140. exit() {
  141. sessionStorage.clear();
  142. this.$cookies.remove("slogin");
  143. this.$cookies.remove("studentInfo");
  144. this.$store.commit("update", ["isLogin", false]);
  145. this.$store.commit("update", ["studentInfo", {}]);
  146. Message({
  147. message: "退出成功",
  148. type: "success",
  149. });
  150. this.$router.push("/login");
  151. },
  152. goTo(path) {
  153. this.$router.push(path);
  154. },
  155. },
  156. };
  157. </script>
  158. <style>
  159. * {
  160. margin: 0;
  161. padding: 0;
  162. }
  163. ul,
  164. li {
  165. list-style: none;
  166. }
  167. html,
  168. body {
  169. height: 100%;
  170. width: 100%;
  171. background: #f2f2f2;
  172. }
  173. /* body {
  174. font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
  175. "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  176. } */
  177. #app {
  178. height: 100%;
  179. width: 100%;
  180. background: #f2f2f2;
  181. /* min-width: 1380px; */
  182. }
  183. .appNoHeight {
  184. min-height: 750px;
  185. }
  186. .app_head {
  187. height: 67.5px;
  188. width: 100%;
  189. background-color: rgb(129, 179, 253);
  190. display: flex;
  191. align-items: center;
  192. min-width: 1000px;
  193. flex-direction: row;
  194. justify-content: space-around;
  195. }
  196. .logo {
  197. height: 48px;
  198. width: 73px;
  199. background: url("./assets/logo.png");
  200. background-size: 100% 100%;
  201. margin-left: 20px;
  202. cursor: pointer;
  203. }
  204. .liveCss {
  205. height: 100%;
  206. overflow: hidden;
  207. }
  208. .pb_body {
  209. width: 100%;
  210. display: inline-block;
  211. height: calc(100% - 67.5px);
  212. /* height: calc(100% - 67.5px - 226px); */
  213. min-height: 750px;
  214. background: #f2f2f2;
  215. /* border-radius: 5px; */
  216. position: relative;
  217. overflow: auto;
  218. }
  219. .pb_head {
  220. font-size: 26px;
  221. /* font-weight: 600; */
  222. width: 95%;
  223. margin: 10px auto;
  224. padding: 10px 5px;
  225. border-bottom: 3px solid #eee;
  226. }
  227. .pb_content {
  228. /* height: 100%; */
  229. }
  230. .pb_content_body {
  231. margin: 0px auto;
  232. width: 100%;
  233. /* overflow: auto;
  234. height: calc(100% - 120px); */
  235. }
  236. .user_head {
  237. display: flex;
  238. align-items: center;
  239. margin-right: 20px;
  240. font-size: 18px;
  241. font-weight: 600;
  242. }
  243. .user_head .user_name {
  244. color: #fff;
  245. margin-right: 10px;
  246. }
  247. .user_head div {
  248. display: flex;
  249. align-items: center;
  250. cursor: pointer;
  251. }
  252. .user_head .exitI {
  253. background-image: url("./assets/exit.png");
  254. width: 25px;
  255. height: 25px;
  256. background-size: 100% 100%;
  257. margin-top: 1px;
  258. line-height: 25px;
  259. vertical-align: text-top;
  260. background-repeat: no-repeat;
  261. }
  262. .noticeBox {
  263. position: relative;
  264. margin-right: 10px;
  265. }
  266. .user_head .noticeI {
  267. background-image: url("./assets/icon/noticeA.png");
  268. width: 25px;
  269. height: 25px;
  270. background-size: 100% 100%;
  271. margin-top: 1px;
  272. line-height: 25px;
  273. vertical-align: text-top;
  274. background-repeat: no-repeat;
  275. cursor: pointer;
  276. }
  277. .noticeBox span {
  278. position: absolute;
  279. background: red;
  280. width: 15px;
  281. height: 15px;
  282. border-radius: 30px;
  283. color: #fff;
  284. text-align: center;
  285. font-size: 12px;
  286. display: flex;
  287. align-items: center;
  288. justify-content: center;
  289. top: -3px;
  290. right: -3px;
  291. }
  292. .stuWidth {
  293. min-width: 1180px;
  294. }
  295. .app_right {
  296. display: flex;
  297. flex-direction: row;
  298. justify-content: flex-end;
  299. color: #fff;
  300. align-items: center;
  301. }
  302. .pic_img {
  303. width: 30px;
  304. height: 30px;
  305. }
  306. .pic_img > img {
  307. width: 100%;
  308. height: 100%;
  309. }
  310. .box_right_three {
  311. display: flex;
  312. margin: 0 25px 0px 0;
  313. }
  314. .box_right_three > div:nth-child(2) {
  315. margin: 5px 10px 0 5px;
  316. cursor: pointer;
  317. line-height: 22px;
  318. }
  319. .bottom {
  320. background: #ccc;
  321. width: 100%;
  322. }
  323. .bottom_flex {
  324. display: flex;
  325. justify-content: space-around;
  326. }
  327. .left_bottom_flex {
  328. margin: 10px 0 5px 0;
  329. }
  330. .left_title {
  331. font-size: 18px;
  332. margin: 5px 0 15px 5px;
  333. color: #747474;
  334. }
  335. .left_content {
  336. color: #767676;
  337. font-size: 14px;
  338. }
  339. .left_content > div {
  340. margin-bottom: 15px;
  341. }
  342. .right_bottom_flex {
  343. width: 219px;
  344. height: 144px;
  345. margin: auto 0;
  346. }
  347. .right_bottom_flex > img {
  348. width: 100%;
  349. height: 100%;
  350. }
  351. html::-webkit-scrollbar {
  352. /*滚动条整体样式*/
  353. width: 6px;
  354. /*高宽分别对应横竖滚动条的尺寸*/
  355. height: 6px;
  356. }
  357. /*定义滚动条轨道 内阴影+圆角*/
  358. html::-webkit-scrollbar {
  359. border-radius: 10px;
  360. background-color: #eee;
  361. }
  362. /*定义滑块 内阴影+圆角*/
  363. html::-webkit-scrollbar-thumb {
  364. border-radius: 10px;
  365. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  366. background-color: rgba(0, 0, 0, 0.1);
  367. }
  368. .btnClassGM {
  369. background: #8681b7 !important;
  370. border-color: #8681b7 !important;
  371. }
  372. .btnClassGM:focus, .btnClassGM:hover{
  373. background: #8681b7 !important;
  374. border-color: #8681b7 !important;
  375. }
  376. .cancelbtnGM:focus,
  377. .cancelbtnGM:hover {
  378. color: rgb(92, 84, 159) !important;
  379. border-color: #5c549f !important;
  380. background-color: #dbd7ff !important;
  381. }
  382. .GMBg{
  383. background: rgb(184, 181, 202) !important;
  384. }
  385. .showtip{
  386. z-index: 999999999 !important;
  387. }
  388. .el-message-box{
  389. padding-bottom: 20px !important;
  390. }
  391. .el-message-box__header{
  392. font-weight: 700 !important;
  393. }
  394. .el-message-box__content{
  395. padding: 10px 15px 25px !important;
  396. }
  397. .el-icon-warning:before{
  398. content: '' !important;
  399. width: 20px !important;
  400. height: 20px !important;
  401. display: block !important;
  402. background-image: url("./assets/icon/newIcon/tips.png") !important;
  403. background-size: 100% 100% !important;
  404. }
  405. .el-message-box__status+.el-message-box__message{
  406. padding-left: 30px !important;
  407. }
  408. .el-message-box__btns{
  409. text-align: center !important;
  410. }
  411. .el-message-box__btns > .el-button--small{
  412. border: 1px solid #CAD1DC !important;
  413. background: #E7EBF1 !important;
  414. color: #060E17 !important;
  415. }
  416. .el-message-box__btns > .el-button--small:hover{
  417. background: #CAD1DC !important;
  418. color: #060E17 !important;
  419. }
  420. .el-message-box__btns > .el-button--primary{
  421. border: 1px solid #EE3E3E !important;
  422. background: #EE3E3E !important;
  423. color: #fff !important;
  424. }
  425. .el-message-box__btns > .el-button--primary:hover{
  426. border: 1px solid #cd3434 !important;
  427. background: #cd3434 !important;
  428. color: #fff !important;
  429. }
  430. .el-checkbox:hover .el-checkbox__label{
  431. color:#409EFF;
  432. }
  433. .el-checkbox .el-checkbox__label{
  434. color: #0E1E33;
  435. }
  436. .el-checkbox:hover .el-checkbox__inner{
  437. border-color: #409EFF;
  438. }
  439. .el-checkbox .el-checkbox, .el-checkbox .el-checkbox__input{
  440. display: flex;
  441. align-items: center;
  442. }
  443. .text_tooltip {
  444. max-width: 350px;
  445. }
  446. .el-pagination.is-background .el-pager li:not(.disabled).active{
  447. background-color: #0061FF !important;
  448. color: #FFF !important;
  449. }
  450. .text_tooltip2 {
  451. max-width: 250px;
  452. }
  453. .el-pagination.is-background .el-pager li:not(.disabled):hover {
  454. color: #0061FF !important;
  455. }
  456. .el-pagination.is-background .el-pager li:not(.disabled).active {
  457. background-color: #0061FF !important;
  458. color: #FFF !important;
  459. }
  460. .oHeight{
  461. height: 100%;
  462. overflow: hidden;
  463. }
  464. </style>