buyHistory.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. var app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. recordList: [{
  8. memberHeadPic: "../../images/head-bitmap.png",
  9. receiverName: "名字",
  10. orderNum: "111",
  11. createTime: "2018-09-12"
  12. }],
  13. refundList: [{
  14. userAvatar: "",
  15. orderUserName: "狮子鱼",
  16. returnOrderCount: "222",
  17. createTime: "2018-09-12"
  18. }],
  19. currentTab: 0,
  20. navList: [{
  21. name: "购买记录",
  22. status: "0"
  23. }, {
  24. name: "退单记录",
  25. status: "1"
  26. }],
  27. LoadingComplete: !1,
  28. loadText: "没有更多了~",
  29. groupOrderStatus: "",
  30. containerHeight: 0,
  31. scrollTop: 0
  32. },
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. onLoad: function (options) {
  37. this.setData({
  38. recordList: this.data.recordList.map(function (t) {
  39. return t.isHide = false, t;
  40. }),
  41. groupOrderNo: options.groupOrderNo,
  42. skuId: options.skuId,
  43. containerHeight: app.globalData.systemInfo.windowHeight - Math.round(app.globalData.systemInfo.windowHeight / 375 * 10),
  44. groupOrderStatus: options.groupOrderStatus
  45. }), this.getList(this.data.currentTab);
  46. },
  47. /**
  48. * 生命周期函数--监听页面初次渲染完成
  49. */
  50. onReady: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面显示
  54. */
  55. onShow: function () {
  56. },
  57. /**
  58. * 监控切换
  59. */
  60. bindChange: function (t) {
  61. this.setData({
  62. currentTab: 1 * t.detail.current
  63. }), this.getList(this.data.currentTab);
  64. },
  65. /**
  66. * 获取数据
  67. */
  68. getList: function (currentTab) {
  69. var a = this;
  70. wx.showLoading({
  71. title: "加载中...",
  72. mask: true
  73. })
  74. if ( 0 === currentTab ){
  75. console.log(222)
  76. wx.hideLoading()
  77. }
  78. },
  79. /**
  80. * 导航切换
  81. */
  82. switchNav: function (t) {
  83. if (this.data.currentTab === 1 * t.currentTarget.dataset.current) return !1;
  84. this.setData({
  85. currentTab: 1 * t.currentTarget.dataset.current
  86. });
  87. },
  88. /**
  89. * 生命周期函数--监听页面隐藏
  90. */
  91. onHide: function () {
  92. },
  93. /**
  94. * 生命周期函数--监听页面卸载
  95. */
  96. onUnload: function () {
  97. },
  98. /**
  99. * 页面相关事件处理函数--监听用户下拉动作
  100. */
  101. onPullDownRefresh: function () {
  102. },
  103. /**
  104. * 页面上拉触底事件的处理函数
  105. */
  106. onReachBottom: function () {
  107. },
  108. /**
  109. * 用户点击右上角分享
  110. */
  111. onShareAppMessage: function () {
  112. }
  113. })