mykabaw.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // pages/kabaw/mykabaw.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. quans: ['1', '2', '1', '2', '1', '2'],
  8. lindex: 0,
  9. mycoupon:''
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. this.getmycoupon(0)
  16. },
  17. getmycoupon: function (index) {
  18. var that = this
  19. console.log(getApp().api.everyday_coupon.user_info)
  20. getApp().request({
  21. url: getApp().api.everyday_coupon.mycoupon,
  22. data: {
  23. status: index
  24. },
  25. success: function (t) {
  26. console.log(t)
  27. var list = t.data.list
  28. that.setData({
  29. mycoupon: list
  30. })
  31. }
  32. })
  33. },
  34. gouser: function () {
  35. var id = e.currentTarget.dataset.id
  36. },
  37. godetail: function (e) {
  38. var id = e.currentTarget.dataset.way
  39. var item = e.currentTarget.dataset.item
  40. var send_id = this.data.send_id
  41. console.log(item)
  42. // var it = JSON.stringify(item)
  43. var it = item
  44. wx.navigateTo({
  45. url: '/pages/kabaw/detail?id=' + it + '&send_id=' + send_id + '&way=' + id,
  46. })
  47. },
  48. thisone: function (e) {
  49. var index = e.currentTarget.dataset.index
  50. this.getmycoupon(index)
  51. this.setData({
  52. lindex: index
  53. })
  54. },
  55. /**
  56. * 生命周期函数--监听页面初次渲染完成
  57. */
  58. onReady: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面显示
  62. */
  63. onShow: function () {
  64. this.getmycoupon(0)
  65. },
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide: function () {
  70. },
  71. /**
  72. * 生命周期函数--监听页面卸载
  73. */
  74. onUnload: function () {
  75. },
  76. /**
  77. * 页面相关事件处理函数--监听用户下拉动作
  78. */
  79. onPullDownRefresh: function () {
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom: function () {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage: function () {
  90. }
  91. })