diff --git a/app.json b/app.json index 0339c99..ba4b841 100644 --- a/app.json +++ b/app.json @@ -52,7 +52,7 @@ { "pagePath": "pages/brandCrisis/index", "iconPath": "/custom-tab-bar/icons/appSearch.png", - "selectedIconPath": "/custom-tab-bar/icons/appSearchActive.png", + "selectedIconPath": "", "text": "品牌搜索" }, { diff --git a/components/indexCom/atlasChild/index.js b/components/indexCom/atlasChild/index.js index a6ebd78..8272e8b 100644 --- a/components/indexCom/atlasChild/index.js +++ b/components/indexCom/atlasChild/index.js @@ -2,6 +2,13 @@ const app = getApp() Component({ data: { + showTu: false, + skey: { + 34: 2000, + 3: 20000, + 20: 60000, + 4: 20000 + } // words: }, lifetimes: { @@ -18,7 +25,6 @@ Component({ let sStartTime = e.detail.sStartTime; let sEndTime = e.detail.sEndTime; this.getData(sTimeType, sStartTime, sEndTime); - }, getData(sTimeType, sStartTime, sEndTime) { wx.showToast({ @@ -26,87 +32,98 @@ Component({ icon: 'loading', duration: 300000 }), - this.getData1(sTimeType, sStartTime, sEndTime), + this.setData({ + showTu: false + }) + Promise.all([this.getData1(sTimeType, sStartTime, sEndTime), this.getData2(sTimeType, sStartTime, sEndTime), - this.getData3(sTimeType, sStartTime, sEndTime), + this.getData3(sTimeType, sStartTime, sEndTime) + ]).then(() => { setTimeout(() => { wx.hideToast(); }, 500) + this.setData({ + showTu: true + }) + }) + // this.getData1(sTimeType, sStartTime, sEndTime), + // this.getData2(sTimeType, sStartTime, sEndTime), + // this.getData3(sTimeType, sStartTime, sEndTime), + }, //热门 getData1(sTimeType, sStartTime, sEndTime) { - let obj = { - action: 'getHotWordHome', - sType: "Home", - sTimeType: sTimeType, - sStartTime: sStartTime, - sEndTime: sEndTime - } - app.globalData.request(obj).then(res => { - const data = res - const arr1 = [] - Object.keys(data).forEach(key => { - let o = [key, data[key]/11000] - arr1.push(o) - }) - const arr2 = [arr1[0]] - console.log(arr2) - this.setData({ - HotWords: arr1 + return new Promise((resolve, reject) => { + let obj = { + action: 'getHotWordHome', + sType: "Home", + sTimeType: sTimeType, + sStartTime: sStartTime, + sEndTime: sEndTime + } + app.globalData.request(obj).then(res => { + const data = res + const arr1 = [] + Object.keys(data).forEach(key => { + let o = [key, data[key] / this.data.skey[sTimeType]] + arr1.push(o) + }) + this.setData({ + HotWords: arr1 + }) + resolve(true) }) }) }, // 正面 getData2(sTimeType, sStartTime, sEndTime) { - const arr2 = [] - const limit2 = [] - let obj = { - action: 'getPositive0528', - sType: "Home", - sTimeType: sTimeType, - sStartTime: sStartTime, - sEndTime: sEndTime - } - app.globalData.request(obj).then(res => { - const obj = res - Object.keys(obj).forEach(item => { - let list = [item, parseInt(obj[item] / 1000)] - arr2.push(list) - }) - for (let index = 0; index < 30; index++) { - limit2.push(arr2[index]) + return new Promise((resolve, reject) => { + let obj = { + action: 'getPositive0528', + sType: "Home", + sTimeType: sTimeType, + sStartTime: sStartTime, + sEndTime: sEndTime } - // console.log(limit2) - this.setData({ - PositiveWords: limit2 + app.globalData.request(obj).then(res => { + const data = res + const arr2 = [] + Object.keys(data).forEach(key => { + let list = [key, data[key] / this.data.skey[sTimeType]] + arr2.push(list) + }) + this.setData({ + PositiveWords: arr2 + }) + resolve(true) }) }) + }, // 负面 getData3(sTimeType, sStartTime, sEndTime) { - const arr3 = [] - const limit3 = [] - let obj = { - action: 'getNegative0528', - sType: "Home", - sTimeType: sTimeType, - sStartTime: sStartTime, - sEndTime: sEndTime - } - app.globalData.request(obj).then(res => { - const obj = res - Object.keys(obj).forEach(item => { - let list = [item, parseInt(obj[item] / 1000)] - arr3.push(list) - }) - for (let index = 10; index < 40; index++) { - limit3.push(arr3[index]) + return new Promise((resolve, reject) => { + let obj = { + action: 'getNegative0528', + sType: "Home", + sTimeType: sTimeType, + sStartTime: sStartTime, + sEndTime: sEndTime } - // console.log(limit3) - this.setData({ - NegativeWords: limit3 + app.globalData.request(obj).then(res => { + const data = res + const arr3 = [] + Object.keys(data).forEach(key => { + let list = [key, data[key] / this.data.skey[sTimeType]] + arr3.push(list) + }) + this.setData({ + NegativeWords: arr3 + }) + resolve(true) }) }) + }, }, }) \ No newline at end of file diff --git a/components/indexCom/atlasChild/index.wxml b/components/indexCom/atlasChild/index.wxml index c79b8bb..c5d1ffe 100644 --- a/components/indexCom/atlasChild/index.wxml +++ b/components/indexCom/atlasChild/index.wxml @@ -3,16 +3,16 @@ 热门词云 - + - + + \ No newline at end of file diff --git a/components/word-cloud/index.js b/components/word-cloud/index.js index 9946b0d..cdebeb3 100644 --- a/components/word-cloud/index.js +++ b/components/word-cloud/index.js @@ -1,5 +1,5 @@ // components/word-cloud/index.js -import WordCloud from './wordcloud' +import WordCloud from './wordCloud' const options = { "list": [], "gridSize": 2, // size of the grid in pixels @@ -37,7 +37,7 @@ Component({ attached: function() { // 在组件实例进入页面节点树时执行 const query = this.createSelectorQuery() - query.select('#myCanvas') + query.select('.wc-canvas') .fields({ node: true, size: true }) .exec((res) => { this.data.canvas = res[0].node diff --git a/components/word-cloud/index.wxss b/components/word-cloud/index.wxss index 5efb4bf..034c3d8 100644 --- a/components/word-cloud/index.wxss +++ b/components/word-cloud/index.wxss @@ -6,7 +6,7 @@ .wc-main { position: relative; margin-left: -40%; - margin-top: -15%; + margin-top: 0px; } .wc-item { white-space: nowrap; diff --git a/custom-tab-bar/icons/appSearch.png b/custom-tab-bar/icons/appSearch.png index 3a801c4..3996982 100644 Binary files a/custom-tab-bar/icons/appSearch.png and b/custom-tab-bar/icons/appSearch.png differ diff --git a/custom-tab-bar/icons/appSearchActive.png b/custom-tab-bar/icons/appSearchActive.png deleted file mode 100644 index a74330b..0000000 Binary files a/custom-tab-bar/icons/appSearchActive.png and /dev/null differ diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index bdc504b..1973403 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -19,7 +19,7 @@ Component({ { "pagePath": "pages/brandCrisis/index", "iconPath": "icons/appSearch.png", - "selectedIconPath": "icons/appSearchActive.png", + "selectedIconPath": "", "text": "", diyClass: 'diy' }, diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml index ab86092..9ec3a21 100644 --- a/custom-tab-bar/index.wxml +++ b/custom-tab-bar/index.wxml @@ -1,5 +1,6 @@ + {{item.text}} diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss index a64c859..1aa979a 100644 --- a/custom-tab-bar/index.wxss +++ b/custom-tab-bar/index.wxss @@ -52,12 +52,13 @@ .tab-bar-item image.diy { position: absolute; - width: 134rpx; + width: 140rpx; height: 140rpx; bottom: 25.6%; z-index: 100; - border-radius: 140rpx; + border-radius: 200rpx; background: #fff; + box-shadow: 0px -2px 10px 0px rgba(0,0,0,0.15); } .tab-bar-item view.diy { @@ -71,4 +72,10 @@ .activeBg { background: #0579FF; } + .tab-middle { + position: absolute; + width: 140rpx; + height: 100%; + background: #fff; + } \ No newline at end of file diff --git a/pages/brandCrisis/index.js b/pages/brandCrisis/index.js index e7753c5..d5d5175 100644 --- a/pages/brandCrisis/index.js +++ b/pages/brandCrisis/index.js @@ -110,7 +110,7 @@ Page({ let intermediateCrisis = Math.round((new Decimal(res.crisis[1].value).div(new Decimal(negativeNum))).toFixed(2) * 100); let seniorCrisis = Math.round((new Decimal(res.crisis[2].value).div(new Decimal(negativeNum))).toFixed(2) * 100); this.setData({ - healthIndex: healthIndex, + healthIndex: 100, topBg: topBg, healthIndexMsg: healthIndexMsg, negativeNum: negativeNum, diff --git a/pages/brandCrisis/index.wxml b/pages/brandCrisis/index.wxml index c7e9ea5..39160b6 100644 --- a/pages/brandCrisis/index.wxml +++ b/pages/brandCrisis/index.wxml @@ -1,31 +1,31 @@ - 健康指数 + 健康指数 {{healthIndex}} {{healthIndexMsg}} {{headlBrand}} - 健康指数 + 健康指数 {{healthIndex}} {{healthIndexMsg}} {{headlBrand}} - 健康指数 + 健康指数 {{healthIndex}} {{healthIndexMsg}} {{headlBrand}} - 健康指数 + 健康指数 {{healthIndex}} {{healthIndexMsg}} {{headlBrand}} - 健康指数 + 健康指数 {{healthIndex}} {{healthIndexMsg}} {{headlBrand}} diff --git a/pages/brandCrisis/index.wxss b/pages/brandCrisis/index.wxss index 99a0cb0..16dde35 100644 --- a/pages/brandCrisis/index.wxss +++ b/pages/brandCrisis/index.wxss @@ -4,17 +4,18 @@ .bc-top { position: relative; width: 100%; - height: 900rpx; + height: 840rpx; border-top: 1px solid transparent; } .bc-top-inner { - width: 100%; + width: 90%; background-repeat: no-repeat; background-size: cover; display: flex; justify-content: center; align-items: center; flex-direction: column; + margin: 0 auto; margin-top: 100rpx; height: 660rpx; } diff --git a/pages/index/Brandsales/Brandsales.js b/pages/index/Brandsales/Brandsales.js index cdf6c2d..d776497 100644 --- a/pages/index/Brandsales/Brandsales.js +++ b/pages/index/Brandsales/Brandsales.js @@ -13,108 +13,92 @@ Page({ currentDate: new Date().getTime(), minDate: new Date().getTime(), ranking: [], - // 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 - // }); - // }, dropdownSel(e){ this.setData({ value1:e.detail }) }, -getData(){ + times(val){ + var month=val.substring(0,4) //获取年份 + var bYear=val.substring(val.length-2,val.length-1)=="0"//是否为带零的月份 + var year1=val.substring(val.length-1,val.length) //获取月份最后一个数 + var year2=val.substring(val.length-2,val.length) //获取整个月份 + var time,months,years + if(parseInt(year1)==1){ + months=parseInt(month-2) + years="12" + }else{ + if(bYear){ + months=parseInt(month-1) + years="0"+(parseInt(year1)-1) + }else{ + if(year2==10){ + years="09" + months=parseInt(month-1) + }else{ + months=parseInt(month-1) + years=(parseInt(year1)-1) + } + } + } + time=months+'-'+years + return time + }, +getData(carName,sStartTime=this.times(wx.getStorageSync('newTime')),sEndTime=wx.getStorageSync('newTime')){ app.globalData.request({ action: 'getCheZhuCarSeriesListHome', sType: 'Marketing', - // sBrand: wx.getStorageSync('sBrand') || '', - // sSeriesName:wx.getStorageSync("sSeriesName") || '', + sBrand: carName|| '', + sStartTime:sStartTime ||"", + sEndTime:sEndTime||'', }).then(res => { const arr=[] - res.forEach(e => { - let obj={ - time:e.sourcetime, - vehicle:e.salescount, - share:e.salespm, - } - arr.push(obj) - }); - - this.setData({ - ranking:arr - })}) - + const time=[] + const obj={} + var totalSum=0 + var num=0 + res.forEach(i=>{ + totalSum+=parseInt(i.salescount) + // console.log(i.salescount) + if(!obj[i.sourcetime]){ + obj[i.sourcetime] = [] + time.push(i.sourcetime) + num++ + } + obj[i.sourcetime].push(i) +}) +for(let j=0;j --> - + {{date}} @@ -18,7 +18,7 @@ —— - + {{date2}} @@ -36,11 +36,11 @@ - {{item.time}} - {{item.vehicle}} + {{item.times}} + {{item.sales}} {{item.share}} - + 详细销量 diff --git a/pages/index/Salesranking/Brandranking/Brandranking.js b/pages/index/Salesranking/Brandranking/Brandranking.js index 64fafdb..b4c6525 100644 --- a/pages/index/Salesranking/Brandranking/Brandranking.js +++ b/pages/index/Salesranking/Brandranking/Brandranking.js @@ -50,53 +50,13 @@ Component({ }, //单个品牌 - times(val){ - var month=val.substring(0,4) //获取年份 - var bYear=val.substring(val.length-2,val.length-1)=="0"//是否为带零的月份 - var year1=val.substring(val.length-1,val.length) //获取月份最后一个数 - var year2=val.substring(val.length-2,val.length) //获取整个月份 - var time,months,years - if(bYear){ - if(parseInt(year1)==1){ - months=parseInt(month-2) - if(parseInt(year1)<3){ - years="0"+((12-(6-parseInt(year1)))+1) - }else{ - years=(12-(6-parseInt(year1)))+1 - } - }else{ - months=month - years="0"+((parseInt(year1)-6)+1) - } - }else{ - months=month - years="0"+(parseInt(year2)-6+1) - } - time=months+'-'+years - console.log(month), - console.log(year1), - console.log(year2) - return time - }, + Brands(e){ - // console.log(e.currentTarget.dataset.brand) - console.log(this.times(wx.getStorageSync('newTime'))) - // app.globalData.request({ - // action: 'getCheZhuCarSeriesRankingHome', - // sType: 'Marketing', - // sBrand:e.currentTarget.dataset.brand, - // sStartTime:times(wx.getStorageSync('newTime')), - // sEndTime:wx.getStorageSync('newTime') - // }).then(res => { - // // console.log("这是数据",res) - // this.setData({ - // // mockData:arr - // }) - // } - // ) + var name=e.currentTarget.dataset.brand + // console.log(name) + wx.navigateTo({ + url: '/pages/index/Brandsales/Brandsales?carName='+name, + }) } - // wx.navigateTo({ - // url: '/pages/index/Brandsales/Brandsales', - // }) }, }) \ No newline at end of file diff --git a/pages/index/detailedvolume/detailedvolume.js b/pages/index/detailedvolume/detailedvolume.js index fae2c07..ff610f0 100644 --- a/pages/index/detailedvolume/detailedvolume.js +++ b/pages/index/detailedvolume/detailedvolume.js @@ -13,23 +13,27 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.getData() + console.log(this.options) + this.getData(this.options.brand,this.options.time) }, - getData(){ + getData(carbrand,cartime ){ app.globalData.request({ action: 'getCheZhuCarSeriesListHome', sType: 'Marketing', - // sBrand: wx.getStorageSync('sBrand') || '', - // sSeriesName:wx.getStorageSync("sSeriesName") || '', + sTimeType:'4', + sBrand:carbrand||'', + sStartTime:cartime||'', + sEndTime:cartime||'' }).then(res => { + console.log(res) const arr=[] res.forEach(e => { let obj={ - type:e.carseries, - volume:e.salescount, - level:e.specname, - rank:e.specpm, - ranks:e.salespm + models:e.carseries, + count:e.salescount, + space:e.specname, + specm:e.specpm, + salespm:e.salespm } arr.push(obj) }); diff --git a/pages/index/detailedvolume/detailedvolume.wxml b/pages/index/detailedvolume/detailedvolume.wxml index 72da406..12fde88 100644 --- a/pages/index/detailedvolume/detailedvolume.wxml +++ b/pages/index/detailedvolume/detailedvolume.wxml @@ -12,12 +12,12 @@ - {{item.type}} - {{item.volume}} + {{item.models}} + {{item.count}} - {{item.level}} - {{item.rank}}/{{item.ranks}} + {{item.space}} + {{item.specm}}/{{item.salespm}} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index c84ea66..9e9f260 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -56,6 +56,13 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/index/Brandsales/Brandsales", + "query": "carName=%E5%A5%A5%E8%BF%AA", + "launchMode": "default", + "scene": null } ] }