order.js 1.5 KB

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