buyHistory.js 2.5 KB

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