special.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // pages/special/special.js
  2. const getReq = require('./../../config.js').getReq;
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. special_datas: {},
  9. summery: [],
  10. special_id:0
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. let title = options.title ? options.title : "熊猫美妆";
  17. let special_id = options.special_id;
  18. wx.setNavigationBarTitle({
  19. title: title
  20. })
  21. this.setData({
  22. special_id,
  23. title
  24. });
  25. var self = this;
  26. getReq({
  27. act: 'special',
  28. op: 'index',
  29. special_id,
  30. page: 10,
  31. curpage: 1
  32. }, function (res) {
  33. if (res.code == 200) {
  34. self.setData({
  35. special_datas: res.datas,
  36. summery: res.datas.summary
  37. });
  38. }
  39. })
  40. },
  41. /**
  42. * 生命周期函数--监听页面初次渲染完成
  43. */
  44. onReady: function () {
  45. },
  46. /**
  47. * 生命周期函数--监听页面显示
  48. */
  49. onShow: function () {
  50. },
  51. /**
  52. * 生命周期函数--监听页面隐藏
  53. */
  54. onHide: function () {
  55. },
  56. /**
  57. * 生命周期函数--监听页面卸载
  58. */
  59. onUnload: function () {
  60. },
  61. /**
  62. * 页面相关事件处理函数--监听用户下拉动作
  63. */
  64. onPullDownRefresh: function () {
  65. },
  66. /**
  67. * 页面上拉触底事件的处理函数
  68. */
  69. onReachBottom: function () {
  70. },
  71. /**
  72. * 用户点击右上角分享
  73. */
  74. onShareAppMessage: function () {
  75. let special_id = this.data.special_id;
  76. let title = this.data.title;
  77. return {
  78. title: `熊猫美妆为您推荐:${title}`,
  79. path: `/pages/special/special?title=${title}&special_id=${special_id}`
  80. }
  81. }
  82. })