index.js 791 B

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  4. var _my = require("../../__antmove/api/index.js")(my);
  5. var wx = _my;
  6. (0, _page["default"])({
  7. data: {
  8. container: null,
  9. scrollTop: 0,
  10. offsetTop: 0
  11. },
  12. onReady: function onReady() {
  13. this.setData({
  14. container: function container() {
  15. return wx.createSelectorQuery().select("#container");
  16. }
  17. });
  18. },
  19. onScroll: function onScroll(event) {
  20. var _this = this;
  21. wx.createSelectorQuery().select("#scroller").boundingClientRect(function (res) {
  22. _this.setData({
  23. scrollTop: event.detail.scrollTop,
  24. offsetTop: res.top
  25. });
  26. }).exec();
  27. }
  28. });