index.js 692 B

123456789101112131415161718192021222324252627
  1. var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
  2. var handleDecodedXML = require('../../behavior-scene/util').handleDecodedXML;
  3. var xmlCode = ``;
  4. Page({
  5. behaviors:[sceneReadyBehavior],
  6. data: {
  7. xmlCode: '',
  8. loaded: false,
  9. run: false,
  10. positions: [[0, 0, '瞬光'], [0, 0, 'roam'], [0, 0, 'xinyi']],
  11. },
  12. handleLoaded: function({detail}) {
  13. console.log('assets loaded', detail);
  14. this.setData({loaded: true});
  15. },
  16. handleSyncPositions: function({detail}) {
  17. const info = detail;
  18. this.setData({positions: info});
  19. },
  20. handleRun: function() {
  21. if (this.data.loaded && !this.data.run) {
  22. this.setData({run: true});
  23. }
  24. }
  25. });