From 2cce4e6abce702e082b74e3aaccc525719c6dc17 Mon Sep 17 00:00:00 2001 From: liuyongli <1598631486@qq.com> Date: Mon, 10 Oct 2022 17:37:02 +0800 Subject: [PATCH] no message --- contrastPackages/addTheme/index.wxss | 5 - contrastPackages/brandRatio/survey/index.js | 3 +- pages/index/Salesranking/Salesranking.js | 727 ++++++++++---------- pages/index/Salesranking/Salesranking.wxml | 8 +- 4 files changed, 365 insertions(+), 378 deletions(-) diff --git a/contrastPackages/addTheme/index.wxss b/contrastPackages/addTheme/index.wxss index f8ee0cd..818b67f 100644 --- a/contrastPackages/addTheme/index.wxss +++ b/contrastPackages/addTheme/index.wxss @@ -20,11 +20,6 @@ font-weight: bold; color: black; } -.my_theme{ - - /* height: 10000rpx; - background: pink; */ -} .line{ height: 4rpx; background: #007bff; diff --git a/contrastPackages/brandRatio/survey/index.js b/contrastPackages/brandRatio/survey/index.js index 49a80d9..61ac8ab 100644 --- a/contrastPackages/brandRatio/survey/index.js +++ b/contrastPackages/brandRatio/survey/index.js @@ -263,7 +263,8 @@ Component({ action: 'getPositiveAndNegative0528C', token: wx.getStorageSync('token'), sType:'BrandOverview', - sTimeType:'34', + // sTimeType:'34', + ...brandRatioTime, iContrastType:'1', sBrand: sBrand.join(',') }).then(res=>{ diff --git a/pages/index/Salesranking/Salesranking.js b/pages/index/Salesranking/Salesranking.js index 85695ce..4aec139 100644 --- a/pages/index/Salesranking/Salesranking.js +++ b/pages/index/Salesranking/Salesranking.js @@ -3,389 +3,380 @@ const app = getApp() import brokenLine from "../../../components/option/singleLineOption" import histogram from "../../../components/option/columnarOption" import { - times + times } from "../../../components/option/text" import moment from "moment" let iPageIndex = 1 // 当前第几页,0代表第一页 let iPageSize = 20 //每页显示多少数据 Page({ - data: { - active: 0, - end: moment().format("YYYY-MM"), - showChart: true, - // select: false, - grade_value1: "", - grade_value2: "", - grade_value3: "", - grade_value4: 0, - grades4: [{ - text: '列表展示', - value: 0 - }, - { - text: '图表展示', - value: 1 - } - ], - num: 0, - num1: false, - //弹出框 - show: false, - duration: 300, - position: 'bottom', - // round: true, - overlay: true, - showChart: true, - //图表 - // positiveOption:brokenLine(dName,dValue,dColor,data), - imageUrl: getApp().globalData.imageUrl, - date: wx.getStorageSync('newTime'), - accountIndex: 0, - ranking: [], - accountIndex: 0, - sSpec: '', - sPriceType: '', - sEnergyType: '', - imageUrl: getApp().globalData.imageUrl, - mockData: [], + data: { + active: 0, + end: moment().format("YYYY-MM"), + showChart: true, + // select: false, + grade_value1: "", + grade_value2: "", + grade_value3: "", + grade_value4: 0, + grades4: [{ + text: '列表展示', + value: 0 + }, + { + text: '图表展示', + value: 1 + } + ], + num: 0, + num1: false, + //弹出框 + show: false, + duration: 300, + position: 'bottom', + // round: true, + overlay: true, + showChart: true, + //图表 + // positiveOption:brokenLine(dName,dValue,dColor,data), + imageUrl: getApp().globalData.imageUrl, + date: wx.getStorageSync('newTime'), + accountIndex: 0, + ranking: [], + accountIndex: 0, + sSpec: '', + sPriceType: '', + sEnergyType: '', + imageUrl: getApp().globalData.imageUrl, + mockData: [], - // - ec: { - lazyLoad: true // 设置图表懒加载 + // + ec: { + lazyLoad: true // 设置图表懒加载 + } + }, + // 标签切换点击事件 + onChange(val) { + let n = val.detail.index; + this.setData({ + active: n + }) + // wx.showToast({ + // // title: `切换到标签 ${event.detail.name}`, + // icon: 'none', + // }); + }, + getData() { + wx.showToast({ + title: '加载中', + icon: 'loading', + duration: 3000 + }) + // 下拉列表 + this.getAmount(); + // 车型 + this.getTrend(); + // 品牌 + app.globalData.request({ + action: 'getUserBrand', + token: 't%2BrswgjvzGM=', + }).then(res => { + 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) { + j.data.push(i) + } } - }, - // 标签切换点击事件 - onChange(val) { - let n = val.detail.index; - this.setData({ - active: n - }) - // wx.showToast({ - // // title: `切换到标签 ${event.detail.name}`, - // icon: 'none', - // }); - }, - getData() { - wx.showToast({ - title: '加载中', - icon: 'loading', - duration: 3000 - }) - // 下拉列表 - this.getAmount(); - // 车型 - this.getTrend(); - // 品牌 - app.globalData.request({ - action: 'getUserBrand', - token: 't%2BrswgjvzGM=', - }).then(res => { - 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) { - j.data.push(i) - } - } - } - this.setData({ - mockData: arr - }) - setTimeout(() => { - wx.hideToast(); - }, 2000) - }) - setTimeout(() => { - wx.hideToast(); - }, 500) - }, - // 排行榜数据 - getTrend() { - wx.showToast({ - title: '加载中', - icon: 'loading', - duration: 300000 + } + this.setData({ + mockData: arr + }) + setTimeout(() => { + wx.hideToast(); + }, 2000) + }) + setTimeout(() => { + wx.hideToast(); + }, 500) + }, + // 排行榜数据 + getTrend() { + wx.showToast({ + title: '加载中', + icon: 'loading', + duration: 300000 + }) + let obj = { + action: 'getCheZhuCarSeriesRankingHome', + sType: 'Marketing', + sStartTime: this.data.date, + sEndTime: this.data.date, + iPageIndex: iPageIndex, + iPageSize: iPageSize, + sSpec: this.data.sSpec, + sPriceType: this.data.sPriceType, + sEnergyType: this.data.sEnergyType + } + //第一次加载数据 + if (iPageIndex == 1) { + this.setData({ + loadMore: true, //把"上拉加载"的变量设为true,显示 + loadAll: false //把“没有数据”设为false,隐藏 + }) + } + app.globalData.request(obj, (database) => {}).then(res => { + const carName = [] + const carValue = [] + // console.log("这是数据",res) + if (res && res.length > 0) { + iPageIndex++; + //把新请求到的数据添加到列表里 + let list = this.data.ranking.concat(res); + list.forEach(e => { + carName.push(e.seriesname) + carValue.push(e.salescount) }) + // length=(carName.length/carName.length)*100 + // console.log(carName.length) + this.setData({ + ranking: list, //获取数据数组 + loadMore: false, //把"上拉加载"的变量设为false,显示 + brandOption: histogram(carName, carValue, '#0084FF', false, (20 / list.length) * 100) + }); + if (res.length < iPageSize) { + this.setData({ + loadMore: false, //隐藏加载中。。 + loadAll: true //所有数据都加载完了 + }); + } + } else { + this.setData({ + loadAll: true, //把“没有数据”设为true,显示 + loadMore: false //把"上拉加载"的变量设为false,隐藏 + + }); + } + setTimeout(() => { + wx.hideToast(); + }, 500) + }) + }, + //页面上拉触底事件的处理函数 + onReachBottom: function () { + // console.log("上拉触底事件") + // console.log(iPageIndex) + let that = this + if (!that.data.loadMore) { + that.setData({ + loadMore: true, //加载中 + loadAll: false //是否加载完所有数据 + }); + //加载更多,这里做下延时加载 + that.getTrend(); + } + }, + // 筛选列表 + getAmount() { + //能源 + app.globalData.request({ + action: 'getEnergyJson2', + }).then(res => { + let arr = [] + res.forEach(ele => { let obj = { - action: 'getCheZhuCarSeriesRankingHome', - sType: 'Marketing', - sStartTime: this.data.date, - sEndTime: this.data.date, - iPageIndex: iPageIndex, - iPageSize: iPageSize, - sSpec: this.data.sSpec, - sPriceType: this.data.sPriceType, - sEnergyType: this.data.sEnergyType + text: ele.value, + value: ele.key, } - //第一次加载数据 - if (iPageIndex == 1) { - this.setData({ - loadMore: true, //把"上拉加载"的变量设为true,显示 - loadAll: false //把“没有数据”设为false,隐藏 - }) + arr.push(obj) + }) + this.setData({ + grades3: arr, + }) + }) + //价格 + app.globalData.request({ + action: 'getPriceRangeS', + }).then(res => { + let arr = [] + res.forEach(ele => { + let obj = { + text: ele.value, + value: ele.key } - app.globalData.request(obj, (database) => {}).then(res => { - const carName = [] - const carValue = [] - // console.log("这是数据",res) - if (res && res.length > 0) { - iPageIndex++; - //把新请求到的数据添加到列表里 - let list = this.data.ranking.concat(res); - list.forEach(e => { - carName.push(e.seriesname) - carValue.push(e.salescount) - }) - // length=(carName.length/carName.length)*100 - // console.log(carName.length) - this.setData({ - ranking: list, //获取数据数组 - loadMore: false, //把"上拉加载"的变量设为false,显示 - brandOption: histogram(carName, carValue, '#0084FF', false, (20 / list.length) * 100) - }); - if (res.length < iPageSize) { - this.setData({ - loadMore: false, //隐藏加载中。。 - loadAll: true //所有数据都加载完了 - }); - } - } else { - this.setData({ - loadAll: true, //把“没有数据”设为true,显示 - loadMore: false //把"上拉加载"的变量设为false,隐藏 - - }); - } - setTimeout(() => { - wx.hideToast(); - }, 500) - }) - }, - //页面上拉触底事件的处理函数 - onReachBottom: function () { - // console.log("上拉触底事件") - // console.log(iPageIndex) - let that = this - if (!that.data.loadMore) { - that.setData({ - loadMore: true, //加载中 - loadAll: false //是否加载完所有数据 - }); - //加载更多,这里做下延时加载 - that.getTrend(); + arr.push(obj) + }) + this.setData({ + grades2: arr + }) + console.log('ooo', arr) + }) + //级别 + app.globalData.request({ + action: 'getSpecName1', + }).then(res => { + console.log('de', res) + // const data = res; + let arr = [] + res.forEach(ele => { + let obj = { + text: ele.value, + value: ele.key } - }, - // 筛选列表 - getAmount() { - //能源 - app.globalData.request({ - action: 'getEnergyJson2', - }).then(res => { - let arr = [{ - text: "全部能源", - value: "" - }] - res.forEach(ele => { - let obj = { - text: ele.value, - value: ele.key - } - arr.push(obj) - }) - this.setData({ - grades3: arr, - }) - }) - //价格 - app.globalData.request({ - action: 'getPriceRangeS', - }).then(res => { - let arr = [{ - text: "全部价格", - value: "" - }] - res.forEach(ele => { - let obj = { - text: ele.value, - value: ele.key - } - arr.push(obj) - }) - this.setData({ - grades2: arr - }) - console.log('ooo',arr) - }) - //级别 - app.globalData.request({ - action: 'getSpecName1', - }).then(res => { - // const data = res; - let arr = [{ - text: "全部级别", - value: "" - }] - res.forEach(ele => { - let obj = { - text: ele.value, - value: ele.key - } - arr.push(obj) - }) - this.setData({ - grades1: arr, - }) - }) - }, - bindValue(e) { - let type = e.detail.type - if (type == 0) { - this.data.roomLevel = e.detail.val + arr.push(obj) + }) + this.setData({ + grades1: arr, + }) + }) + }, + bindValue(e) { + let type = e.detail.type + if (type == 0) { + this.data.roomLevel = e.detail.val + } else { + this.data.builds = e.detail.val + } + }, + // 按级别 + mySelect1(e) { + iPageIndex = 1 + iPageSize = 20 + this.setData({ + ranking: [], + sSpec: e.detail, + }) + this.getTrend() + }, + // 按价格 + mySelect2(e) { + iPageIndex = 1 + iPageSize = 20 + this.setData({ + ranking: [], + sPriceType: e.detail, + }) + this.getTrend() + }, + // 按能源 + mySelect3(e) { + iPageIndex = 1 + iPageSize = 20 + this.setData({ + ranking: [], + sEnergyType: e.detail, + }) + this.getTrend() + }, + // 列表展示 + mySelect4(e) { + iPageIndex = 1 + iPageSize = 20 + this.setData({ + ranking: [], + a: e.detail != 0 + }) + this.getTrend() + }, + // 全部 + all() { + iPageIndex = 1 + iPageSize = 20 + this.data.num++ + let dj = this.data.num % 2 == 0 + this.setData({ + ranking: [], + grade_value1: "", + grade_value2: "", + grade_value3: "", + sSpec: '', + sPriceType: '', + sEnergyType: '', + boxSize: dj ? 'noall' : 'all1' + }) + this.getTrend() + }, + bindDateChange: function (e) { + this.data.num1 = true + iPageIndex = 1 + iPageSize = 20 + this.setData({ + date: e.detail.value, + ranking: [], + boxSize1: !this.data.num1 ? 'noall' : 'all1' + }) + this.getTrend() + }, + priceSel(e) { + this.setData({ + intervalSel: e.currentTarget.dataset.index + }) + }, + //弹出框 + popup(e) { + let duration = this.data.duration + let models = e.currentTarget.dataset.car + app.globalData.request({ + action: "getCheZhuCarSeriesListHome", + sType: "Marketing", + sSeriesName: models, + sStartTime: times(this.data.date), + sEndTime: this.data.date, + }).then(res => { + // console.log(res) + const dataTime = [] + const dataCar = [] + res.forEach(e => { + if ((e.sourcetime).substring(5, 6) == "0") { + dataTime.push((e.sourcetime).substring((e.sourcetime).length - 1, (e.sourcetime).length) + '月') } else { - this.data.builds = e.detail.val + dataTime.push((e.sourcetime).substring((e.sourcetime).length - 2, (e.sourcetime).length) + "月") } - }, - // 按级别 - mySelect1(e) { - iPageIndex = 1 - iPageSize = 20 - this.setData({ - ranking: [], - sSpec: e.detail, - }) - this.getTrend() - }, - // 按价格 - mySelect2(e) { - iPageIndex = 1 - iPageSize = 20 - this.setData({ - ranking: [], - sPriceType: e.detail, - }) - this.getTrend() - }, - // 按能源 - mySelect3(e) { - iPageIndex = 1 - iPageSize = 20 - this.setData({ - ranking: [], - sEnergyType: e.detail, - }) - this.getTrend() - }, - // 列表展示 - mySelect4(e) { - iPageIndex = 1 - iPageSize = 20 - this.setData({ - ranking: [], - a: e.detail != 0 - }) - this.getTrend() - }, - // 全部 - all() { - iPageIndex = 1 - iPageSize = 20 - this.data.num++ - let dj = this.data.num % 2 == 0 - this.setData({ - ranking: [], - grade_value1: "", - grade_value2: "", - grade_value3: "", - sSpec: '', - sPriceType: '', - sEnergyType: '', - boxSize: dj ? 'noall' : 'all1' - }) - this.getTrend() - }, - bindDateChange: function (e) { - this.data.num1 = true - iPageIndex = 1 - iPageSize = 20 - this.setData({ - date: e.detail.value, - ranking: [], - boxSize1: !this.data.num1 ? 'noall' : 'all1' - }) - this.getTrend() - }, - priceSel(e) { - this.setData({ - intervalSel: e.currentTarget.dataset.index - }) - }, - //弹出框 - popup(e) { - let duration = this.data.duration - let models = e.currentTarget.dataset.car - console.log('222',e) - app.globalData.request({ - action: "getCheZhuCarSeriesListHome", - sType: "Marketing", - sSeriesName: models, - sStartTime: times(this.data.date), - sEndTime: this.data.date, - }).then(res => { - // console.log(res) - const dataTime = [] - const dataCar = [] - res.forEach(e => { - if ((e.sourcetime).substring(5, 6) == "0") { - dataTime.push((e.sourcetime).substring((e.sourcetime).length - 1, (e.sourcetime).length) + '月') - } else { - dataTime.push((e.sourcetime).substring((e.sourcetime).length - 2, (e.sourcetime).length) + "月") - } - dataCar.push(e.salescount) - }); - this.setData({ - show: true, - duration, - positiveOption: brokenLine(dataCar, dataTime), - models - }) - }) - }, - exit() { - this.setData({ - show: false - }) - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) {}, + dataCar.push(e.salescount) + }); + this.setData({ + show: true, + duration, + positiveOption: brokenLine(dataCar, dataTime), + models + }) + }) + }, + exit() { + this.setData({ + show: false + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) {}, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { - }, + }, - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - iPageIndex = 1; - // this.getTabBar().init(); - this.getData() - }, - changeTab(val) { - let n = val.detail.index; - // console.log(n) - this.setData({ - active: n - }) - }, + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + iPageIndex = 1; + // this.getTabBar().init(); + this.getData() + }, + changeTab(val) { + let n = val.detail.index; + // console.log(n) + this.setData({ + active: n + }) + }, }) \ No newline at end of file diff --git a/pages/index/Salesranking/Salesranking.wxml b/pages/index/Salesranking/Salesranking.wxml index 4c60536..f27d9a0 100644 --- a/pages/index/Salesranking/Salesranking.wxml +++ b/pages/index/Salesranking/Salesranking.wxml @@ -24,11 +24,11 @@ - + - - - + + +