|
@@ -8,7 +8,18 @@ Component({
|
|
|
loaded2:false,
|
|
|
position2:[0,0,0],
|
|
|
rot:0,
|
|
|
- str:"1"
|
|
|
+ str:"1",
|
|
|
+
|
|
|
+ zhaohuanstate:true,
|
|
|
+ paizhaostate:false,
|
|
|
+ luxiangstate:false,
|
|
|
+ isStartluxiang:true,
|
|
|
+ isCloseluxiang:false,
|
|
|
+
|
|
|
+ captureState: 0,
|
|
|
+ recordState: 0,
|
|
|
+ captureQuality: 0.8,
|
|
|
+ captureType: 'jpg',
|
|
|
|
|
|
},
|
|
|
lifetimes: {
|
|
@@ -20,7 +31,7 @@ Component({
|
|
|
handleReady: function ({detail}) {
|
|
|
const xrScene = this.scene = detail.value;
|
|
|
console.log('xr-scene', xrScene);
|
|
|
-
|
|
|
+
|
|
|
this.binglong = {el:this.scene.getElementById('binglong')};
|
|
|
},
|
|
|
handleAssetsProgress: function({detail}) {
|
|
@@ -72,6 +83,7 @@ Component({
|
|
|
console.log('animation Stop');
|
|
|
},
|
|
|
handleGLTFLoadedbingLong:function({detail}){
|
|
|
+
|
|
|
const el2 = detail.value;
|
|
|
const el = detail.value.target;
|
|
|
const animator = el.getComponent("animator");
|
|
@@ -91,21 +103,94 @@ Component({
|
|
|
}else{
|
|
|
state = true;
|
|
|
animator.play("ui_motion_1");
|
|
|
- el2.position =(0 -2.5 -40);
|
|
|
- }
|
|
|
-
|
|
|
- }, 5000)
|
|
|
- var interval2 = setInterval(function() {
|
|
|
- if(false)
|
|
|
- {
|
|
|
- clearInterval(interval2);
|
|
|
- }
|
|
|
- console.log(5000 +" 毫秒更新");
|
|
|
- binglong.position =(0 -2.5 -40);
|
|
|
-
|
|
|
-
|
|
|
- }, 5000)
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ }, 5000);
|
|
|
+ },
|
|
|
+ handleTouchModel: function ({detail}) {
|
|
|
+ const {target} = detail.value;
|
|
|
+ const id = target.id;
|
|
|
+
|
|
|
+ wx.showToast({title: `点击了模型: ${id}`});
|
|
|
+ },
|
|
|
+ clickZhaoHuan(e){
|
|
|
+ this.setData({zhaohuanstate:true});
|
|
|
+ this.setData({paizhaostate:false});
|
|
|
+ this.setData({luxiangstate:false});
|
|
|
+ this.setData({isStartluxiang:false});
|
|
|
+ },
|
|
|
+ clickPaiZhao(e){
|
|
|
+ this.setData({zhaohuanstate:false});
|
|
|
+ this.setData({paizhaostate:true});
|
|
|
+ this.setData({luxiangstate:false});
|
|
|
+ this.setData({isStartluxiang:false});
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ clickLuXiang(e){
|
|
|
+ this.setData({luxiangstate:true});
|
|
|
+ this.setData({zhaohuanstate:false});
|
|
|
+ this.setData({paizhaostate:false});
|
|
|
+ },
|
|
|
+ ClickzhaohuanSS(e){
|
|
|
+ this.setData({zhaohuanstate:false});
|
|
|
+ },
|
|
|
+ Clickpaizhao(e){
|
|
|
+ this.setData({paizhaostate:false});
|
|
|
+
|
|
|
+ this.scene.share.captureToFriends({
|
|
|
+ fileType: 'png',
|
|
|
+ quality: 0.8
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ await this.scene.share.captureToFriends({
|
|
|
+ fileType: this.data.captureType,
|
|
|
+ quality: this.data.captureQuality
|
|
|
+ });
|
|
|
+ }*/
|
|
|
+
|
|
|
+ },
|
|
|
+ Clickstartluxiang(e){
|
|
|
+
|
|
|
+ this.setData({isStartluxiang:true});
|
|
|
+ this.StartRecord();
|
|
|
+ },
|
|
|
+ Clickcloseluxiang(e){
|
|
|
+
|
|
|
+ this.setData({isStartluxiang:false});
|
|
|
+ this.CloseRecord();
|
|
|
+ },
|
|
|
+
|
|
|
+ await this.scene.share.captureToFriends({
|
|
|
+ fileType: 'png',
|
|
|
+ quality: 0.8
|
|
|
+ });
|
|
|
+ },*/
|
|
|
+ capture() {
|
|
|
+ this.scene.share.captureToFriends({
|
|
|
+ fileType: 'jpg',
|
|
|
+ quality: 0.8
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async StartRecord(){
|
|
|
+ await this.scene.share.recordStart({
|
|
|
+ fps: 30,
|
|
|
+ width: scene.width,
|
|
|
+ height: scene.height,
|
|
|
+ videoBitsPerSecond: 20
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async CloseRecord(){
|
|
|
+ await this.scene.share.recordFinishToAlbum({
|
|
|
+ fps: 30,
|
|
|
+ width: scene.width,
|
|
|
+ height: scene.height,
|
|
|
+ videoBitsPerSecond: 20
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
})
|