searchRecords.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // pages/searchRecords/searchRecords.js
  2. const api = require('../../api/index')
  3. const app = getApp()
  4. import { $startWuxRefresher, $stopWuxRefresher,$stopWuxLoader} from '../../miniprogram_npm/wux-weapp/index'
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. tableData:[],
  11. queryParams:{
  12. current:1,
  13. size:10
  14. },
  15. total:0,
  16. loading:false,
  17. imgHttp:app.globalData.imghttp,
  18. scrollTop: 10,
  19. },
  20. /**
  21. * 生命周期函数--监听页面加载
  22. */
  23. onLoad(options) {
  24. },
  25. /**
  26. * 生命周期函数--监听页面初次渲染完成
  27. */
  28. onReady() {
  29. this.init()
  30. },
  31. /**
  32. * 生命周期函数--监听页面显示
  33. */
  34. onShow() {
  35. },
  36. /**
  37. * 页面功能
  38. */
  39. //初始化加载
  40. init(){
  41. var params = {
  42. current:1,
  43. size:10
  44. }
  45. this.setData(
  46. {
  47. queryParams:params,
  48. total:0,
  49. tableData:[]
  50. }
  51. )
  52. this.getSearchRecords()
  53. },
  54. //下拉
  55. onPulling() {
  56. console.log('onPulling')
  57. },
  58. //下拉刷新
  59. onRefresh() {
  60. console.log('onRefresh')
  61. this.init()
  62. },
  63. //查看图片
  64. previewImage(e) {
  65. const { current,imglist } = e.currentTarget.dataset
  66. var imgs = []
  67. for(var i =0;i<imglist.length;i++){
  68. imgs.push(this.data.imgHttp + imglist[i].guid)
  69. }
  70. current = this.data.imgHttp + current
  71. wx.previewImage({
  72. current,
  73. urls:imgs,
  74. })
  75. },
  76. //获取检索记录
  77. getSearchRecords(){
  78. },
  79. //加载更多
  80. loadMore(){
  81. var current = this.data.queryParams.current
  82. this.setData(
  83. {
  84. ['queryParams.current']:current+1
  85. }
  86. )
  87. this.getSearchRecords()
  88. },
  89. /**
  90. * 生命周期函数--监听页面隐藏
  91. */
  92. onHide() {
  93. },
  94. /**
  95. * 生命周期函数--监听页面卸载
  96. */
  97. onUnload() {
  98. },
  99. /**
  100. * 页面相关事件处理函数--监听用户下拉动作
  101. */
  102. onPullDownRefresh() {
  103. },
  104. /**
  105. * 页面上拉触底事件的处理函数
  106. */
  107. onReachBottom() {
  108. },
  109. /**
  110. * 用户点击右上角分享
  111. */
  112. onShareAppMessage() {
  113. }
  114. })