index.js 852 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Component({
  2. behaviors: [require('../common/share-behavior').default],
  3. properties: {
  4. markerImg: {
  5. type: String
  6. },
  7. },
  8. data: {
  9. loaded: false,
  10. arReady: false,
  11. },
  12. lifetimes: {
  13. attached() {
  14. console.log('data', this.data)
  15. }
  16. },
  17. methods: {
  18. handleReady({
  19. detail
  20. }) {
  21. const xrScene = this.scene = detail.value;
  22. console.log('xr-scene', xrScene);
  23. },
  24. handleAssetsProgress: function ({
  25. detail
  26. }) {
  27. console.log('assets progress', detail.value);
  28. },
  29. handleAssetsLoaded: function ({
  30. detail
  31. }) {
  32. console.log('assets loaded', detail.value);
  33. this.setData({
  34. loaded: true
  35. });
  36. },
  37. handleARReady: function ({
  38. detail
  39. }) {
  40. console.log('arReady');
  41. this.setData({
  42. arReady: true
  43. })
  44. }
  45. }
  46. })