// pages/index/total/tatal.js const app =getApp(); // Page({ // /** // * 页面的初始数据 // */ // data: { // content:[ // { // time: '2022-04-29 23:00:00', // title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机,星途凌云换个运动轮胎妥妥的6秒3最快6...', // author: '明哥飞扬', // media:'新浪微博' // }, // { // time: '2022-04-29 23:00:00', // title: '星途凌云S上市传播分析:评论中毒 奇瑞车为何如此招黑?', // author: '明哥飞扬', // media:'新浪微博' // }, // { // time: '2022-04-29 23:00:00', // title: 'MG5天蝎座上市传播分析:评论区疑似闹“水灾', // author: '明哥飞扬', // media:'新浪微博' // }, // { // time: '2022-04-29 23:00:00', // title: '谁说国产没有高性能SUV这3款国产SUV配2.0T发动机,星途凌云换个运动轮胎妥妥的6秒3最快6...', // author: '明哥飞扬', // media:'新浪微博' // }, // ] // }, // /** // * 生命周期函数--监听页面加载 // */ // onLoad(options) { // console.log("aaa",options); // }, // /** // * 生命周期函数--监听页面初次渲染完成 // */ // onReady() { // }, // /** // * 生命周期函数--监听页面显示 // */ // onShow() { // }, // /** // * 生命周期函数--监听页面隐藏 // */ // onHide() { // }, // /** // * 生命周期函数--监听页面卸载 // */ // onUnload() { // }, // /** // * 页面相关事件处理函数--监听用户下拉动作 // */ // onPullDownRefresh() { // }, // /** // * 页面上拉触底事件的处理函数 // */ // onReachBottom() { // }, // /** // * 用户点击右上角分享 // */ // onShareAppMessage() { // } // }) Component({ data: { content: {}, }, methods: { // modalChoose(e) { // let id = e.currentTarget.dataset.id; //获取点击的id // app.globalData.request({ // action: 'getUserSeriesName', // token: 't%2BrswgjvzGM=', // sBrandName: id // }).then(res => { // this.setData({ // modalList: res, // popShow: true, // currentBrand: id, // }) // }); // }, // handlerSearch(value) { // let keyword = value.detail; // app.globalData.request({ // action: 'getQueryrSeriesName', // token: 't%2BrswgjvzGM=', // queryname: keyword // }).then(res => { // //图片少了.png后缀 // let arr = [] // for (let i = 65; i <= 90; i++) { // arr.push({ // name: String.fromCharCode(i), // data: [] // }); // } // for(let i of res){ // for(let j of arr){ // if(i.firstword == j.name){ // let obj = { // brandname: i.name, // img: i.img+'.png', // data: i.data, // firstword: i.firstword // } // j.data.push(obj) // } // } // }; // this.setData({ // brandList: arr // }); // }); // }, // toModalInsight(value) { // let id = value.target.dataset.id; // wx.setStorageSync('sSeriesName', id); // // wx.navigateTo({ // // url: "/pages/insight/pages/modalInsight/index" // // }) // }, // onClose() { // this.setData({ // popShow: false // }) // } }, lifetimes: { attached() { let sTimeType = wx.getStorageSync("sTimeType") || 34; let sStartTime = wx.getStorageSync("sStartTime") || ''; let sEndTime = wx.getStorageSync("sEndTime") || ''; this.getData(sTimeType, sStartTime, sEndTime); } }, methods: { // 时间 changeTime(e){ let sTimeType = e.detail.sTimeType; let sStartTime = e.detail.sStartTime; let sEndTime = e.detail.sEndTime; this.getData(sTimeType, sStartTime, sEndTime); }, getData(sTimeType, sStartTime, sEndTime){ wx.showToast({ title: '加载中', icon: 'loading', duration: 300000 }) // let key = ele.key app.globalData.request({ action: 'getHomeList0528', sType: 'Home', sTimeType:sTimeType, sStartTime:sStartTime, sEndTime:sEndTime, // sQuDao:wx.getStorageSync('sQuDao') }).then(res => { const data= res; const _source = [] // for (let i = 0 ;i{ // let obj = { // sourcetime:data._source.sourcetime, // title:data._source.title, // user_author:data._source.user_author, // source:data._source.source // } // _source.push(obj) // }) this.setData({ content:data._source }); // console.log('9999',data) // console.log('9999',arr) }); setTimeout(() =>{ wx.hideToast(); },500) }, }, })