a1aca8be99e62ea683fd8d7db82d7a480f5d0305..ae00f214aaeb74d8f3c8e9c6fb0a8c793816f892
2025-07-11 web
fix:修改默认头像
ae00f2 对比 | 目录
2025-07-11 web
fix:修改设备取水状态
397d00 对比 | 目录
2025-07-11 web
fix:修改取水输入限制
79381d 对比 | 目录
已修改2个文件
26 ■■■■ 文件已修改
pages/device/index.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/user/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/device/index.vue
@@ -12,7 +12,8 @@
                        <view class="item-info">
                            <view class="info-name">
                                <view class="name">{{item.facilityName}}</view>
                                <view class="btn" @click="handleQushui(item.id)">取水</view>
                                <view class="btn" v-if="item.state === 2" @click="handleQushui(item.id)">取水</view>
                                <view v-else>设备使用中...</view>
                            </view>
                            <view class="info-addr" @click="openMap(item.lat,item.lon)">
                                <text class="addr-text">地址:{{item.address}}</text>
@@ -28,12 +29,12 @@
        </view>
        <uni-popup ref="qushuiDialog" type="dialog">
            <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="请输入取水量" 
                before-close="true"
                :before-close="true"
                @confirm="dialogConfirm"
                @close="dialogClose"
            >
                <view>
                    <input v-model="qushuiNum" type="number" placeholder="请输入取水量(L)" />
                    <input v-model="qushuiNum" placeholder="请输入取水量(m³)" />
                </view>
            </uni-popup-dialog>
        </uni-popup>
@@ -52,6 +53,8 @@
    const facilityId = ref()
    const qushuiNum = ref()
    
    let timer = null
    const getFacitilyList = () => {
        const data = {
            longitude: userLocation.value?.lon,
@@ -64,6 +67,12 @@
                facitilyList.value = res.data.list
            }
        })
        // 重新挂在定时器
        clearInterval(timer)
        timer = setInterval(() => {
            getFacitilyList()
        }, 10000)
    }
    
    // 取水
@@ -81,9 +90,10 @@
    
    // 确认
    const dialogConfirm = () => {
        if(!qushuiNum.value) {
        let reg = /^(0|([1-9][0-9]*))(\.[\d]+)?$/
        if(!reg.test(qushuiNum.value)) {
            uni.showToast({
                title:'请输入取水量',
                title:'取水量为大于零的数字',
                icon:'none'
            })
            return
@@ -99,6 +109,7 @@
                    icon:'success'
                })
                dialogClose()
                getFacitilyList()
            }else{
                uni.showToast({
                    title:res.msg,
pages/user/index.vue
@@ -3,10 +3,10 @@
        <view class="content">
            <view class="user" @click="setUser">
                <view class="userImg">
                    <image :src="userInfo?.headImg" mode="widthFix"></image>
                    <image :src="userInfo?.headImg ? userInfo.headImg : defaultImg" mode="widthFix"></image>
                </view>
                <view class="info">
                    <text class="name">{{userInfo?.nickName}}</text>
                    <text class="name">{{userInfo?.nickName ? userInfo.nickName : '用户'}}</text>
                </view>
            </view>
            <view class="typeList">
@@ -33,6 +33,7 @@
<script setup>
    import { onMounted, ref } from "vue";
    import { onShow } from "@dcloudio/uni-app"
    import defaultImg from '../../static/images/default-head.png'
    
    const topHeight = ref(0)
    const userInfo = ref()