From e4f573060fc201196d67317fdebe816ec170e33f Mon Sep 17 00:00:00 2001 From: callmeyan Date: Thu, 27 Jun 2019 20:32:07 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/user/index.js | 25 ++++++++++++------------- utils/api.js | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pages/user/index.js b/pages/user/index.js index 802ac3c..43478e7 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -61,30 +61,29 @@ Page({ * 初始化用户数据 */ async initUserData() { - let evaluationData = await api.queryAllEvaluation(); - var tags = []; - console.log(evaluationData); - evaluationData.forEach((o,i) => { - tags.push(true); - }) let d = app.globalData.userInfo.detail; medicalList.forEach((o, i) => { medicalList[i].checked = d.medical_history.indexOf(i) != -1 }) smokeList[d.smoke].checked = true; - // d['address'] = this.parseUserAddress( - // d.province,d.city - // ) + this.setData({ - userDetail:d, + userDetail: d, userInfo: app.globalData.userInfo, - dataList: evaluationData, - collapseTags: tags, subjects: { - smoke:smokeList, + smoke: smokeList, medical_histories: medicalList } }); + let evaluationData = await api.queryAllEvaluation(); + var tags = []; + evaluationData.forEach((o, i) => { + tags.push(true); + }); + this.setData({ + dataList: evaluationData, + collapseTags: tags + }); }, parseUserAddress(province,city){ diff --git a/utils/api.js b/utils/api.js index c329687..9ebf16f 100644 --- a/utils/api.js +++ b/utils/api.js @@ -1,4 +1,4 @@ -const API_URL = 'http://192.168.10.121:8000'; +const API_URL = 'http://127.0.0.1:8000'; const getOpenId = () => { return getApp().globalData.openId;