修改
This commit is contained in:
parent
e633e1a756
commit
131d230b4d
12
App.vue
12
App.vue
@ -1,8 +1,18 @@
|
||||
<script>
|
||||
import {
|
||||
mapMutations
|
||||
} from "vuex";
|
||||
export default {
|
||||
onLaunch: function() {},
|
||||
methods: {
|
||||
...mapMutations(['socketOpenfalse']),
|
||||
},
|
||||
onShow: function() {},
|
||||
onHide: function() {}
|
||||
onHide: function() {
|
||||
this.socketOpenfalse();
|
||||
uni.closeSocket();
|
||||
clearInterval(this.$store.state.timeoutObj);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,45 +1,21 @@
|
||||
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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
import request from "@/api/request.js"
|
||||
|
||||
//获取东营报告list
|
||||
// 东营驿站记录接口:http://218.58.213.15:8009/fd/sh05/record/{identity}
|
||||
// 东营获取驿站报告接口:http://218.58.213.15:8009/fd/sh05/report/view/{reportId}
|
||||
export function dyrecord(identity) {
|
||||
return request({
|
||||
url: `http://218.58.213.15:8009/fd/sh05/record/${identity}`,
|
||||
url: `/fado/dy/sh05/record/${identity}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//获取德州报告list
|
||||
|
||||
//获取德州报告list
|
||||
// 德州驿站记录接口: http: //112.6.122.71:8009/fd/sh05/record/{identity}
|
||||
// 德州获取驿站报告接口: http: //112.6.122.71:8009/fd/sh05/report/view/{reportId}
|
||||
export function dzrecord(identity) {
|
||||
return request({
|
||||
url: `http://112.6.122.71:8009/fd/sh05/record/${identity}`,
|
||||
url: `/fado/dz/sh05/record/${identity}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
@ -5,7 +5,8 @@
|
||||
{{item.date}}
|
||||
</view>
|
||||
<view class="name">
|
||||
{{item.reportId}}
|
||||
<!-- {{item.reportId}} -->
|
||||
检测报告
|
||||
</view>
|
||||
<view class="btn" v-if="item.existReport==1" @tap='lookReport(item)'>
|
||||
<span>查看报告</span>
|
||||
@ -24,14 +25,17 @@
|
||||
dyreport,
|
||||
dzreport
|
||||
} from '@/api/pagesC/testreport/index.js'
|
||||
import baseurl from '@/api/baseurl.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
region: undefined,
|
||||
baseurl: '',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.baseurl = baseurl
|
||||
this.region = uni.getStorageSync('region')
|
||||
if (this.region == 1) {
|
||||
dzrecord(uni.getStorageSync('userinfo').cardNo).then(res => {
|
||||
@ -55,7 +59,7 @@
|
||||
lookReport(item) {
|
||||
if (this.region == 1) {
|
||||
uni.downloadFile({
|
||||
url: `http://112.6.122.71:8009/fd/sh05/report/download/${item.reportId}`,
|
||||
url: `${this.baseurl}/fado/dz/sh05/report/download/${item.reportId}`,
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
var filePath = res.tempFilePath;
|
||||
@ -72,7 +76,7 @@
|
||||
});
|
||||
} else if (this.region == 2) {
|
||||
uni.downloadFile({
|
||||
url: `http://218.58.213.15:8009/fd/sh05/report/download/${item.reportId}`,
|
||||
url: `${this.baseurl}/fado/dy/sh05/report/download/${item.reportId}`,
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
var filePath = res.tempFilePath;
|
||||
@ -161,7 +165,8 @@
|
||||
}
|
||||
|
||||
.name {
|
||||
margin: 20rpx 0 0 20rpx;
|
||||
font-size: 40rpx;
|
||||
margin: 40rpx 0 0 20rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
|
||||
@ -39,7 +39,7 @@ const store = new Vuex.Store({
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}, 3000)
|
||||
})
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
@ -49,7 +49,7 @@ const store = new Vuex.Store({
|
||||
uni.connectSocket({
|
||||
url: state.SOCKETURL
|
||||
})
|
||||
}, 1000)
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
uni.onSocketClose(err => {
|
||||
@ -60,13 +60,16 @@ const store = new Vuex.Store({
|
||||
uni.connectSocket({
|
||||
url: state.SOCKETURL
|
||||
})
|
||||
}, 1000)
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
socketOpenfalse(state) {
|
||||
state.socketOpen = false
|
||||
},
|
||||
//相当于同步的操作
|
||||
//点击确认
|
||||
integralsubscribesuccess(state) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user