applyDist.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. var http = require("../../utils/http.js");
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. shopid: 1,
  8. content: '',
  9. pic: '',
  10. title: '',
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function(options) {
  16. //加载分销员推广
  17. // console.log(decodeURIComponent(options.scene))
  18. this.setData({
  19. scene: options.scene
  20. })
  21. this.getClaimerList(this.data.shopid)
  22. },
  23. /**
  24. * 生命周期函数--监听页面初次渲染完成
  25. */
  26. onReady: function() {
  27. },
  28. /**
  29. * 生命周期函数--监听页面显示
  30. */
  31. onShow: function() {
  32. },
  33. /**
  34. * 生命周期函数--监听页面隐藏
  35. */
  36. onHide: function() {
  37. },
  38. /**
  39. * 生命周期函数--监听页面卸载
  40. */
  41. onUnload: function() {
  42. },
  43. /**
  44. * 页面相关事件处理函数--监听用户下拉动作
  45. */
  46. onPullDownRefresh: function() {
  47. },
  48. /**
  49. * 页面上拉触底事件的处理函数
  50. */
  51. onReachBottom: function() {
  52. },
  53. /**
  54. * 用户点击右上角分享
  55. */
  56. onShareAppMessage: function() {
  57. },
  58. /**
  59. * 查看
  60. */
  61. getClaimerList: function(shopid) {
  62. //wx.showLoading();
  63. var params = {
  64. url: "/p/distribution/recruit/info",
  65. method: "GET",
  66. // data: {
  67. // shopId:shopid,
  68. // },
  69. callBack: (res) => {
  70. this.setData({
  71. content: res.content,
  72. pic: res.pic,
  73. title: res.title,
  74. })
  75. //设置标题
  76. wx.setNavigationBarTitle({
  77. title: res.title,
  78. })
  79. }
  80. };
  81. http.request(params);
  82. },
  83. onApplyDist: function() {
  84. // console.log(this.data.scene)
  85. if (this.data.scene) {
  86. wx.navigateTo({
  87. url: '/pages/applyDistCon/applyDistCon?scene=' + this.data.scene,
  88. })
  89. } else {
  90. wx.navigateTo({
  91. url: '/pages/applyDistCon/applyDistCon',
  92. })
  93. }
  94. }
  95. })