index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view>
  3. <mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @up="upCallback" @down="downCallback"
  4. height="1060">
  5. <view v-for='(item,index) in list' class="item flex">
  6. </view>
  7. </mescroll-uni>
  8. </view>
  9. </template>
  10. <script>
  11. var that;
  12. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  13. export default {
  14. mixins: [MescrollMixin],
  15. data() {
  16. return {
  17. downOption: {
  18. auto: false,
  19. textColor: '#bbb'
  20. },
  21. upOption: {
  22. page: {
  23. size: 10 // 每页数据的数量,默认10
  24. },
  25. auto: false,
  26. noMoreSize: 1,
  27. textNoMore: '没有更多了~',
  28. textColor: '#bbb'
  29. },
  30. userInfo: {
  31. head: '',
  32. nickname: '',
  33. phone: '',
  34. },
  35. list: [{
  36. name: '1'
  37. },
  38. {
  39. name: '2'
  40. },
  41. {
  42. name: '3'
  43. }, {
  44. name: '4'
  45. }, {
  46. name: '5'
  47. }, {
  48. name: '6'
  49. }, {
  50. name: '7'
  51. }, {
  52. name: '8'
  53. }, {
  54. name: '9'
  55. }, {
  56. name: '10'
  57. }, {
  58. name: '11'
  59. }
  60. ]
  61. };
  62. },
  63. onLoad() {
  64. that = this
  65. },
  66. onShow() {
  67. this.$nextTick(() => {
  68. this.mescroll.resetUpScroll()
  69. })
  70. },
  71. methods: {
  72. downCallback() {
  73. this.mescroll.resetUpScroll()
  74. },
  75. upCallback(page) {
  76. that.mescroll.endBySize(0, 0)
  77. // this.$request.baseRequest('admin.unimall.cardHolderInfo', 'list', {
  78. // page: page.num,
  79. // limit: page.size,
  80. // }, failres => {
  81. // uni.hideLoading()
  82. // console.log('res+++++', failres.errmsg)
  83. // uni.showToast({
  84. // icon: "none",
  85. // title: failres.errmsg,
  86. // duration: 3000
  87. // });
  88. // }).then(res => {
  89. // console.log(res)
  90. // if (page.num == 1) this.list = [];
  91. // let curPageLen = res.data.items.length;
  92. // let totalPage = res.data.total;
  93. // this.list = res.data.items
  94. // this.$nextTick(() => {
  95. // that.mescroll.endBySize(curPageLen, totalPage)
  96. // });
  97. // uni.hideLoading()
  98. // })
  99. },
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. </style>