auctioneer.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // pages/auctioneer/auctioneer.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. goods:[
  8. {
  9. collect: true,
  10. goodsimg: "images/goods-img-1.jpg",
  11. state: true,
  12. money: "¥88.5",
  13. username: "134****6521"
  14. },
  15. {
  16. collect: false,
  17. goodsimg: "images/goods-img-1.jpg",
  18. state: false,
  19. money: "¥828.5",
  20. username: "134****6521"
  21. },
  22. {
  23. collect: false,
  24. goodsimg: "images/goods-img-1.jpg",
  25. state: true,
  26. money: "¥599.5",
  27. username: "134****6521"
  28. },
  29. {
  30. collect: true,
  31. goodsimg: "images/goods-img-1.jpg",
  32. state: false,
  33. money: "¥58.5",
  34. username: "134****6521"
  35. }, {
  36. collect: true,
  37. goodsimg: "images/goods-img-1.jpg",
  38. state: true,
  39. money: "¥88.5",
  40. username: "134****6521"
  41. },
  42. {
  43. collect: false,
  44. goodsimg: "images/goods-img-1.jpg",
  45. state: false,
  46. money: "¥828.5",
  47. username: "134****6521"
  48. },
  49. {
  50. collect: false,
  51. goodsimg: "images/goods-img-1.jpg",
  52. state: true,
  53. money: "¥599.5",
  54. username: "134****6521"
  55. },
  56. {
  57. collect: true,
  58. goodsimg: "images/goods-img-1.jpg",
  59. state: false,
  60. money: "¥58.5",
  61. username: "134****6521"
  62. }
  63. ],
  64. templateName:'goodsModular'
  65. },
  66. /**
  67. * 生命周期函数--监听页面加载
  68. */
  69. onLoad: function (options) {
  70. var _this = this;
  71. wx.createSelectorQuery().select('.company-title-content').boundingClientRect(function (rect) {
  72. _this.setData({
  73. pageScrollTop: rect.top
  74. })
  75. }).exec()
  76. },
  77. /**
  78. * 生命周期函数--监听页面初次渲染完成
  79. */
  80. onReady: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面显示
  84. */
  85. onShow: function () {
  86. },
  87. /**
  88. * 生命周期函数--监听页面隐藏
  89. */
  90. onHide: function () {
  91. },
  92. /**
  93. * 生命周期函数--监听页面卸载
  94. */
  95. onUnload: function () {
  96. },
  97. /**
  98. * 页面相关事件处理函数--监听用户下拉动作
  99. */
  100. onPullDownRefresh: function () {
  101. },
  102. /**
  103. * 页面上拉触底事件的处理函数
  104. */
  105. onReachBottom: function () {
  106. },
  107. onPageScroll:function(e){
  108. var _this = this;
  109. var scrollTop = _this.data.pageScrollTop;
  110. if (e.scrollTop > scrollTop) {
  111. this.setData({
  112. classifyPosition: true
  113. })
  114. }
  115. if (e.scrollTop < scrollTop) {
  116. this.setData({
  117. classifyPosition: false
  118. })
  119. }
  120. }
  121. })