home.vue 18 KB

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