const getHeight = require("../../utils/getRheRemainingHeight"); const _Http = getApp().globalData.http; Page({ data: { content: { "pageNumber": 1, "pageSize": 20, "where": { "condition": "", "status": "待跟进" } }, list: [], sort: null, tagColor: '#FA8C16' }, onLoad(options) { this.getList() }, /* 查询列表 */ getList(init = false) { if (init.detail != undefined) init = init.detail; if (init) this.setData({ ['content.pageNumber']: 1 }) if (this.data.content.pageNumber > this.data.content.pageTotal) return; let content = this.data.content; if (this.data.sort != null) content.sort = this.data.sort; _Http.basic({ "classname": "saletool.orderclue.web.orderclue", "method": "selectList", content }).then(res => { console.log("列表", res) this.selectComponent('#ListBox').RefreshToComplete(); if (res.msg != '成功') return wx.showToast({ title: res.data, icon: "none" }); this.setData({ list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data), ['content.pageNumber']: res.pageNumber + 1, ['content.pageTotal']: res.pageTotal, sort: res.sort }) }) }, /* 切换tab分类 */ tabsChange({ detail }) { let tagColor = '#BBBBBB'; switch (detail.title) { case '待跟进': tagColor = '#FA8C16' break; case '跟进中': tagColor = '#52C41A' break; case '已成交': tagColor = '#ffffff' break; case '丢单': tagColor = '#FF3B30' break; } this.setData({ 'content.where.status': detail.title, tagColor, list: [] }) this.getList(true); }, /* 搜索 */ inputSharch({ detail }) { this.setData({ 'content.where.condition': detail }); this.getList(true); }, /* 选择排序方式 */ selectSort() { if (this.data.sort[0].sorted == 1) { this.setData({ 'sort[0].sorted': 0, 'sort[1].sorted': 1, }) } else { this.setData({ 'sort[0].sorted': 1, 'sort[1].sorted': 0, }) }; this.getList(true) }, onReady() { getHeight.getHeight('.tabs', this).then(res => { this.setData({ scrollHeight: res }) }) }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })