微信

index.vue 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="mainPage">
  3. <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
  4. <div class="box">
  5. <discounts v-for="(item,index) in list" :key='index' @toUse='toUse' :data='item'></discounts>
  6. <noMore v-if="hasPic"></noMore>
  7. </div>
  8. </scroll>
  9. </div>
  10. </template>
  11. <script>
  12. import line from '../../../common/icon/cicyle.png'
  13. import logo from '../../../common/icon/logo-t.png'
  14. import Line3 from '../../../common/icon/Line3.png'
  15. import used from '../../../common/icon/already.png'
  16. import failure from '../../../common/icon/inv.png'
  17. // 上拉加载组件
  18. import scroll from '../../../components/scroll/scroll'
  19. import noMore from '../../../components/noMore/noMore'
  20. import discounts from '../../../components/discounts/discounts'
  21. export default {
  22. data () {
  23. return {
  24. logo,
  25. Line3,
  26. used,
  27. failure,
  28. pullUpLoad: true,
  29. pullUpLoadThreshold: 40,
  30. startY: 0,
  31. isloading: true,
  32. hasPic: false,
  33. hasMore: true,
  34. list: [
  35. {
  36. title: '小小外交官体验卡',
  37. desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
  38. time: '2018年02月17日',
  39. useType: '未使用',
  40. tag: '共享'
  41. },
  42. {
  43. title: '小小外交官体验卡',
  44. desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
  45. time: '2018年02月17日',
  46. useType: '已使用',
  47. tag: '商品'
  48. },
  49. {
  50. title: '小小外交官体验卡',
  51. desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
  52. time: '2018年02月17日',
  53. useType: '已失效',
  54. tag: '商品'
  55. }
  56. ],
  57. line
  58. }
  59. },
  60. components: {
  61. scroll,
  62. noMore,
  63. discounts
  64. },
  65. computed: {
  66. pullUpLoadObj: function () {
  67. return this.pullUpLoad
  68. ? {
  69. threshold: parseInt(this.pullUpLoadThreshold),
  70. txt: {
  71. more: this.pullUpLoadMoreTxt,
  72. noMore: this.pullUpLoadNoMoreTxt
  73. }
  74. }
  75. : false
  76. }
  77. },
  78. methods: {
  79. change (item, index) {
  80. this.active = index
  81. },
  82. toUse (item) {
  83. // console.log(item)
  84. },
  85. getList () {
  86. // console.log(111)
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. @import "page.scss";
  93. </style>