Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	pages.json
#	pages/homepage/homepage.vue
This commit is contained in:
shidongli 2023-10-23 14:01:40 +08:00
commit 227090b25f
15 changed files with 295 additions and 56 deletions

View File

@ -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')
}
})
}

View File

@ -249,7 +249,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -302,7 +302,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -221,7 +221,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false

View File

@ -221,7 +221,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -274,7 +274,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -241,7 +241,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -294,7 +294,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -234,7 +234,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -287,7 +287,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -221,7 +221,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -274,7 +274,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -221,7 +221,7 @@
}
},
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
uni.closeSocket()
this.socketOpen = false
@ -274,7 +274,7 @@
//
reset() {
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);
that.timer = setInterval(() => {
uni.sendSocketMessage({

View File

@ -611,6 +611,12 @@
"navigationBarTitleText": "记录心率",
"enablePullDownRefresh": false
}
}, {
"path": "devicelist/devicelist",
"style": {
"navigationBarTitleText": "设备列表",
"enablePullDownRefresh": false
}
}
]
}],

View File

@ -93,9 +93,7 @@
}
},
onLoad() {
// this.getAddress()
this.login()
// this.login()
},
onShow() {
this.address = uni.getStorageSync('location')
@ -111,7 +109,6 @@
this.userinfo = uni.getStorageSync('userinfo');
if (this.userinfo) {
this.patientName = this.userinfo.patientName
console.log(this.patientName, '000')
checkSignApply(this.userinfo.cardNo).then(res => {
if (res.data.code != 0) {
this.checkSign = true
@ -119,8 +116,8 @@
this.checkSign = false
}
})
} else {
this.patientName = ''
}else{
this.patientName=''
}
},

View File

@ -435,7 +435,7 @@
//
homeshow() {
// this.getSetting()
// this.listquery.bindingCity = uni.getStorageSync('userInfo').bindingCity
// this.listquery.bindingCity = uni.getStorageSync('userinfo').bindingCity
var patientCode = this.userinfo.patientCode
var openid = uni.getStorageSync('openid')

View File

@ -1,8 +1,8 @@
.app {
height: 100vh;
width:99.5%;
margin: 0 auto;
background-color: #F7F5F5;
padding: 15rpx 0 0 0;
overflow: scroll;
padding: 15rpx 0;
.top {
width: 95%;

View File

@ -26,7 +26,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/sugar.png" mode=""></image>
</view>
@ -61,7 +61,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/bloodpressure.png" mode=""></image>
</view>
@ -128,7 +128,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/bloodfat.png" mode=""></image>
</view>
@ -241,7 +241,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/dkw.png" mode=""></image>
</view>
@ -272,7 +272,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/oxygen.png" mode=""></image>
</view>
@ -297,7 +297,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/heartrate.png" mode=""></image>
</view>
@ -324,7 +324,7 @@
快来测量吧~
</view>
<view class="itemtext two">
30天未测量
暂时未测量
</view>
<image src="../../static/pageC/temperature.png" mode=""></image>
</view>
@ -387,7 +387,7 @@
},
goaddequipment() {
uni.navigateTo({
url: "/pagesC/addequipment/addequipment"
url: "/pagesC/devicelist/devicelist"
})
},
gohealthdata(index) {

View File

@ -19,29 +19,37 @@
</view>
</view>
<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 class="submit" @click="submit">
保存
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
// import { bindDevice } from '@/service/api/api.js'
import {
binding
} from '@/api/examinationapi/add.js'
export default {
data() {
return {
type: 1,
data: {
deviceType: 0,
identity: uni.getStorageSync('userInfo').identity,
signNo: uni.getStorageSync('signInfo').signNo,
sn: ''
deviceType: undefined,
// identity: uni.getStorageSync('userinfo').cardNo,
identity: '370882199909092123',
sn: '',
bindTime: undefined, //
state: 1,
}
};
},
onLoad() {
this.data.bindTime = this.timeFormat()
},
methods: {
scanning() {
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() {
// bindDevice(this.data).then(res => {
// if(res.data.code == '1') {
// uni.showToast({
// title: '',
// duration: 1000
// })
// setTimeout(function() {
// uni.navigateBack({
// delta: 1
// })
// }, 1000);
// }
// })
binding(this.data).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '绑定成功',
type: 'success',
})
setTimeout(function() {
uni.navigateBack({
delta: 1
})
}, 2000);
}
})
}
}
}

View 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>