You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
3.1KB

  1. // pages/personalCenter/personalCenter.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. myTicketArrows: false,
  8. historyTicketArrows: false,
  9. getUser:false,
  10. getUserArr:[],
  11. mydeg: -90,
  12. historydeg: -90,
  13. historyArr: [
  14. {
  15. "code": "11111",
  16. "name": "80元抵100元优惠券",
  17. "type": "未使用"
  18. },
  19. {
  20. "code": "11111",
  21. "name": "80元抵100元优惠券",
  22. "type": "未使用"
  23. },
  24. {
  25. "code": "11111",
  26. "name": "80元抵100元优惠券",
  27. "type": "未使用"
  28. },
  29. {
  30. "code": "11111",
  31. "name": "80元抵100元优惠券",
  32. "type": "未使用"
  33. },
  34. ],
  35. myTicketArr: [
  36. {
  37. "image": "../images/ticketImg.jpg",
  38. "name": "80抵100",
  39. "time": "2020.2.18-2020.12.31"
  40. },
  41. {
  42. "image": "../images/ticketImg.jpg",
  43. "name": "80抵100",
  44. "time": "2020.2.18-2020.12.31"
  45. },
  46. {
  47. "image": "../images/ticketImg.jpg",
  48. "name": "80抵100",
  49. "time": "2020.2.18-2020.12.31"
  50. },
  51. {
  52. "image": "../images/ticketImg.jpg",
  53. "name": "80抵100",
  54. "time": "2020.2.18-2020.12.31"
  55. },
  56. ],
  57. },
  58. /**
  59. * 生命周期函数--监听页面加载
  60. */
  61. onLoad: function (options) {
  62. // wx.getUserInfo({
  63. // success: function (res) {
  64. // console.log(res)
  65. // }
  66. // })
  67. },
  68. /**
  69. * 生命周期函数--监听页面初次渲染完成
  70. */
  71. onReady: function () {
  72. },
  73. /**
  74. * 生命周期函数--监听页面显示
  75. */
  76. onShow: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面隐藏
  80. */
  81. onHide: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面卸载
  85. */
  86. onUnload: function () {
  87. },
  88. /**
  89. * 页面相关事件处理函数--监听用户下拉动作
  90. */
  91. onPullDownRefresh: function () {
  92. },
  93. /**
  94. * 页面上拉触底事件的处理函数
  95. */
  96. onReachBottom: function () {
  97. },
  98. /**
  99. * 用户点击右上角分享
  100. */
  101. onShareAppMessage: function () {
  102. },
  103. lookMyTicket:function(){
  104. this.setData({
  105. myTicketArrows: !this.data.myTicketArrows,
  106. })
  107. if (this.data.myTicketArrows){
  108. this.setData({
  109. mydeg: 0,
  110. })
  111. }else{
  112. this.setData({
  113. mydeg: -90,
  114. })
  115. }
  116. },
  117. lookHistory:function(){
  118. this.setData({
  119. historyTicketArrows: !this.data.historyTicketArrows,
  120. })
  121. if (this.data.historyTicketArrows) {
  122. this.setData({
  123. historydeg: 0,
  124. })
  125. } else {
  126. this.setData({
  127. historydeg: -90,
  128. })
  129. }
  130. },
  131. lookTicket:function(e){
  132. console.log(e)
  133. var index = e.target.dataset.index;
  134. wx.navigateTo({
  135. url: '../TicketDetails/TicketDetails',
  136. })
  137. },
  138. giveTicket:function(e){
  139. var index = e.target.dataset.index;
  140. wx.navigateTo({
  141. url: '../givePage/givePage',
  142. })
  143. },
  144. getUser:function(e){
  145. console.log(e)
  146. this.setData({
  147. getUserArr: e.detail.userInfo
  148. })
  149. if (this.data.getUserArr){
  150. this.setData({
  151. getUser: true
  152. })
  153. }
  154. console.log(this.data.getUserArr)
  155. }
  156. })