gemercheung il y a 1 an
Parent
commit
7cf5777d7b

+ 8 - 5
miniprogram/components/ar-tracker/ar-tracker.wxml

@@ -6,10 +6,9 @@
     <xr-asset-load type="gltf" asset-id="item2" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/gc99.glb" />
     <xr-asset-load type="gltf" asset-id="item3" src="https://houseoss.4dkankan.com/mini-ar-test/mtgj.glb" />
 
-    <xr-asset-load type="gltf" asset-id="butterfly" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
-
-    <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
-    <xr-asset-material asset-id="item1-m" effect="simple" uniforms="u_baseColorMap: video-item1-v" />
+    <!-- <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:https://houseoss.4dkankan.com/mini-ar-test/AR/01/video_cover.png" /> -->
+    <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video1_480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:https://houseoss.4dkankan.com/mini-ar-test/AR/01/output.jpg" />
+    <xr-asset-material asset-id="item1-m" effect="standard" uniforms="u_baseColorMap: video-item1-v" />
 
     <!-- <xr-asset-load type="video-texture" asset-id="item12-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4" options="autoPlay:true,loop:true,abortAudio:true,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/01/video2_480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="item12-m" effect="simple" uniforms="u_baseColorMap: video-item12-v" /> -->
@@ -18,6 +17,10 @@
     <xr-asset-load type="video-texture" asset-id="item2-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="item2-m" effect="simple" uniforms="u_baseColorMap: video-item2-v" />
 
+    <!-- <xr-asset-load type="video-texture" asset-id="cat" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/cat.mp4" options="autoPlay:true,loop:true,abortAudio:false,placeHolder:https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/videos/cat.jpg" />
+
+    <xr-asset-material asset-id="standard-mat" effect="standard" /> -->
+
   </xr-assets>
 
   <xr-env env-data="xr-frame-team-workspace-day" />
@@ -29,7 +32,7 @@
       <!-- <xr-gltf model="butterfly" anim-autoplay position="0 0 0" scale="0.4 0.4 0.4" rotation="0 -50 0" /> -->
     </xr-ar-tracker>
     <xr-ar-tracker id="ar-tracker-2" mode="Marker" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/marker.png" bind:ar-tracker-state="handleARTrackerState2">
-      <xr-gltf model="item2" position="0 0.2 0"  scale="0.08 0.08 0.08" rotation="0 -90 80" bind:gltf-loaded="handleItem2Loaded"></xr-gltf>
+      <xr-gltf model="item2" position="0 0.2 0" scale="0.08 0.08 0.08" rotation="0 -90 80" bind:gltf-loaded="handleItem2Loaded"></xr-gltf>
     </xr-ar-tracker>
     <xr-ar-tracker id="ar-tracker-3" mode="Marker" src="https://houseoss.4dkankan.com/mini-ar-test/AR/3/marker.png" bind:ar-tracker-state="handleARTrackerState3">
       <xr-node>

+ 4 - 0
miniprogram/components/privacy/privacy.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 57 - 0
miniprogram/components/privacy/privacy.ts

@@ -0,0 +1,57 @@
+Component({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    privacyContractName: '',
+    showPrivacy: false
+  },
+  /**
+   * 组件的生命周期
+   */
+  pageLifetimes: {
+    show() {
+      const _ = this
+      wx.getPrivacySetting({
+        success(res) {
+          console.log('res', res)
+          if (res.needAuthorization) {
+            _.setData({
+              privacyContractName: res.privacyContractName,
+              showPrivacy: true
+            })
+          }
+        }
+      })
+    }
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    // 打开隐私协议页面
+    openPrivacyContract() {
+      const _ = this
+      wx.openPrivacyContract({
+        fail: () => {
+          wx.showToast({
+            title: '遇到错误',
+            icon: 'error'
+          })
+        }
+      })
+    },
+    // 拒绝隐私协议
+    exitMiniProgram() {
+      // 直接退出小程序
+      wx.exitMiniProgram()
+    },
+    // 同意隐私协议
+    handleAgreePrivacyAuthorization() {
+      const _ = this
+      _.setData({
+        showPrivacy: false
+      })
+    },
+  },
+})

+ 13 - 0
miniprogram/components/privacy/privacy.wxml

@@ -0,0 +1,13 @@
+<!--components/privacy/privacy.wxml-->
+<view class="privacy" wx:if="{{showPrivacy}}">
+    <view class="content">
+        <view class="title">隐私保护指引</view>
+        <view class="des">
+            在使用当前小程序服务之前,请仔细阅读<text class="link" bind:tap="openPrivacyContract">{{privacyContractName}}</text>。如你同意{{privacyContractName}},请点击“同意”开始使用。
+        </view>
+        <view class="btns">
+            <button class="item reject" bind:tap="exitMiniProgram">拒绝</button>
+            <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
+        </view>
+    </view>
+</view>

+ 67 - 0
miniprogram/components/privacy/privacy.wxss

@@ -0,0 +1,67 @@
+.privacy {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background: rgba(0, 0, 0, .5);
+  z-index: 9999999;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.content {
+  width: 632rpx;
+  padding: 48rpx;
+  box-sizing: border-box;
+  background: #fff;
+  border-radius: 16rpx;
+}
+
+.content .title {
+  text-align: center;
+  color: #333;
+  font-weight: bold;
+  font-size: 32rpx;
+}
+
+.content .des {
+  font-size: 26rpx;
+  color: #666;
+  margin-top: 40rpx;
+  text-align: justify;
+  line-height: 1.6;
+}
+
+.content .des .link {
+  color: #07c160;
+  text-decoration: underline;
+}
+
+.btns {
+  margin-top: 48rpx;
+  display: flex;
+}
+
+.btns .item {
+  justify-content: space-between;
+  width: 244rpx;
+  height: 80rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 16rpx;
+  box-sizing: border-box;
+  border: none;
+}
+
+.btns .reject {
+  background: #f4f4f5;
+  color: #909399;
+}
+
+.btns .agree {
+  background: #07c160;
+  color: #fff;
+}

+ 2 - 1
miniprogram/pages/children/children.json

@@ -3,6 +3,7 @@
   "renderer": "webview",
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-3/index"
+    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-3/index",
+    "privacy": "/components/privacy/privacy"
   }
 }

+ 1 - 1
miniprogram/pages/children/children.wxml

@@ -4,6 +4,6 @@
     <text>{{progress}}%</text>
   </view>
   <xr-ar-vio-marker disable-scroll id="main-frame" width="{{renderWidth}}" height="{{renderHeight}}" style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;" bind:loaded="handleLoaded" bind:progress="handleProgress" fromScan="{{fromScan}}" />
-
+  <privacy />
 
 </view>

+ 0 - 7
miniprogram/pages/demo/index.json

@@ -1,7 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "ar-tracker": "/components/ar-tracker/ar-tracker"
-  }
-}

+ 0 - 26
miniprogram/pages/demo/index.ts

@@ -1,26 +0,0 @@
-// index.ts
-// 获取应用实例
-const app = getApp<IAppOption>()
-Component({
-  data: {
-    width: 300,
-    height: 300,
-    renderWidth: 300,
-    renderHeight: 300,
-  },
-  methods: {
-    // 事件处理函数
-    onLoad() {
-      const info = wx.getSystemInfoSync();
-      const width = info.windowWidth;
-      const height = info.windowHeight;
-      const dpi = info.pixelRatio;
-      this.setData({
-        width, height,
-        renderWidth: width * dpi,
-        renderHeight: height * dpi
-      });
-    },
- 
-  },
-})

+ 0 - 1
miniprogram/pages/demo/index.wxml

@@ -1 +0,0 @@
-<ar-tracker disable-scroll id="main-frame" width="{{renderWidth}}" height="{{renderHeight}}" style="width:{{width}}px;height:{{height}}px;" />

+ 0 - 62
miniprogram/pages/demo/index.wxss

@@ -1,62 +0,0 @@
-/**index.wxss**/
-page {
-  height: 100vh;
-  display: flex;
-  flex-direction: column;
-}
-.scrollarea {
-  flex: 1;
-  overflow-y: hidden;
-}
-
-.userinfo {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  color: #aaa;
-  width: 80%;
-}
-
-.userinfo-avatar {
-  overflow: hidden;
-  width: 128rpx;
-  height: 128rpx;
-  margin: 20rpx;
-  border-radius: 50%;
-}
-
-.usermotto {
-  margin-top: 200px;
-}
-
-.avatar-wrapper {
-  padding: 0;
-  width: 56px !important;
-  border-radius: 8px;
-  margin-top: 40px;
-  margin-bottom: 40px;
-}
-
-.avatar {
-  display: block;
-  width: 56px;
-  height: 56px;
-}
-
-.nickname-wrapper {
-  display: flex;
-  width: 100%;
-  padding: 16px;
-  box-sizing: border-box;
-  border-top: .5px solid rgba(0, 0, 0, 0.1);
-  border-bottom: .5px solid rgba(0, 0, 0, 0.1);
-  color: black;
-}
-
-.nickname-label {
-  width: 105px;
-}
-
-.nickname-input {
-  flex: 1;
-}

+ 2 - 1
miniprogram/pages/dunhuang/dunhuang.json

@@ -3,6 +3,7 @@
   "renderer": "webview",
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-1/index"
+    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-1/index",
+    "privacy": "/components/privacy/privacy"
   }
 }

+ 2 - 2
miniprogram/pages/dunhuang/dunhuang.wxml

@@ -1,8 +1,8 @@
 <view class="page">
-  <navigation-bar title="{{'“敦敦”带您游览敦煌千年'}}" back="{{true}}" />
+  <navigation-bar title="{{'四维AR'}}" back="{{true}}" />
   <view class="loading" wx:if="{{!loaded}}">
     <text>{{progress}}%</text>
   </view>
   <xr-ar-vio-marker disable-scroll id="main-frame" width="{{renderWidth}}" height="{{renderHeight}}" style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;" bind:loaded="handleLoaded" bind:progress="handleProgress" />
-
+  <privacy />
 </view>

+ 2 - 1
miniprogram/pages/index/index.json

@@ -5,6 +5,7 @@
   "disableScroll": true,
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "ar-tracker": "/components/ar-tracker/ar-tracker"
+    "ar-tracker": "/components/ar-tracker/ar-tracker",
+    "privacy": "/components/privacy/privacy"
   }
 }

+ 2 - 1
miniprogram/pages/index/index.wxml

@@ -34,4 +34,5 @@
   </view>
 
 </view>
-<navigation-bar />
+<navigation-bar />
+<privacy />

+ 2 - 1
miniprogram/pages/myth/myth.json

@@ -3,6 +3,7 @@
   "renderer": "webview",
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-2/index"
+    "xr-ar-vio-marker": "/components/xr-ar-vio-marker-2/index",
+    "privacy": "/components/privacy/privacy"
   }
 }

+ 1 - 2
miniprogram/pages/myth/myth.wxml

@@ -4,6 +4,5 @@
     <text>{{progress}}%</text>
   </view>
   <xr-ar-vio-marker disable-scroll id="main-frame" width="{{renderWidth}}" height="{{renderHeight}}" style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;" bind:loaded="handleLoaded" bind:progress="handleProgress" fromScan="{{fromScan}}" />
-
-
+  <privacy />
 </view>

+ 3 - 2
miniprogram/pages/scaner/scaner.json

@@ -1,10 +1,11 @@
 {
-    "component": true,
+  "component": true,
   "navigationBarTitleText": "四维AR",
   "navigationBarTextStyle": "black",
   "disableScroll": true,
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "ar-tracker": "/components/ar-tracker/ar-tracker"
+    "ar-tracker": "/components/ar-tracker/ar-tracker",
+    "privacy": "/components/privacy/privacy"
   }
 }

+ 3 - 1
miniprogram/pages/scaner/scaner.ts

@@ -11,7 +11,8 @@ Page({
     renderWidth: 300,
     renderHeight: 300,
     loaded: false,
-    isShowGuide: true
+    isShowGuide: true,
+    progress: 0,
   },
 
   /**
@@ -86,6 +87,7 @@ Page({
   handleHideGuide() {
     this.setData({ isShowGuide: false })
   },
+
   handleLoaded() {
     this.setData({ loaded: true })
   }

+ 1 - 0
miniprogram/pages/scaner/scaner.wxml

@@ -11,4 +11,5 @@
     <image mode="widthFix" src="https://houseoss.4dkankan.com/mini-ar-test/assets/scanner_guide.png" />
   </view>
   <ar-tracker disable-scroll id="main-frame" width="{{renderWidth}}" height="{{renderHeight}}" style="width:{{width}}px;height:{{height}}px;" bind:progress="handleProgress" bind:loaded="handleLoaded" bind:hideGuide="handleHideGuide"/>
+  <privacy />
 </view>

+ 2 - 1
project.config.json

@@ -35,5 +35,6 @@
     "ignore": [],
     "include": []
   },
-  "appid": "wx85269d0a44286ccf"
+  "appid": "wx85269d0a44286ccf",
+  "__usePrivacyCheck__": true
 }