Commit 0e0d0f69 authored by 王炽's avatar 王炽

图标优化

parent e90f06f6
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
<text class="graph-title-text">{{getYAxisLabel()}}</text> <text class="graph-title-text">{{getYAxisLabel()}}</text>
</view> </view>
<view class="graph-container"> <view class="graph-container">
<canvas class="curve-canvas" canvas-id="growthCurve" :style="{ width: 630 + 'rpx', height: '100%' }" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd"></canvas> <canvas class="curve-canvas" canvas-id="growthCurve" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd"></canvas>
</view> </view>
<view class="graph-title-x"> <view class="graph-title-x">
<text class="graph-title-text">月龄</text> <text class="graph-title-text">月龄</text>
...@@ -727,12 +727,13 @@ onMounted(async () => { ...@@ -727,12 +727,13 @@ onMounted(async () => {
await shengzhangStore.getGrowthCurveData(babyDataHead); await shengzhangStore.getGrowthCurveData(babyDataHead);
//默认展示身高 // //默认展示身高--用户数据
curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoHeight.userDataPoints,'height'); // curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoHeight.userDataPoints,'height');
// 初始化绘制曲线 // debugger;
setTimeout(() => { // // 初始化绘制曲线
drawGrowthCurve() // setTimeout(() => {
}, 100) // drawGrowthCurve()
// }, 100)
}else{ }else{
...@@ -740,6 +741,10 @@ onMounted(async () => { ...@@ -740,6 +741,10 @@ onMounted(async () => {
shengzhangInfo = {...shengzhangStore.shengzhangInfo}; shengzhangInfo = {...shengzhangStore.shengzhangInfo};
} }
//默认展示身高--用户数据
curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoHeight.userDataPoints,'height');
shareText.value = shengzhangInfo?.content?.shareText; shareText.value = shengzhangInfo?.content?.shareText;
console.log('shareText.value=', shareText.value); console.log('shareText.value=', shareText.value);
//分析结果处理 //分析结果处理
...@@ -1161,7 +1166,7 @@ const onTouchMove = (e) => { ...@@ -1161,7 +1166,7 @@ const onTouchMove = (e) => {
// drawGrowthCurve() // 重新绘制图表 // drawGrowthCurve() // 重新绘制图表
// } // }
const maxOffset = Math.max(0, totalWidth.value - canvasWidth.value -20) const maxOffset = Math.max(0, totalWidth.value - canvasWidth.value + 10)
if (newOffset <= 0) { if (newOffset <= 0) {
scrollOffset.value = 0; scrollOffset.value = 0;
} else if (newOffset >= maxOffset) { } else if (newOffset >= maxOffset) {
...@@ -1812,13 +1817,13 @@ const onTouchEnd = () => { ...@@ -1812,13 +1817,13 @@ const onTouchEnd = () => {
.graph-container { .graph-container {
position: relative; position: relative;
height: 400rpx; height: 400rpx;
width: 630rpx; width: 660rpx;
background-color: #fff; background-color: #fff;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; // 添加遮罩效果,超出部分不展示 overflow: hidden; // 添加遮罩效果,超出部分不展示
.curve-canvas { .curve-canvas {
width: 100%; width: 660rpx;
height: 100%; height: 100%;
display: block; display: block;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment