0.16.1 • Published 3 years ago

vr-navigation v0.16.1

Weekly downloads
76
License
-
Repository
-
Last release
3 years ago

安装

tnpm install --save @alipay/mas-vr-navigation

组件介绍

vr 全景球

参数说明

属性必填参数类型参数说明默认值示例
srcstring资源包地址可为 url,也可为本地路径-----
ballIdstring全景球素材---root
scenestring场景名称-----
sceneNodesMapobject场景对应表-----
destinationIdstring目的地素材-----
onDetectDestinationfunction目的地偏离检测-----
visibleWhenTapMapobject点击可见素材表-----
animationNodesMapobject动画素材表-----
checkIntervalnumber检测全景球是否在运行间隔100--
checkTimenumber检测全景球是否在运行时间2000--
normalIntervalnumber启动之后的检测间隔5000--
headingLengthnumber检测定位的次数5--
iosVersionstring兼容的ios版本10.2.3--
androidVersionstring兼容的android版本10.2.6--
swipeDegressnumber滑动角度10--
offsetDegressnumber偏离角度30--
destinationIntervalnumber目的地检测间隔1500--
visibleWhenTapIntervalnumber点击可见素材间隔3000--
animationIntervalnumber动画间隔100--

在小程序中使用

{
  "usingComponents": {
    "mas-vr-navigation": "@alipay/mas-vr-navigation/es/index"
  }
}

在 page.axml 中引用组件

<!-- 页面使用方式 -->
 <mas-vr-navigation
    src="{{src}}"
    scene="{{scene}}"
    sceneNodesMap="{{sceneNodesMap}}"
    onFail="onFail"
    onNodeTap="onNodeTap"
    ballId="{{ballId}}"
    onDetectDestination="onDetectDestination"
    destinationId="pPlane_door2"
  />
Page({
  data: {
    ballId: 'root',
    src: 'https://gw.alipayobjects.com/os/bmw-prod/273ae6c3-8b04-4f7e-bdc5-6224d923142a.dat',
    scene: 'a',
    sceneNodesMap: {
      a: ['pPlane_door2'],
      b: ['pPlane_door3', 'pPlane_door4', 'pPlane_door2'],
      c: ['pPlane_door4'],
      d: ['pPlane_door5'],
    },
  },
  onLoad() {},
  changeSrc() {
    this.setData({
      src: `https://gw.alipayobjects.com/os/bmw-prod/273ae6c3-8b04-4f7e-bdc5-6224d923142a.dat?a=123${Math.random()}`,
    });
  },
  changeScene(e) {
    my.alert({
      content: e.target.dataset.scene,
    });
    this.setData({
      scene: e.target.dataset.scene,
    });
  },
  onFail(e) {
    my.alert({
      content: `失败${e.type}`,
    });
  },
  onNodeTap(e) {
    my.alert({
      content: e.nodeId,
    });
  },
  onDetectDestination(e) {
    // e.direction 为当前偏离方向,值为1(目的地没有偏离), 4(目的地在右侧),8(目的地在左侧),2(需要转身)
    this.setData({
      direction: e.direction,
    })
  }
});

Badges

TNPM version TNPM downloads install size


0.16.1

3 years ago

0.16.0

3 years ago

0.15.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.11.0

4 years ago

0.12.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago