topMenu.vue 17 KB

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