电速宝
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // pages/userlist/index.js
  2. const api = require('../../../api/index.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. userdata:[],
  9. tabsindex:0
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad(options) {
  15. this.getuser()
  16. },
  17. getuser(){
  18. let data ={
  19. workorderType:3,
  20. settlementType:this.data.tabsindex,
  21. pageNum:1,
  22. pageSize:99
  23. }
  24. api.request(`/sysworkorder/selectworkorderlist`, 'post',data,{ isPublic: false })
  25. .then((data) => {
  26. console.log(data.data);
  27. if (data.code==200) {
  28. this.setData({
  29. userdata:data.data.list
  30. })
  31. }
  32. })
  33. .catch((err) => {
  34. console.error('请求失败:', err);
  35. });
  36. },
  37. onTabsChange(e){
  38. console.log(e.detail.value);
  39. this.setData({
  40. tabsindex:e.detail.value
  41. })
  42. this.getuser()
  43. },
  44. details(e){
  45. wx.navigateTo({
  46. url: `/package-map/pages/map/index?id=${e.currentTarget.dataset.id}`,
  47. })
  48. },
  49. /**
  50. *
  51. */
  52. onReady() {
  53. },
  54. /**
  55. * 生命周期函数--监听页面显示
  56. */
  57. onShow() {
  58. },
  59. /**
  60. * 生命周期函数--监听页面隐藏
  61. */
  62. onHide() {
  63. },
  64. /**
  65. * 生命周期函数--监听页面卸载
  66. */
  67. onUnload() {
  68. },
  69. /**
  70. * 页面相关事件处理函数--监听用户下拉动作
  71. */
  72. onPullDownRefresh() {
  73. },
  74. /**
  75. * 页面上拉触底事件的处理函数
  76. */
  77. onReachBottom() {
  78. },
  79. /**
  80. * 用户点击右上角分享
  81. */
  82. onShareAppMessage() {
  83. }
  84. })