From 0077fa47abc07ae0c2fc7fa4d2676a58ae516b08 Mon Sep 17 00:00:00 2001 From: suvvm <915269675@qq.com> Date: Wed, 4 Dec 2019 15:48:51 +0800 Subject: [PATCH] =?UTF-8?q?allCmpInv=E6=B7=BB=E5=8A=A0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigates/allCmpInv.vue | 43 ++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) 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); } } }