You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

224 lines
5.7 KiB

3 years ago
// pages/index/total/tatal.js
3 years ago
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:'新浪微博'
// },
3 years ago
3 years ago
// ]
// },
// /**
// * 生命周期函数--监听页面加载
// */
// onLoad(options) {
3 years ago
// console.log("aaa",options);
3 years ago
// },
// /**
// * 生命周期函数--监听页面初次渲染完成
// */
// onReady() {
// },
// /**
// * 生命周期函数--监听页面显示
// */
// onShow() {
// },
// /**
// * 生命周期函数--监听页面隐藏
// */
// onHide() {
// },
// /**
// * 生命周期函数--监听页面卸载
// */
// onUnload() {
// },
// /**
// * 页面相关事件处理函数--监听用户下拉动作
// */
// onPullDownRefresh() {
// },
// /**
// * 页面上拉触底事件的处理函数
// */
// onReachBottom() {
// },
// /**
// * 用户点击右上角分享
// */
// onShareAppMessage() {
// }
// })
Component({
data: {
content: {},
},
3 years ago
3 years ago
methods: {
3 years ago
3 years ago
// 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") || '';
3 years ago
this.getData(sTimeType, sStartTime, sEndTime);
3 years ago
}
3 years ago
},
3 years ago
3 years ago
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
})
3 years ago
// let key = ele.key
3 years ago
app.globalData.request({
action: 'getHomeList0528',
sType: 'Home',
sTimeType:sTimeType,
sStartTime:sStartTime,
sEndTime:sEndTime,
3 years ago
// sQuDao:wx.getStorageSync('sQuDao')
3 years ago
}).then(res => {
const data= res;
const _source = []
// for (let i = 0 ;i<res.length;i++){
// data.push(res[i])
// }
3 years ago
// res.forEach(ele =>{
// let obj = {
3 years ago
// 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
});
3 years ago
// console.log('9999',data)
3 years ago
// console.log('9999',arr)
});
setTimeout(() =>{
wx.hideToast();
},500)
},
},
3 years ago
})