diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index ce4b050c6..e9e968099 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -386,7 +386,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj realsectionlist = loadrealsectionlist; rails = loadrails; - console.log(trainlisttest.group.children[0]); + // console.log(trainlisttest.group.children[0]); trainlisttest.group.children[0].getObjectByName("C3").add(cameracctv); } diff --git a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js index 1bada05c5..8c430e5a6 100644 --- a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js +++ b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js @@ -79,7 +79,16 @@ export function AssetModelManager(editor,scene) { resourceType:"三维课程", sceneType:"standstation", }; - + scope.staticAsset['wxc'] = { + modelId:'wxc', + packageName:"维修厂", + url:"/MODEL/2021-08-12/200-34275.FBX", + mesh:"", + assetType:'onlineasset', + isUse:true, + resourceType:"三维课程", + sceneType:"stopstation", + }; //场景中可触发事件模型 this.lessonTriggerList = []; @@ -251,6 +260,16 @@ export function AssetModelManager(editor,scene) { asset.mesh = object; groupList[asset.sceneType].add(object); // scene.add(object); + resolve(); + } ); + }else if(asset.assetType == "onlineasset"){ + loader.load( BASE_ASSET_API+asset.url, function ( object ) { + if(asset.sceneType){ + object.sceneType = asset.sceneType; + } + asset.mesh = object; + groupList[asset.sceneType].add(object); + resolve(); } ); }else{ diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js index 8d1bf732c..6d4bfadc3 100644 --- a/src/jlmap3d/lesson3d/manager/controlmanager.js +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -84,26 +84,30 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { let loaderObj = new THREE.OBJLoader(); - let pengzhuang; + let standstationPZ,stopstationPZ; // load a resource loaderObj.load( - // resource URL - JL3D_LOCAL_STATIC+'/lesson3d/PZ427.obj', - // called when resource is loaded + JL3D_LOCAL_STATIC+'/lesson3d/standstationPZ.obj', function ( object ) { - pengzhuang = object; + standstationPZ = object; + }, + function ( xhr ) { + console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' ); + }, + function ( error ) { + console.log( 'An error happened' ); + } + ); + loaderObj.load( + JL3D_LOCAL_STATIC+'/lesson3d/stopstationPZ.obj', + function ( object ) { + stopstationPZ = object; }, - // called when loading is in progresses function ( xhr ) { - console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' ); - }, - // called when loading has errors function ( error ) { - console.log( 'An error happened' ); - } ); this.initRoleMode = function(rMode,role){ @@ -211,7 +215,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { this.init = function(actions){ - worldOctree.fromGraphNode( pengzhuang ); + worldOctree.fromGraphNode( standstationPZ ); actionList = actions; } @@ -476,6 +480,13 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { } this.initControlMode = function(nowLessonIndex){ + console.log(lessonData.lessonProgress[nowLessonIndex].progressScene); + + if(lessonData.lessonProgress[nowLessonIndex].progressScene == "standstation"){ + worldOctree.fromGraphNode( standstationPZ ); + }else if(lessonData.lessonProgress[nowLessonIndex].progressScene == "stopstation"){ + worldOctree.fromGraphNode( stopstationPZ ); + } scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; if(lessonData.lessonProgress[nowLessonIndex].changeCamera == true){ @@ -526,6 +537,8 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { console.log(roleMode); console.log(eventTrigger); console.log("----------------------------"); + + if(actions.length>0 && roleMode){ scope.eventHitMode = true; for(let i=0;i 课程:{{lessonMsg.lessonTittle}} +
+ 退出 +
+
用户ID:{{lessonMsg.userId}}
+
@@ -90,21 +97,24 @@
考试成绩分析
+ :style="{'background-image': 'url('+lessonbg+')'}" + v-show = "examMode"> 考试计时:{{this.lastPlayTime}}
+ :style="{'background-image': 'url('+lessonbg+')'}" + v-show = "examMode"> 考核步骤:{{examStatus.nowStep}}/{{examStatus.allStep}}
+ :style="{'background-image': 'url('+lessonbg+')'}" + v-show = "examMode"> 考试得分:{{examStatus.lastScore}}/{{examStatus.allScore}}
@@ -153,6 +163,7 @@ return { lessonbg:JL3D_LOCAL_STATIC+"/lesson3d/lessonbg.png", staticImg:JL3D_LOCAL_STATIC, + examMode:false, examStatus:{ allScore:0, nowStep:0, @@ -255,7 +266,7 @@ userJob:"", }; loadData = JSON.parse(data.data.data); - + this.examMode = loadData.setup.examMode; if(loadData.setup.checkedRole.length == 0){ this.showSelectJob = false; } @@ -283,10 +294,12 @@ this.examStatus = newExamStatus; }, lessonEnd(){ - this.endExam = true; - this.showResult(); - this.examStatus.time = this.lastPlayTime; + if(this.examMode == true){ + this.endExam = true; + this.showResult(); + this.examStatus.time = this.lastPlayTime; + } this.stopTime(); }, showResult(){ @@ -381,6 +394,9 @@ changeCameraPos(pos){ this.jl3d.changeCameraPos(pos); }, + openBack(){ + history.go(-1); + }, }, } diff --git a/src/views/lesson/lesson3d.vue b/src/views/lesson/lesson3d.vue index c2ad7d426..1f86fb01d 100644 --- a/src/views/lesson/lesson3d.vue +++ b/src/views/lesson/lesson3d.vue @@ -18,7 +18,7 @@