index.js 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. async 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. handleLog: function ({
  46. detail
  47. }) {
  48. console.log('log', detail.value);
  49. }
  50. }
  51. })