hotel.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // pages/order/order.js
  2. const app = getApp()
  3. var host = app.globalData.host;
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. act: 0
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. wx.showNavigationBarLoading()
  16. wx.request({
  17. url: host + '/api/signup/hotel/list',
  18. method: 'GET',
  19. data: {
  20. id: options.id
  21. },
  22. success: res => {
  23. wx.hideNavigationBarLoading();
  24. this.setData({
  25. list: res.data.data.list
  26. })
  27. },
  28. fail: function () {
  29. wx.hideLoading();
  30. wx.showToast({
  31. title: '服务器开小差啦!',
  32. icon: 'none'
  33. })
  34. }
  35. })
  36. },
  37. tab: function (e) {
  38. this.setData({
  39. act: e.target.dataset.id
  40. })
  41. },
  42. /**
  43. * 生命周期函数--监听页面初次渲染完成
  44. */
  45. onReady: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面显示
  49. */
  50. onShow: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide: function () {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload: function () {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh: function () {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom: function () {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage: function () {
  76. }
  77. })