Merge branch 'dd-7' of git.oa00.com:xiaowen/swsWecat into dd-7

* 'dd-7' of git.oa00.com:xiaowen/swsWecat:
  wyl
  cxw-010203
  cxw-010203
dev
liuyongli 3 years ago
commit bf556dc308

@ -52,7 +52,7 @@
{
"pagePath": "pages/brandCrisis/index",
"iconPath": "/custom-tab-bar/icons/appSearch.png",
"selectedIconPath": "/custom-tab-bar/icons/appSearchActive.png",
"selectedIconPath": "",
"text": "品牌搜索"
},
{

@ -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)
})
})
},
},
})

@ -3,16 +3,16 @@
<time-component bindchange="changeTime"></time-component>
<view class="brand">
<view class="text" bindtap="a">热门词云</view>
<word-cloud list="{{HotWords}}" width="100%" height="200"></word-cloud>
<word-cloud wx:if="{{showTu}}" list="{{HotWords}}" width="100%" height="200"></word-cloud>
</view>
<!-- <view class="brand">
<view class="brand">
<view class="text">正面词云</view>
<view>
<word-cloud class="wordtext" list="{{PositiveWords}}" width="680rpx" height="130"></word-cloud>
<word-cloud wx:if="{{showTu}}" class="wordtext" list="{{PositiveWords}}" width="680rpx" height="130"></word-cloud>
</view>
</view>
<view class="brand">
<view class="text">负面词云</view>
<word-cloud class="wordtext" list="{{NegativeWords}}" width="680rpx" height="130"></word-cloud>
</view> -->
<word-cloud wx:if="{{showTu}}" class="wordtext" list="{{NegativeWords}}" width="680rpx" height="130"></word-cloud>
</view>
</view>

@ -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

@ -6,7 +6,7 @@
.wc-main {
position: relative;
margin-left: -40%;
margin-top: -15%;
margin-top: 0px;
}
.wc-item {
white-space: nowrap;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

@ -19,7 +19,7 @@ Component({
{
"pagePath": "pages/brandCrisis/index",
"iconPath": "icons/appSearch.png",
"selectedIconPath": "icons/appSearchActive.png",
"selectedIconPath": "",
"text": "",
diyClass: 'diy'
},

@ -1,5 +1,6 @@
<view class="tab-bar">
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item {{item.diyClass}}" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<view wx:if="{{item.diyClass}}" class="tab-middle"></view>
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}" class="{{item.diyClass}}" mode="aspectFit"/>
<view style="color: {{selected === index ? selectedColor : color}}" class="{{item.diyClass}} {{item.diyClass ? 'activeBg' : ''}}">{{item.text}}</view>
</view>

@ -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;
}

@ -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,

@ -1,31 +1,31 @@
<view class="bc-container">
<view class="bc-top" style="background-color: {{topBg}};">
<view class="bc-top-inner" style="{{healthCrisis}}" wx:if="{{healthIndex < 60}}">
<view class="bc-c-j" style="margin-top: 100rpx;">健康指数</view>
<view class="bc-c-j" style="margin-top: 30rpx;">健康指数</view>
<view class="bc-top-fen" style="color: #FF3A30">{{healthIndex}}</view>
<view class="bc-top-btn1">{{healthIndexMsg}}</view>
<view class="bc-brand">{{headlBrand}}</view>
</view>
<view class="bc-top-inner" style="{{healthGood}}" wx:if="{{healthIndex >= 90}}">
<view class="bc-c-j" style="margin-top: -60rpx;">健康指数</view>
<view class="bc-c-j" style="margin-top: -100rpx;">健康指数</view>
<view class="bc-top-fen" style="color: #0284FF">{{healthIndex}}</view>
<view class="bc-top-btn1" style="color: #0084FF">{{healthIndexMsg}}</view>
<view class="bc-brand">{{headlBrand}}</view>
</view>
<view class="bc-top-inner" style="{{healthGenerally}}" wx:if="{{80 <= healthIndex && healthIndex < 90}}">
<view class="bc-c-j" style="margin-top: -40rpx;">健康指数</view>
<view class="bc-c-j" style="margin-top: -100rpx;">健康指数</view>
<view class="bc-top-fen" style="color: #00CA2F">{{healthIndex}}</view>
<view class="bc-top-btn1" style="color: #00CA2F">{{healthIndexMsg}}</view>
<view class="bc-brand">{{headlBrand}}</view>
</view>
<view class="bc-top-inner" style="{{healthMedium}}" wx:if="{{70 <= healthIndex && healthIndex < 80}}">
<view class="bc-c-j" style="margin-top: 0rpx;">健康指数</view>
<view class="bc-c-j" style="margin-top: -60rpx;">健康指数</view>
<view class="bc-top-fen" style="color: #FFCC01">{{healthIndex}}</view>
<view class="bc-top-btn1" style="color: #FFCC01">{{healthIndexMsg}}</view>
<view class="bc-brand">{{headlBrand}}</view>
</view>
<view class="bc-top-inner" style="{{healthWarning}}" wx:if="{{60 <= healthIndex && healthIndex < 70}}">
<view class="bc-c-j" style="margin-top: 90rpx;">健康指数</view>
<view class="bc-c-j" style="margin-top: 16rpx;">健康指数</view>
<view class="bc-top-fen" style="color: #FF9500">{{healthIndex}}</view>
<view class="bc-top-btn1" style="color: #FF9500 ">{{healthIndexMsg}}</view>
<view class="bc-brand">{{headlBrand}}</view>

@ -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;
}

@ -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<num;j++){
var sum=0
for(let a=0;a<obj[time[j]].length;a++){
sum+= parseInt( obj[time[j]][a].salescount)
}
arr.push({times:time[j],sales:sum,share:((sum/totalSum)*100).toFixed(2),brand:carName})
}
this.setData({
ranking:arr
})
})
},
priceSel(e){
this.setData({
priceSelected: e.currentTarget.dataset.index
})
},
//详情跳转
detail(){
detail(e){
console.log(e)
const carBrand=e.currentTarget.dataset.carbrand
const carTime=e.currentTarget.dataset.cartime
// console.log(carbrand,carTime)
wx.navigateTo({
url: '/pages/index/detailedvolume/detailedvolume',
url: '/pages/index/detailedvolume/detailedvolume?brand='+carBrand+"&time="+carTime,
})
},
showPopup() {
this.setData({ show: true });
},
onClose() {
this.setData({ show: false });
},
@ -123,22 +107,28 @@ showPopup() {
currentDate: event.detail,
});
},
// 点击日期组件确定事件
// // 点击日期组件确定事件
bindDateChange: function (e) {
// console.log(this.data)
// this.getData('',this.data.date,"")
this.setData({
date: e.detail.value
date:e.detail.value
})
},
bindDateChange2: function (e) {
// this.getData("","",this.data.date)
this.setData({
date2: e.detail.value
date2: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getData()
// console.log("这是时间",this.res.ranking)
// console.log("123",this.options.carName)
this.getData(this.options.carName)
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -154,24 +144,16 @@ showPopup() {
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onShow: function (options) {
// console.log(this.data)
// this.getData(this.options.carName)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
@ -179,17 +161,4 @@ showPopup() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

@ -9,7 +9,7 @@
</van-popup> -->
<!-- 底部 -->
<view class="section" style="padding:20rpx">
<picker mode="date" value="{{date}}" start="1800-01-01" end="{{end}}" bindchange="bindDateChange">
<picker mode="date" value="{{date}}" end="{{end}}" bindchange="bindDateChange">
<view class="picker">
{{date}}
</view>
@ -18,7 +18,7 @@
</view>
<view class="line">——</view>
<view class="section" style="padding:20rpx">
<picker mode="date" value="{{date2}}" start="1800-01-01" end="{{end}}" bindchange="bindDateChange2">
<picker mode="date" value="{{date2}}" end="{{end}}" bindchange="bindDateChange2">
<view class="picker">
{{date2}}
</view>
@ -36,11 +36,11 @@
</view>
<view class="ranks" wx:for="{{ranking}}" wx:key="index" data-ranking='{{item}}'>
<view style="display: flex;">
<view class="time_text" style="width: 30%;"> {{item.time}}</view>
<view class="media_text" style="width: 30%;">{{item.vehicle}}</view>
<view class="time_text" style="width: 30%;"> {{item.times}}</view>
<view class="media_text" style="width: 30%;">{{item.sales}}</view>
<view style="width: 30%;">
<view class="volume">{{item.share}}</view>
<view class="trend" bindtap="detail">
<view class="trend" bindtap="detail" data-carTime="{{item.times}}" data-carBrand="{{item.brand}}">
<view>详细销量</view>
</view>
</view>

@ -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',
// })
},
})

@ -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)
});

@ -12,12 +12,12 @@
</view>
<view class="container" wx:for="{{content}}" wx:key="index" data-content='{{item}}'>
<view class="box_left">
<view class="title">{{item.type}} </view>
<view class="num">{{item.volume}}</view>
<view class="title">{{item.models}} </view>
<view class="num">{{item.count}}</view>
</view>
<view class="box_right">
<view class="title">{{item.level}}</view>
<view class="title">{{item.rank}}/{{item.ranks}}</view>
<view class="title">{{item.space}}</view>
<view class="title">{{item.specm}}/{{item.salespm}}</view>
</view>
</view>
</view>

@ -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
}
]
}

Loading…
Cancel
Save