topMenu.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <!-- 顶部导航栏 -->
  3. <view class="topMenuBox df jcsb">
  4. <view class="df fdr">
  5. <!-- 左侧导航icon -->
  6. <view class="df aic jcc topMenu-lefticon" @click="onTopMenuIconClick">
  7. <img src="../assets/topMenu/leftUpIcon.png" />
  8. </view>
  9. <!-- 左上角标题 -->
  10. <view class="df aic topMenu-lefttitle-box">
  11. <view v-show="middleShowIndex==0" @click="onClick_topMenu_sy">影视现场实时特效虚拟仿真实验</view>
  12. <view v-show="middleShowIndex==1" class="df fdr aic">
  13. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  14. <view>前序准备</view>
  15. <view class="topMenu-lefttitle-line"></view>
  16. </view>
  17. <view v-show="middleShowIndex==2" class="df fdr aic">
  18. <img src="../assets/learning/icon_ksxx_xxysy.png"></img>
  19. <!-- <view>学习与实验</view> -->
  20. <view>开始学习</view>
  21. <view class="topMenu-lefttitle-line"></view>
  22. </view>
  23. <view v-show="middleShowIndex==3" class="df fdr aic">
  24. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  25. <view>原理认知</view>
  26. <view class="topMenu-lefttitle-line"></view>
  27. </view>
  28. <!-- 实验简介 -->
  29. <view v-show="middleShowIndex==4" class="df fdr aic">
  30. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  31. <view v-for="(syjjTitle,syjjTitleI) in titleSYJJ" :key="syjjTitleI" v-show="syjjTitleI==checkedIndex_middleTitle">
  32. {{syjjTitle}}
  33. </view>
  34. <view class="topMenu-lefttitle-line"></view>
  35. </view>
  36. <view v-show="middleShowIndex==5" class="df fdr aic">
  37. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  38. <view>学习概要</view>
  39. <view class="topMenu-lefttitle-line"></view>
  40. </view>
  41. <view v-show="middleShowIndex==6" class="df fdr aic">
  42. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  43. <view>实验步骤</view>
  44. <view class="topMenu-lefttitle-line"></view>
  45. </view>
  46. <view v-show="middleShowIndex==7" class="df fdr aic">
  47. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  48. <view>实验引导视频</view>
  49. <view class="topMenu-lefttitle-line"></view>
  50. </view>
  51. <view v-show="middleShowIndex==8" class="df fdr aic">
  52. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  53. <view>学习资料下载</view>
  54. <view class="topMenu-lefttitle-line"></view>
  55. </view>
  56. <view v-show="middleShowIndex==9">虚拟仿真1号摄影棚</view>
  57. <view v-show="middleShowIndex==10">虚拟仿真库</view>
  58. <view v-show="middleShowIndex==11">虚拟影视项目开发管理中心</view>
  59. <view v-show="middleShowIndex==12">虚拟仿真真题拍摄基地</view>
  60. <view v-show="middleShowIndex==13" class="df fdr aic">
  61. <view>影视现场实时特效虚拟仿真实验</view>
  62. <view class="topMenu-lefttitle-line"></view>
  63. </view>
  64. <view v-show="middleShowIndex==14" class="df fdr aic">
  65. <img src="../assets/learning/icon_ksxx_qxzb.png"></img>
  66. <view>实景勘察</view>
  67. <view class="topMenu-lefttitle-line"></view>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 中间几个导航标题 -->
  72. <!-- 首页开始学习那几个 -->
  73. <view class="df aic topMenu-middleMenu" v-show="middleShowIndex==0||middleShowIndex==13">
  74. <view v-for="(item,i) in titleList_sy" :key="i" @click="onTitleClick_SY(i)" class="df fdr aic jcc topMenu-middleMenu-item">
  75. <view class="df">
  76. <img :src="checkedIndex_middleTitle==i?item.icon_checked:item.icon_unchecked"></img>
  77. </view>
  78. <view class="topMenu-middleMenu-item-text" :style="{color:checkedIndex_middleTitle==i?titleColorChecked:titleColorUnchecked}">{{item.text}}</view>
  79. </view>
  80. </view>
  81. <!-- 前序准备 -->
  82. <view class="df aic topMenu-middleMenu" v-show="middleShowIndex==1">
  83. <view v-for="(item,i) in titleQXZB" :key="i" @click="onTitleClick_QXZB(i)" class="df fdc aic jcc top2thTitle-item">
  84. <view class="top2thTitle-item-text df aic" :style="{color:checkedIndex_middleTitle==i?titleColorChecked:titleColorUnchecked}">{{item}}</view>
  85. <view class="top2thTitle-item-line" :style="{opacity: checkedIndex_middleTitle==i?1:0}"></view>
  86. </view>
  87. </view>
  88. <!-- 学习与实验 -->
  89. <view class="df aic topMenu-middleMenu" v-show="middleShowIndex==2">
  90. <view v-for="(item,i) in titleXXYSY" :key="i" @click="onTitleClick_XXYSY(i)" class="df fdc aic jcc top2thTitle-item">
  91. <view class="top2thTitle-item-text df aic" :style="{color:checkedIndex_middleTitle==i?titleColorChecked:titleColorUnchecked}">{{item}}</view>
  92. <view class="top2thTitle-item-line" :style="{opacity: checkedIndex_middleTitle==i?1:0}"></view>
  93. </view>
  94. </view>
  95. <!-- 右侧登录或个人头像名字等 -->
  96. <view class="df jcc aic topMenu-rightbox">
  97. <!-- 原理认知页面-返回上一层 -->
  98. <view class="ylrz-return df aic fdr" v-show="returnShowIndex==1" @click="onClick_return">
  99. <view class="df">
  100. <img src="../assets/topMenu/icon_return.png" />
  101. </view>
  102. <view class="ylrz-return-text">返回</view>
  103. <view class="ylrz-return-line"></view>
  104. </view>
  105. <!-- 登录按钮 -->
  106. <view v-show="loginShowIndex==0" class="df jcc aic btnLogin" id="btnLogin" @click="onLoginClick">登录</view>
  107. <!-- 头像名字 -->
  108. <view v-show="loginShowIndex==1" class="df aic">
  109. <view class="topMenu-avatar df" @click="onClick_avatar">
  110. <!-- <img :src="userInfo.avatarSrc" /> -->
  111. <!-- <img src="../assets/login/loginPic3.png" /> -->
  112. <img :src="userInfo.avatarSrc" />
  113. </view>
  114. <!-- <view class="topMenu-rightbox-text">学生</view>
  115. <view class="df">
  116. <img src="../assets/topMenu/arrowDown.png" />
  117. </view> -->
  118. </view>
  119. </view>
  120. <!-- 个人小浮窗 -->
  121. <view class="user-window-box" v-show="isShow_userWindow" @click="onClick_userWindowBlank">
  122. <view class="user-window df fdc aic">
  123. <view class="user-window-avatar df">
  124. <!-- <img src="../assets/login/loginPic3.png" /> -->
  125. <img :src="userInfo.avatarSrc" />
  126. </view>
  127. <view class="user-window-name">{{userInfo.Name+userInfo.role}}</view>
  128. <view class="user-window-email">{{userInfo.email}}</view>
  129. <!-- <view class="user-window-email">zhanglinlaoshi@qq.com</view> -->
  130. <view class="user-window-line"></view>
  131. <view class="user-window-userCenter df fdr jcc aic" @click="onClick_userCenter">
  132. <view class="df">
  133. <img src="../assets/user/icon_user_05_01.png" />
  134. </view>
  135. <view class="user-window-userCenter-text">个人中心</view>
  136. </view>
  137. <view class="user-window-line"></view>
  138. <view class="user-window-exit df jcc aic" @click="onClick_exit">退出</view>
  139. </view>
  140. </view>
  141. <!-- <view @click="onClick_test">测试1</view> -->
  142. </view>
  143. </template>
  144. <script>
  145. export default {
  146. data() {
  147. return {
  148. userInfo: mydata_userInfo,
  149. //中间导航状态 0首页1前序准备2学习与实验3原理认知
  150. middleShowIndex: 0,
  151. //中间菜单选择索引
  152. checkedIndex_middleTitle: -1,
  153. //0登录按钮1个人头像信息
  154. loginShowIndex: 0,
  155. //返回上一层 0不显示1显示
  156. returnShowIndex: 0,
  157. visibleMiddle: true,
  158. isShow_userWindow: false,
  159. userInfo: mydata_userInfo,
  160. // checkedIndexQXZB: 0, //选中的前序准备的菜单
  161. // checkedIndexXXYSY: 0, //选中的学习与实验的菜单
  162. // checkedIndexSYJJ: 0, //选中的实验简介的菜单
  163. //////////////////////以下皆为静态
  164. titleList_sy: [{
  165. "text": '实验简介',
  166. "icon_checked": require("../assets/topMenu/introductionToTheExperimentChecked.png"),
  167. "icon_unchecked": require("../assets/topMenu/introductionToTheExperimentUnchecked.png"),
  168. },
  169. {
  170. "text": '学前导览',
  171. "icon_checked": require("../assets/topMenu/learningProcessChecked.png"),
  172. "icon_unchecked": require("../assets/topMenu/learningProcessUnchecked.png"),
  173. },
  174. {
  175. "text": '开始学习',
  176. "icon_checked": require("../assets/topMenu/startLearningChecked.png"),
  177. "icon_unchecked": require("../assets/topMenu/startLearningUnchecked.png"),
  178. },
  179. ],
  180. //首页-中间标题选中时颜色
  181. titleColorChecked: "#EA252C",
  182. //首页-中间标题未选中时颜色
  183. titleColorUnchecked: "#020202",
  184. //前序准备
  185. titleQXZB: ["实验前言", "实验流程步骤", "教学引导视频", "基础知识"],
  186. //学习与实验
  187. titleXXYSY: ["原理认知", "实景勘察", "虚拟技术搭建", "虚拟艺术创作", "虚拟资源库"],
  188. //实验简介
  189. titleSYJJ: ['评审账号', '快速进入实验', '项目概述', '使用环境与技术构架', '项目简介视频']
  190. }
  191. },
  192. methods: {
  193. onClick_test() {
  194. MyRequest.GetScore(function(res) {
  195. let data = res.data;
  196. console.log("请求成功", data);
  197. let scores = data.Scores;
  198. scores[0].Score = 6;
  199. MyRequest.SetupScore(scores, function(res) {
  200. MyRequest.GetScore(function(res) {
  201. console.log("请求成功2", res);
  202. }, null);
  203. }, null);
  204. }, null);
  205. },
  206. //初始化数据
  207. initData() {
  208. this.curTitleSrc = this.titleSrcUnchecked;
  209. this.curTitleColor = this.titleColorUnchecked;
  210. },
  211. onLoginClick() {
  212. this.$emit("onLoginClick");
  213. },
  214. //首页标题点击
  215. onTitleClick_SY(index) {
  216. this.$emit("onTopSYClick", index);
  217. this.checkedIndex_middleTitle = index;
  218. },
  219. //切换登录状态
  220. switchLoginState(isLogged) {
  221. if (isLogged) {
  222. this.loginShowIndex = 1;
  223. } else {
  224. this.loginShowIndex = 0;
  225. }
  226. },
  227. //切换中间导航状态
  228. switchMiddleState(state, checkedIndex_middleTitle) {
  229. switch (state) {
  230. case topMenuS.SY:
  231. this.middleShowIndex = 0;
  232. this.returnShowIndex = 0;
  233. break;
  234. case topMenuS.QXZB:
  235. this.middleShowIndex = 1
  236. this.returnShowIndex = 1;
  237. break;
  238. case topMenuS.XXYSY:
  239. this.middleShowIndex = 2
  240. this.returnShowIndex = 1;
  241. break;
  242. case topMenuS.YLRZ:
  243. this.middleShowIndex = 3
  244. this.returnShowIndex = 1;
  245. break;
  246. case topMenuS.SYJJ:
  247. this.middleShowIndex = 4
  248. this.returnShowIndex = 1;
  249. break;
  250. case topMenuS.XXGY:
  251. this.middleShowIndex = 5
  252. this.returnShowIndex = 1;
  253. break;
  254. case topMenuS.SYBZ:
  255. this.middleShowIndex = 6
  256. this.returnShowIndex = 1;
  257. break;
  258. case topMenuS.SYYDSP:
  259. this.middleShowIndex = 7
  260. this.returnShowIndex = 1;
  261. break;
  262. case topMenuS.XXZLXZ:
  263. this.middleShowIndex = 8;
  264. this.returnShowIndex = 1;
  265. break;
  266. case topMenuS.SJKC:
  267. this.middleShowIndex = 14
  268. this.returnShowIndex = 1;
  269. break;
  270. case topMenuS.home1:
  271. this.middleShowIndex = 9;
  272. this.returnShowIndex = 1;
  273. this.loginShowIndex = 1;
  274. break;
  275. case topMenuS.home2:
  276. this.middleShowIndex = 10;
  277. this.returnShowIndex = 1;
  278. this.loginShowIndex = 1;
  279. break;
  280. case topMenuS.home3:
  281. this.middleShowIndex = 11;
  282. this.returnShowIndex = 1;
  283. this.loginShowIndex = 1;
  284. break;
  285. case topMenuS.home4:
  286. this.middleShowIndex = 12;
  287. this.returnShowIndex = 1;
  288. this.loginShowIndex = 1;
  289. break;
  290. case topMenuS.home5:
  291. this.middleShowIndex = 13;
  292. this.returnShowIndex = 1;
  293. this.loginShowIndex = 1;
  294. break;
  295. default:
  296. console.log("切换中间导航状态", state);
  297. }
  298. this.checkedIndex_middleTitle = checkedIndex_middleTitle;
  299. },
  300. //前序准备标题点击
  301. onTitleClick_QXZB(index) {
  302. // console.log("前序准备标题点击",index);
  303. // this.checkedIndexQXZB = index;
  304. this.checkedIndex_middleTitle = index;
  305. this.$emit("onTopQXZBClick", index);
  306. // this.$forceUpdate();
  307. },
  308. onTitleClick_XXYSY(index) {
  309. // this.checkedIndexXXYSY = index;
  310. this.checkedIndex_middleTitle = index;
  311. this.$emit("onTopXXYSYClick", index);
  312. // console.log("学习与实验topmenu",index);
  313. },
  314. onTopMenuIconClick() {
  315. this.$emit("onTopMenuIconClick");
  316. // console.log("顶部icon点击");
  317. },
  318. //返回上一层
  319. onClick_return() {
  320. let type = this.middleShowIndex;
  321. this.$emit("onClick_return", type);
  322. //从首页建筑页返回到首页
  323. if (type == 9 || type == 10 || type == 11 || type == 12) {
  324. this.switchMiddleState(topMenuS.SY, -1);
  325. }
  326. //学前导览三级级返回到学前导览
  327. else if (type == 5 || type == 6 || type == 7 || type == 8) {
  328. this.switchMiddleState(topMenuS.SY, 1);
  329. }
  330. //
  331. else {
  332. switch (this.middleShowIndex) {
  333. // case 1: //前序准备-返回上一层:返回到开始学习-前序准备的展开页 type-1
  334. // this.switchMiddleState(topMenuS.SY, 2);
  335. // break;
  336. case 2: //学习与实验-返回上一层:返回到开始学习-学习与实验的展开页 type-2
  337. this.switchMiddleState(topMenuS.SY, 2);
  338. break;
  339. case 3: //原理认知-返回上一层:返回到开始学习-学习与实验-原理认知页 type-3
  340. this.switchMiddleState(topMenuS.XXYSY, 0);
  341. break;
  342. case 4: //实验简介-返回上一层:返回到实验简介的展开页 type-4
  343. this.switchMiddleState(topMenuS.SY, 0);
  344. break;
  345. case 14: //开始勘察-返回上一层:返回到开始学习-实景勘察页
  346. this.switchMiddleState(topMenuS.XXYSY, 1);
  347. break;
  348. default:
  349. console.log("返回", this.middleShowIndex);
  350. }
  351. }
  352. // console.log("返回", this.middleShowIndex);
  353. },
  354. switchState_syjj(index) {
  355. // this.checkedIndexSYJJ = index;
  356. this.checkedIndex_middleTitle = index;
  357. },
  358. onClick_avatar() {
  359. this.isShow_userWindow = !this.isShow_userWindow;
  360. },
  361. onClick_topMenu_sy() {
  362. this.$emit("onClick_topMenu_sy");
  363. this.switchMiddleState(topMenuS.SY, -1);
  364. },
  365. onClick_userCenter() {
  366. this.isShow_userWindow = false;
  367. this.$emit("onClick_avatar");
  368. },
  369. onClick_userWindowBlank() {
  370. this.isShow_userWindow = false;
  371. },
  372. onClick_exit(){
  373. this.switchLoginState(false);
  374. this.$emit("onClick_exit");
  375. localStorage.removeItem("account");
  376. localStorage.removeItem("password");
  377. }
  378. }
  379. }
  380. </script>
  381. <style lang="scss">
  382. .topMenuBox {
  383. width: 100%;
  384. // height: px2vw(119);
  385. // height: 11%;
  386. background: #FFFFFF;
  387. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  388. position: fixed;
  389. z-index: 0;
  390. }
  391. .topMenu-lefticon {
  392. width: 6.2vw;
  393. height: 6.2vw;
  394. background: #EA252C;
  395. }
  396. .topMenu-lefttitle-box {
  397. margin-left: 2.4vw;
  398. font-size: 1.5vw;
  399. font-family: MicrosoftYaHei;
  400. color: #323232;
  401. margin-right: 2.4vw;
  402. }
  403. .topMenu-lefttitle-box img {
  404. width: px2vw(50);
  405. margin-right: px2vw(18);
  406. }
  407. .topMenu-lefttitle-line {
  408. width: px2vw(2);
  409. // width: 1px;
  410. height: px2vw(53);
  411. background: #D5D5D5;
  412. margin-left: px2vw(32);
  413. }
  414. .topMenu-middleMenu {
  415. /* display: none; */
  416. flex-grow: 1;
  417. /* justify-content: center; */
  418. justify-content: space-evenly;
  419. }
  420. /* .topMenu-middleMenu-item {
  421. margin-left: 71px;
  422. } */
  423. .topMenu-middleMenu-item-text {
  424. margin-left: px2vw(20);
  425. font-size: px2vw(24);
  426. }
  427. .topMenu-rightbox {
  428. margin-right: px2vw(58);
  429. margin-left: px2vw(58);
  430. }
  431. .btnLogin {
  432. width: 6.2vw;
  433. height: 3vw;
  434. background: #EA252C;
  435. border-radius: 8px;
  436. font-size: 1.14vw;
  437. font-family: MicrosoftYaHei;
  438. color: #FFFFFF;
  439. line-height: 1.5vw;
  440. letter-spacing: 1px;
  441. }
  442. .topMenu-avatar img {
  443. width: px2vw(50);
  444. height: px2vw(50);
  445. border-radius: px2vw(25);
  446. }
  447. .topMenu-rightbox-text {
  448. margin-left: px2vw(18);
  449. margin-right: px2vw(23);
  450. }
  451. .top2thTitle-item {
  452. height: 100%;
  453. }
  454. // 二级目录标题字
  455. .top2thTitle-item-text {
  456. flex: 1;
  457. font-size: px2vw(24);
  458. color: #323232;
  459. }
  460. // 二级目录标题红线
  461. .top2thTitle-item-line {
  462. width: px2vw(110);
  463. height: px2vw(6);
  464. background: #EA252C;
  465. border-radius: px2vw(5);
  466. }
  467. //返回上一层
  468. .ylrz-return {
  469. margin-right: px2vw(43);
  470. }
  471. .ylrz-return img {
  472. width: px2vw(23);
  473. }
  474. .ylrz-return-text {
  475. font-size: px2vw(24);
  476. color: #EA252C;
  477. margin-left: px2vw(14);
  478. }
  479. .ylrz-return-line {
  480. width: px2vw(1);
  481. height: px2vw(53);
  482. background: #D5D5D5;
  483. margin-left: px2vw(32);
  484. }
  485. .user-window-box {
  486. position: fixed;
  487. width: 100%;
  488. height: 100%;
  489. }
  490. .user-window {
  491. width: px2vw(473);
  492. height: px2vw(514);
  493. background: #FFFFFF;
  494. box-shadow: 0px px2vw(4) px2vw(10) 0px rgba(0, 0, 0, 0.16);
  495. border-radius: px2vw(8);
  496. margin-left: px2vw(1433);
  497. margin-top: px2vw(133);
  498. }
  499. .user-window-avatar {
  500. margin-top: px2vw(56);
  501. }
  502. .user-window-avatar img {
  503. width: px2vw(100);
  504. }
  505. .user-window-name {
  506. font-size: px2vw(26);
  507. color: #020202;
  508. line-height: px2vw(35);
  509. letter-spacing: px2vw(2);
  510. margin-top: px2vw(24);
  511. }
  512. .user-window-email {
  513. font-size: px2vw(20);
  514. color: #7D7D7D;
  515. line-height: px2vw(26);
  516. letter-spacing: 1px;
  517. margin-top: px2vw(16);
  518. margin-bottom: px2vw(40);
  519. }
  520. .user-window-line {
  521. width: px2vw(380);
  522. height: 1px;
  523. background: #DDDDDD;
  524. }
  525. .user-window-userCenter {
  526. margin-top: px2vw(24);
  527. margin-bottom: px2vw(24);
  528. }
  529. .user-window-userCenter-text {
  530. margin-left: px2vw(20);
  531. font-size: px2vw(24);
  532. color: #020202;
  533. line-height: px2vw(31);
  534. letter-spacing: px2vw(2);
  535. }
  536. .user-window-exit {
  537. width: px2vw(146);
  538. height: px2vw(52);
  539. background: #FFFFFF;
  540. border-radius: px2vw(8);
  541. border: 1px solid #979797;
  542. font-size: px2vw(24);
  543. color: #7D7D7D;
  544. line-height: px2vw(31);
  545. letter-spacing: px2vw(2);
  546. margin-top: px2vw(38);
  547. }
  548. </style>