// pages/index/Salesranking/Allbrands/Allbrands.js var newtime=new Date(); const app = getApp() Page({ /** * 页面的初始数据 */ data: { imageUrl: getApp().globalData.imageUrl, startdate: '开始日期',//默认起始时间 enddate: '结束日期',//默认结束时间 show:false, currentDate: new Date().getTime(), minDate: new Date().getTime(), ranking: [ { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, { time:'2022-05', vehicle:9391, share: 10.02, }, ], }, // sliderChange(event) { // this.setData({ // sliderValue: event.detail // }); // }, // 点击日期组件确定事件 bindDateChange(e) { let that = this; console.log(e.detail.value) that.setData({ startdate: e.detail.value, }) }, bindDateChange2(e) { let that = this; console.log(e.detail.value) that.setData({ enddate: e.detail.value, }) }, dropdownSel(e){ this.setData({ value1:e.detail }) }, priceSel(e){ this.setData({ priceSelected: e.currentTarget.dataset.index }) }, //详情跳转 detail(){ wx.navigateTo({ url: '/pages/index/Brandsales/Brandsales', }) }, showPopup() { this.setData({ show: true }); }, onClose() { this.setData({ show: false }); }, onInput(event) { this.setData({ currentDate: event.detail, }); }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { app.globalData.request({ action: 'getCheZhuCarBrandRankingHome', sType: 'Marketing', sTimeType:'4', sStartTime:'2020-01-01', sEndTime:'2021-01-01', iPageIndex:'1', }).then(res => { const arr=[] res.forEach(e => { let obj={ name:e.brand, img:e.img, share:e.percentage, sales:e.salescount } arr.push(obj) }); this.setData({ ranking:arr })}) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })