|
- // pages/pageSearch/pageSearch.js
- const pubic = require('../../utils/pubic')
- const utils = require('../../utils/serve')
-
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- isKong: false,
- searchData: []
- },
- skipDetail: function (ev) {
- let param = ev.currentTarget.dataset.param
- let obj = {
- param: param,
- searchData: this.data.searchData,
- paginate: this.data.paginate,
- finData: this.data.finData
- }
-
-
- wx.redirectTo({
- url: '/pages/detailContent/detailContent?obj=' + JSON.stringify(obj),
- success: res=> {
- // 通过eventChannel向被打开页面传送数据
- // res.eventChannel.emit('acceptDataFromOpenerPage', param , this.data.searchData , this.data.paginate , this.data.finData)
- }
- })
- },
-
- onInput:pubic.Debounce(function(ev){
- console.log(ev)
- wx.showLoading({
- title: '搜索中···',
- mask: true,
- })
-
-
-
- utils.http({
- url:'/manicureApi/Index/finishedProduct',
- method:'GET',
- data:{
- name: ev.detail.value,
- p: 1
- }
- }).then(res=>{
- this.setData({
- searchData: res.data.lists,
- value : ev.detail.value
- })
- })
- }),
-
-
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- console.log(pubic)
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- }
- })
|