Browse Source

提交

dev
douzhuo 2 years ago
parent
commit
21125121b5
3 changed files with 116 additions and 111 deletions
  1. +2
    -2
      manifest.json
  2. +112
    -107
      pages/mine/equipment/index.vue
  3. +2
    -2
      utils/domain.js

+ 2
- 2
manifest.json View File

@@ -1,5 +1,5 @@
{
"name" : "去房智控管家",
"name" : "数智工牌",
"appid" : "__UNI__D88F14A",
"description" : "AI营销助理",
"versionName" : "1.1.0",
@@ -91,7 +91,7 @@
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx8f883dca5ecc5510",
"appid" : "wxe044603515ff2cb5",
"setting" : {
"urlCheck" : false,
"es6" : true,


+ 112
- 107
pages/mine/equipment/index.vue View File

@@ -1,9 +1,9 @@
<template>
<view class="cented">
<view style="width: 690rpx;margin: 0 auto;margin-top: 20rpx;">
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei"></u-search>
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei"></u-search>
</view>
<view class="tab-box">
<!-- <view class="tab-item-wrap">
<view v-for="(item, index) in tablist" :key="index" :class="activeClass == index ? 'bottom' : ''" @tap="clocktab(index)">
@@ -11,12 +11,12 @@
<view class="bottomLine" v-if="activeClass == index"></view>
</view>
</view> -->
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass" @change="clocktab()"
inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist" :is-scroll="true">
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass"
@change="clocktab()" inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist" :is-scroll="true">
</u-tabs-swiper>
</view>
<view class="infoet">
<view class="infoviewbox" v-for="(item,index) in newListdata" :key="index">
<view class="infobox1">
@@ -28,23 +28,29 @@
<view class="you11" v-if="item.electricity<20">
<view class="youimg" :style="{ height: item.electricity + '%' }"></view>
</view>
<view class="you2">电量:
<view class="you2">电量:
<text v-if="item.electricity>20">{{item.electricity}}%</text>
<text v-if="item.electricity<20" style="color: red;">{{item.electricity}}%</text>
</view>
<view class="you3">
<image v-if="item.signalDevice==''" class="youimg" src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg" src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg" src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg" src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg" src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg" src="../../../static/images/newimg/xinhao5.png" mode=""></image>
<image v-if="item.signalDevice==''" class="youimg"
src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg"
src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg"
src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg"
src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg"
src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg"
src="../../../static/images/newimg/xinhao5.png" mode=""></image>
</view>
<view class="you4" v-if="item.signalDevice=='' ">信号:0</view>
<view class="you4" v-else>信号:{{item.signalDevice}}</view>
</view>
</view>
<view class="infobox2">
<view class="box2-zuo">设备编号</view>
@@ -53,15 +59,12 @@
<view class="infobox2">
<view class="box2-zuo">录音状态</view>
<view class="box2-you" v-if="item.audioStatus=='false'">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="item.audioStatus=='' ">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="!item.audioStatus">关闭</view>
</view>
<view class="infobox2">
<view class="box2-zuo">待上传</view>
<view class="box2-you"><!--
<template v-if="item.audioUploadStatus=='false'">无上传</template>
<template v-if="item.audioUploadStatus=='true'">上传中</template>
<template v-if="item.audioUploadStatus=='' ">无上传</template> -->
<view class="box2-you">
<template v-if="item.fileCount && item.fileCount > 0">
<text class="stayupload">{{ item.fileCount }}条</text>
</template>
@@ -91,8 +94,7 @@
export default {
data() {
return {
tablist: [
{
tablist: [{
name: "全部(0)",
},
{
@@ -109,29 +111,29 @@
}
],
activeClass: 0,
pageNum:1,
pageSize:20,
imei:"",
orgcode:"",
newListdata:[],
buildingID:'',
jump:''
pageNum: 1,
pageSize: 20,
imei: "",
orgcode: "",
newListdata: [],
buildingID: '',
jump: ''
};
},
onReachBottom() {
this.pageNum +=1;
this.pageNum += 1;
this.init()
},
onLoad(options) {
if(options.active){
this.activeClass=options.active
}else{
this.activeClass=0
if (options.active) {
this.activeClass = options.active
} else {
this.activeClass = 0
}
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.init()
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init()
},
filters: {
formatDate: (dateTimeStamp) => {
@@ -141,113 +143,114 @@
var day = hour * 24;
var halfamonth = day * 15;
var month = day * 30;
var now = new Date().getTime();
var now = new Date().getTime();
var diffValue = now - newDate;
if(diffValue < 0){return;}
var monthC =diffValue/month;
var weekC =diffValue/(7*day);
var dayC =diffValue/day;
var hourC =diffValue/hour;
var minC =diffValue/minute;
var result = '';
if(weekC>=1){
result= "1周前";
}else if(dayC>=1){
result=""+ parseInt(dayC) +"天前";
} else if(hourC>=1){
result=""+ parseInt(hourC) +"小时前";
if (diffValue < 0) {
return;
}
else if(minC>=1){
result=""+ parseInt(minC) +"分钟前";
}else{
result="刚刚";
var monthC = diffValue / month;
var weekC = diffValue / (7 * day);
var dayC = diffValue / day;
var hourC = diffValue / hour;
var minC = diffValue / minute;
var result = '';
if (weekC >= 1) {
result = "1周前";
} else if (dayC >= 1) {
result = "" + parseInt(dayC) + "天前";
} else if (hourC >= 1) {
result = "" + parseInt(hourC) + "小时前";
} else if (minC >= 1) {
result = "" + parseInt(minC) + "分钟前";
} else {
result = "刚刚";
}
return result;
}
},
methods: {
shecs(){
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.init()
shecs() {
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init()
},
// tab
clocktab(index) {
this.activeClass=index;
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.activeClass = index;
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init()
},
init(){
this.buildingID=uni.getStorageSync('buildingID').id;
init() {
this.buildingID = uni.getStorageSync('buildingID').id;
const parames = {
pageNum: this.pageNum,
pageSize: this.pageSize,
query:{
imei:this.imei,
onLine:this.activeClass,
propertyId:this.buildingID,
orderType:1
query: {
imei: this.imei,
onLine: this.activeClass,
propertyId: this.buildingID,
orderType: 1
}
}
if(this.activeClass==0){
parames.query.onLine=null
if (this.activeClass == 0) {
parames.query.onLine = null
}
this.$u.post("/equipment/apiFindByPage", parames).then(res => {
this.tablist[0].name="全部("+res.allCount+")";
this.tablist[1].name="在线("+res.eqOnLineCount+")";
this.tablist[2].name="低电量("+res.lowElectricityCount+")";
this.tablist[3].name="今日活跃("+res.activeCount+")";
this.tablist[4].name="离线("+res.eqOffLineCount+")";
if(res.obj.list.results==null){
if (this.pageNum == 1){
this.tablist[0].name = "全部(" + res.allCount + ")";
this.tablist[1].name = "在线(" + res.eqOnLineCount + ")";
this.tablist[2].name = "低电量(" + res.lowElectricityCount + ")";
this.tablist[3].name = "今日活跃(" + res.activeCount + ")";
this.tablist[4].name = "离线(" + res.eqOffLineCount + ")";
if (res.obj.list.results == null) {
if (this.pageNum == 1) {
return
}else{
} else {
uni.showToast({
title: '已经到底了!',
duration: 2000
title: '已经到底了!',
duration: 2000
});
}
}else{
res.obj.list.results.forEach(item=>{
if(item.onLine==0){
item.signalDevice=0
} else {
res.obj.list.results.forEach(item => {
if (item.onLine == 0) {
item.signalDevice = 0
}
if(item.electricity==''){
item.electricity=0
if (item.electricity == '') {
item.electricity = 0
}
if(item.electricity>100){
item.electricity=100
if (item.electricity > 100) {
item.electricity = 100
}
let num=this.ascformatDate(item.updateTime)
if(num>12){
item.electricity=0
let num = this.ascformatDate(item.updateTime)
if (num > 12) {
item.electricity = 0
}
})
if (this.pageNum == 1) {
this.newListdata=res.obj.list.results
this.newListdata = res.obj.list.results
} else {
this.newListdata = [...this.newListdata, ...res.obj.list.results];
this.newListdata = [...this.newListdata, ...res.obj.list.results];
}
}
})
},
ascformatDate(dateTimeStamp){
ascformatDate(dateTimeStamp) {
let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime();
let minute = 1000 * 60;
let hour = minute * 60;
let day = hour * 24;
let halfamonth = day * 15;
let month = day * 30;
let now = new Date().getTime();
let now = new Date().getTime();
let diffValue = now - newDate;
let result =diffValue/hour;
let result = diffValue / hour;
return result;
}
},
@@ -372,6 +375,7 @@
background-color: #333333;
}
}

.you11 {
width: 20rpx;
height: 28rpx;
@@ -380,7 +384,7 @@
background-size: 100% 100%;
display: flex;
flex-direction: column-reverse;
.youimg {
width: 100%;
background-color: red;
@@ -395,6 +399,7 @@
color: #333333;
margin-left: 6rpx;
}

.you22 {
width: 114rpx;
height: 30rpx;
@@ -451,7 +456,7 @@
font-size: 24rpx;
color: #333333;
text-indent: 30rpx;
.stayupload {
color: #F41313;
}


+ 2
- 2
utils/domain.js View File

@@ -4,8 +4,8 @@
// const baseUrl = 'http://192.168.31.167:8080/autoSR/api'; // 长龙
// const baseUrl = 'http://192.168.31.134:8080/autoSR/api'; // 佳豪
// const baseUrl = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏
const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式
// const baseUrl = 'https://hfju.com/api'; // 数智正式
// const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式
const baseUrl = 'https://hfju.com/api'; // 数智正式


// config使用域名


Loading…
Cancel
Save