dev
xiaowen 3 years ago
parent ffaf72c111
commit 316f673989

@ -38,7 +38,7 @@ Component({
detached(e) { // 组件移除
this[this.data.chartId] = null
this[this.data.canvasId] = null
this[this.data.showChart]=false
this[this.data.showChart] = false
},
},
/**
@ -48,9 +48,9 @@ Component({
initChart() {
this[this.data.chartId]?.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, { // 配置图表的配置项
width:width, // 宽度
width: width, // 宽度
height: height, // 高度
devicePixelRatio:dpr// 像素
devicePixelRatio: dpr// 像素
})
chart.setOption(this.getOption())
return chart

@ -1,4 +1,4 @@
<!--pages/components/custom-echarts/index.wxml-->
<view style="height: {{ height }};width:100%">
<view style="height: {{ height }}; width:100%;">
<ec-canvas force-use-old-canvas="{{true}}" wx:if="{{showChart}}" id="{{ chartId }}" canvas-id="eventBar" ec="{{ec}}" options="{{chartOption}}"></ec-canvas>
</view>

@ -59,18 +59,20 @@ Component({
icon: 'rectangle',//data图标样式
itemWidth: 10,//data图标大小
itemHeight: 10,
left: 7,
textStyle: {
fontSize: 9
fontSize: 10,
fontWeight: 400
},
data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'],
// color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'],
data: ['微博', '其他','短视频', '微信','APP', '论坛', '新闻'],
// color:['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF'],
},
//图表位置
grid: {
left: 20,
right: 20,
bottom: 15,
top: 40,
left: 7,
right: 7,
bottom: 7,
top: 36,
containLabel: true
},
yAxis: [
@ -222,16 +224,32 @@ Component({
}
]
}
},
onShow() {
this.getTabBar().init();
lifetimes: {
created() {
wx.removeStorageSync('currTemplateType');
},
attached() {
setTimeout(() => {
},1000)
},
detached(e) {
console.log(2222)
this.setData({
showChart: false
})
},
},
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
changeTab(val) {
console.log(val)
}
}

@ -50,5 +50,10 @@ Page({
onLoad: function (options) {
},
changeTab(val) {
let n = val.detail.index;
this.setData({
active: n
})
}
})

@ -1,12 +1,12 @@
<!--index.wxml-->
<view class="container">
<van-tabs class="menu-tabs" active="{{ active }}" ellipsis="{{false}}" animated="{{true}}">
<van-tabs class="menu-tabs" active="{{ active }}" ellipsis="{{false}}" animated="{{true}}" bind:change="changeTab">
<van-tab wx:for="{{navData}}" title="{{item.text}}" wx:key="index">
<data-child wx:if="{{item.component === 'data-child'}}"></data-child>
<event-child wx:if="{{item.component === 'event-child'}}"></event-child>
<media-child wx:if="{{item.component === 'media-child'}}"></media-child>
<sound-child wx:if="{{item.component === 'sound-child'}}"></sound-child>
<barometer-child wx:if="{{item.component === 'barometer-child'}}"></barometer-child>
<data-child wx:if="{{item.component === 'data-child' && active === 0}}"></data-child>
<event-child wx:if="{{item.component === 'event-child' && active === 1}}"></event-child>
<media-child wx:if="{{item.component === 'media-child' && active === 2}}"></media-child>
<sound-child wx:if="{{item.component === 'sound-child' && active === 3}}"></sound-child>
<barometer-child wx:if="{{item.component === 'barometer-child' && active === 4}}"></barometer-child>
</van-tab>
</van-tabs>
<tabbar />

@ -6,5 +6,5 @@
"urlCheck": false
},
"condition": {},
"libVersion": "2.14.1"
"libVersion": "2.23.4"
}
Loading…
Cancel
Save