6170分享设备页面功能开发

This commit is contained in:
fengerli
2025-07-19 10:22:48 +08:00
parent bc3bea6df0
commit 1663ae75e4
9 changed files with 321 additions and 89 deletions

View File

@ -21,39 +21,46 @@
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
style="height:80vh;">
<uni-swipe-action ref="swipeAction">
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options" @click="handleSwipeClick($event, item, index)"
class="device-card">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
<image :src="item.devicePic" class="IMG"></image>
</view>
<view class="device-name">
<view>设备:{{item.deviceName}}</view>
<view class="ID">
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}
<view v-if="deviceList.length>0">
<uni-swipe-action ref="swipeAction">
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options"
@click="handleSwipeClick($event, item, index)" class="device-card">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
<image :src="item.devicePic" class="IMG"></image>
</view>
<view class="device-name">
<view>设备:{{item.deviceName}}</view>
<view class="ID">
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}
</view>
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
<view class="onlines" v-if="item.communicationMode==0">在线</view>
<view>电量90%</view>
</view>
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
<view class="onlines" v-if="item.communicationMode==0">在线</view>
<view>电量90%</view>
</view>
</view>
<view class="" v-if="item.communicationMode==1">
<view class="device-status online">已连接</view>
<view class="device-status unline">未连接</view>
</view>
</view>
<view class="" v-if="item.communicationMode==1">
<view class="device-status online">已连接</view>
<view class="device-status unline">未连接</view>
</view>
</view>
<image src="/static/images/cires.png" class="circle"></image>
</uni-swipe-action-item>
</block>
</uni-swipe-action>
<!-- 加载状态提示 -->
<view class="loading-status">
<text v-if="loading">加载中...</text>
<text v-if="finished">没有更多数据了</text>
<image src="/static/images/cires.png" class="circle"></image>
</uni-swipe-action-item>
</block>
</uni-swipe-action>
<!-- 加载状态提示 -->
<view class="loading-status">
<text v-if="loading">加载中...</text>
<text v-if="finished">没有更多数据了</text>
</view>
</view>
<view v-else class="noDATA">
<view> <uni-icons type="image-filled" size="120" color="rgba(255, 255, 255, 0.9)"></uni-icons>
</view>
暂无数据
</view>
</scroll-view>
</view>
@ -420,6 +427,7 @@
// 绑定页面做了监听,新增成功,刷新页面
uni.$on('refreshDeviceList', () => {
this.getTab() // 刷新数据
this.onIntall()
});
},
beforeDestroy() {
@ -592,6 +600,7 @@
width: 68rpx;
height: 50rpx;
margin-left: 17%;
object-fit: contain;
}
.onlines {
@ -625,6 +634,11 @@
padding: 20rpx;
font-size: 22rpx;
}
.noDATA{
text-align: center;
color: rgba(255, 255, 255, 0.87);
transform: translate(-0%,100%);
}
/* 遮罩层 */
.agreement-mask {

View File

@ -55,15 +55,14 @@
<script>
import {
login,
sendRegisterSms
resourceSmsCode
} from '@/api/common/login.js';
export default {
data() {
return {
showView: false,
//codebtn: '获取验证码',
phone: '13058067817', //手机号码
code: "123456", //验证码
code: "", //验证码
agreed: false,
isCounting: false,
countdown: 0,
@ -92,15 +91,20 @@
return false;
}
try {
// 调用发送验证码接口
await sendRegisterSms({
phoneNumber: this.phone
await resourceSmsCode({
phonenumber: this.phone
})
//倒计时
// 更新倒计时状态
this.isCounting = true;
this.showView = true;
this.countdown = 60
const timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) clearInterval(timer)
if (this.countdown <= 0) {
clearInterval(timer)
this.isCounting = false;
this.showView = false;
}
}, 1000)
uni.showToast({
title: '验证码已发送',
@ -146,7 +150,7 @@
tenantId: '894078' //租户ID
})
if (res.code == 200) {
console.log(res,'ressss');
console.log(res, 'ressss');
uni.hideLoading()
uni.setStorageSync('token', res.data.access_token) // 缓存token
uni.setStorageSync('clientID', res.data.client_id) // 缓存token
@ -257,7 +261,7 @@
}
.blue {
color: rgba(255, 255, 255, 0.6);
color: rgb(187, 230, 0);
}
.agreement {

View File

@ -1,7 +1,6 @@
<template>
<view class="page-section page-section-gap">
<map class="map" :latitude="latitude" :longitude="longitude":show-location="true"
:markers="covers">
<map class="map" :latitude="latitude" :longitude="longitude":show-location="true">
</map>
</view>
</template>