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.

191 lines
3.8 KiB

3 years ago
// pages/index/Salesranking/Allbrands/Allbrands.js
var newtime=new Date();
3 years ago
const app = getApp()
3 years ago
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({
3 years ago
url: '/pages/index/Brandsales/Brandsales',
3 years ago
})
},
showPopup() {
this.setData({ show: true });
},
onClose() {
this.setData({ show: false });
},
onInput(event) {
this.setData({
currentDate: event.detail,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
3 years ago
app.globalData.request({
action: 'getCheZhuCarBrandRankingHome',
sType: 'Marketing',
3 years ago
sTimeType:'4',
sStartTime:'2020-01-01',
sEndTime:'2021-01-01',
iPageIndex:'1',
3 years ago
}).then(res => {
3 years ago
const arr=[]
res.forEach(e => {
let obj={
name:e.brand,
img:e.img,
share:e.percentage,
sales:e.salescount
}
arr.push(obj)
});
3 years ago
this.setData({
3 years ago
ranking:arr
3 years ago
})})
3 years ago
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})