Browse Source

6dof 同步

DGJ 1 year ago
parent
commit
f2bd2df558

+ 3 - 5
miniprogram/app.json

@@ -1,14 +1,12 @@
 {
   "pages": [
-   
- 
+    "pages/index/index",
     "pages/ar-classic/scene-classic-show/index",
+    "pages/ar-classic/scene-classic-showsix/index",
     "pages/ar-classic/scene-classic-saomiao/index",
     "pages/ar-classic/scene-classic-tujian/index",
     "pages/ar/plane-ar-v2-marker/plane-ar-v2-marker",
-    "pages/ar-classic/scene-classic-portal/index",
-    "pages/ar-classic/scene-classic-showsix/index"
-    
+    "pages/ar-classic/scene-classic-portal/index"
   ],
   "usingComponents": {},
   "window": {

+ 193 - 2
miniprogram/components/xr-classic-showsix/index.js

@@ -1,7 +1,81 @@
 Component({
   behaviors: [require('../common/share-behavior').default],
-  properties: {},
+  properties: {
+    captureState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) {
+        if (newVal !== oldVal) {
+          if (newVal === 1) {
+            this.capture();
+            this.ShowModel();
+          }
+        }
+      },
+    },
+    recordState: {
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) {
+        if (newVal !== oldVal) {
+          if (newVal === 0) {
+            this.recordEnd();
+          } else {
+            this.recordStart();
+          }
+        }
+      }
+    },
+    captureQuality: {
+      type: Number,
+      value: 0.8,
+    },
+    captureType: {
+      type: String,
+      value: 'jpg',
+    },
+    recordFPS: {
+      type: Number,
+      value: 30,
+    },
+    recordWidth: {
+      type: Number,
+      value: undefined,
+    },
+    recordHeight: {
+      type: Number,
+      value: undefined,
+    },
+    recordBPS: {
+      type: Number,
+      value: 1000,
+    },
+    uiShowModelView:{
+      type: Boolean,
+      value: false,
+      observer: function (newVal, oldVal) {
+      
+        if (newVal !== oldVal) {
+          if(newVal){
+            //this.ShowModel(1);
+          }else{
+            this.CloseModel();
+          }
+        }     
+      },
+    },   
+    uiShowIndex:{
+      type: Number,
+      value: 0,
+      observer: function (newVal, oldVal) {
+        if (newVal !== oldVal) {
+          this.ShowModel(newVal);
+        }
+      },
+    }
+  },
   data: {
+    loaded: false,
     loadedSaoMiao:false,
     loaded: false,
     arReady: false,
@@ -9,8 +83,12 @@ Component({
     position2:[0,0,0],
     rot:0,
     str:"1",
-  
+    luanniaoShow:false,
+    fuzhuShow:false,
+    yinglongShow:false,
+    nianshouShow:false,
   },
+
   lifetimes: {
     async attached() {
       console.log('data', this.data);
@@ -20,6 +98,19 @@ Component({
     handleReady: function ({detail}) {
       const xrScene = this.scene = detail.value;
       console.log('xr-scene', xrScene);
+
+      this.binglong = {el:this.scene.getElementById('binglong')};
+
+      const scene = this.scene = detail.value;
+      const appHide = () => this.scene.share.recordPause();
+      const appShow = () => this.scene.share.recordResume();
+      wx.onAppHide(appHide);
+      wx.onAppShow(appShow);
+      wx.offAppHide(appHide);
+      wx.offAppShow(appShow);
+      
+      this.triggerEvent('sceneReady', {width: scene.width, height: scene.height});
+
     },
     handleAssetsProgress: function({detail}) {
       this.triggerEvent('assetsProgress', detail.value);
@@ -30,6 +121,7 @@ Component({
       this.setData({
         loaded: true
       });
+     
     },handleGltfLoaded2: function() {
       
     },handleGltfLoaded: function() {
@@ -68,6 +160,105 @@ Component({
     },
     handleAnimationStop: function() {
       console.log('animation Stop');
+    },
+   /* handleGLTFLoadedbingLong:function({detail}){
+      const el2 = detail.value;
+  
+      
+      var state = true;
+
+      const xrScene = this.scene;
+      const xrFrameSystem = wx.getXrFrameSystem();
+      const myModel = xrScene.getElementById('binglong');
+      this.myModelAnimator = myModel.getComponent(xrFrameSystem.Animator);
+      const clips = this.myModelAnimator._clips;
+      this.clipName = []
+       clips.forEach((v, key) => {
+        if (key.indexOf('pose') == -1) {
+          this.clipName.push(key)
+        }
+      })
+      wx.showToast({
+        title: this.clipName[0],
+      });
+      this.myModelAnimator.play.play(this.clipName[0],{ loop:5,});
+
+      var interval = setInterval(function() {
+        if(false)
+        {
+          clearInterval(interval);
+        }
+        console.log(5000 +" 毫秒更新");
+        if(state)
+        {
+          state = false;
+          this.myModelAnimator.play.play(this.clipName[1],{ loop:5,});
+        }else{
+          state = true;
+          this.myModelAnimator.play.play(this.clipName[2],{ loop:5,});
+          el2.position =(0 -2.5 -40);
+        }
+        
+       }, 5000)
+
+    },*/
+    capture() {
+      this.scene.share.captureToFriends({
+        fileType: this.data.captureType,
+        quality: this.data.captureQuality
+      });
+    },
+    recordStart() {
+      console.log('recordStart') 
+      wx.updateShareMenu({
+        withShareTicket: true,
+        success () { }
+      })
+      this.scene.share.recordStart({
+        fps: this.data.recordFPS,
+        videoBitsPerSecond: this.data.recordBPS,
+        width: this.data.recordWidth,
+        height: this.data.recordHeight
+      });
+    },
+    recordEnd() {
+      console.log('recordEnd')
+     
+      
+      //
+      const tempFilePath =  this.scene.share.recordFinishToAlbum({
+        fps: this.data.recordFPS,
+        videoBitsPerSecond: this.data.recordBPS,
+        width: this.data.recordWidth,
+        height: this.data.recordHeight
+      });
+      wx.shareVideoMessage({
+        videoPath: tempFilePath,
+      });
+    },
+    ShowModel(modelIndex){
+      console.log(' ShowMoelIndex ',modelIndex);
+      switch(modelIndex){
+        case 0:
+          this.setData({luanniaoShow:true});
+        
+          break;
+        case 1:
+          this.setData({yinglongShow:true});
+          break;
+        case 2:
+          this.setData({fuzhuShow:true});
+          break;
+        case 3:
+           this.setData({nianshouShow:true});
+           break;
+      }
+     
+    },
+    CloseModel(){
+      this.setData({longshow:false});
+      this.setData({binglongshow:false});
+      this.setData({lanjiachongshow:false});
     }
   }
 })

+ 70 - 108
miniprogram/components/xr-classic-showsix/index.wxml

@@ -1,128 +1,90 @@
 <xr-scene ar-system="modes:Plane ; planeMode: 1;" bind:ready="handleReady" bind:ar-ready="handleARReady">
   
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
-
-    <xr-asset-load type="env-data" asset-id="env1" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/env-test.bin" />
+    <xr-asset-load type="gltf" asset-id="gltf-kun" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/5.glb" />
 
     <xr-asset-load type="gltf" asset-id="gltf-long" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/2low_poly_dragon_white_dh10.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-yanhua" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/4.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-binglong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/3.glb" />
-    <xr-asset-load type="gltf" asset-id="gltf-lanjiachong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/5.glb" />
-    <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-asset-load asset-id="anim" type="keyframe" src="/assets/animation/miku-kawaii-animation.json"/> 
+
+    <xr-asset-load type="gltf" asset-id="gltf-luanniao" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/fenghuang.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-fuzhu" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/shenlu.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-qiling" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/shizi.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-denglong" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/DengLong3.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-paopao" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/PaoPao1.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-bubble" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/bubble.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-birdslow" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/phoenix_bird_slow4.glb" />
+    <xr-asset-load type="gltf" asset-id="gltf-qipao" src="https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXModel/%E6%B0%94%E6%B3%A1.glb" />
   </xr-assets>
   <xr-env node-id="World" env-data="env1"/>
+    <xr-node>
+    
+      <xr-gltf id="kun" node-id="kun" scale="30 30 30" position="-0.3 -0.5 -5" rotation="0 0 0"   model="gltf-kun" anim-autoplay  />
 
-      <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
-          />
-      
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="25 25 25" position="0 -1.5 -40"    model="gltf-binglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="300 300 300" position="-10 0 0"    model="gltf-lanjiachong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="30 30 30" position="10 -1 -10"    model="gltf-huangfeilong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="10 10 10" position="15 -1 0"  rotation="0 180 0"   model="gltf-lanniao" 
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="1 1.5 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="1 1 1"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="0 3 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="3 3 1"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="1 2 3"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="0 1.5 3"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="3 1.4 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="2 1.4 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="2 1.5 2"    model="gltf-denglong"
-            anim-autoplay
-          />
-
-
-
-          
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-1 1.5 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-1 1.7 -1"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="0 1.6 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-3 1.5 -1"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-1 1 -3"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="0 1.5 -3"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-3 1.5 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-2 2 0"    model="gltf-denglong"
-            anim-autoplay
-          />
-          <xr-gltf id="wxball2" node-id="mesh-gltf-wxball2" scale="100 100 100" position="-2 1.5 -2"    model="gltf-denglong"
-            anim-autoplay
-          />
-
-
-          <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="1 1.5 0" model="gltf-yanhua"
-        anim-autoplay
-      />
-          <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="3 1.5 0" model="gltf-yanhua"
-        anim-autoplay
-      />
-          <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="3 1.5 3" model="gltf-yanhua"
-        anim-autoplay
-      />
-
-      <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="-1 1.5 0" model="gltf-yanhua"
-        anim-autoplay
-      />
-          <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="-3 1.5 0" model="gltf-yanhua"
-        anim-autoplay
-      />
-          <xr-gltf id="wxball" node-id="mesh-gltf-wxball" scale="0.1 0.1 0.1" position="-3 1.5 -3" model="gltf-yanhua"
-        anim-autoplay
-      />
+      <xr-gltf id="long" node-id="long" scale="40 40 40" position="-2.3 -0.5 -4" rotation="0 0 0"   model="gltf-long" anim-autoplay  />
+  
+      <xr-gltf 
+    wx:if="true"
+    id="denglong" node-id="denglong" scale="1 1 1" position="-0.5 0 -3" rotation="0 -100 0"   model="gltf-denglong" anim-autoplay  />
+
+    <xr-gltf 
+    wx:if="{{luanniaoShow}}"
+    id="luanniao" node-id="luanniao" scale="2 2 2" position="-2.3 0 5" rotation="0 -80 0"   model="gltf-luanniao" anim-autoplay  />
+
+    <xr-gltf 
+    wx:if="{{nianshouShow}}"
+    id="qiling" node-id="qiling" scale="0.05 0.05 0.05" position="10.3 0 0" rotation="0 -80 0"   model="gltf-qiling" anim-autoplay  />
+
+    <xr-gltf 
+    wx:if="{{fuzhuShow}}"
+    id="fuzhu" node-id="fuzhu" scale="2 2 2" position="-4.3 0 0" rotation="0 170 0"   model="gltf-fuzhu" anim-autoplay  />
+
+
+    </xr-node>
+    <xr-node position="4.3 0 -15" anim-keyframe="anim" anim-autoplay="clip:parent">
+      <xr-node position="0 0 -5" rotation="0 0 0" anim-keyframe="anim" anim-autoplay="clip:child">
+        <xr-gltf position="0 0 0"  scale="0.01 0.01 0.01" rotation="0 180 0" model="gltf-birdslow" anim-keyframe="anim" anim-autoplay></xr-gltf>
       </xr-node>
 
+<!--
+      <xr-gltf id="birdslow" node-id="birdslow" scale="0.01 0.01 0.01" position="-0.3 -0.5 5" rotation="0 90 0"   model="gltf-birdslow" anim-autoplay  />
+      
 
+      <xr-gltf id="bubble" node-id="bubble" scale="1 1 1" position="-0.3 0 2" rotation="0 0 0"   model="gltf-bubble" anim-autoplay  />
+
+  
+
+      <xr-gltf 
+    wx:if="true"
+    id="luanniao" node-id="luanniao" scale="0.5 0.5 0.5" position="-0.3 0 2" rotation="0 -100 0"   model="gltf-luanniao" anim-autoplay  />
+      <xr-gltf 
+    wx:if="true"
+    id="qiling" node-id="qiling" scale="0.01 0.01 0.01" position="-0.3 -0.5 2" rotation="0 -180 0"   model="gltf-qiling" anim-autoplay  />
+ 
 
    
+
+      <xr-gltf 
+    id="luanniao" node-id="luanniao" scale="1 1 1" position="-0.3 0 -5" rotation="0 100 0"   model="gltf-luanniao" anim-autoplay  />
+
+    <xr-gltf 
+    wx:if="true"
+    id="fuzhu" node-id="fuzhu" scale="1 1 1" position="-2.3 -0.5 -2" rotation="0 100 0"   model="gltf-fuzhu" anim-autoplay  />
+
+      <xr-gltf id="qipao" node-id="qipao" scale="2 2 2" position="-0.3 0 -3" rotation="0 0 0"   model="gltf-qipao" anim-autoplay  />
+   -->
+    </xr-node>
+
+
     <xr-camera
       id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
       background="ar" is-ar-camera
-    />
-  
+    >
+
+  </xr-camera>
   <xr-node node-id="lights">
-    <xr-light type="ambient" color="1 1 1" intensity="0.3" />
-    <xr-light type="directional" rotation="30 60 0" color="1 1 1" intensity="1" />
+    <xr-light type="ambient" color="1 1 1" intensity="0.5" />
+    <xr-light type="directional" rotation="40 170 0" color="1 1 1" intensity="5" />
   </xr-node>
 
 

+ 317 - 1
miniprogram/pages/ar-classic/scene-classic-showsix/index.js

@@ -1,6 +1,107 @@
 var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
+//var capate = require("G:/GUnityProject/WXXR/miniprogram/components/xr-classic-show/index.js");
 Page({
   behaviors:[sceneReadyBehavior],
+  data:{   
+    captureState: 0,
+    recordState: 0,
+    captureQuality: 0.8,
+    captureType: 'jpg',
+    recordFPS: 30,
+    recordScale: 1,
+    recordWidth: 0,
+    recordHeight: 0,
+    recordBPS: 30000,
+    sceneWidth: 0,
+    sceneHeight: 0,
+
+    zhaohuanstate:true,
+    paizhaostate:false,
+    luxiangstate:false,
+    isStartluxiang:true,
+    isCloseluxiang:false,
+
+    uiShowModelView:false,
+    UiShowModel_Bottom:false,
+    uiMainView:true,
+    uiShowNum:3,
+    uiShowIndex:0,
+
+    current:0,
+    products:[],
+    modelImg:[
+      'https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E9%B8%BE%E9%B8%9F%E9%A2%84%E8%A7%88%E5%9B%BE.png',
+      'https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E5%BA%94%E9%BE%99%E9%A2%84%E8%A7%88%E5%9B%BE.png',
+      'https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E5%A4%AB%E8%AF%B8%E9%A2%84%E8%A7%88%E5%9B%BE.png',
+      'https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E7%8B%BB%E7%8C%8A%E9%A2%84%E8%A7%88%E5%9B%BE.png',
+    ],
+    log:"123",
+  },
+  onLoad(){
+   
+  },
+  onShow(){
+    this.setData({log:'OnShow'});
+    var that = this;
+
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          // 获取到用户的临时登录凭证 code,可以发送给服务器
+          console.log('用户登录成功,code:', res.code);
+      
+          wx.request({
+            url: 'https://api-fat1.ghz-tech.com/miniprogram-shanhaijing/v1/product/listInfo',
+            method:'POST',
+            header:{
+              'Content-Type':'application/json'
+            },
+            data:{
+              topic:1,
+              js_code:res.code
+            },
+            success:(res)=>{ 
+                console.log('POST 请求成功', res.data);
+                that.setData({log:'POST 请求成功'});
+                var products2 = res.data.data.products;
+                var modelImgs = this.data.modelImg;
+                console.log(' 商品列表 ',products2[0].desc);
+                
+                for(var i =0;i<products2.length;i++){
+                  products2[i]["modelImg"] = modelImgs[i];
+                  if(products2[i].activate){
+                    that.setData({uiShowIndex:i});
+                  }
+                }
+                that.setData({products:products2});      
+                console.log(' 商品列表 ',this.data.products[0]);
+                that.setData({UiShowModel_Bottom:true});
+      
+            },  
+            fail:function(err){
+              console.error('POST 请求失败', err);
+              var errorlog = err.toString();
+              that.setData({log:errorlog});
+            }
+          });
+        } else {
+          console.log('登录失败!' + res.errMsg);
+        }
+      },
+    });
+
+   
+  },
+
+  handleReady: function({detail}) {
+    this.setData({
+      sceneWidth: detail.width,
+      sceneHeight: detail.height,
+      recordWidth: detail.width,
+      recordHeight: detail.height,
+    });
+
+  },
   handleProgress: function({detail}) {
     console.log('assets progress', detail);
 
@@ -14,7 +115,222 @@ Page({
   handlestr: function({detail}) {
     //console.log('assets handlestr', detail);
 
-    this.setData({loadedSaoMiao: true});
+    this.setData({
+      loadedSaoMiao: true,
+    });
+  },
+  
+  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});
+    this.setData({uiMainView:false});
+    this.setData({uiShowModelView:true});
+    this.setData({uiShowNum:1});
+  },
+  Clickpaizhaoss(e){
+   
+   // 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
+  });
+    }*/
+    //capate.capate();
+    //this.setData({paizhaostate:false});
+    
+    if (this.data.recordState) {
+      wx.showToast({
+        title: '录屏中不允许!',
+      });
+      return;
+    }
+
+    if (this.data.captureState) {
+      wx.showToast({
+        title: '等待上次完成!',
+      });
+      return;
+    }
+
+    this.setData({captureState: 1});
+    // hack,其实应该等待异步方法完成
+    setTimeout(() => {
+      this.setData({captureState: 0});
+    }, 1000);
+    
+  },
+  Clickstartluxiang(e){
+  
+   this.setData({isStartluxiang:true});
+   this.setData({recordState: 1});
+  },
+  Clickcloseluxiang(e){
+
+    this.setData({isStartluxiang:false});
+    this.setData({recordState: 0});
+    wx.showToast({
+      title: '视频录制完成',
+    });
+  },
+  changeCaptureState(e) {
+    if (this.data.recordState) {
+      wx.showToast({
+        title: '录屏中不允许!',
+      });
+      return;
+    }
+
+    if (this.data.captureState) {
+      wx.showToast({
+        title: '等待上次完成!',
+      });
+      return;
+    }
+
+    this.setData({captureState: 1});
+    // hack,其实应该等待异步方法完成
+    setTimeout(() => {
+      this.setData({captureState: 0});
+    }, 1000);
+  },
+  changeRecordState(e) {
+    this.setData({recordState: this.data.recordState ? 0 : 1});
+  },
+  clickCloseUIShow(e){
+    this.setData({uiMainView:true});
+    this.setData({zhaohuanstate:true});
+    this.setData({uiShowModelView:false});
+  },
+  clickJiSuoModel(e){
+
+  },
+  changeMoel:function(event){
+    var current2 = event.detail.current;
+    this.setData({
+      current:current2
+    })
+  },
+  clickShowLeft(e){
+   
+    var leftoldIndex = this.data.uiShowNum;
+    if(leftoldIndex ==0){
+      
+    }
+   
+    switch(this.data.uiShowIndex){
+      case 0:
+        this.setData({uiShowIndex:2});
+        break;
+      case 2:
+        this.setData({uiShowIndex:1});
+        break;
+      case 1:
+        this.setData({uiShowIndex:0});
+        break;
+    }
+    let current = this.data.current;
+    current = current > 0 ? current - 1 : 0;
+    this.setData({
+      current: current,
+    });
+  },
+  clickShowRight(e){
+    var  oldIndex = this.data.uiShowIndex;
+    oldIndex = oldIndex+1;    
+    var nIndex = oldIndex%3;
+    this.setData({uiShowIndex:nIndex});  
+
+    let current = this.data.current;
+    current = current < 2 ? current + 1 : 2; // 假设总共有3页
+    this.setData({
+      current: current,
+    });
+   
+  },clickJiSuoModel(e){
+    var that = this;
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          // 获取到用户的临时登录凭证 code,可以发送给服务器
+          console.log('用户登录成功,code:', res.code);
+          var modelId = this.data.products[this.data.current].id;
+          console.log('当前ModelId ', modelId);
+          wx.request({
+            url: 'https://api-fat1.ghz-tech.com/miniprogram-shanhaijing/v1/order/prepay',
+            method:'POST',
+            header:{
+              'Content-Type':'application/json'
+            },
+            data:{
+              shop_cart:[{
+                id:modelId,
+                count:1
+              }],
+              js_code:res.code
+            },
+            success:function(res){
+              console.log('POST 请求成功', res.data.data);
+              var paySignStr = res.data.data.pay_Sign;
+              console.log('即将调取微信支付',res.data.data.pay_Sign);
+             
+              wx.requestPayment({
+                nonceStr: res.data.data.nonce_str,
+                package: res.data.data.package,
+                paySign: res.data.data.pay_sign,
+                timeStamp: res.data.data.time_stamp,
+                signType:res.data.data.sign_type,
+                success(res){
+                  console.log( '微信支付请求成功',res );
+                  // 付款成功回调
+
+                    var products2 = that.data.products;
+                  products2[that.data.current].activate = true;
+                 that.setData({products:products2});
+                  console.log('AAAA ',that.data.products);
+                  var uiShowIndex2 = that.data.current;
+                  that.setData({uiShowIndex:uiShowIndex2});
+                },
+                fail(err){
+                  console.log('微信支付请求失败',err);
+                }
+              })
+            },
+            fail:function(err){
+              console.error('POST 请求失败', err);
+            }
+          });
+        } else {
+          console.log('登录失败!' + res.errMsg);
+        }
+      },
+    });
   }
+
 });
 

+ 158 - 2
miniprogram/pages/ar-classic/scene-classic-showsix/index.wxml

@@ -11,18 +11,174 @@
         bind:assetsProgress="handleProgress"
         bind:assetsLoaded="handleLoaded"
         bind:assetsstr="handlestr"
+        bind:sceneReady="handleReady"
+        captureState="{{captureState}}"
+        recordState="{{recordState}}"
+        captureType="{{captureType}}"
+        captureQuality="{{captureQuality}}"
+        recordFPS="{{recordFPS}}"
+        recordBPS="{{recordBPS}}"
+        recordWidth="{{recordWidth}}"
+        recordHeight="{{recordHeight}}"
+        uiShowModelView="{{uiShowModelView}}"
+        uiShowIndex ="{{uiShowIndex}}"
+     
     />
-<!--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">
+
+  <view wx:if="{{uiMainView}}" >
+  
+ 
+  <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="Clickpaizhaoss"  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>
+
+
+<view wx:if="{{uiShowModelView}}" class="ZhaoHuanShowModel">
+
+ 
+
+<view class ="uiShowModel">
+  <button class="tapbtn2" plain="true" bindtap="clickShowLeft"  style="position: fixed; left: 20rpx; top: 600rpx; width:100rpx; height: 100rpx" >
+  <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/if-caret-left.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 100rpx; width:100rpx;" ></image>
+</button>
+ <!-- <image wx:if="{{current==0}}" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E9%B8%BE%E9%B8%9F%E9%A2%84%E8%A7%88%E5%9B%BE.png' style="position: absolute; left: 80rpx; top:300rpx;  height: 600rpx; width:600rpx;">
+  </image>
+  <image wx:if="{{current==1}}" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E5%BA%94%E9%BE%99%E9%A2%84%E8%A7%88%E5%9B%BE.png' style="position: absolute; left: 80rpx; top:300rpx;  height: 600rpx; width:600rpx;">
+  </image>
+  <image wx:if="{{current==2}}" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E5%A4%AB%E8%AF%B8%E9%A2%84%E8%A7%88%E5%9B%BE.png' style="position: absolute; left: 80rpx; top:300rpx;  height: 600rpx; width:600rpx;">
+  </image>
+  <image wx:if="{{current==3}}" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/%E9%80%89%E6%8B%A9%E7%A5%9E%E5%85%BD-%E7%8B%BB%E7%8C%8A%E9%A2%84%E8%A7%88%E5%9B%BE.png' style="position: absolute; left: 80rpx; top:300rpx;  height: 600rpx; width:600rpx;">
+  </image>-->
+<button class="tapbtn2" plain="true" bindtap="clickShowRight"  style="position: fixed; right: 20rpx; top: 600rpx; width:100rpx; height: 100rpx" >
+  <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/if-caret-right.png'  style="position: absolute; left: 0rpx; top:-15rpx;  height: 100rpx; width:100rpx;" ></image>
+</button>
+<view style="position: absolute; left: 0rpx; top:300rpx;">{{log}}</view>
+</view>
+
+<view wx:if="{{ UiShowModel_Bottom }}" class="UiShowModel_Bottom">
+ <!-- <image class="bg_left" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ui-bg-left.png'  style="position: absolute; left: 0rpx; top:1240rpx;  height: 450rpx; width:55rpx;" ></image>
+  <image class="bg_left" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ui-bg-right.png'  style="position: absolute; right: 0rpx; top:1240rpx;  height: 450rpx; width:55rpx;" ></image>
+-->
+  <swiper class="swiper-container" current="{{current}}" style="position: fixed;  top: 0rpx; width: 100%; height: 2000rpx; left: 0rpx; display: flex; box-sizing: border-box" bindchange="changeMoel">
+ <swiper-item wx:for="{{products}}"  >
+        <image class="bg_main" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ui-bg.png' style="position: absolute; top: 1030rpx; left: 80rpx; ">      
+          <view style="color: rgb(26, 26, 26); position: absolute; left: 70rpx; top:50rpx; font-size:38rpx; font-weight: bold;">{{item.name}}</view>
+           <view style="color: rgb(5, 19, 148); position: absolute; right: 150rpx; top:50rpx; font-size:38rpx; font-weight: bold;">¥{{item.price}}</view>
+           <view style="color: rgb(26, 26, 26); position: absolute; left: 70rpx; top:125rpx; font-size:25rpx; font-weight: bold; width:395rpx;  ">{{item.attach}}</view>
+           <view style="color: rgb(26, 26, 26); position: absolute; left: 70rpx; top:170rpx; font-size:25rpx; width:395rpx;  ">{{item.desc}}</view>
+
+          <button class="tapbtn2" plain="true" bindtap="clickCloseUIShow"  style="position: absolute; right: 20rpx; top: 20rpx; width:52rpx; height: 52rpx" >
+              <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ze-cross.png'  style="position: absolute; left: 0rpx; top:0rpx;  height: 52rpx; width:52rpx;" ></image>
+           </button>
+
+           <button wx:if="{{!item.activate}}" class="tapbtn2" plain="true" bindtap="clickJiSuoModel"   style="position: absolute; right: 80rpx; top: 255rpx; height: 120rpx; width:360rpx; ">
+              <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/WeiJieSuo.png'  style="position: absolute; left: 0rpx; top:0rpx;   height: 120rpx; width:325rpx;" ></image>
+           </button>
+
+           <button  wx:if="{{item.activate}}" class="tapbtn2" plain="true"  style="position: absolute; right: 80rpx; top: 255rpx; height: 120rpx; width:360rpx; ">
+              <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/YiJieSuo.png'  style="position: absolute; left: 6rpx; top:12rpx;   height: 80rpx; width:300rpx;" ></image>
+           </button>
+         
+        </image>
+
+        <image class="modelImg" src="{{item.modelImg}}" style="position: absolute; top:300rpx; left: 80rpx; width: 600rpx; height: 600rpx; ">
+        </image>
+  </swiper-item>
+  
+</swiper>
+
+ 
+<!--<image class="bg_main" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ui-bg.png'  style=" position: absolute; right: 120rpx; top:1200rpx;  height: 430rpx; width:520rpx;" >
+    <view style="color: rgb(26, 26, 26); position: absolute; left: 70rpx; top:50rpx; font-size:38rpx; font-weight: bold;">{{showModelName}}</view>
+    <view style="color: rgb(26, 26, 26); position: absolute; left: 180rpx; top:50rpx; font-size:38rpx; font-weight: bold;">{{showModelPrice}}</view>
+    <view style="color: rgb(26, 26, 26); position: absolute; left: 70rpx; top:120rpx; font-size:25rpx; width:395rpx;  ">{{showModelIntroduce
+}}</view>
+    <button class="tapbtn2" plain="true" bindtap="clickCloseUIShow"  style="position: fixed; right: 130rpx; top: 1230rpx; width:60rpx; height: 60rpx" >
+
+      <image class="tapimg2" src='https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/WXImage/ze-cross.png'  style="position: absolute; left: 0rpx; top:0rpx;  height: 60rpx; width:60rpx;" ></image>
+    </button>
+    
+  </image>--> 
+ 
+
+</view>
+</view>
+
+
+</view>
 </xr-demo-viewer>

+ 28 - 0
miniprogram/pages/ar-classic/scene-classic-showsix/index.wxss

@@ -6,6 +6,8 @@
     width: 150rpx;
     height: 60rpx;
   }
+
+
   .zhaohuan{  
     display: flex;
     justify-content: end;
@@ -27,3 +29,29 @@
     width: 150rpx;
     height: 60rpx;
   }
+  .img-size {
+    width: 100%;
+    margin: auto;
+  
+  }
+  .swiper-container {
+    z-index: 999; /* 设置一个足够高的值,确保在大多数情况下都位于最上方 */
+    position: relative; /* 确保 z-index 生效的前提是,元素的 position 属性不是 static */
+    width: 100vw; /* 设置 swiper 宽度为屏幕宽度 */
+    height: 100vh; /* 设置 swiper 高度为屏幕高度 */
+  }
+  
+  /* 如果 Swiper 的子元素也需要显示在最上方,可以设置其 z-index */
+  .swiper-slide {
+    z-index: 999;
+  }
+  .liucheng-img {
+    width: 100%;
+    height: 100%;
+   
+  }
+  .item {
+    height: 100%;
+    width: 100%;   
+  }
+