修改时间冒泡的问题,调整电表详情

This commit is contained in:
2025-09-28 16:06:27 +08:00
parent a2f92a0959
commit 87bb23a9a4
7 changed files with 38 additions and 22 deletions

View File

@@ -15,7 +15,10 @@
{{ meterInfo.address }}
</view>
<view class="meterType">
<van-tag type="primary">华昌宝能收费</van-tag>
<van-tag type="primary" custom-style="width: 100%;" wx:if="{{meterInfo.feeType === 1}}">物业代收1</van-tag>
<van-tag type="primary" custom-style="width: 100%;" wx:elif="{{meterInfo.feeType === 2}}">物业代收2</van-tag>
<van-tag type="primary" custom-style="width: 100%;" wx:elif="{{meterInfo.feeType === 3}}">物业代收线损</van-tag>
<van-tag type="primary" custom-style="width: 100%;" wx:else>华昌宝能收费</van-tag>
</view>
</view>
@@ -50,23 +53,25 @@
<van-col span="12">
<view class="text">
<view class="titleText">
状态
建筑
</view>
<view wx:if="{{meterInfo.enabled}}">
<!-- <view wx:if="{{meterInfo.enabled}}">
正常
</view>
<view wx:else>
停用
</view>
</view> -->
<view> {{ meterInfo.buildingName || "-" }} </view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view class="titleText">
读数
楼层
</view>
<view>
{{meterInfo.overall}}
{{ meterInfo.floor || "-" }}
<!-- {{meterInfo.overall}} -->
</view>
</view>
</van-col>

View File

@@ -20,6 +20,15 @@
.info .title .address {
font-size: 36rpx;
font-weight: 800;
flex: 1;
margin-right: 24rpx;
word-break: break-all;
}
.info .title .meterType {
display: flex;
justify-content: end;
width: 180rpx;
}
.info .detail {

View File

@@ -23,7 +23,7 @@ Component({
if (newActive === 0) {
this.setData({ scrollLeft: 0 })
} else if (newActive > 0) {
this.setData({ scrollLeft: 220 * newList.length - 20 })
this.setData({ scrollLeft: (220 * (newActive) - 20) + "rpx" })
}
const { scrollWidth } = this.data;
if (scrollWidth) {
@@ -114,7 +114,8 @@ Component({
// });
// },
scrollLeft() {
handleScrollLeft() {
console.log("left--------------")
// 向左滚动:减少 scrollLeft但不能小于0
const newScrollLeft = Math.max(0, this.data.scrollLeft - 200);
this.setData({
@@ -122,7 +123,8 @@ Component({
});
},
scrollRight() {
handleScrollRight() {
console.log("right-----------------")
// 向右滚动:增加 scrollLeft但不能超过 maxScrollLeft
const newScrollLeft = Math.min(this.data.maxScrollLeft, this.data.scrollLeft + 200);
this.setData({

View File

@@ -5,13 +5,13 @@
<text> 电表列表 (总计{{list.length}}块,已抄{{list.length - finishNumber}}块) </text>
</view>
<view style="display: flex; align-items: center;margin-top: 20rpx;">
<van-icon name="arrow-left" size="50rpx" bind:tap="scrollLeft" />
<!-- <van-icon name="arrow-left" size="50rpx" bind:tap="handleScrollLeft" /> -->
<scroll-view
scroll-x="{{true}}"
class="meterListScrollView"
scroll-left="{{scrollLeft}}"
bindscroll="onScroll"
scroll-with-animation="true"
scroll-with-animation="{{true}}"
scroll-anchoring="{{true}}"
>
<view style="display: flex;" class="scroll-content">
<meter-item
@@ -19,14 +19,13 @@
wx:for="{{list}}"
wx:key="id"
meter="{{item}}"
bind:click="handleSelect"
catch:click="handleSelect"
data-index="{{index}}"
data-id="{{item.meterId}}"
status="{{item.status}}"
/>
</view>
</scroll-view>
<van-icon name="arrow" size="50rpx" bind:tap="scrollRight" />
<!-- <van-icon name="arrow" size="50rpx" bind:tap="handleScrollRight" /> -->
</view>
</view>

View File

@@ -26,7 +26,7 @@ Component({
this.checkFinish(newValue)
},
"meterInfo": function(newValue) {
console.log("workStatus------------", newValue)
}
},
/**

View File

@@ -11,8 +11,9 @@
<meter-info
meterInfo="{{meterInfo}}"
routeId="{{routeId}}"
disabled="{{meterInfo.status === 1}}"
disabled="{{meterList[active].status === 1}}"
/>
<reading-info
meterInfo="{{meterInfo}}"
showLeft="{{active !== 0}}"
@@ -22,5 +23,5 @@
routeId="{{routeId}}"
bind:finishNumber="onSetFinishNumber"
bind:onSubmit="onSubmit"
disabled="{{meterInfo.status === 1}}"
disabled="{{meterList[active].status === 1}}"
/>