Commit 8bc844d1 authored by 冯超鹏's avatar 冯超鹏

主页设备

parent a2672513
......@@ -26,7 +26,11 @@
"navigationBarTitleText": "我的"
}
},{
"path": "pages/adddevice/home",
"path": "pages/basics/deviceinfo",
"style": {
}
},{
"path": "pages/basics/devicerecording",
"style": {
}
}
......
<template>
<view>
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">{{ devicedata.devicenum }}设备详情</block>
</cu-custom>
<!-- 设备详情开始 -->
<view class="cu-list menu" style="margin-top: 20upx;">
<view class="cu-item">
<view class="content">
<text class="cuIcon-titles text-grey"></text>
<text class="text-grey">ID:<text style="color: black;">{{ devicedata.id }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-similar text-grey"></text>
<text class="text-grey">设备号:<text style="color: black;"> {{ devicedata.devicenum }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-newsfill text-grey"></text>
<text class="text-grey">设备名称: <text style="color: black;">{{ devicedata.username }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-profile text-grey"></text>
<text class="text-grey">用户名称:<text style="color: black;">{{ devicedata.nameh }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-btn text-grey"></text>
<text class="text-grey">设备类型:<text style="color: black;">{{ devicedata.tname }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-post text-grey"></text>
<text class="text-grey">设备介质:<text style="color: black;">{{ devicedata.gas }}/{{ devicedata.nd }}/{{ devicedata.danwei }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-sort text-grey"></text>
<text class="text-grey">设备单位:<text style="color: black;">{{ devicedata.gas }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-title text-grey"></text>
<text class="text-grey">实时设备状态:<text :style="devicedata.status_name === '正常' ? 'color:green;' : 'color:red;' ">{{ devicedata.status_name }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-deletefill text-grey"></text>
<text class="text-grey">是否被丢弃废纸篓:<text :style="devicedata.delete === 1 ? 'color:red' : 'color:green'">{{ devicedata.delete === 1 ? '设备丢弃' : '设备正常' }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-ellipse text-grey"></text>
<text class="text-grey">设备所属:<text style="color: black;">{{ devicedata.isadmin === 1 ? '设备所属管理员' : "设备所属用户" }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-usefull text-grey"></text>
<text class="text-grey">设备联系人:<text style="color: black;">{{ devicedata.devicelinkman }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-shake text-grey"></text>
<text class="text-grey">设备手机号:<text style="color: black;" @click="phonect(devicedata.devicephone)">{{ devicedata.devicephone }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-infofill text-grey"></text>
<text class="text-grey">设备详情:<text style="color: black;">{{ devicedata.deviceinfo }}</text></text>
</view>
</view>
<view class="cu-item">
<view class="content">
<text class="cuIcon-timefill text-grey"></text>
<text class="text-grey">添加时间:<text style="color: black;">{{ devicedata.deviceaddtime | timeStamp }}</text></text>
</view>
</view>
</view>
</view>
</template>
<script>
import http from '@/components/utils/http.js';
export default {
data() {
return {
devicedata: [],
}
},
methods: {
//拨打电话
phonect(phone){
if (!phone) return '';
uni.makePhoneCall({
phoneNumber: phone, //仅为示例
});
},
},
filters: {
timeStamp: function(value) {
if (!value) return '';
var date = new Date(value * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var year = date.getFullYear();
var month = ("0" + (date.getMonth() + 1)).slice(-2);
var sdate = ("0" + date.getDate()).slice(-2);
var hour = ("0" + date.getHours()).slice(-2);
var minute = ("0" + date.getMinutes()).slice(-2);
var second = ("0" + date.getSeconds()).slice(-2);
// 拼接
var result = year + "." + month + "." + sdate + " " + hour + ":" + minute //+ ":" + second;
// 返回
return result;
},
},
onLoad(e) {
var data = JSON.parse(e.data);
this.devicedata = data;
}
}
</script>
<style>
</style>
<template>
<view style="background-color: #F0F0F0;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">设备记录</block>
</cu-custom>
<view>
<view class="cu-timeline" v-for="(item,index) in devicedata">
<view class="cu-item">
<view class="content">
<view class="cu-capsule radius">
<view class="cu-tag bg-cyan">时间</view>
<view class="cu-tag line-cyan">{{ item.time | timeStamp }}</view>
</view>
<view class="margin-top">
<view>用户ID:{{ item.user_id }}</view>
<view>值:{{ item.value }}</view>
<view>设备状态:<text :style="item.device_status != 1 ? 'color:red' : 'color:green;'">{{ item.device_status != 1 ? '异常' : '正常' }}</text></view>
<view>设备编号:{{ item.device_num }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import http from '@/components/utils/http.js';
export default {
data() {
return {
devicedata: [],
}
},
methods: {
deviceinfo(total, device_num) {
let data = {
currentPage: 1,
deviceNum: device_num,
deviceStatus: 0,
pageSize: total,
timeRange: '',
total: 1,
};
let opts = {
url: 'devices/detedevice',
method: 'post'
};
http.httpRequest(opts, data).then(res => {
this.devicedata = res.data.data.list
}, error => {
console.log(error);
})
},
},
filters: {
timeStamp: function(str) {
if (!str) return '';
var result;
var reg = /[a-zA-Z]+/;
while (result = str.match(reg)) {
str = str.replace(result[0], ' ');
}
return str;
},
},
onLoad(e) {
var data = JSON.parse(e.data);
this.deviceinfo(data.total, data.list[0].device_num);
}
}
</script>
<style>
</style>
......@@ -48,7 +48,7 @@
<canvas style="width: 100%;height: 360upx;" canvas-id="canvasColumnStack" id="canvasColumnStack" @touchstart="touchColumn"></canvas>
<!--#endif-->
<!--#ifndef MP-ALIPAY -->
<canvas style="width: 100%;height: 360upx;" canvas-id="canvasColumnStack" id="canvasColumnStack" @touchstart="touchColumn"></canvas>
<canvas style="width: 100%;height: 360upx;" canvas-id="canvasColumnStack" id="canvasColumnStack" @touchstart="touchColumn"></canvas>
<!--#endif-->
</view>
<!-- 设备分类 -->
......@@ -89,8 +89,8 @@
<view :class="item.status_name === '正常'? 'cu-tag bg-green' : 'cu-tag bg-red' ">{{item.status_name}}</view>
</view>
<view class="move">
<view class="bg-grey">查详情</view>
<view class="bg-red">查记录</view>
<view class="bg-grey" @click="devicedatainfo(item.id)">查详情</view>
<view class="bg-red" @click="devicerecording(item.devicenum)">查记录</view>
</view>
</view>
<view class="loadingjiazai" v-if="loadingjiazai || countdevice > 10">
......@@ -223,6 +223,57 @@
url: '../main/adddevice',
});
},
//获取设备详情
devicedatainfo(id) {
this.isshow();
let opts = {
url: 'huinapphome/devicedatainfo/' + id,
method: 'get'
};
http.httpRequest(opts).then(res => {
if (res.data.code === 200) {
uni.navigateTo({
url: '/pages/basics/deviceinfo?data=' + JSON.stringify(res.data.data),
});
}
this.isnone();
}, error => {
console.log(error);
})
},
devicerecording(id) {
this.isshow();
let data = {
currentPage: 1,
deviceNum: id,
deviceStatus: 0,
pageSize: 1,
timeRange: '',
total: 1,
};
let opts = {
url: 'devices/detedevice',
method: 'post'
};
http.httpRequest(opts, data).then(res => {
if (res.data.data.total > 0) {
if (res.data.code === 200) {
uni.navigateTo({
url: '/pages/basics/devicerecording?data=' + JSON.stringify(res.data.data),
});
}
} else {
uni.showToast({
icon: 'none',
title: '暂无记录',
duration: 2000
});
}
this.isnone();
}, error => {
console.log(error);
})
},
//复制设备号
okhideModal() {
var that = this;
......@@ -347,7 +398,7 @@
legend: {
show: true,
padding: 0,
lineHeight:-10,
lineHeight: -10,
margin: 0,
},
fontSize: 10,
......
<template>
<view class="zai-box" @touchmove.prevent>
<image src="../../static/zaizai-login/login.png" mode='aspectFit' class="zai-logo"></image>
<view class="zai-title">LOGO区域</view>
<image src="../../static/zaizai-login/login.png" class="zai-logo"></image>
<!-- <view class="zai-title">LOGO区域</view> -->
<form @submit="formSubmit">
<view class="zai-form">
<input class="zai-input" placeholder="请输入用户名" name="email" />
......@@ -102,14 +102,14 @@
<style>
.zai-box {
padding: 0 100upx;
position: relative;
/* padding: 0 0 100upx; */
/* position: relative; */
}
.zai-logo {
width: 100%;
height: 310upx;
margin-top: 174upx;
height: 580upx;
/* margin-top: 174upx; */
}
.zai-title {
......@@ -133,7 +133,8 @@
border-radius: 100upx;
padding: 20upx 40upx;
font-size: 36upx;
height: 150upx;
height: 150upx;
margin-left: 30upx;
}
.input-placeholder,
......@@ -153,7 +154,8 @@
color: #fff;
border: 0;
border-radius: 100upx;
font-size: 36upx;
font-size: 36upx;
width: 90%;
}
.zai-btn:after {
......@@ -167,5 +169,6 @@
.loading-white {
position: fixed;
top: 25%;
left: 50upx;
}
</style>
......@@ -6,7 +6,7 @@
<!-- <text>Amibition</text> -->
</view>
<view class="margin-top-sm">
<text>{{ username }}</text>
<text class="radius text-center shadow-blur bg-black" >{{ username }}</text>
</view>
<image src="https://raw.githubusercontent.com/weilanwl/ColorUI/master/demo/images/wave.gif" mode="scaleToFill"
class="gif-wave"></image>
......@@ -120,7 +120,7 @@
<style>
.UCenter-bg {
background-image: url(https://image.weilanwl.com/color2.0/index.jpg);
background-image: url(../../static/zaizai-login/userbage.png);
background-size: cover;
height: 450rpx;
display: flex;
......
static/zaizai-login/login.png

66.9 KB | W: | H:

static/zaizai-login/login.png

406 KB | W: | H:

static/zaizai-login/login.png
static/zaizai-login/login.png
static/zaizai-login/login.png
static/zaizai-login/login.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment