issueTicket.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. const app = getApp()
  2. const util = require("../../../utils/util");
  3. const api = require('../../../api/api.js');
  4. const user = require('../../../utils/user.js');
  5. // const update = require('../../../api/update.js');
  6. Page({
  7. data: {
  8. activeTab:1,
  9. ticketList:[
  10. ]
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. this.selectComponent('#tabs').resize();
  17. this.getList(1);
  18. },
  19. onTabChange(e) {
  20. this.setData({
  21. activeTab: e.detail.name,
  22. });
  23. if (this.data.activeTab == 1) {
  24. this.getList(1);
  25. }else{
  26. this.getList(2);
  27. }
  28. },
  29. getList(status){
  30. wx.showLoading({
  31. title: '加载中...',
  32. });
  33. util.request(api.crmTicket, {
  34. status:status
  35. }, 'GET').then(res=> {
  36. wx.hideLoading();
  37. if (res.errno === 0) {
  38. console.log(res);
  39. this.setData({
  40. ticketList:res.data.ticketList
  41. });
  42. }
  43. }).catch(err=>{
  44. wx.hideLoading();
  45. });
  46. },
  47. goDetail(e){
  48. let id=e.currentTarget.dataset.id;
  49. if(id){
  50. wx.navigateTo({
  51. url: '/pages/upgrade/ticketDetail/ticketDetail?bookTradeNo=' + id,
  52. });
  53. }
  54. },
  55. onReachBottom() {
  56. // if (this.data.totalPages > this.data.page) {
  57. // this.setData({
  58. // page: this.data.page + 1
  59. // });
  60. // this.getGoodsList();
  61. // } else {
  62. // wx.showToast({
  63. // title: '没有更多商品了',
  64. // icon: 'none',
  65. // duration: 2000
  66. // });
  67. // return false;
  68. // }
  69. },
  70. /**
  71. * 生命周期函数--监听页面初次渲染完成
  72. */
  73. onReady: function () {
  74. },
  75. /**
  76. * 生命周期函数--监听页面显示
  77. */
  78. onShow: function () {
  79. },
  80. onHide: function () {
  81. },
  82. onUnload: function () {
  83. },
  84. /**
  85. * 页面相关事件处理函数--监听用户下拉动作
  86. */
  87. onPullDownRefresh: function () {
  88. },
  89. /**
  90. * 页面上拉触底事件的处理函数
  91. */
  92. onReachBottom: function () {
  93. },
  94. /**
  95. * 用户点击右上角分享
  96. */
  97. onShareAppMessage: function () {
  98. },
  99. })