// pages/youpei/company.js const app = getApp() const api = require("../../utils/request.js"); Page({ data: { query: { page: 1, limit: 10, search:"" }, // 数据源 results: [ // {id:1,title:"开发需求",is_top:true,ifrom:"第一条咨询",update_time:"2022-10-01"} ], name:"中存大数据科技有限公司" }, onLoad: function (options) { this.getList(options.art_cate) console.log(options.art_cate) wx.stopPullDownRefresh(); }, getList: function (art_cate) { console.log(art_cate) var that = this that.data.query.art_cate=art_cate console.log(that.data.query.art_cate) api.request('/cms/userpz/', 'GET', that.data.query).then(res => { if (that.data.query.page == 1) { that.data.results = res.data.results } else { that.data.results = that.data.results.concat(res.data.results) } that.setData({ results: that.data.results, count: res.data.count, url:app.globalData.mediahost }) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { var that = this that.data.query.page = 1; that.getList(); wx.stopPullDownRefresh(); }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { var that = this if (that.data.count <= that.data.query.page * that.data.query.limit) { wx.showToast({ title: '没有更多了', icon: 'none' }) } else { that.data.query.page = that.data.query.page + 1 that.getList() } }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, //优培企业图片点击 goartisan(){ wx.navigateTo({ url: '/pages/youpei/detailpy', }) }, })