import { ApiModel } from "../../utils/api"; const _Http = new ApiModel(); const handleList = require("../../utils/processingData") Page({ /** * 页面的初始数据 */ data: { //轮播图列表 swiperBannerList: [], liveList: [], //云展会直播大厅 agentList: [], //热门展商 prodList: [], //热门展品 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { console.log(options) let data = { "classname": "publicmethod.live.live", "method": "getLiveChannelData", "content": { "tactivityid": options.id } } /* 云展会直播大厅 */ _Http.basic(data).then(res => { if (res.msg != "成功") wx.showToast({ title: '直播大厅加载失败,请重新进入页面', icon: "error", duration: 5000 }) console.log("直播大厅", res) const liveList = handleList.twoDimensionalArr(res.data.tlivelist, 4, 10); this.setData({ liveList }) }); /* 热门展商 */ data.method = "agentList"; _Http.basic(data).then(res => { console.log("热门展商", res) if (res.msg != "成功") wx.showToast({ title: '热门展商加载失败,请重新进入页面', icon: "error", duration: 5000 }) const agentList = handleList.twoDimensionalArr(res.data, 4, 10); this.setData({ agentList }) }); /* 热门展品 */ data.method = "prodList"; _Http.basic(data).then(res => { console.log("热门展品", res) if (res.msg != "成功") wx.showToast({ title: '热门展品加载失败,请重新进入页面', icon: "error", duration: 5000 }) const prodList = handleList.twoDimensionalArr(res.data, 6, 10); this.setData({ prodList }) }); /* 获取轮播图 */ const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'activity_head'); this.setData({ swiperBannerList: bannerList[0].banner }); }, searchBlur(e) { const { value } = e.detail; console.log(value) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })