index.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // components/toast/type/join/index.ts
  2. var mixinsBehavior = require('../toast/toast_behavior')
  3. Component({
  4. behaviors: [mixinsBehavior],
  5. options: {
  6. styleIsolation: 'apply-shared'
  7. },
  8. /**
  9. * 组件的属性列表
  10. */
  11. properties: {
  12. // g_cdn:String
  13. },
  14. /**
  15. * 组件的初始数据
  16. */
  17. data: {
  18. background: [{
  19. id: '0',
  20. txt: '游戏开始前,将随机指定3个地标为任务目标,在地图中找到这些目标吧!'
  21. }, {
  22. id: '1',
  23. txt: '找到任务目标,在点击弹出窗口中,进行答题任务挑战。'
  24. }, {
  25. id: '2',
  26. txt: '完成全部3个任务挑战,即视为通关完成,耗时越短,积分越高!'
  27. }],
  28. indicatorDots: false,
  29. vertical: false,
  30. autoplay: false,
  31. interval: 2000,
  32. duration: 500,
  33. currentIdx: 0,
  34. current: {
  35. id: '0',
  36. txt: '游戏开始前,将随机指定3个地标为任务目标,在地图中找到这些目标吧!'
  37. }
  38. },
  39. /**
  40. * 组件的方法列表
  41. */
  42. methods: {
  43. tapclose() {
  44. let item = this.data.background.find(ii => ii.id === '0')
  45. this.triggerEvent('close')
  46. setTimeout(() => {
  47. this.setData({
  48. currentIdx: 0,
  49. current: item
  50. })
  51. }, 500);
  52. },
  53. swiperChange(e: any) {
  54. console.log(e.detail.current);
  55. let item = this.data.background.find(ii => ii.id == e.detail.current)
  56. if (e.detail.source == 'touch') {
  57. this.setData({
  58. current: item,
  59. })
  60. }
  61. },
  62. }
  63. })