special.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. wx.setNavigationBarTitle({
  16. title: options.title ? options.title : "熊猫美妆"
  17. })
  18. // console.log(options);
  19. const special_id = options.special_id;
  20. var self = this;
  21. getReq({
  22. act: 'special',
  23. op: 'index',
  24. special_id,
  25. page: 10,
  26. curpage: 1
  27. }, function (res) {
  28. console.log(res);
  29. if (res.code == 200) {
  30. self.setData({
  31. special_datas: res.datas,
  32. summery: res.datas.summary
  33. });
  34. }
  35. })
  36. },
  37. /**
  38. * 生命周期函数--监听页面初次渲染完成
  39. */
  40. onReady: function () {
  41. },
  42. /**
  43. * 生命周期函数--监听页面显示
  44. */
  45. onShow: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload: function () {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function () {
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom: function () {
  66. },
  67. /**
  68. * 用户点击右上角分享
  69. */
  70. onShareAppMessage: function () {
  71. }
  72. })