修改解绑表的时候读数问题,抄表路线的抄表记录可以查看图片

This commit is contained in:
2025-10-28 14:25:59 +08:00
parent 2535720023
commit fe590353df
16 changed files with 197 additions and 29 deletions

View File

@@ -0,0 +1,30 @@
// pages/readingHistory/components/detailModal/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
visible: Boolean,
detail: Object,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
showImage() {
this.setData({ show: true })
},
onClose() {
this.setData({ show: false })
}
}
})

View File

@@ -0,0 +1,9 @@
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"van-field": "@vant/weapp/field/index",
"van-image": "@vant/weapp/image/index",
"van-popup": "@vant/weapp/popup/index"
}
}

View File

@@ -0,0 +1,64 @@
<!--pages/readingHistory/components/detailModal/index.wxml-->
<van-dialog
use-slot
title="详情"
show="{{ visible }}"
confirmButtonText="关闭"
bind:close="onClose"
>
<view class="modalContentWrapper">
<van-field
value="{{ detail.readAt }}"
label="时间"
readonly
border="{{ false }}"
use-button-slot
title-width="100rpx"
>
</van-field>
<van-field
value="{{ detail.overall }}"
placeholder="请输入读数"
label="读数"
readonly
type="digit"
border="{{ false }}"
title-width="100rpx"
>
</van-field>
<van-field
wx:if="{{!!detail.url}}"
value="{{ detail.overall }}"
label="图片"
readonly
border="{{ false }}"
title-width="100rpx"
use-button-slot
>
<view slot="input">
<van-image
width="100"
height="100"
fit="contain"
src="{{detail.url}}"
bind:click="showImage"
/>
</view>
</van-field>
</view>
</van-dialog>
<van-popup
show="{{ show }}"
bind:close="onClose"
z-index="99999"
>
<van-image
width="100vw"
height="99.1vh"
fit="contain"
src="{{detail.url}}"
bind:click="onClose"
/>
</van-popup>

View File

@@ -0,0 +1 @@
/* pages/readingHistory/components/detailModal/index.wxss */

View File

@@ -104,6 +104,13 @@ Page({
type: "edit",
})
},
handleDetail(e) {
const { data } = e.currentTarget.dataset;
this.setData({
detail: data,
detailVisible: true
})
},
handleDelete(e) {
const { data } = e.currentTarget.dataset;
const that = this;

View File

@@ -6,7 +6,8 @@
"van-icon": "@vant/weapp/icon/index",
"editModal": "./components/editModal/index",
"pagination": "/components/pagination/index",
"empty": "/components/empty/index"
"empty": "/components/empty/index",
"detailModal": "./components/detailModal/index"
},
"navigationStyle": "custom"
}

View File

@@ -14,8 +14,8 @@
<view class="table">
<view class="thead">
<view class="th" style="width: 40%; text-align: center;"> 抄表时间 </view>
<view class="th" style="width: 35%; text-align: center;"> 抄表读数 </view>
<view class="th" style="width: 25%; text-align: center;"> 操作 </view>
<view class="th" style="width: 30%; text-align: center;"> 抄表读数 </view>
<view class="th" style="width: 30%; text-align: center;"> 操作 </view>
</view>
<view class="tbody">
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
@@ -23,13 +23,14 @@
<view class="th" style="width: 40%; text-align: center; font-size: 30rpx;">
{{ item.readAt }}
</view>
<view class="th" style="width: 35%; text-align: center; font-size: 30rpx;">
<view class="th" style="width: 30%; text-align: center; font-size: 30rpx;">
{{ item.overall }}
</view>
<view class="th" style="width: 25%; text-align: center; justify-content: center; display: flex; align-items: center;">
<view class="th" style="width: 30%; text-align: center; justify-content: center; display: flex; align-items: center;">
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="edit" size="40rpx" bind:tap="handleUpdate" data-data="{{item}}" color="#15755e" />
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="delete" size="40rpx" bind:tap="handleDelete" data-data="{{item}}" color="#15755e" custom-style="margin-left: 20rpx" />
<van-icon name="ellipsis" size="40rpx" data-data="{{item}}" color="#15755e" bind:tap="handleDetail" custom-style="margin-left: 20rpx" />
</view>
</view>
</view>
@@ -58,4 +59,9 @@
bind:ok="onEditFinish"
startTime="{{startTime}}"
routeId="{{routeId}}"
/>
<detailModal
visible="{{detailVisible}}"
detail="{{detail}}"
/>