partner.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. const pages = require('../../mixin/pages')
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. ...pages.data(),
  9. listUrl: '/api/user/goods/shop/list',
  10. searchForm: {
  11. key_words: ''
  12. }
  13. },
  14. ...pages.methods,
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad(options) {
  19. this.fetchOrderList()
  20. },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady() {
  25. },
  26. /**
  27. * 生命周期函数--监听页面显示
  28. */
  29. onShow() {
  30. const { shop_status } = app.globalData.userInfo
  31. this.getTabBar().init()
  32. if (shop_status === 1 && this.getTabBar().data.list.findIndex(item => item.pagePath === 'pages/news/news') === -1) {
  33. this.getTabBar().setData({ list: app.globalData.tabBarList })
  34. }
  35. },
  36. /**
  37. * 生命周期函数--监听页面隐藏
  38. */
  39. onHide() {
  40. },
  41. /**
  42. * 生命周期函数--监听页面卸载
  43. */
  44. onUnload() {
  45. },
  46. /**
  47. * 页面相关事件处理函数--监听用户下拉动作
  48. */
  49. onPullDownRefresh() {
  50. if (this.data.freshing) {
  51. return
  52. }
  53. this.setData({
  54. freshing: true
  55. })
  56. this.bindCallBack()
  57. },
  58. /**
  59. * 页面上拉触底事件的处理函数
  60. */
  61. onReachBottom() {
  62. this.fetchOrderList()
  63. },
  64. bindCallBack() {
  65. this.refreshOrderList()
  66. },
  67. jumpLeavingAMessage() {
  68. wx.navigateTo({
  69. url: '/pages/leavingAMessage/leavingAMessage'
  70. })
  71. },
  72. jumpBusinessDetail(e) {
  73. const { item } = e.currentTarget.dataset
  74. wx.navigateTo({
  75. url: '/pages/businessDetail/businessDetail?shop_id=' + item.id
  76. })
  77. }
  78. })