修改缴费记录按年查询错误的问题

This commit is contained in:
qiaomu 2024-05-08 15:32:50 +08:00
parent aab3819a9d
commit 2d59d0eb8c
5 changed files with 59 additions and 25 deletions

View File

@ -1,6 +1,7 @@
.ec-canvas { .ec-canvas {
position: static !important; position: relative !important;
float: none; float: none;
width: 700rpx; width: 700rpx;
height: 700rpx; height: 700rpx;
z-index: 0 !important;
} }

View File

@ -3,7 +3,18 @@ import { alertInfo } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
const { OK } = request const { OK } = request
const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
// pages/billDetail/index.js // pages/billDetail/index.js
Page({ Page({
@ -81,24 +92,29 @@ Page({
{ value: 187.56, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } }, { value: 187.56, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
], ],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
} }
] ]
}; };
this.init_pieCharts(option); this.init_pieCharts(option);
const that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
statusBarHeight : res.statusBarHeight,
navBarHeight : res.statusBarHeight , // 顶部导航栏高度为 44px
jiaonangheight: wx.getMenuButtonBoundingClientRect().height, // 胶囊高度
jiaonangwidth:wx.getMenuButtonBoundingClientRect().width,
})
},
})
}, },
init_pieCharts: function(options) { init_pieCharts: function(options) {
this.selectComponent('#echarts').init((canvas, width, height) => { this.selectComponent('#echarts').init((canvas, width, height) => {
// 初始化图表 // 初始化图表
const pieChart = echarts.init(canvas, null, { const pieChart = echarts.init(canvas, null, {
width: width, width: width,
height: height height: height,
devicePixelRatio: getPixelRatio(),
}); });
pieChart.setOption(options); pieChart.setOption(options);
@ -117,14 +133,31 @@ Page({
confirmText: '复制链接', confirmText: '复制链接',
complete: (res) => { complete: (res) => {
if (res.cancel) {
}
if (res.confirm) { if (res.confirm) {
wx.setClipboardData({ const result = wx.getAccountInfoSync();
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`, const { envVersion } = result.miniProgram;
}) let api = ""
switch (envVersion) {
// 开发版
case 'develop':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`,
})
break;
// 体验版
case 'trial':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/h5/?report=${id}&tenement=${tenement}`,
})
break;
// 正式版
case 'release':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/reporth5/?report=${id}&tenement=${tenement}`,
})
break;
}
} }
} }
}) })

View File

@ -1,6 +1,6 @@
<!--pages/billDetail/index.wxml--> <!--pages/billDetail/index.wxml-->
<navigator title="{{ time }}电费账单" canBack="{{true}}" /> <navigator title="{{ time }}电费账单" canBack="{{true}}" />
<view class="title"> <view class="title" style="top: {{statusBarHeight + 46}}px">
<avatar text="{{detail.tenement.shortName}}" /> <avatar text="{{detail.tenement.shortName}}" />
<view class="titleContent"> <view class="titleContent">
<view class="park"> <view class="park">
@ -51,12 +51,12 @@
<view class="line"></view> <view class="line"></view>
<view class="contentTitle"> 电费构成 </view> <view class="contentTitle"> 电费构成 </view>
<echarts <echarts
style="width:200rpx;height:200rpx;" style="width:200rpx;height:180rpx;"
id="echarts" id="echarts"
class='mychart-bar' class='mychart-bar'
canvas-id="mychart-bar" canvas-id="mychart-bar"
ec="{{ ec }}" ec="{{ ec }}"
forceUseOldCanvas="{{true}}" forceUseOldCanvas="{{false}}"
> >
</echarts> </echarts>
<view class="tooltip"> <view class="tooltip">

View File

@ -6,8 +6,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: sticky; position: sticky;
top: 66px; z-index: 99 !important;
z-index: 99;
} }
.titleContent { .titleContent {

View File

@ -65,15 +65,16 @@ Page({
}, },
onChangeYear(e) { onChangeYear(e) {
const { years, tenement } = this.data; const { years, codeId } = this.data;
const currentYear = years[Number(e)] const currentYear = e
console.log('e', e, 'currentYear', currentYear, 'years', years)
this.setData({ this.setData({
year: currentYear, year: currentYear,
type: "", type: "",
show: false, show: false,
title: "" title: ""
}) })
this.init(currentYear, tenement) this.init(currentYear, codeId)
}, },
onChangeMeter(e) { onChangeMeter(e) {
const { id, code } = e; const { id, code } = e;