美甲小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 rivejä
1.8 KiB

  1. // pages/pageSearch/pageSearch.js
  2. const pubic = require('../../utils/pubic')
  3. const utils = require('../../utils/serve')
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. isKong: false,
  10. searchData: []
  11. },
  12. skipDetail: function (ev) {
  13. let param = ev.currentTarget.dataset.param
  14. wx.redirectTo({
  15. url: '/pages/detailContent/detailContent',
  16. success: res=> {
  17. // 通过eventChannel向被打开页面传送数据
  18. res.eventChannel.emit('acceptDataFromOpenerPage', param , this.data.searchData , this.data.paginate , this.data.finData)
  19. }
  20. })
  21. },
  22. onInput:pubic.Debounce(function(ev){
  23. console.log(ev)
  24. wx.showLoading({
  25. title: '搜索中···',
  26. mask: true,
  27. })
  28. utils.http({
  29. url:'/manicureApi/Index/finishedProduct',
  30. method:'GET',
  31. data:{
  32. name: ev.detail.value,
  33. p: 1
  34. }
  35. }).then(res=>{
  36. this.setData({
  37. searchData: res.data.lists,
  38. value : ev.detail.value
  39. })
  40. })
  41. }),
  42. /**
  43. * 生命周期函数--监听页面加载
  44. */
  45. onLoad: function (options) {
  46. console.log(pubic)
  47. },
  48. /**
  49. * 生命周期函数--监听页面初次渲染完成
  50. */
  51. onReady: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面显示
  55. */
  56. onShow: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload: function () {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh: function () {
  72. },
  73. /**
  74. * 页面上拉触底事件的处理函数
  75. */
  76. onReachBottom: function () {
  77. },
  78. /**
  79. * 用户点击右上角分享
  80. */
  81. onShareAppMessage: function () {
  82. }
  83. })