pay_list.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // pages/pay_list/pay_list.js
  2. const { globalData } = getApp()
  3. const { baseImgUrl, thumbnail } = globalData
  4. const app = getApp()
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. baseImgUrl,
  11. thumbnail,
  12. hiddenModel:false
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. },
  19. /**
  20. * 生命周期函数--监听页面初次渲染完成
  21. */
  22. onReady: function () {
  23. },
  24. /**
  25. * 生命周期函数--监听页面显示
  26. */
  27. onShow: function () {
  28. var parentVipList = wx.getStorageSync('parentVipList')
  29. if (parentVipList.length > 0) {
  30. wx.setNavigationBarTitle({
  31. title: `续费列表(${parentVipList.length})`,
  32. })
  33. } else {
  34. wx.setNavigationBarTitle({
  35. title: `续费列表`,
  36. })
  37. }
  38. this.setData({ parentVipList })
  39. },
  40. /**
  41. * 生命周期函数--监听页面隐藏
  42. */
  43. onHide: function () {
  44. // const { isSubmit } = this.data
  45. // if (isSubmit) return
  46. },
  47. /**
  48. * 生命周期函数--监听页面卸载
  49. */
  50. onUnload: function () {
  51. // const { isSubmit } = this.data
  52. // if (isSubmit) return
  53. },
  54. /**
  55. * 页面相关事件处理函数--监听用户下拉动作
  56. */
  57. onPullDownRefresh: function () {
  58. },
  59. /**
  60. * 页面上拉触底事件的处理函数
  61. */
  62. onReachBottom: function () {
  63. },
  64. /**
  65. * 用户点击右上角分享
  66. */
  67. onShareAppMessage: function () {
  68. if (app.sharePageDefaultCtl) {
  69. return app.sharePageDefaultCtl()
  70. }
  71. },
  72. /**
  73. * 跳转
  74. */
  75. navigateCtl: app.navigateCtl,
  76. /**
  77. * 底部导航跳转
  78. */
  79. redirectCtl: app.redirectCtl,
  80. /**
  81. * 提示框隐藏
  82. */
  83. allShowModel: function () {
  84. this.setData({ hiddenModel: false })
  85. },
  86. /**
  87. * 删除孩子
  88. */
  89. deleteChild: function (e) {
  90. const { index } = e.currentTarget.dataset;
  91. this.setData({ hiddenModel: true, childIdx: index })
  92. },
  93. /**
  94. * 确定删除孩子
  95. */
  96. sureMember: function () {
  97. const { parentVipList, childIdx } = this.data;
  98. console.log(parentVipList, childIdx)
  99. parentVipList.splice(childIdx, 1);
  100. wx.setStorageSync('parentVipList', parentVipList)
  101. this.setData({ parentVipList, hiddenModel: false })
  102. },
  103. })