home.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <template>
  2. <view class="mybody bgclF8 df fdc">
  3. <TopMenu ref="TopMenu" v-on:onTopSYClick="onTopSYClick" v-on:onTopQXZBClick="onTopQXZBClick" v-on:onLoginClick="onLoginClick"
  4. v-on:onTopXXYSYClick="onTopXXYSYClick" v-on:onTopMenuIconClick="onTopMenuIconClick" v-on:onClick_return="onClick_return"
  5. v-on:onClick_avatar="onClick_avatar" v-on:onClick_topMenu_sy="onClick_topMenu_sy" v-on:onClick_exit="onClick_userExit"></TopMenu>
  6. <view class="content homeContent">
  7. <Login ref="Login" v-show="bShow[0]" v-on:onLogin="onLogin"></Login>
  8. <SYJJ ref="SYJJ" v-show="bShow[1]" v-on:onClick_Btn1="onClick_SYJJ_btn1"></SYJJ>
  9. <!-- <XXLC ref="XXLC" v-show="bShow[2]" v-on:onClick_ksxx="onClick_ksxx"></XXLC> -->
  10. <XQDL ref="XQDL" v-show="bShow[2]" v-on:onClick_Btn1="onClick_XQDL_btn1"></XQDL>
  11. <KSXX ref="KSXX" v-show="bShow[3]" v-on:on2thTitleClick="on2thKSXXClick"></KSXX>
  12. <!-- <image v-show="bShow[4]" class="homeBG" mode="aspectFill" src="../assets/home/homeBG.png"></image> -->
  13. <SY ref="SY" v-show="bShow[4]" v-on:onClick_menu_btn="onClick_sy_btn"></SY>
  14. <QXZB ref="QXZB" v-show="bShow[5]"></QXZB>
  15. <XXYSY ref="XXYSY" v-show="bShow[6]" v-on:onClick_KSRZ="onClick_KSRZ" v-on:onClick_KSKC="onClick_KSKC"></XXYSY>
  16. <YLRZ ref="YLRZ" v-show="bShow[7]"></YLRZ>
  17. <SYJJ2 ref="SYJJ2" v-show="bShow[8]"></SYJJ2>
  18. <simulation ref="simulation" v-show="bShow[9]"></simulation>
  19. <simulationLibrary ref="simulationLibrary" v-show="bShow[10]"></simulationLibrary>
  20. <simulationcore ref="simulationcore" v-show="bShow[11]" v-on:goToTeachCreation="goToTeachCreation"></simulationcore>
  21. <simulationBase ref="simulationBase" v-show="bShow[12]"></simulationBase>
  22. <teacherCreation ref="teacherCreation" v-show="bShow[13]"></teacherCreation>
  23. <User ref="User" v-show="bShow[14]" v-on:onClick_proManage="onClick_proManage"></User>
  24. <XXGY ref="XXGY" v-show="bShow[15]"></XXGY>
  25. <SYBZ ref="SYBZ" v-show="bShow[16]" v-on:onClick_ksxx="onClick_ksxx"></SYBZ>
  26. <SYYDSP ref="SYYDSP" v-show="bShow[17]"></SYYDSP>
  27. <student ref="student" v-show="bShow[18]"></student>
  28. <vstudentPlatform ref="vstudentPlatform" v-show="bShow[19]"></vstudentPlatform>
  29. <survey ref="survey" v-show="bShow[20]"></survey>
  30. <SJKC ref="SJKC" v-show="bShow[21]"></SJKC>
  31. <XXZLXZ ref="XXZLXZ" v-show="bShow[22]"></XXZLXZ>
  32. </view>
  33. <!-- 左侧导航栏永远保持在最上层 -->
  34. <LeftMenu ref="LeftMenu" v-on:onLeftMenuClick="onLeftMenuClick"></LeftMenu>
  35. </view>
  36. </template>
  37. <script>
  38. import SY from '../components/home/sy.vue'
  39. import LeftMenu from '../components/leftMenu.vue'
  40. import TopMenu from '../components/topMenu.vue'
  41. import Login from '../components/login/login.vue'
  42. import simulation from "../components/home/simulation.vue"
  43. import simulationLibrary from "../components/home/simulationLibrary.vue"
  44. import simulationcore from "../components/home/simulationCore.vue"
  45. import simulationBase from "../components/home/simulationBase.vue"
  46. import teacherCreation from "../components/home/teacherCreation.vue"
  47. import vstudentPlatform from "../components/student/Index.vue"
  48. import student from "../components/student/commoand.vue"
  49. import survey from "../components/student/survey.vue"
  50. //一级页面
  51. import KSXX from '../components/startLearning/startLearning.vue' //开始学习
  52. import SYJJ from '../components/introductionToTheExperiment/introductionToTheExperiment.vue' //实验简介
  53. // import XXLC from '../components/learningProcess/learningProcess.vue' //学习流程
  54. //二级页面
  55. //开始学习
  56. import QXZB from '../components/startLearning/preludePreparation/preludePreparation.vue' //前序准备
  57. import XXYSY from '../components/startLearning/learningAndExperiment/learningAndExperiment.vue' //学习与实验
  58. import YLRZ from '../components/startLearning/learningAndExperiment/ksxx_xxysy_ylrz/ksxx_xxysy_ylrz.vue' //原理认知
  59. //实验简介的详情页
  60. import SYJJ2 from '../components/introductionToTheExperiment/syjj_second.vue' //实验简介的详情页
  61. import User from '../components/user/user.vue' //用户信息等
  62. import XQDL from '../components/learningProcess/xqdl.vue' //学前导览
  63. import XXGY from '../components/learningProcess/xxgy.vue' //学习概要
  64. import SYBZ from '../components/learningProcess/learningProcess.vue' //实验步骤
  65. import SYYDSP from '../components/learningProcess/syydsp.vue' //实验引导视频
  66. import XXZLXZ from '../components/learningProcess/xxzlxz.vue' //学习资料下载
  67. import SJKC from '../components/startLearning/learningAndExperiment/ksxx_xxysy_sjkc/ksxx_xxysy_sjkc.vue' //实景勘察
  68. export default {
  69. components: {
  70. LeftMenu,
  71. TopMenu,
  72. Login,
  73. SYJJ,
  74. // XXLC,
  75. XQDL,
  76. KSXX,
  77. QXZB,
  78. XXYSY,
  79. YLRZ,
  80. SYJJ2,
  81. simulation,
  82. simulationLibrary,
  83. simulationcore,
  84. simulationBase,
  85. teacherCreation,
  86. User,
  87. XXGY,
  88. SYBZ,
  89. SYYDSP,
  90. SY,
  91. student,
  92. vstudentPlatform,
  93. survey,
  94. SJKC,
  95. XXZLXZ
  96. },
  97. data() {
  98. return {
  99. curShowPage: 4,
  100. //这里记录当前需要显示哪个页面。每新添加一个页面,都需要在这里注册。
  101. bShow: [
  102. false, //0登录
  103. false, //1实验简介一级页面
  104. false, //2学习流程一级页面----改为学前导览
  105. false, //3开始学习一级页面
  106. true, //4首页
  107. false, //5开始学习-前序准备
  108. false, //6开始学习-学习与实验
  109. false, //7开始学习-学习与实验-原理认知
  110. false, //8实验简介的详情页
  111. false, //9虚拟仿真1号摄影棚
  112. false, //10虚拟仿真资产库
  113. false, //11虚拟影视项目开发管理中心
  114. false, //12虚拟仿真真题拍摄基地
  115. false, //13老师创作管理平台
  116. false, //14用户(个人信息等)
  117. false, //15学习概要
  118. false, //16实验步骤
  119. false, //17实验引导视频
  120. false, //18 学生信息
  121. false, //19 学生创作项目管理平台
  122. false, //20开始勘测
  123. false, //21实景勘察
  124. false, //22学习资料下载
  125. ],
  126. // bShowLogin: true, //登录
  127. // bShowSYJJ: false, //实验简介一级页面
  128. // bShowXXLC: false, //学习流程一级页面
  129. // bShowSL: false, //开始学习一级页面
  130. checkedIndex_SYJJ: 0, //实验简介选中标题索引值
  131. }
  132. },
  133. methods: {
  134. onTopSYClick(index) {
  135. if(!getApp().globalData.bLogin) {
  136. alert('请先登录')
  137. return
  138. };
  139. // console.log("点击了首页标题", index, myData_QXZB_SYQY.length);
  140. let pageIndex = -1;
  141. switch (index) {
  142. case 0: //实验简介
  143. pageIndex = 1;
  144. // this.$refs.SYJJ.initData();
  145. break;
  146. case 1: //学习流程
  147. pageIndex = 2;
  148. // this.$refs.XXLC.initData();
  149. break;
  150. case 2: //开始学习
  151. pageIndex = 3;
  152. this.$refs.KSXX.initData();
  153. break;
  154. default:
  155. console.log("选中状态为home:", state);
  156. }
  157. this.showPage(pageIndex);
  158. },
  159. onLogin: function() {
  160. console.log("登陆成功home");
  161. this.$refs.TopMenu.switchLoginState(true);
  162. this.showPage(4);
  163. // uni.chooseImage({
  164. // success: (chooseImageRes) => {
  165. // const tempFilePaths = chooseImageRes.tempFilePaths;
  166. // uni.uploadFile({
  167. // url: 'http://39.105.166.141:8085/project/createprojectnew', //仅为示例,非真实的接口地址
  168. // filePath: tempFilePaths[0],
  169. // name: 'file',
  170. // formData: {
  171. // 'CreateUserID': 'lyy22', // 创建用户 id
  172. // 'ProjectName': 'test22', // 项目名称
  173. // 'Describe': 'aaa22', // 项目描述
  174. // 'Type': 'bbbbb22', // 科幻 现实 历史 主旋律 纪录片
  175. // },
  176. // success: (uploadFileRes) => {
  177. // console.log('upload ok=', uploadFileRes.data);
  178. // }
  179. // });
  180. // }
  181. // });
  182. },
  183. showPage(index) {
  184. this.curShowPage = index;
  185. for (let i = 0; i < this.bShow.length; i++) {
  186. if (i == index) {
  187. this.bShow[i] = true;
  188. } else {
  189. this.bShow[i] = false;
  190. }
  191. }
  192. // console.log("显示页面", index, this.bShow, this.bShow.length);
  193. this.$forceUpdate();
  194. },
  195. //2级开始学习标题点击事件
  196. on2thKSXXClick(data) {
  197. // console.log("2级点击", data);
  198. let lineIndex = data.indexOf("-");
  199. let type = data.substr(0, lineIndex)
  200. let index = data.substr(lineIndex + 1, data.length - 1)
  201. // console.log("2级点击home---", type, index);
  202. //前序准备
  203. if (type == "QXZB") {
  204. this.showPage(5)
  205. this.$refs.TopMenu.switchMiddleState(topMenuS.QXZB, index);
  206. this.$refs.QXZB.onTopQXZBClick(index);
  207. // this.$refs.TopMenu.checkedIndexQXZB = index;
  208. }
  209. //学习与实验
  210. else if (type == "XXYSY") {
  211. this.showPage(6)
  212. this.$refs.TopMenu.switchMiddleState(topMenuS.XXYSY, index);
  213. this.$refs.XXYSY.onTopXXYSYClick(index);
  214. // this.$refs.TopMenu.checkedIndexXXYSY = index;
  215. } else {
  216. console.log("2级点击---", lineIndex, type, index);
  217. }
  218. },
  219. //顶部前序准备小标题点击事件
  220. onTopQXZBClick(index) {
  221. // console.log("顶部点击home",index);
  222. this.$refs.QXZB.onTopQXZBClick(index);
  223. },
  224. //顶部学习与实验小标题点击事件
  225. onTopXXYSYClick(index) {
  226. // console.log("顶部点击home",index);
  227. this.$refs.XXYSY.onTopXXYSYClick(index);
  228. },
  229. //左侧导航点击事件
  230. onLeftMenuClick(indexArr) {
  231. let targetPage = -1;
  232. let topMiddleState = '';
  233. switch (indexArr[0]) {
  234. case 0: //首页
  235. // targetPage = 4;
  236. // topMiddleState = topMenuS.SY;
  237. // this.$refs.SY.initData();
  238. if (indexArr[1] == 0) {
  239. targetPage = 9;
  240. topMiddleState = topMenuS.home1;
  241. } else if (indexArr[1] == 1) {
  242. targetPage = 10;
  243. topMiddleState = topMenuS.home2;
  244. } else if (indexArr[1] == 2) {
  245. targetPage = 11;
  246. topMiddleState = topMenuS.home3;
  247. } else if (indexArr[1] == 3) {
  248. targetPage = 12;
  249. topMiddleState = topMenuS.home4;
  250. } else if (indexArr[1] == 4) {
  251. targetPage = 13;
  252. topMiddleState = topMenuS.home5;
  253. } else {
  254. targetPage = 4;
  255. topMiddleState = topMenuS.SY;
  256. }
  257. break;
  258. case 1: //实验简介
  259. targetPage = 8;
  260. topMiddleState = topMenuS.SYJJ;
  261. this.$refs.SYJJ2.showPage(indexArr[1]);
  262. this.$refs.TopMenu.switchState_syjj(indexArr[1]);
  263. // this.$forceUpdate();
  264. break;
  265. case 2: //学习流程
  266. switch (indexArr[1]) {
  267. case 0: //学习概要
  268. targetPage = indexArr[1] + 15;
  269. topMiddleState = topMenuS.XXGY;
  270. break;
  271. case 1: //实验步骤
  272. targetPage = indexArr[1] + 15;
  273. topMiddleState = topMenuS.SYBZ;
  274. break;
  275. case 2: //实验引导视频
  276. targetPage = indexArr[1] + 15;
  277. topMiddleState = topMenuS.SYYDSP;
  278. break;
  279. case 3: //学习资料下载
  280. targetPage = 22;
  281. topMiddleState = topMenuS.XXZLXZ;
  282. break;
  283. default:
  284. }
  285. break;
  286. case 3: //开始学习
  287. targetPage = 6;
  288. topMiddleState = topMenuS.XXYSY;
  289. this.$refs.XXYSY.checkedIndex_topTitle = indexArr[1];
  290. break;
  291. case 4:
  292. targetPage = 18;
  293. topMiddleState = topMenuS.info;
  294. break;
  295. case 5:
  296. targetPage = 19;
  297. topMiddleState = topMenuS.info;
  298. break;
  299. case 6:
  300. targetPage = 20;
  301. topMiddleState = '开始勘测'
  302. break;
  303. default:
  304. console.log("展示页面home:", this.curShowPage);
  305. }
  306. this.showPage(targetPage);
  307. this.$refs.TopMenu.switchMiddleState(topMiddleState, indexArr[1]);
  308. // console.log("左侧导航点击home", indexArr);
  309. this.$forceUpdate();
  310. },
  311. goToTeachCreation(){
  312. this.showPage(13);
  313. },
  314. //顶部导航左上角icon点击事件
  315. onTopMenuIconClick() {
  316. if(!getApp().globalData.bLogin) {
  317. alert('请先登录')
  318. return
  319. };
  320. let indexArr = [];
  321. switch (this.curShowPage) {
  322. case 0: //登录
  323. indexArr = [-1, -1];
  324. break;
  325. case 1: //实验简介1级
  326. indexArr = [1, -1];
  327. break;
  328. case 2: //学习流程1级
  329. indexArr = [2, -1];
  330. break;
  331. case 3: //开始学习1级
  332. indexArr = [3, -1];
  333. break;
  334. case 4: //首页
  335. indexArr = [0, -1];
  336. break;
  337. case 5: //开始学习-前序准备
  338. indexArr = [3, 0];
  339. break;
  340. case 6: //开始学习-学习与实验
  341. indexArr = [3, 1];
  342. break;
  343. case 7: //开始学习-学习与实验-原理认知
  344. indexArr = [3, 1];
  345. break;
  346. case 8: //实验简介2级
  347. indexArr = [1, this.checkedIndex_SYJJ];
  348. break;
  349. default:
  350. console.log("展示页面home:", this.curShowPage);
  351. }
  352. this.$refs.LeftMenu.show(indexArr);
  353. },
  354. //开始学习-学习与实验-开始认知按钮
  355. onClick_KSRZ() {
  356. this.showPage(7);
  357. this.$refs.TopMenu.switchMiddleState(topMenuS.YLRZ, -1);
  358. // this.$refs.TopMenu.switchRightState(2);
  359. },
  360. //开始学习-实景勘察-开始勘察按钮
  361. onClick_KSKC() {
  362. this.showPage(21);
  363. this.$refs.TopMenu.switchMiddleState(topMenuS.SJKC, -1);
  364. },
  365. onClick_return(type) {
  366. //从首页建筑页返回到首页
  367. if (type == 9 || type == 10 || type == 11 || type == 12) {
  368. this.showPage(4);
  369. this.$refs.SY.initData();
  370. }
  371. //学前导览三级级返回到学前导览
  372. else if (type == 5 || type == 6 || type == 7 || type == 8) {
  373. this.showPage(2);
  374. }
  375. //
  376. else {
  377. switch (type) {
  378. case 1: //前序准备-返回上一层:返回到开始学习-前序准备的展开页 type-1
  379. this.showPage(3);
  380. this.$refs.KSXX.switchSecondTitle(0);
  381. break;
  382. case 2: //学习与实验-返回上一层:返回到开始学习-学习与实验的展开页 type-2
  383. this.showPage(3);
  384. this.$refs.KSXX.switchSecondTitle(1);
  385. break;
  386. case 3: //原理认知-返回上一层:返回到开始学习-学习与实验-原理认知页 type-3
  387. this.showPage(6);
  388. this.$refs.XXYSY.checkedIndex_topTitle = 0;
  389. break;
  390. case 4: //实验简介-返回上一层:返回到实验简介的展开页 type-4
  391. this.showPage(1);
  392. break;
  393. case 14: //开始勘察-返回上一层:返回到开始学习-实景勘察页
  394. this.showPage(6);
  395. this.$refs.XXYSY.checkedIndex_topTitle = 1;
  396. break;
  397. default:
  398. console.log("返回上一层", type);
  399. }
  400. }
  401. },
  402. //实验简介按钮点击
  403. onClick_SYJJ_btn1(index) {
  404. if (index == 1) { //点击快速进入实验后跳转到原理认知页
  405. this.showPage(6)
  406. this.$refs.TopMenu.switchMiddleState(topMenuS.XXYSY, 0);
  407. this.$refs.XXYSY.onTopXXYSYClick(0);
  408. } else {
  409. this.showPage(8);
  410. this.checkedIndex_SYJJ = index;
  411. this.$refs.SYJJ2.showPage(index);
  412. this.$refs.TopMenu.switchMiddleState(topMenuS.SYJJ, -1);
  413. this.$refs.TopMenu.switchState_syjj(index);
  414. this.$forceUpdate();
  415. }
  416. },
  417. onClick_ksxx() {
  418. this.showPage(3);
  419. this.$refs.KSXX.initData();
  420. this.$refs.TopMenu.switchMiddleState(topMenuS.SY, 2);
  421. },
  422. //顶部导航栏-头像点击事件
  423. onClick_avatar() {
  424. this.showPage(14);
  425. this.$refs.User.initData();
  426. },
  427. //学前导览
  428. onClick_XQDL_btn1(index) {
  429. let targetPage = 0;
  430. switch (index) {
  431. case 0: //学习概要
  432. this.$refs.TopMenu.switchMiddleState(topMenuS.XXGY, -1);
  433. targetPage = index + 15;
  434. break;
  435. case 1: //实验步骤
  436. this.$refs.TopMenu.switchMiddleState(topMenuS.SYBZ, -1);
  437. targetPage = index + 15;
  438. break;
  439. case 2: //实验引导视频
  440. this.$refs.TopMenu.switchMiddleState(topMenuS.SYYDSP, -1);
  441. targetPage = index + 15;
  442. break;
  443. case 3: //学习资料下载
  444. this.$refs.TopMenu.switchMiddleState(topMenuS.XXZLXZ, -1);
  445. targetPage = 22;
  446. break;
  447. default:
  448. console.log("onClick_XQDL_btn1", type);
  449. }
  450. this.showPage(targetPage);
  451. },
  452. //顶部导航点击"影视现场实时特效虚拟仿真实验"
  453. onClick_topMenu_sy() {
  454. this.showPage(4);
  455. this.$refs.SY.initData();
  456. },
  457. //首页建筑按钮点击事件
  458. onClick_sy_btn(index) {
  459. let targetPage = -1;
  460. let topMiddleState = '';
  461. switch (index) {
  462. case 0: //资产库
  463. targetPage = 10;
  464. topMiddleState = topMenuS.home2;
  465. this.$refs.simulationLibrary.init();
  466. break;
  467. case 1: //摄影棚
  468. targetPage = 9;
  469. topMiddleState = topMenuS.home1;
  470. break;
  471. case 2: //管理中心
  472. targetPage = 11;
  473. topMiddleState = topMenuS.home3;
  474. this.$refs.simulationcore.init();
  475. break;
  476. case 3: //拍摄基地
  477. targetPage = 12;
  478. topMiddleState = topMenuS.home4;
  479. break;
  480. default:
  481. console.log("展示页面home:", this.curShowPage);
  482. }
  483. this.showPage(targetPage);
  484. this.$refs.TopMenu.switchMiddleState(topMiddleState, index);
  485. this.$forceUpdate();
  486. },
  487. //项目管理平台
  488. onClick_proManage() {
  489. let targetPage = -1;
  490. let topMiddleState = '';
  491. if (mydata_userInfo.role == '老师') {
  492. targetPage = 13;
  493. } else {
  494. targetPage = 19;
  495. this.$refs.vstudentPlatform.updateInfo();
  496. }
  497. topMiddleState = topMenuS.SY;
  498. this.showPage(targetPage);
  499. this.$refs.TopMenu.switchMiddleState(topMiddleState, -1);
  500. this.$forceUpdate();
  501. },
  502. //用户退出
  503. onClick_userExit() {
  504. this.showPage(4);
  505. this.$refs.TopMenu.switchMiddleState(topMenuS.SY, -1);
  506. },
  507. onLoginClick() {
  508. this.showPage(0);
  509. this.$refs.Login.initData();
  510. this.$refs.TopMenu.switchMiddleState(topMenuS.SY, -1);
  511. }
  512. }
  513. }
  514. </script>
  515. <style lang="scss">
  516. .homeBG {
  517. width: 100%;
  518. height: 100%;
  519. }
  520. .homeContent {
  521. margin-top: px2vw(120);
  522. }
  523. </style>