DGJ 10 months ago
parent
commit
c32406b424

+ 18 - 103
miniprogram/components/xr-classic-show/index.js

@@ -8,18 +8,7 @@ Component({
     loaded2:false,
     position2:[0,0,0],
     rot:0,
-    str:"1",
-    
-    zhaohuanstate:true,
-    paizhaostate:false,
-    luxiangstate:false,
-    isStartluxiang:true,
-    isCloseluxiang:false,
-    
-    captureState: 0,
-    recordState: 0,
-    captureQuality: 0.8,
-    captureType: 'jpg',
+    str:"1"
    
   },
   lifetimes: {
@@ -31,7 +20,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}) {
@@ -83,7 +72,6 @@ Component({
       console.log('animation Stop');
     },
     handleGLTFLoadedbingLong:function({detail}){
-
       const el2 = detail.value;
       const el = detail.value.target;
       const animator = el.getComponent("animator");
@@ -103,94 +91,21 @@ Component({
         }else{
           state = true;
           animator.play("ui_motion_1");
-         // position ="0 -5.5 -40";      
-        }     
-       }, 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.capture();
-      this.scene.share.captureToFriends({
-        fileType: 'png',
-        quality: 0.8
-      });
-     
-      //const base64 = scene.share.captureToDataURL();
-      /*if(supported){
-         // 判断当前客户端是否支持分享系统
-     // const supported = scene.share.supported;
-     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();
-    },
-   /* async capture(){
-      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
-      });
-    },
+          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)
+
+    }
   }
 })

+ 3 - 3
miniprogram/components/xr-classic-show/index.wxml

@@ -18,8 +18,8 @@
         <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="500 500 500" position="-5 0.5 5"    model="gltf-long"
           anim-autoplay 
           />
-      -
-          <xr-gltf id="binglong" node-id="binglong" scale="25 25 25" position="0 -1.5 -40"  model="gltf-binglong"
+      
+          <xr-gltf id="binglong" node-id="binglong" scale="25 25 25" position="0 -1.5 -40"    model="gltf-binglong"
             bind:gltf-loaded="handleGLTFLoadedbingLong"
           />
           <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="300 300 300" position="-10 0 0"    model="gltf-lanjiachong"
@@ -111,7 +111,7 @@
         anim-autoplay
       />
       </xr-node>
- 
+
 
 
    

+ 3 - 50
miniprogram/components/xr-classic-showsix/index.wxml

@@ -11,13 +11,12 @@
     <xr-asset-load type="gltf" asset-id="gltf-huangfeilong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/fourseasonsgriffons_spring.glb" />
     <xr-asset-load type="gltf" asset-id="gltf-lanniao" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/fourseasonsgriffons_winter.glb" />
     <xr-asset-load type="gltf" asset-id="gltf-denglong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/8.glb" />
-    
   </xr-assets>
   <xr-env node-id="World" env-data="env1"/>
 
       <xr-node  node-id="models">
         <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="500 500 500" position="-5 0.5 5"    model="gltf-long"
-            anim-autoplay 
+            anim-autoplay
           />
       
           <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="25 25 25" position="0 -1.5 -40"    model="gltf-binglong"
@@ -112,58 +111,12 @@
         anim-autoplay
       />
       </xr-node>
-<!--<view class="uiView">
-  <button class="tapbtn2" plain="true" bindtap="clickZhaoHuan"  style="position: fixed; right: 30rpx; top: 650rpx; width:180rpx; height: 160rpx" >
-  <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/rigth_zhaohuan.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
-</button>
-
-<button class="tapbtn3" plain="true" bindtap="clickPaiZhao"  style="position: fixed; right: 30rpx; top: 850rpx; width:180rpx; height: 160rpx">
-  <image class="tapimg3" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/right_paizhao.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
-</button>
-
-<button class="tapbtn4" plain="true" bindtap="clickLuXiang"  style="position: fixed; right: 30rpx; top: 1050rpx; width:180rpx; height: 160rpx">
-  <image class="tapimg4" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/right_luxiang.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
-</button>
-
-
-<view wx:if="{{zhaohuanstate}}" class="zhaohuanView">
-  <image  class="zhaohuan" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/zhaohuanText.png'    style="position: fixed; left: 100rpx; top: 1270rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
-
-  <button class="tapbtn5" plain="false" bindtap="ClickzhaohuanSS"  style="position: fixed; left:230rpx; top: 1390rpx; ">
-    <image  class="zhaohuan" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/zhaohuanBtn.png'    style="position: fixed; left:230rpx; top: 1390rpx; width: 300rpx; height: 100rpx; display: flex; box-sizing: border-box"></image>
-  </button>
-</view>
-
-<view wx:if="{{paizhaostate}}" class="paizhaoView">
-  <image  class="paizhao" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/paizhaoText.png'    style="position: fixed; left: 100rpx; top: 1270rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
-
-  <button class="tapbtn6" plain="true" bindtap="Clickpaizhao"  style="position: fixed; left:230rpx; top: 1390rpx;">
-    <image  class="paizhao" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/paizhaoBtn.png'    style="position: fixed; left:300rpx; top: 1390rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
-  </button>
-</view>
-
-<view wx:if="{{luxiangstate}}" class="luxiangView">
-  <view wx:if="{{isStartluxiang}}" class="startluxiang">
-    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang2Text.png'    style="position: fixed; left: 100rpx; top: 1270rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
-
-  <button class="tapbtn8" plain="true" bindtap="Clickcloseluxiang"  style="position: fixed; right: 30rpx; top: 1050rpx; ">
-    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang2Btn.png'    style="position: fixed; left:300rpx; top: 1390rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
-  </button>
-  </view>
 
-  <view wx:if="{{!isStartluxiang}}" class="closeluxiang">
-    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang1Text.png'    style="position: fixed; left: 100rpx; top: 1270rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
 
-<button class="tapbtn7" plain="true" bindtap="Clickstartluxiang"  style="position: fixed; left:230rpx; top: 1390rpx;">
-  <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang1Btn.png'    style="position: fixed; left:300rpx; top: 1390rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
-</button>
- 
-</view>
-</view>
-</view>-->
 
+   
     <xr-camera
-      id="camera" node-id="camera" position="1 1 10" clear-color="0.925 0.925 0.925 1"
+      id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
       background="ar" is-ar-camera
     />
   

+ 93 - 3
miniprogram/pages/ar-classic/scene-classic-show/index.js

@@ -1,6 +1,18 @@
 var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
 Page({
   behaviors:[sceneReadyBehavior],
+  data:{
+    zhaohuanstate:true,
+    paizhaostate:false,
+    luxiangstate:false,
+    isStartluxiang:true,
+    isCloseluxiang:false,
+    
+    captureState: 0,
+    recordState: 0,
+    captureQuality: 0.8,
+    captureType: 'jpg',
+  },
   handleProgress: function({detail}) {
     console.log('assets progress', detail);
 
@@ -12,11 +24,89 @@ Page({
     this.setData({loaded: true});
   },
   handlestr: function({detail}) {
-    console.log('assets handlestr', detail);
+    //console.log('assets handlestr', detail);
+
     this.setData({loadedSaoMiao: true});
   },
-  ontouchend(){
+  
+  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.capture();
+    this.scene.share.captureToFriends({
+      fileType: 'png',
+      quality: 0.8
+    });
    
-  }
+    //const base64 = scene.share.captureToDataURL();
+    /*if(supported){
+       // 判断当前客户端是否支持分享系统
+   // const supported = scene.share.supported;
+   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();
+  },
+ /* async capture(){
+    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
+    });
+  },
 });
 

+ 53 - 2
miniprogram/pages/ar-classic/scene-classic-show/index.wxml

@@ -12,17 +12,68 @@
         bind:assetsLoaded="handleLoaded"
         bind:assetsstr="handlestr"
     />
-<!--wx:if="{{!loaded}}"-->
+<!--<videw wx:if="{{!loaded}}"-->
 
   <view  wx:if="{{!loaded}}" style="position: absolute;display: flex; justify-content: center; align-items: center; left: 0;top: 0;width: 100%;height:100%;background-color: rgba(0, 0, 0,1); text-align: center;line-height: 24px;">
     <text style="color: white;font-size: 18px;">{{progressInfo}}</text>
   </view>
-<!--  wx:if="{{loaded&&!loadedSaoMiao}}"-->
+<!--  wx:if="{{loaded&&!loadedSaoMiao}}"
 
   <view  style="position: absolute; display: flex; justify-content: center; align-items: center; left: 146rpx; top: 261rpx; width: 100%; height: 441rpx; background-color: rgba(0, 0, 0,0); text-align: center; line-height: 24px; box-sizing: content-box">
 
     
 <image  wx:if="{{loaded}}"  class="zhaohuan" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/zhaohuan.png'    style="position: relative; left: -164rpx; top: 704rpx; width: 554rpx; height: 211rpx; display: flex; box-sizing: border-box"></image>
+</view>-->
+<view wx:if="{{loaded}}" class="zhaohuan">
+  <button class="tapbtn2" plain="true" bindtap="clickZhaoHuan"  style="position: fixed; right: 30rpx; top: 450rpx; width:180rpx; height: 160rpx" >
+  <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/rigth_zhaohuan.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
+</button>
+
+<button class="tapbtn3" plain="true" bindtap="clickPaiZhao"  style="position: fixed; right: 30rpx; top: 650rpx; width:180rpx; height: 160rpx">
+  <image class="tapimg3" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/right_paizhao.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
+</button>
+
+<button class="tapbtn4" plain="true" bindtap="clickLuXiang"  style="position: fixed; right: 30rpx; top: 850rpx; width:180rpx; height: 160rpx">
+  <image class="tapimg4" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/right_luxiang.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 180rpx; width:180rpx;" ></image>
+</button>
+
+
+<view wx:if="{{zhaohuanstate}}" class="zhaohuanView">
+  <image  class="zhaohuan" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/zhaohuanText.png'    style="position: fixed; left: 100rpx; top: 1070rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
+
+  <button class="tapbtn5" plain="false" bindtap="ClickzhaohuanSS"  style="position: fixed; left:230rpx; top: 1190rpx; ">
+    <image  class="zhaohuan" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/zhaohuanBtn.png'    style="position: fixed; left:230rpx; top: 1190rpx; width: 300rpx; height: 100rpx; display: flex; box-sizing: border-box"></image>
+  </button>
+</view>
+
+<view wx:if="{{paizhaostate}}" class="paizhaoView">
+  <image  class="paizhao" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/paizhaoText.png'    style="position: fixed; left: 100rpx; top: 1070rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
+
+  <button class="tapbtn6" plain="true" bindtap="Clickpaizhao"  style="position: fixed; left:230rpx; top: 1190rpx;">
+    <image  class="paizhao" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/paizhaoBtn.png'    style="position: fixed; left:300rpx; top: 1190rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
+  </button>
 </view>
 
+<view wx:if="{{luxiangstate}}" class="luxiangView">
+  <view wx:if="{{isStartluxiang}}" class="startluxiang">
+    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang2Text.png'    style="position: fixed; left: 100rpx; top: 1070rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
+
+  <button class="tapbtn8" plain="true" bindtap="Clickcloseluxiang"  style="position: fixed; right: 30rpx; top: 1190rpx; ">
+    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang2Btn.png'    style="position: fixed; left:300rpx; top: 1190rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
+  </button>
+  </view>
+
+  <view wx:if="{{!isStartluxiang}}" class="closeluxiang">
+    <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang1Text.png'    style="position: fixed; left: 100rpx; top: 1070rpx; width: 554rpx; height: 80rpx; display: flex; box-sizing: border-box"></image>
+
+<button class="tapbtn7" plain="true" bindtap="Clickstartluxiang"  style="position: fixed; left:230rpx; top: 1190rpx;">
+  <image  class="luxiang" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/luxiang1Btn.png'    style="position: fixed; left:300rpx; top: 1190rpx; width: 160rpx; height: 160rpx; display: flex; box-sizing: border-box"></image>
+</button>
+ 
+</view>
+</view>
+</view >
+ 
+
+
 </xr-demo-viewer>