home.vue 18 KB

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