# Conflicts:
#	pages/index/Brandsales/Brandsales.js
dev
wylyl22 3 years ago
commit 29d36d469d

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

@ -133,12 +133,13 @@ showPopup() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
// onReady: function () {
// //动态设置标题
onReady: function () {
//动态设置标题
// wx.setNavigationBarTitle({
// title:this.data.query.title
// })
// },
},
/**
* 生命周期函数--监听页面显示

@ -284,16 +284,15 @@ Component({
icon: 'loading',
duration: 300000
})
// console.log('picker发送选择改变携带值为', e.detail.value)
this.getTrend(e.detail.value)
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
date: e.detail.value,
})
this.getTrend(e.detail.value)
setTimeout(() =>{
wx.hideToast();
},500),
this.setData({
date: e.detail.value,
})
},500)
},
priceSel(e) {
this.setData({
@ -376,18 +375,5 @@ Component({
show: false
})
},
//页面上拉触底事件的处理函数
onReachBottom: function () {
console.log("上拉触底事件")
let that = this
if (!that.data.loadMore) {
that.setData({
loadMore: true, //加载中
loadAll: false //是否加载完所有数据
});
//加载更多,这里做下延时加载
that.getTrend();
}
},
},
})
Loading…
Cancel
Save