home.vue 18 KB

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