order.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. let app = getApp();
  2. let host = app.globalData.servsers; // 请求的url
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. state:null, // 请求状态
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. this.setData({
  15. state:options.state
  16. })
  17. },
  18. /**
  19. * 生命周期函数--监听页面初次渲染完成
  20. */
  21. onReady: function () {
  22. },
  23. /**
  24. * 生命周期函数--监听页面显示
  25. */
  26. onShow: function () {
  27. },
  28. /**
  29. * 生命周期函数--监听页面隐藏
  30. */
  31. onHide: function () {
  32. },
  33. /**
  34. * 生命周期函数--监听页面卸载
  35. */
  36. onUnload: function () {
  37. },
  38. /**
  39. * 页面相关事件处理函数--监听用户下拉动作
  40. */
  41. onPullDownRefresh: function () {
  42. },
  43. /**
  44. * 页面上拉触底事件的处理函数
  45. */
  46. onReachBottom: function () {
  47. },
  48. /**
  49. * 用户点击右上角分享
  50. */
  51. onShareAppMessage: function () {
  52. },
  53. getOrderList(that,state,page){
  54. wx.showLoading({
  55. title: '加载中...',
  56. })
  57. wx.request({
  58. url: host + '/queryOrderCustomerByUserId',
  59. method:'get',
  60. header: {
  61. 'content-type': 'application/x-www-form-urlencoded'
  62. },
  63. data:{
  64. userId:app.globalData.user_id,
  65. orderStatus: state, //订单状态 0未支付\\1: 待定制\\2: 待发货\\3: 已发货\\4: 已完成\\5: 取消'
  66. limit:10,
  67. offset:page,
  68. },
  69. success(res){
  70. console.log(res,"orderList")
  71. },
  72. complete(){
  73. wx.hideLoading()
  74. }
  75. })
  76. }
  77. })