topMenu.vue 17 KB

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