Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # pages.json # pages/homepage/homepage.vue
This commit is contained in:
commit
227090b25f
@ -93,3 +93,37 @@ export function recordlast(identity) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设备列表
|
||||||
|
export function bound(identity) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/device/bound/${identity}`,
|
||||||
|
method: 'get',
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//解绑
|
||||||
|
export function unbind(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/device/unbind`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加设备
|
||||||
|
export function binding(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/device/binding`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -249,7 +249,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -302,7 +302,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -221,7 +221,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
|
|||||||
@ -221,7 +221,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -274,7 +274,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -241,7 +241,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -294,7 +294,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -234,7 +234,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -287,7 +287,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -221,7 +221,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -274,7 +274,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -221,7 +221,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoket() {
|
scoket() {
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
const that = this
|
const that = this
|
||||||
uni.closeSocket()
|
uni.closeSocket()
|
||||||
this.socketOpen = false
|
this.socketOpen = false
|
||||||
@ -274,7 +274,7 @@
|
|||||||
// 心跳响应
|
// 心跳响应
|
||||||
reset() {
|
reset() {
|
||||||
let that = this
|
let that = this
|
||||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo
|
||||||
clearInterval(that.timer);
|
clearInterval(that.timer);
|
||||||
that.timer = setInterval(() => {
|
that.timer = setInterval(() => {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
|
|||||||
@ -611,6 +611,12 @@
|
|||||||
"navigationBarTitleText": "记录心率",
|
"navigationBarTitleText": "记录心率",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "devicelist/devicelist",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "设备列表",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
|
|||||||
@ -93,9 +93,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
// this.login()
|
||||||
// this.getAddress()
|
|
||||||
this.login()
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.address = uni.getStorageSync('location')
|
this.address = uni.getStorageSync('location')
|
||||||
@ -111,7 +109,6 @@
|
|||||||
this.userinfo = uni.getStorageSync('userinfo');
|
this.userinfo = uni.getStorageSync('userinfo');
|
||||||
if (this.userinfo) {
|
if (this.userinfo) {
|
||||||
this.patientName = this.userinfo.patientName
|
this.patientName = this.userinfo.patientName
|
||||||
console.log(this.patientName, '000')
|
|
||||||
checkSignApply(this.userinfo.cardNo).then(res => {
|
checkSignApply(this.userinfo.cardNo).then(res => {
|
||||||
if (res.data.code != 0) {
|
if (res.data.code != 0) {
|
||||||
this.checkSign = true
|
this.checkSign = true
|
||||||
|
|||||||
@ -435,7 +435,7 @@
|
|||||||
// 切换家庭成员
|
// 切换家庭成员
|
||||||
homeshow() {
|
homeshow() {
|
||||||
// this.getSetting()
|
// this.getSetting()
|
||||||
// this.listquery.bindingCity = uni.getStorageSync('userInfo').bindingCity
|
// this.listquery.bindingCity = uni.getStorageSync('userinfo').bindingCity
|
||||||
|
|
||||||
var patientCode = this.userinfo.patientCode
|
var patientCode = this.userinfo.patientCode
|
||||||
var openid = uni.getStorageSync('openid')
|
var openid = uni.getStorageSync('openid')
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
.app {
|
.app {
|
||||||
height: 100vh;
|
width:99.5%;
|
||||||
|
margin: 0 auto;
|
||||||
background-color: #F7F5F5;
|
background-color: #F7F5F5;
|
||||||
padding: 15rpx 0 0 0;
|
padding: 15rpx 0;
|
||||||
overflow: scroll;
|
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/sugar.png" mode=""></image>
|
<image src="../../static/pageC/sugar.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/bloodpressure.png" mode=""></image>
|
<image src="../../static/pageC/bloodpressure.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/bloodfat.png" mode=""></image>
|
<image src="../../static/pageC/bloodfat.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -241,7 +241,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/dkw.png" mode=""></image>
|
<image src="../../static/pageC/dkw.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -272,7 +272,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/oxygen.png" mode=""></image>
|
<image src="../../static/pageC/oxygen.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -297,7 +297,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/heartrate.png" mode=""></image>
|
<image src="../../static/pageC/heartrate.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -324,7 +324,7 @@
|
|||||||
快来测量吧~
|
快来测量吧~
|
||||||
</view>
|
</view>
|
||||||
<view class="itemtext two">
|
<view class="itemtext two">
|
||||||
您30天未测量
|
您暂时未测量
|
||||||
</view>
|
</view>
|
||||||
<image src="../../static/pageC/temperature.png" mode=""></image>
|
<image src="../../static/pageC/temperature.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -387,7 +387,7 @@
|
|||||||
},
|
},
|
||||||
goaddequipment() {
|
goaddequipment() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pagesC/addequipment/addequipment"
|
url: "/pagesC/devicelist/devicelist"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gohealthdata(index) {
|
gohealthdata(index) {
|
||||||
|
|||||||
@ -19,29 +19,37 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="types">
|
<view class="types">
|
||||||
<view @tap='data.deviceType=0' :class="data.deviceType==0?'type':'type2'">血压计</view>
|
<view @tap='data.deviceType=1' :class="data.deviceType==1?'type':'type2'">血压计</view>
|
||||||
<view @tap='data.deviceType=1' :class="data.deviceType==1?'type':'type2'">血糖仪</view>
|
<view @tap='data.deviceType=2' :class="data.deviceType==2?'type':'type2'">血糖仪</view>
|
||||||
|
<view @tap='data.deviceType=3' :class="data.deviceType==3?'type':'type2'">动态血压仪</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit" @click="submit">
|
<view class="submit" @click="submit">
|
||||||
保存
|
保存
|
||||||
</view>
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { bindDevice } from '@/service/api/api.js'
|
import {
|
||||||
|
binding
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: 1,
|
|
||||||
data: {
|
data: {
|
||||||
deviceType: 0,
|
deviceType: undefined,
|
||||||
identity: uni.getStorageSync('userInfo').identity,
|
// identity: uni.getStorageSync('userinfo').cardNo,
|
||||||
signNo: uni.getStorageSync('signInfo').signNo,
|
identity: '370882199909092123',
|
||||||
sn: ''
|
sn: '',
|
||||||
|
bindTime: undefined, //绑定时间
|
||||||
|
state: 1,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.data.bindTime = this.timeFormat()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scanning() {
|
scanning() {
|
||||||
const that = this
|
const that = this
|
||||||
@ -52,20 +60,49 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
timeFormat() {
|
||||||
|
let time = parseInt(new Date().getTime() / 1000)
|
||||||
|
time = time * 1000 //(后端为秒,则转为 毫秒再格式化)
|
||||||
|
var x = new Date(time)
|
||||||
|
var z = {
|
||||||
|
y: x.getFullYear(),
|
||||||
|
M: x.getMonth() + 1,
|
||||||
|
d: x.getDate(),
|
||||||
|
h: x.getHours(),
|
||||||
|
m: x.getMinutes(),
|
||||||
|
s: x.getSeconds(),
|
||||||
|
}
|
||||||
|
if (z.M < 10) {
|
||||||
|
z.M = '0' + z.M
|
||||||
|
}
|
||||||
|
if (z.d < 10) {
|
||||||
|
z.d = '0' + z.d
|
||||||
|
}
|
||||||
|
if (z.h < 10) {
|
||||||
|
z.h = '0' + z.h
|
||||||
|
}
|
||||||
|
if (z.m < 10) {
|
||||||
|
z.m = '0' + z.m
|
||||||
|
}
|
||||||
|
if (z.s < 10) {
|
||||||
|
z.s = '0' + z.s
|
||||||
|
}
|
||||||
|
return z.y + '-' + z.M + '-' + z.d + ' ' + z.h + ':' + z.m + ':' + z.s
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// bindDevice(this.data).then(res => {
|
binding(this.data).then(res => {
|
||||||
// if(res.data.code == '1') {
|
if (res.code == 200) {
|
||||||
// uni.showToast({
|
this.$refs.uToast.show({
|
||||||
// title: '绑定成功',
|
title: '绑定成功',
|
||||||
// duration: 1000
|
type: 'success',
|
||||||
// })
|
})
|
||||||
// setTimeout(function() {
|
setTimeout(function() {
|
||||||
// uni.navigateBack({
|
uni.navigateBack({
|
||||||
// delta: 1
|
delta: 1
|
||||||
// })
|
})
|
||||||
// }, 1000);
|
}, 2000);
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
165
pagesC/devicelist/devicelist.vue
Normal file
165
pagesC/devicelist/devicelist.vue
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<view class="devicelist">
|
||||||
|
<view class="title" v-if="deviceList.length != 0">已绑定设备</view>
|
||||||
|
<view class="title" style="text-align: center;" v-else>暂无绑定设备</view>
|
||||||
|
<template v-for="(item, index) in deviceList">
|
||||||
|
<view class="devices" :key="index">
|
||||||
|
<text v-if="item.deviceType == 1">血压计</text>
|
||||||
|
<text v-else-if="item.deviceType == 2">血糖仪</text>
|
||||||
|
<text v-else>动态血压计</text>
|
||||||
|
<text style="margin-left: -30rpx; font-size: 26rpx;">SN: {{ item.sn }}</text>
|
||||||
|
<view class="delbind" @click="delbind(item)">解绑</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="addbtn" @click="addequipment">
|
||||||
|
<text>添加设备</text>
|
||||||
|
<image src="http://112.7.50.34:8001/static/addicon.png"></image>
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
bound,
|
||||||
|
unbind
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
deviceList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getbindDeviceList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getbindDeviceList() {
|
||||||
|
// uni.getStorageSync('userinfo').cardNo
|
||||||
|
bound('370882199909092123').then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.deviceList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delbind(e) {
|
||||||
|
const that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定解绑此设备吗?',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
const data = {
|
||||||
|
remark: e.remark,
|
||||||
|
id: e.id,
|
||||||
|
bindTime: e.bindTime,
|
||||||
|
// identity: uni.getStorageSync('userinfo').cardNo,
|
||||||
|
identity: '370882199909092123',
|
||||||
|
sn: e.sn,
|
||||||
|
unbindTime: that.timeFormat(),
|
||||||
|
state: 0,
|
||||||
|
deviceType: e.deviceType,
|
||||||
|
}
|
||||||
|
|
||||||
|
unbind(data).then(respone => {
|
||||||
|
if (respone.code == 200) {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: '解绑成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
that.getbindDeviceList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
timeFormat() {
|
||||||
|
let time = parseInt(new Date().getTime() / 1000)
|
||||||
|
time = time * 1000 //(后端为秒,则转为 毫秒再格式化)
|
||||||
|
var x = new Date(time)
|
||||||
|
var z = {
|
||||||
|
y: x.getFullYear(),
|
||||||
|
M: x.getMonth() + 1,
|
||||||
|
d: x.getDate(),
|
||||||
|
h: x.getHours(),
|
||||||
|
m: x.getMinutes(),
|
||||||
|
s: x.getSeconds(),
|
||||||
|
}
|
||||||
|
if (z.M < 10) {
|
||||||
|
z.M = '0' + z.M
|
||||||
|
}
|
||||||
|
if (z.d < 10) {
|
||||||
|
z.d = '0' + z.d
|
||||||
|
}
|
||||||
|
if (z.h < 10) {
|
||||||
|
z.h = '0' + z.h
|
||||||
|
}
|
||||||
|
if (z.m < 10) {
|
||||||
|
z.m = '0' + z.m
|
||||||
|
}
|
||||||
|
if (z.s < 10) {
|
||||||
|
z.s = '0' + z.s
|
||||||
|
}
|
||||||
|
return z.y + '-' + z.M + '-' + z.d + ' ' + z.h + ':' + z.m + ':' + z.s
|
||||||
|
},
|
||||||
|
addequipment() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pagesC/addequipment/addequipment"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.devicelist {
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.devices {
|
||||||
|
border: 2rpx solid #ccc;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
padding: 30rpx 20rpx;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 36rpx;
|
||||||
|
margin-left: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
view {
|
||||||
|
border: 1px solid #4AC4AB;
|
||||||
|
padding: 8rpx 40rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
color: #4AC4AB;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addbtn {
|
||||||
|
height: 170rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
align-items: center;
|
||||||
|
background: #4AC4AB;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user