diff --git a/api/pagesC/testreport/index.js b/api/pagesC/testreport/index.js new file mode 100644 index 0000000..68f3763 --- /dev/null +++ b/api/pagesC/testreport/index.js @@ -0,0 +1,40 @@ +var request = function(config) { + return new Promise((resolve, rejected) => { + if (config.url != '/nurseApplet/chatRecord/updateReadStatus' && config.url != + "/nurseApplet/chatRecord/sendMessage" && config.url != + `/applet/sign/apply/checkSignApply/` + uni.getStorageSync('userinfo').cardNo) { + uni.showLoading({ + title: '' + }); + } + uni.request({ + url: config.url, + data: config.data, + method: config.method, + timeout: 60000, + header: config.header, + success(res) { + uni.hideLoading(); + resolve(res.data) + }, + fail(err) { + uni.hideLoading(); + rejected(err) + } + }) + }) +} +//获取dy报告list +export function dyrecord(identity) { + return request({ + url: `http://8.131.93.145:54098/fd/sh05/record/${identity}`, + method: 'get', + }) +} +//获取dz报告list +export function dzrecord(identity) { + return request({ + url: `http://112.6.122.71:8009/fd/sh05/record/${identity}`, + method: 'get', + }) +} diff --git a/components/BloodSugar/BloodSugar.vue b/components/BloodSugar/BloodSugar.vue index ef04598..2f5b793 100644 --- a/components/BloodSugar/BloodSugar.vue +++ b/components/BloodSugar/BloodSugar.vue @@ -94,8 +94,6 @@ }, ], timeindex: 0, - socketOpen: false, - timer: null, datalist: null, datalisttwo: null, pie_opts: { @@ -156,12 +154,6 @@ // } this.getServerData() }, - destroyed() { - clearInterval(this.timer); - if (this.socketOpen == true) { - uni.closeSocket(); - } - }, watch: { echartData: { handler() { @@ -169,18 +161,6 @@ }, deep: true }, - current(newValue, oldValue) { - if (newValue != 0) { - clearInterval(this.timer); - if (this.socketOpen == true) { - uni.closeSocket(); - } - } else { - setTimeout(() => { - this.scoket() - }, 800) - } - } }, methods: { taptimeindex(index) { @@ -233,78 +213,6 @@ }, 500) } }, - scoket() { - var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo - const that = this - uni.closeSocket() - this.socketOpen = false - try { - uni.connectSocket({ - url: SOCKETURL - }) - uni.onSocketOpen(res => { - console.log('webScoket连接已打开', res); - that.socketOpen = true - that.reset() - }) - - uni.onSocketError(err => { - console.log('webScoket连接打开失败', err); - if (err && err.code != 1000) { - setTimeout(() => { - that.socketOpen = true - uni.connectSocket({ - url: SOCKETURL - }) - }, 3 * 1000) - } - }) - - uni.onSocketClose(err => { - console.log('webScoket连接关闭', err); - if (err && err.code !== 1000) { - setTimeout(() => { - that.socketOpen = true - uni.connectSocket({ - url: SOCKETURL - }) - }, 3 * 1000) - } - }) - uni.onSocketMessage(res => { - console.log("webScoket监听收到的信息", res); - // that.newsList.push({ - // senderName: that.currentItem.senderName, - // content: JSON.parse(res.data).message - // }) - this.$emit('websocket-message'); - this.$forceUpdate() - }) - } catch (e) { - console.log(e); - } - }, - // 心跳响应 - reset() { - let that = this - var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userinfo').cardNo - clearInterval(that.timer); - that.timer = setInterval(() => { - uni.sendSocketMessage({ - data: 'ping', - success(res) { - console.log('正在发送心跳'); - }, - fail(err) { - console.log('心跳发送失败,重新连接...'); - _socketOpen = true - uni.connectSocket({ - url: SOCKETURL - }) - } - }) - }, 60000) - }, } } diff --git a/manifest.json b/manifest.json index dbb145e..5d3d598 100644 --- a/manifest.json +++ b/manifest.json @@ -51,7 +51,6 @@ /* 小程序特有相关 */ "mp-weixin": { "appid": "wxccb16a452ab5e4b4", - "__usePrivacyCheck__": true, "setting": { "urlCheck": false, "postcss": true, diff --git a/pages.json b/pages.json index 8f226a4..223ae91 100644 --- a/pages.json +++ b/pages.json @@ -621,6 +621,14 @@ "navigationBarTitleText": "设备列表", "enablePullDownRefresh": false } + }, + { + "path" : "testreport/testreport", + "style" : + { + "navigationBarTitleText" : "检测报告", + "enablePullDownRefresh" : false + } } ] }, { diff --git a/pages/myinformation/myinformation.scss b/pages/myinformation/myinformation.scss index a4c8a95..14b43be 100644 --- a/pages/myinformation/myinformation.scss +++ b/pages/myinformation/myinformation.scss @@ -52,7 +52,7 @@ left: 10%; width: 80%; height: 68rpx; - background-color: #55d0df; + background-color: #4AC4AB; margin: 0 auto; border-radius: 10rpx; margin-bottom: 30rpx; diff --git a/pagesB/CommodityDetails/CommodityDetails.vue b/pagesB/CommodityDetails/CommodityDetails.vue index 44b7a48..fc483d0 100644 --- a/pagesB/CommodityDetails/CommodityDetails.vue +++ b/pagesB/CommodityDetails/CommodityDetails.vue @@ -461,6 +461,11 @@ .paySign, success: function( res) { + that.couponId = + null + that.Paidinprice = + null + that.coupon = null that.goodsDetailsinfo( that .goodsInfoId, @@ -731,10 +736,10 @@ if (list.length >= 1) { this.updata.receiver = list[0].receiveName var areaName - if(res.data[0].areaName){ - areaName=res.data[0].areaName - }else{ - areaName="" + if (res.data[0].areaName) { + areaName = res.data[0].areaName + } else { + areaName = "" } this.updata.receiveAddress = list[0].areaName + list[0].receiveAddress this.updata.phone = list[0].receivePhone @@ -743,14 +748,14 @@ this.updata.receiver = res.data[0].receiveName var areaName - if(res.data[0].areaName){ - areaName=res.data[0].areaName + if (res.data[0].areaName) { + areaName = res.data[0].areaName - }else{ - areaName="" + } else { + areaName = "" } - this.updata.receiveAddress =areaName + res.data[0].receiveAddress + this.updata.receiveAddress = areaName + res.data[0].receiveAddress this.updata.phone = res.data[0].receivePhone this.userid = res.data[0].id } @@ -853,4 +858,4 @@ + \ No newline at end of file diff --git a/pagesB/ProductList/ProductList.vue b/pagesB/ProductList/ProductList.vue index 71b7f61..e3b313d 100644 --- a/pagesB/ProductList/ProductList.vue +++ b/pagesB/ProductList/ProductList.vue @@ -20,9 +20,7 @@ 分类 - - @@ -352,34 +352,34 @@ }) }) // 画文字 - await this.$refs.rCanvas.drawText({ - // text: "智慧康养,医护关怀到家", - x: 150, - y: 300, - font_color: "#444444", - font_size: 12, - font_weight: 600, - text_align: 'center' - }).catch(err_msg => { - uni.showToast({ - title: err_msg, - icon: "none" - }) - }) - await this.$refs.rCanvas.drawText({ - // text: "超多福利,快来体验吧!", - x: 150, - y: 320, - font_color: "#444444", - font_size: 12, - font_weight: 600, - text_align: 'center' - }).catch(err_msg => { - uni.showToast({ - title: err_msg, - icon: "none" - }) - }) + // await this.$refs.rCanvas.drawText({ + // text: "", + // x: 150, + // y: 300, + // font_color: "#444444", + // font_size: 12, + // font_weight: 600, + // text_align: 'center' + // }).catch(err_msg => { + // uni.showToast({ + // title: err_msg, + // icon: "none" + // }) + // }) + // await this.$refs.rCanvas.drawText({ + // text: "", + // x: 150, + // y: 320, + // font_color: "#444444", + // font_size: 12, + // font_weight: 600, + // text_align: 'center' + // }).catch(err_msg => { + // uni.showToast({ + // title: err_msg, + // icon: "none" + // }) + // }) await this.$refs.rCanvas.drawText({ text: "新医路健康服务平台", x: 150, diff --git a/pagesB/mysigning/mysigning.scss b/pagesB/mysigning/mysigning.scss index dcb0c5c..5340d66 100644 --- a/pagesB/mysigning/mysigning.scss +++ b/pagesB/mysigning/mysigning.scss @@ -76,7 +76,7 @@ .Rescind { width: 50%; height: 100rpx; - color: #55d0df; + color: #4AC4AB; border-left: 0.5rpx solid #f6f6f6; } } diff --git a/pagesB/screeningResult/screeningResult.vue b/pagesB/screeningResult/screeningResult.vue index dd4de26..d26befd 100644 --- a/pagesB/screeningResult/screeningResult.vue +++ b/pagesB/screeningResult/screeningResult.vue @@ -9,14 +9,9 @@ 筛查记录 - + {{screeningResultData.projectName}} - - + 检测报告 @@ -366,8 +366,7 @@ }, methods: { info() { - // userinfo.cardNo, - recordlast('370882199909092123').then(res => { + recordlast(uni.getStorageSync('userinfo').cardNo).then(res => { res.data.forEach(e => { e.type == '1' ? this.dataone = e : '' e.type == '2' ? this.datatwo = e : '' @@ -395,6 +394,11 @@ url: `/pagesC/healthdata/healthdata?index=${index}` }) }, + gotestreport() { + uni.navigateTo({ + url: "/pagesC/testreport/testreport" + }) + }, } } diff --git a/pagesC/Screeningdetails/Screeningdetails.vue b/pagesC/Screeningdetails/Screeningdetails.vue index e9b796c..b353079 100644 --- a/pagesC/Screeningdetails/Screeningdetails.vue +++ b/pagesC/Screeningdetails/Screeningdetails.vue @@ -13,14 +13,12 @@ 筛查机构: {{screeningResultData.hospitalName}} - 筛查医生: {{screeningResultData.doctorName}} 筛查结果: - @@ -57,14 +55,11 @@ --> - - 诊断结果: - {{screeningResultData.diagnosticResult}} - + + 诊断结果: + {{screeningResultData.diagnosticResult}} + - - - @@ -90,21 +85,15 @@ this.projectId = e.projectId this.getLastScreeningResult() console.log(e) - }, onShow() { this.baseurl = baseurl - - }, - methods: { // 获取最新的筛查结果 getLastScreeningResult() { - lastScreeningResult(this.patientld, this.projectId).then(res => { this.screeningResultData = res.data - }) }, // 查看报告 diff --git a/pagesC/addBMI/addBMI.vue b/pagesC/addBMI/addBMI.vue index 815a9e1..3a87171 100644 --- a/pagesC/addBMI/addBMI.vue +++ b/pagesC/addBMI/addBMI.vue @@ -89,8 +89,7 @@ bmi: (this.weight / ((this.height / 100) * (this.height / 100))).toFixed(2), height: this.height, weight: this.weight, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, } savebmi(data).then(res => { @@ -127,7 +126,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -233,4 +232,4 @@ } } } - \ No newline at end of file + diff --git a/pagesC/addBloodFat/addBloodFat.vue b/pagesC/addBloodFat/addBloodFat.vue index 505f067..6686bb2 100644 --- a/pagesC/addBloodFat/addBloodFat.vue +++ b/pagesC/addBloodFat/addBloodFat.vue @@ -92,8 +92,7 @@ ldl: this.ldl, tc: this.tc, tg: this.tg, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, } savebf(data).then(res => { @@ -138,7 +137,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -244,4 +243,4 @@ } } } - \ No newline at end of file + diff --git a/pagesC/addBloodOxygen/addBloodOxygen.vue b/pagesC/addBloodOxygen/addBloodOxygen.vue index dae0974..3ca0e3d 100644 --- a/pagesC/addBloodOxygen/addBloodOxygen.vue +++ b/pagesC/addBloodOxygen/addBloodOxygen.vue @@ -70,8 +70,7 @@ let data = { pulse: this.pulse, spo2: this.spo2, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, } savebo(data).then(res => { @@ -116,7 +115,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -222,4 +221,4 @@ } } } - \ No newline at end of file + diff --git a/pagesC/addHeartRate/addHeartRate.vue b/pagesC/addHeartRate/addHeartRate.vue index 7bf3b18..f241562 100644 --- a/pagesC/addHeartRate/addHeartRate.vue +++ b/pagesC/addHeartRate/addHeartRate.vue @@ -37,8 +37,24 @@ hr: '', timetext: this.formatDate(Date.now()), measureTime: this.formatDate(Date.now()), + uploadType: undefined, + timeoutObj: null, + socketOpen: false, + SOCKETURL: '', }; }, + onLoad(options) { + bound(uni.getStorageSync('userinfo').cardNo).then(res => { + if (res.code == 200) { + res.data.forEach(e => { + if (e.deviceType == 1) { + this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + this.scoket(); + } + }) + } + }) + }, methods: { formatDate(timestamp) { const now = new Date(parseInt(timestamp)) @@ -55,13 +71,79 @@ timeconfirm(time) { this.timetext = time }, + scoket() { + const that = this + this.socketOpen = false + try { + uni.connectSocket({ + url: that.SOCKETURL + }) + uni.onSocketOpen(res => { + console.log('webScoket连接已打开', res); + that.socketOpen = true + that.reset() + }) + + uni.onSocketError(err => { + console.log('webScoket连接打开失败', err); + if (err && err.code != 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + + uni.onSocketClose(err => { + console.log('webScoket连接关闭', err); + if (err && err.code !== 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + uni.onSocketMessage(res => { + console.log("webScoket监听收到的信息", res); + this.uploadType = 2 + this.hr = JSON.parse(res.data).pulse + this.$forceUpdate() + }) + } catch (e) { + console.log(e); + } + }, + // 心跳响应 + reset() { + let that = this + clearInterval(that.timeoutObj); + that.timeoutObj = setInterval(() => { + uni.sendSocketMessage({ + data: 'ping', + success(res) { + console.log('正在发送心跳'); + }, + fail(err) { + console.log('心跳发送失败,重新连接...'); + console.log(this.SOCKETURL) + that.socketOpen = true + uni.connectSocket({ + url: this.SOCKETURL + }) + } + }) + }, 60000) + }, submit() { if (this.hr) { let data = { hr: this.hr, - uploadType: 1, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + uploadType: this.uploadType ? this.uploadType : 1, + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, } savehr(data).then(res => { @@ -92,7 +174,12 @@ return true } } - } + }, + onUnload() { + if (this.socketOpen) { + uni.closeSocket(); + } + }, } @@ -106,7 +193,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; diff --git a/pagesC/addPressure/addPressure.vue b/pagesC/addPressure/addPressure.vue index 99325a3..22b4644 100644 --- a/pagesC/addPressure/addPressure.vue +++ b/pagesC/addPressure/addPressure.vue @@ -49,6 +49,9 @@ import { savebp } from '@/api/examinationapi/add.js' + import { + bound, + } from '@/api/examinationapi/add.js' export default { data() { return { @@ -57,8 +60,24 @@ hr: '', timetext: this.formatDate(Date.now()), measureTime: this.formatDate(Date.now()), + uploadType: undefined, + timeoutObj: null, + socketOpen: false, + SOCKETURL: '', }; }, + onLoad(options) { + bound(uni.getStorageSync('userinfo').cardNo).then(res => { + if (res.code == 200) { + res.data.forEach(e => { + if (e.deviceType == 1) { + this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + this.scoket(); + } + }) + } + }) + }, methods: { formatDate(timestamp) { const now = new Date(parseInt(timestamp)) @@ -75,16 +94,84 @@ timeconfirm(time) { this.timetext = time }, + scoket() { + const that = this + this.socketOpen = false + try { + uni.connectSocket({ + url: that.SOCKETURL + }) + uni.onSocketOpen(res => { + console.log('webScoket连接已打开', res); + that.socketOpen = true + that.reset() + }) + + uni.onSocketError(err => { + console.log('webScoket连接打开失败', err); + if (err && err.code != 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + + uni.onSocketClose(err => { + console.log('webScoket连接关闭', err); + if (err && err.code !== 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + uni.onSocketMessage(res => { + console.log("webScoket监听收到的信息", res); + this.uploadType = 2 + this.dbp = JSON.parse(res.data).dbp + this.sbp = JSON.parse(res.data).sbp + this.hr = JSON.parse(res.data).pulse + this.$forceUpdate() + }) + } catch (e) { + console.log(e); + } + }, + // 心跳响应 + reset() { + let that = this + clearInterval(that.timeoutObj); + that.timeoutObj = setInterval(() => { + uni.sendSocketMessage({ + data: 'ping', + success(res) { + console.log('正在发送心跳'); + }, + fail(err) { + console.log('心跳发送失败,重新连接...'); + console.log(this.SOCKETURL) + that.socketOpen = true + uni.connectSocket({ + url: this.SOCKETURL + }) + } + }) + }, 60000) + }, submit() { if (this.ruls(this.dbp) && this.ruls(this.sbp) && this.ruls(this.hr)) { let data = { dbp: this.dbp, sbp: this.sbp, hr: this.hr, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, - uploadType: 1, + uploadType: this.uploadType ? this.uploadType : 1, } savebp(data).then(res => { if (res.code == 200) { @@ -113,8 +200,13 @@ } else { return true } + }, + }, + onUnload() { + if (this.socketOpen) { + uni.closeSocket(); } - } + }, } @@ -128,7 +220,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -229,4 +321,4 @@ } } } - + \ No newline at end of file diff --git a/pagesC/addTemperature/addTemperature.vue b/pagesC/addTemperature/addTemperature.vue index a94685a..41beb63 100644 --- a/pagesC/addTemperature/addTemperature.vue +++ b/pagesC/addTemperature/addTemperature.vue @@ -58,8 +58,7 @@ submit() { if (this.timetext && this.temp) { let data = { - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, measureTime: this.timetext, temp: this.temp, } @@ -105,7 +104,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -203,4 +202,4 @@ } } } - \ No newline at end of file + diff --git a/pagesC/addequipment/addequipment.vue b/pagesC/addequipment/addequipment.vue index ca82717..bcc16c4 100644 --- a/pagesC/addequipment/addequipment.vue +++ b/pagesC/addequipment/addequipment.vue @@ -39,8 +39,7 @@ return { data: { deviceType: undefined, - // identity: uni.getStorageSync('userinfo').cardNo, - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, sn: '', bindTime: undefined, //绑定时间 state: 1, @@ -116,7 +115,7 @@ width: 60%; height: 98rpx; margin: 60rpx auto; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 10rpx; border: solid 0rpx #0c0c0c; color: #ffffff; @@ -150,8 +149,8 @@ height: 60rpx; background-color: #ffffff; border-radius: 10rpx; - border: solid 1rpx #55d0df; - color: #55d0df; + border: solid 1rpx #4AC4AB; + color: #4AC4AB; } } @@ -191,9 +190,9 @@ .left { width: 8rpx; height: 32rpx; - background-color: #55d0df; + background-color: #4AC4AB; border-radius: 4rpx; } } } - \ No newline at end of file + diff --git a/pagesC/addsugar/addsugar.vue b/pagesC/addsugar/addsugar.vue index 527fda3..f44fd55 100644 --- a/pagesC/addsugar/addsugar.vue +++ b/pagesC/addsugar/addsugar.vue @@ -45,16 +45,36 @@ import { savebg } from '@/api/examinationapi/add.js' + import { + bound, + } from '@/api/examinationapi/add.js' export default { data() { return { + uploadType: undefined, number: '', timetext: this.formatDate(Date.now()), measureTime: this.formatDate(Date.now()), bucketchoice: 1, + timeoutObj: null, + socketOpen: false, + SOCKETURL: '', + // 德州的用:ws://112.6.122.71:8009/fd/webSocket/{sn} + // 东营的用:ws://218.58.213.15:8009/fd/webSocket/{sn} }; }, - onLoad(options) {}, + onLoad(options) { + bound(uni.getStorageSync('userinfo').cardNo).then(res => { + if (res.code == 200) { + res.data.forEach(e => { + if (e.deviceType == 2) { + this.SOCKETURL = `ws://112.6.122.71:8009/fd/webSocket/${e.sn}` + this.scoket(); + } + }) + } + }) + }, methods: { timeconfirm(time) { this.timetext = time @@ -83,9 +103,8 @@ bg: this.number, bucket: this.bucketchoice, measureTime: this.measureTime, - uploadType: 1, - // identity: uni.getStorageSync('userinfo').cardNo - identity: '370882199909092123' + uploadType: this.uploadType ? this.uploadType : 1, + identity: uni.getStorageSync('userinfo').cardNo } savebg(data).then(res => { if (res.code == 200) { @@ -100,8 +119,80 @@ }, 1000) } }) + }, + scoket() { + const that = this + this.socketOpen = false + try { + uni.connectSocket({ + url: that.SOCKETURL + }) + uni.onSocketOpen(res => { + console.log('webScoket连接已打开', res); + that.socketOpen = true + that.reset() + }) + + uni.onSocketError(err => { + console.log('webScoket连接打开失败', err); + if (err && err.code != 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + + uni.onSocketClose(err => { + console.log('webScoket连接关闭', err); + if (err && err.code !== 1000) { + setTimeout(() => { + that.socketOpen = true + uni.connectSocket({ + url: that.SOCKETURL + }) + }, 3 * 1000) + } + }) + uni.onSocketMessage(res => { + console.log("webScoket监听收到的信息", res); + this.uploadType = 2 + this.number = JSON.parse(res.data).fbg + this.$forceUpdate() + }) + } catch (e) { + console.log(e); + } + }, + // 心跳响应 + reset() { + let that = this + clearInterval(that.timeoutObj); + that.timeoutObj = setInterval(() => { + uni.sendSocketMessage({ + data: 'ping', + success(res) { + console.log('正在发送心跳'); + }, + fail(err) { + console.log('心跳发送失败,重新连接...'); + console.log(this.SOCKETURL) + that.socketOpen = true + uni.connectSocket({ + url: this.SOCKETURL + }) + } + }) + }, 60000) + }, + }, + onUnload() { + if (this.socketOpen) { + uni.closeSocket(); } - } + }, } diff --git a/pagesC/devicelist/devicelist.vue b/pagesC/devicelist/devicelist.vue index 390f135..ad05ccc 100644 --- a/pagesC/devicelist/devicelist.vue +++ b/pagesC/devicelist/devicelist.vue @@ -35,8 +35,7 @@ }, methods: { getbindDeviceList() { - // uni.getStorageSync('userinfo').cardNo - bound('370882199909092123').then(res => { + bound(uni.getStorageSync('userinfo').cardNo).then(res => { if (res.code == 200) { this.deviceList = res.data } @@ -53,8 +52,7 @@ remark: e.remark, id: e.id, bindTime: e.bindTime, - // identity: uni.getStorageSync('userinfo').cardNo, - identity: '370882199909092123', + identity: uni.getStorageSync('userinfo').cardNo, sn: e.sn, unbindTime: that.timeFormat(), state: 0, @@ -162,4 +160,4 @@ } } } - \ No newline at end of file + diff --git a/pagesC/healthdata/healthdata.vue b/pagesC/healthdata/healthdata.vue index 0e9739c..3b6f5f0 100644 --- a/pagesC/healthdata/healthdata.vue +++ b/pagesC/healthdata/healthdata.vue @@ -93,8 +93,7 @@ let userinfo = uni.getStorageSync('userinfo'); var obj = { label: Number(this.tabindex) + 1, - // identity: userinfo.cardNo, - identity: '370882199909092123', + identity: userinfo.cardNo, type: this.type, } record(obj).then(res => { @@ -120,4 +119,4 @@ ::v-deep .u-tabs { background-color: #F7F5F5 !important; } - \ No newline at end of file + diff --git a/pagesC/seekadvicefrom/seekadvicefrom.vue b/pagesC/seekadvicefrom/seekadvicefrom.vue index ecc07f5..38c9dbd 100644 --- a/pagesC/seekadvicefrom/seekadvicefrom.vue +++ b/pagesC/seekadvicefrom/seekadvicefrom.vue @@ -701,7 +701,7 @@ } .sendBox { - background-color: #55d0df7d; + background-color: #4AC4AB; padding: 18rpx 20rpx; border-radius: 0 0 10rpx 10rpx; font-size: 34rpx; @@ -764,4 +764,4 @@ bottom: 38rpx; } } - \ No newline at end of file + diff --git a/pagesC/signseekadvicefrom/signseekadvicefrom.vue b/pagesC/signseekadvicefrom/signseekadvicefrom.vue index fec5500..7abaf5c 100644 --- a/pagesC/signseekadvicefrom/signseekadvicefrom.vue +++ b/pagesC/signseekadvicefrom/signseekadvicefrom.vue @@ -684,7 +684,7 @@ } .sendBox { - background-color: #55d0df7d; + background-color: #4AC4AB; padding: 18rpx 20rpx; border-radius: 0 0 10rpx 10rpx; font-size: 34rpx; @@ -747,4 +747,4 @@ bottom: 38rpx; } } - \ No newline at end of file + diff --git a/pagesC/testreport/testreport.vue b/pagesC/testreport/testreport.vue new file mode 100644 index 0000000..d7d5e57 --- /dev/null +++ b/pagesC/testreport/testreport.vue @@ -0,0 +1,172 @@ + + + + + \ No newline at end of file