diff --git a/pages/investigates/allCmpInv.vue b/pages/investigates/allCmpInv.vue index b833282..e757648 100644 --- a/pages/investigates/allCmpInv.vue +++ b/pages/investigates/allCmpInv.vue @@ -1,6 +1,8 @@ @@ -8,7 +10,8 @@ export default { data() { return { - userInfo: {} + userInfo: {}, + isLoading: false } }, onLoad() { @@ -66,6 +69,42 @@ invId: this.userInfo.investigates[key].id } }); + }, + onRefresh() { + setTimeout(() => { + var rp = require('request-promise'); + var options = { + method: 'POST', + uri: 'http://101.201.70.76:8211/getUserById', + form: { + id: this.$cookies.get("userInfo").id, + } + }; + rp(options).then(res => { + this.isLoading = false; + if(res == "error") { + this.$toast.fail('获取用户信息识别,未找到用户信息'); + } else { + this.userInfo = JSON.parse(res); + console.log(this.userInfo); + for(var i = 0; i < this.userInfo.investigates.length; i++){ + if(this.userInfo.investigates[i].visible){ + this.userInfo.investigates[i].statusText = "已审核"; + } else { + this.userInfo.investigates[i].statusText = "未审核"; + } + + } + this.$forceUpdate(); + this.$toast.success('刷新成功'); + } + // console.log(this.note.backgroundImage) + }).catch(err => { + this.isLoading = false; + this.$toast.fail('获取用户信息, 请检查网络连接'); + console.log(err); + }); + }, 500); } } }