|
@@ -4,18 +4,18 @@ |
|
@@ -4,18 +4,18 @@ |
4
|
const Page = require('../../utils/ald-stat.js').Page;
|
4
|
const Page = require('../../utils/ald-stat.js').Page;
|
5
|
const app = getApp();
|
5
|
const app = getApp();
|
6
|
Page({
|
6
|
Page({
|
7
|
- /**
|
|
|
8
|
- * 页面的初始数据
|
|
|
9
|
- */
|
|
|
10
|
- data: {
|
|
|
11
|
- showdoctor:false,//是否显示首页医生信息
|
|
|
12
|
- show_notest:false,//显示有记录和无记录之间的切换
|
|
|
13
|
- showfilesLog:false,//是否显示最新记录(没有记录不显示)
|
|
|
14
|
- filesLogdata:'',//档案数量
|
|
|
15
|
- doctorinfo:[],//医生信息
|
|
|
16
|
- fileslog:{},//最新记录
|
|
|
17
|
- },
|
|
|
18
|
- goaddrecord(files_id, patient){
|
7
|
+ /**
|
|
|
8
|
+ * 页面的初始数据
|
|
|
9
|
+ */
|
|
|
10
|
+ data: {
|
|
|
11
|
+ showdoctor: false, //是否显示首页医生信息
|
|
|
12
|
+ show_notest: false, //显示有记录和无记录之间的切换
|
|
|
13
|
+ showfilesLog: false, //是否显示最新记录(没有记录不显示)
|
|
|
14
|
+ filesLogdata: '', //档案数量
|
|
|
15
|
+ doctorinfo: [], //医生信息
|
|
|
16
|
+ fileslog: {}, //最新记录
|
|
|
17
|
+ },
|
|
|
18
|
+ goaddrecord(files_id, patient) {
|
19
|
wx.navigateTo({
|
19
|
wx.navigateTo({
|
20
|
url: '/pages/addrecord/addrecord?fields_id=' + files_id + '&patient=' + patient,
|
20
|
url: '/pages/addrecord/addrecord?fields_id=' + files_id + '&patient=' + patient,
|
21
|
success: function(res) {},
|
21
|
success: function(res) {},
|
|
@@ -23,24 +23,24 @@ Page({ |
|
@@ -23,24 +23,24 @@ Page({ |
23
|
complete: function(res) {},
|
23
|
complete: function(res) {},
|
24
|
})
|
24
|
})
|
25
|
},
|
25
|
},
|
26
|
- gointroduce(e){
|
26
|
+ gointroduce(e) {
|
27
|
console.log(e.currentTarget.dataset.id);
|
27
|
console.log(e.currentTarget.dataset.id);
|
28
|
wx.navigateTo({
|
28
|
wx.navigateTo({
|
29
|
url: '/pages/introduce/introduce?doctor_id=' + e.currentTarget.dataset.id,
|
29
|
url: '/pages/introduce/introduce?doctor_id=' + e.currentTarget.dataset.id,
|
30
|
- success: function (res) { },
|
|
|
31
|
- fail: function (res) { },
|
|
|
32
|
- complete: function (res) { },
|
30
|
+ success: function(res) {},
|
|
|
31
|
+ fail: function(res) {},
|
|
|
32
|
+ complete: function(res) {},
|
33
|
})
|
33
|
})
|
34
|
},
|
34
|
},
|
35
|
- gonormal(){
|
35
|
+ gonormal() {
|
36
|
wx.navigateTo({
|
36
|
wx.navigateTo({
|
37
|
url: '/pages/normal/normal',
|
37
|
url: '/pages/normal/normal',
|
38
|
- success: function (res) { },
|
|
|
39
|
- fail: function (res) { },
|
|
|
40
|
- complete: function (res) { },
|
38
|
+ success: function(res) {},
|
|
|
39
|
+ fail: function(res) {},
|
|
|
40
|
+ complete: function(res) {},
|
41
|
})
|
41
|
})
|
42
|
},
|
42
|
},
|
43
|
- goarticle(){
|
43
|
+ goarticle() {
|
44
|
wx.navigateTo({
|
44
|
wx.navigateTo({
|
45
|
url: '/pages/article/article',
|
45
|
url: '/pages/article/article',
|
46
|
success: function(res) {},
|
46
|
success: function(res) {},
|
|
@@ -48,14 +48,14 @@ Page({ |
|
@@ -48,14 +48,14 @@ Page({ |
48
|
complete: function(res) {},
|
48
|
complete: function(res) {},
|
49
|
})
|
49
|
})
|
50
|
},
|
50
|
},
|
51
|
- gorecord(e){
|
|
|
52
|
- let that=this;
|
|
|
53
|
- if (that.data.showfilesLog){
|
51
|
+ gorecord(e) {
|
|
|
52
|
+ let that = this;
|
|
|
53
|
+ if (that.data.showfilesLog) {
|
54
|
wx.navigateTo({
|
54
|
wx.navigateTo({
|
55
|
url: '/pages/record/record?showrecord=' + e.currentTarget.dataset.showrecord + '&files_id=' +
|
55
|
url: '/pages/record/record?showrecord=' + e.currentTarget.dataset.showrecord + '&files_id=' +
|
56
|
e.currentTarget.dataset.files_id,
|
56
|
e.currentTarget.dataset.files_id,
|
57
|
})
|
57
|
})
|
58
|
- }else{
|
58
|
+ } else {
|
59
|
wx.showToast({
|
59
|
wx.showToast({
|
60
|
title: '暂无记录',
|
60
|
title: '暂无记录',
|
61
|
icon: 'none',
|
61
|
icon: 'none',
|
|
@@ -63,99 +63,98 @@ Page({ |
|
@@ -63,99 +63,98 @@ Page({ |
63
|
})
|
63
|
})
|
64
|
}
|
64
|
}
|
65
|
},
|
65
|
},
|
66
|
- gofile_manage(files_id){
|
66
|
+ gofile_manage(files_id) {
|
67
|
console.log(files_id)
|
67
|
console.log(files_id)
|
68
|
wx.navigateTo({
|
68
|
wx.navigateTo({
|
69
|
url: '/pages/file_manage/file_manage?files_id=' + files_id,
|
69
|
url: '/pages/file_manage/file_manage?files_id=' + files_id,
|
70
|
})
|
70
|
})
|
71
|
},
|
71
|
},
|
72
|
//到文章详情
|
72
|
//到文章详情
|
73
|
- goarticle_details(e){
|
73
|
+ goarticle_details(e) {
|
74
|
console.log(e)
|
74
|
console.log(e)
|
75
|
wx.navigateTo({
|
75
|
wx.navigateTo({
|
76
|
- url: '/pages/article_detail/article_detail?id='+e.currentTarget.id,
|
76
|
+ url: '/pages/article_detail/article_detail?id=' + e.currentTarget.id,
|
77
|
success: function(res) {},
|
77
|
success: function(res) {},
|
78
|
fail: function(res) {},
|
78
|
fail: function(res) {},
|
79
|
complete: function(res) {},
|
79
|
complete: function(res) {},
|
80
|
})
|
80
|
})
|
81
|
},
|
81
|
},
|
82
|
//判断是否有医生id和是否登陆
|
82
|
//判断是否有医生id和是否登陆
|
83
|
- ifdoctorid(){
|
|
|
84
|
- let that=this;
|
|
|
85
|
- if (app.globalData.doctorid == 0) {//没有传过来的doctorid
|
|
|
86
|
- let url ='public/checkOpenid';
|
|
|
87
|
- let params={
|
|
|
88
|
- openid: wx.getStorageSync('openid')
|
|
|
89
|
- }
|
|
|
90
|
- app.post(url,params).then((res)=>{
|
|
|
91
|
- wx.setStorageSync('token', res.token);
|
|
|
92
|
- if (res.doctor_id==0){//没有关联医生
|
|
|
93
|
- that.setData({
|
|
|
94
|
- showdoctor:false
|
|
|
95
|
- })
|
|
|
96
|
- }else{//有关联医生获取医生详情
|
|
|
97
|
- app.globalData.doctor_id = res.doctor_id;
|
|
|
98
|
- app.globalData.doctorid = res.doctorid;
|
|
|
99
|
- that.getDoctorInfo(doctorid);
|
|
|
100
|
- }
|
|
|
101
|
- }).catch((errMsg)=>{
|
|
|
102
|
- console.log(errMsg)
|
|
|
103
|
- })
|
|
|
104
|
- }else{
|
|
|
105
|
- that.getDoctorInfo(app.globalData.doctorid);
|
|
|
106
|
- that.bindDoctor(app.globalData.doctorid);
|
|
|
107
|
- }
|
83
|
+ ifdoctorid(openid) {
|
|
|
84
|
+ let that = this;
|
|
|
85
|
+ let url = 'public/checkOpenid';
|
|
|
86
|
+ let params = {
|
|
|
87
|
+ openid:openid
|
|
|
88
|
+ }
|
|
|
89
|
+ app.post(url, params).then((res) => {
|
|
|
90
|
+ wx.setStorageSync('token', res.token);
|
|
|
91
|
+ if (res.doctor_id == 0) { //没有关联医生
|
|
|
92
|
+ if (app.globalData.doctorid == 0) { //没有传过来的doctorid
|
|
|
93
|
+ that.setData({
|
|
|
94
|
+ showdoctor: false
|
|
|
95
|
+ })
|
|
|
96
|
+ } else {
|
|
|
97
|
+ that.getDoctorInfo(app.globalData.doctorid);
|
|
|
98
|
+ that.bindDoctor(openid,app.globalData.doctorid);
|
|
|
99
|
+ }
|
|
|
100
|
+ } else { //有关联医生获取医生详情
|
|
|
101
|
+ app.globalData.doctor_id = res.doctor_id;
|
|
|
102
|
+ app.globalData.doctorid = res.doctorid;
|
|
|
103
|
+ that.getDoctorInfo(res.doctorid);
|
|
|
104
|
+ }
|
|
|
105
|
+ }).catch((errMsg) => {
|
|
|
106
|
+ console.log(errMsg)
|
|
|
107
|
+ })
|
108
|
},
|
108
|
},
|
109
|
//绑定医生
|
109
|
//绑定医生
|
110
|
- bindDoctor(doctorid){
|
|
|
111
|
- let that=this;
|
|
|
112
|
- let url ='public/bindDoctor';
|
|
|
113
|
- let params={
|
|
|
114
|
- openid: wx.getStorageSync('openid'),
|
|
|
115
|
- doctorid: doctorid
|
|
|
116
|
- }
|
|
|
117
|
- app.post(url,params).then((res)=>{
|
|
|
118
|
- }).catch((errMsg)=>{
|
|
|
119
|
- console.log(errMsg)
|
|
|
120
|
- })
|
110
|
+ bindDoctor(openid, doctorid) {
|
|
|
111
|
+ let that = this;
|
|
|
112
|
+ let url = 'public/bindDoctor';
|
|
|
113
|
+ let params = {
|
|
|
114
|
+ openid: openid,
|
|
|
115
|
+ doctorid: doctorid
|
|
|
116
|
+ }
|
|
|
117
|
+ app.post(url, params).then((res) => {}).catch((errMsg) => {
|
|
|
118
|
+ console.log(errMsg)
|
|
|
119
|
+ })
|
121
|
},
|
120
|
},
|
122
|
//获取医生详情,医生ID有两个用处不同
|
121
|
//获取医生详情,医生ID有两个用处不同
|
123
|
- getDoctorInfo(doctorid){
|
|
|
124
|
- let that=this;
|
|
|
125
|
- let url = 'index/getDoctorInfo';
|
|
|
126
|
- let params = {
|
|
|
127
|
- // doctorid: doctorid//暂时
|
|
|
128
|
- doctorid:'tigeryang01'
|
122
|
+ getDoctorInfo(doctorid) {
|
|
|
123
|
+ let that = this;
|
|
|
124
|
+ let url = 'index/getDoctorInfo';
|
|
|
125
|
+ let params = {
|
|
|
126
|
+ // doctorid: doctorid//暂时
|
|
|
127
|
+ doctorid: 'tigeryang01'
|
|
|
128
|
+ }
|
|
|
129
|
+ app.post(url, params).then((res) => {
|
|
|
130
|
+ if (res.avatar == '') {
|
|
|
131
|
+ res.avatar = '../../img/no_puimg.png'
|
129
|
}
|
132
|
}
|
130
|
- app.post(url, params).then((res) => {
|
|
|
131
|
- if (res.avatar == ''){
|
|
|
132
|
- res.avatar ='../../img/no_puimg.png'
|
|
|
133
|
- }
|
|
|
134
|
- that.setData({
|
|
|
135
|
- doctorinfo: res,
|
|
|
136
|
- showdoctor:true
|
|
|
137
|
- })
|
|
|
138
|
- }).catch((errMsg) => {
|
|
|
139
|
- console.log(errMsg)
|
|
|
140
|
- })
|
133
|
+ that.setData({
|
|
|
134
|
+ doctorinfo: res,
|
|
|
135
|
+ showdoctor: true
|
|
|
136
|
+ })
|
|
|
137
|
+ }).catch((errMsg) => {
|
|
|
138
|
+ console.log(errMsg)
|
|
|
139
|
+ })
|
141
|
},
|
140
|
},
|
142
|
//获取文章列表
|
141
|
//获取文章列表
|
143
|
- getArticleList(){
|
|
|
144
|
- let that=this;
|
|
|
145
|
- let url ='index/getArticleList';
|
|
|
146
|
- let params={//参数暂时
|
|
|
147
|
- doctor_id:1,
|
|
|
148
|
- page:1,
|
|
|
149
|
- list_rows:5
|
142
|
+ getArticleList() {
|
|
|
143
|
+ let that = this;
|
|
|
144
|
+ let url = 'index/getArticleList';
|
|
|
145
|
+ let params = { //参数暂时
|
|
|
146
|
+ doctor_id: 1,
|
|
|
147
|
+ page: 1,
|
|
|
148
|
+ list_rows: 5
|
150
|
}
|
149
|
}
|
151
|
app.post(url, params).then((res) => {
|
150
|
app.post(url, params).then((res) => {
|
152
|
- let list=res.data;
|
|
|
153
|
- for(let obj of list){
|
|
|
154
|
- if (obj.more.thumbnail==''){
|
|
|
155
|
- obj.more.thumbnail ='../../img/LoadFail.png'
|
151
|
+ let list = res.data;
|
|
|
152
|
+ for (let obj of list) {
|
|
|
153
|
+ if (obj.more.thumbnail == '') {
|
|
|
154
|
+ obj.more.thumbnail = '../../img/LoadFail.png'
|
156
|
}
|
155
|
}
|
157
|
}
|
156
|
}
|
158
|
- res.data=list;
|
157
|
+ res.data = list;
|
159
|
that.setData({
|
158
|
that.setData({
|
160
|
articlelist: res
|
159
|
articlelist: res
|
161
|
})
|
160
|
})
|
|
@@ -164,7 +163,7 @@ Page({ |
|
@@ -164,7 +163,7 @@ Page({ |
164
|
})
|
163
|
})
|
165
|
},
|
164
|
},
|
166
|
//到添加患者界面
|
165
|
//到添加患者界面
|
167
|
- goaddfile(){
|
166
|
+ goaddfile() {
|
168
|
wx.navigateTo({
|
167
|
wx.navigateTo({
|
169
|
url: '/pages/addfile/addfile',
|
168
|
url: '/pages/addfile/addfile',
|
170
|
success: function(res) {},
|
169
|
success: function(res) {},
|
|
@@ -173,53 +172,53 @@ Page({ |
|
@@ -173,53 +172,53 @@ Page({ |
173
|
})
|
172
|
})
|
174
|
},
|
173
|
},
|
175
|
//获取最新病情记录
|
174
|
//获取最新病情记录
|
176
|
- getLastFilesLog(){
|
|
|
177
|
- let that=this;
|
|
|
178
|
- let url ='index/getLastFilesLog';
|
|
|
179
|
- let params={
|
|
|
180
|
- 'openid': wx.getStorageSync('openid')
|
|
|
181
|
- }
|
|
|
182
|
- app.post(url,params).then((res)=>{
|
|
|
183
|
- if (res.more.length != 0 ){
|
|
|
184
|
- if (res.doctor_reply == null) {
|
|
|
185
|
- res.doctor_reply = '等待医生回复'
|
|
|
186
|
- }
|
|
|
187
|
- that.setData({
|
|
|
188
|
- showfilesLog:true,
|
|
|
189
|
- fileslog:res
|
|
|
190
|
- })
|
|
|
191
|
- }else{
|
|
|
192
|
- that.setData({
|
|
|
193
|
- showfilesLog: false,
|
|
|
194
|
- fileslog: res
|
|
|
195
|
- })
|
|
|
196
|
- }
|
|
|
197
|
- }).catch((errMsg)=>{
|
|
|
198
|
- console.log(errMsg)
|
|
|
199
|
- })
|
175
|
+ getLastFilesLog(openid) {
|
|
|
176
|
+ let that = this;
|
|
|
177
|
+ let url = 'index/getLastFilesLog';
|
|
|
178
|
+ let params = {
|
|
|
179
|
+ 'openid': openid
|
|
|
180
|
+ }
|
|
|
181
|
+ app.post(url, params).then((res) => {
|
|
|
182
|
+ if (res.more.length != 0) {
|
|
|
183
|
+ if (res.doctor_reply == null) {
|
|
|
184
|
+ res.doctor_reply = '等待医生回复'
|
|
|
185
|
+ }
|
|
|
186
|
+ that.setData({
|
|
|
187
|
+ showfilesLog: true,
|
|
|
188
|
+ fileslog: res
|
|
|
189
|
+ })
|
|
|
190
|
+ } else {
|
|
|
191
|
+ that.setData({
|
|
|
192
|
+ showfilesLog: false,
|
|
|
193
|
+ fileslog: res
|
|
|
194
|
+ })
|
|
|
195
|
+ }
|
|
|
196
|
+ }).catch((errMsg) => {
|
|
|
197
|
+ console.log(errMsg)
|
|
|
198
|
+ })
|
200
|
},
|
199
|
},
|
201
|
//获取档案数
|
200
|
//获取档案数
|
202
|
- getFilesNumber(){
|
|
|
203
|
- let that=this;
|
|
|
204
|
- let url='index/getFilesNumber';
|
|
|
205
|
- let params={
|
|
|
206
|
- openid: wx.getStorageSync('openid')
|
|
|
207
|
- }
|
|
|
208
|
- app.post(url, params).then((res) => {
|
|
|
209
|
- if(res==0){
|
|
|
210
|
- that.setData({
|
|
|
211
|
- filesLogdata:res,
|
|
|
212
|
- show_notest:true//显示没有档案,没有记录
|
|
|
213
|
- })
|
|
|
214
|
- }else{
|
|
|
215
|
- that.setData({
|
|
|
216
|
- filesLogdata: res,
|
|
|
217
|
- show_notest: false
|
201
|
+ getFilesNumber(openid) {
|
|
|
202
|
+ let that = this;
|
|
|
203
|
+ let url = 'index/getFilesNumber';
|
|
|
204
|
+ let params = {
|
|
|
205
|
+ openid: openid
|
|
|
206
|
+ }
|
|
|
207
|
+ app.post(url, params).then((res) => {
|
|
|
208
|
+ if (res == 0) {
|
|
|
209
|
+ that.setData({
|
|
|
210
|
+ filesLogdata: res,
|
|
|
211
|
+ show_notest: true //显示没有档案,没有记录
|
|
|
212
|
+ })
|
|
|
213
|
+ } else {
|
|
|
214
|
+ that.setData({
|
|
|
215
|
+ filesLogdata: res,
|
|
|
216
|
+ show_notest: false
|
|
|
217
|
+ })
|
|
|
218
|
+ }
|
|
|
219
|
+ }).catch((errMsg) => {
|
|
|
220
|
+ console.log(errMsg)
|
218
|
})
|
221
|
})
|
219
|
- }
|
|
|
220
|
- }).catch((errMsg) => {
|
|
|
221
|
- console.log(errMsg)
|
|
|
222
|
- })
|
|
|
223
|
},
|
222
|
},
|
224
|
//授权
|
223
|
//授权
|
225
|
getopwer(e) {
|
224
|
getopwer(e) {
|
|
@@ -236,17 +235,23 @@ Page({ |
|
@@ -236,17 +235,23 @@ Page({ |
236
|
wx.setStorageSync('openid', res.openid);
|
235
|
wx.setStorageSync('openid', res.openid);
|
237
|
wx.setStorageSync('session_key', res.session_key);
|
236
|
wx.setStorageSync('session_key', res.session_key);
|
238
|
if (e.currentTarget.dataset.tag == '1') {
|
237
|
if (e.currentTarget.dataset.tag == '1') {
|
|
|
238
|
+
|
239
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, '', '', e.currentTarget.dataset.tag);
|
239
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, '', '', e.currentTarget.dataset.tag);
|
|
|
240
|
+
|
|
|
241
|
+
|
240
|
} else if (e.currentTarget.dataset.tag == '2') {
|
242
|
} else if (e.currentTarget.dataset.tag == '2') {
|
|
|
243
|
+
|
241
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, e.currentTarget.dataset.files_id, '', e.currentTarget.dataset.tag);
|
244
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, e.currentTarget.dataset.files_id, '', e.currentTarget.dataset.tag);
|
|
|
245
|
+
|
|
|
246
|
+
|
242
|
} else if (e.currentTarget.dataset.tag == '3') {
|
247
|
} else if (e.currentTarget.dataset.tag == '3') {
|
|
|
248
|
+
|
243
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient, e.currentTarget.dataset.tag);
|
249
|
that.login(res.openid, res.session_key, e.detail.encryptedData, e.detail.iv, e.currentTarget.dataset.files_id, e.currentTarget.dataset.patient, e.currentTarget.dataset.tag);
|
|
|
250
|
+
|
|
|
251
|
+
|
244
|
}
|
252
|
}
|
245
|
-
|
|
|
246
|
- // 调用sendSession方法,将session_key以参数形式传入
|
|
|
247
|
- that.aldstat.sendSession(res.session_key);
|
|
|
248
|
- // 调用sendOpenid方法,将openid以参数形式传入
|
|
|
249
|
- that.aldstat.sendOpenid(res.openid);
|
253
|
+
|
|
|
254
|
+
|
250
|
}).catch((errMsg) => {
|
255
|
}).catch((errMsg) => {
|
251
|
console.log(errMsg)
|
256
|
console.log(errMsg)
|
252
|
})
|
257
|
})
|
|
@@ -254,7 +259,7 @@ Page({ |
|
@@ -254,7 +259,7 @@ Page({ |
254
|
})
|
259
|
})
|
255
|
},
|
260
|
},
|
256
|
//用户登陆
|
261
|
//用户登陆
|
257
|
- login(openid, session_key, encryptedData, iv, files_id='', patient='',tag) {
|
262
|
+ login(openid, session_key, encryptedData, iv, files_id = '', patient = '', tag) {
|
258
|
console.log('files_id', files_id);
|
263
|
console.log('files_id', files_id);
|
259
|
console.log('patient', patient);
|
264
|
console.log('patient', patient);
|
260
|
console.log('tag', tag);
|
265
|
console.log('tag', tag);
|
|
@@ -272,80 +277,99 @@ Page({ |
|
@@ -272,80 +277,99 @@ Page({ |
272
|
that.setData({
|
277
|
that.setData({
|
273
|
userInfo: app.globalData.userInfo,
|
278
|
userInfo: app.globalData.userInfo,
|
274
|
})
|
279
|
})
|
275
|
- if(tag=='1'){
|
280
|
+ if (tag == '1') {
|
276
|
that.goaddfile();
|
281
|
that.goaddfile();
|
277
|
- }else if(tag=='2'){
|
282
|
+ } else if (tag == '2') {
|
278
|
that.gofile_manage(files_id);
|
283
|
that.gofile_manage(files_id);
|
279
|
- }else if(tag == '3'){
|
284
|
+ } else if (tag == '3') {
|
280
|
that.goaddrecord(files_id, patient);
|
285
|
that.goaddrecord(files_id, patient);
|
281
|
}
|
286
|
}
|
282
|
}).catch((errMsg) => {
|
287
|
}).catch((errMsg) => {
|
283
|
console.log(errMsg)
|
288
|
console.log(errMsg)
|
284
|
})
|
289
|
})
|
285
|
},
|
290
|
},
|
286
|
- /**
|
|
|
287
|
- * 生命周期函数--监听页面加载
|
|
|
288
|
- */
|
|
|
289
|
- onLoad: function (options) {
|
|
|
290
|
- let that=this;
|
|
|
291
|
- that.ifdoctorid();//判断是否有医生ID
|
|
|
292
|
- that.getArticleList();//获取文章列表
|
|
|
293
|
- that.getFilesNumber();//获取档案数量
|
|
|
294
|
- let openid = wx.getStorageSync('openid');//获取最新记录
|
|
|
295
|
- if(openid != ''){
|
|
|
296
|
- that.getLastFilesLog();
|
291
|
+ /**
|
|
|
292
|
+ * 生命周期函数--监听页面加载
|
|
|
293
|
+ */
|
|
|
294
|
+ onLoad: function(options) {
|
|
|
295
|
+ let that = this;
|
|
|
296
|
+ wx.login({
|
|
|
297
|
+ success: (res) => {
|
|
|
298
|
+ let url = 'public/getSessionKey';
|
|
|
299
|
+ let params = {
|
|
|
300
|
+ code: res.code
|
|
|
301
|
+ }
|
|
|
302
|
+ app.post(url, params).then((res) => {
|
|
|
303
|
+ wx.setStorageSync('openid', res.openid)
|
|
|
304
|
+ that.ifdoctorid(res.openid); //判断是否有医生ID
|
|
|
305
|
+ that.getArticleList(res.openid); //获取文章列表
|
|
|
306
|
+ that.getFilesNumber(res.openid); //获取档案数量
|
|
|
307
|
+ that.getLastFilesLog(res.openid);
|
|
|
308
|
+ app.setStatisticsVisitorLog('/pages/index/index'); //统计打开界面数量
|
|
|
309
|
+ }).catch((errMsg) => {
|
|
|
310
|
+ console.log(errMsg)
|
|
|
311
|
+ })
|
297
|
}
|
312
|
}
|
298
|
- app.setStatisticsVisitorLog('/pages/index/index');//统计打开界面数量
|
|
|
299
|
- },
|
|
|
300
|
- /**
|
|
|
301
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
302
|
- */
|
|
|
303
|
- onReady: function () {
|
|
|
304
|
- },
|
|
|
305
|
- /**
|
|
|
306
|
- * 生命周期函数--监听页面显示
|
|
|
307
|
- */
|
|
|
308
|
- onShow: function (options) {
|
313
|
+ })
|
|
|
314
|
+ },
|
|
|
315
|
+ /**
|
|
|
316
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
317
|
+ */
|
|
|
318
|
+ onReady: function() {},
|
|
|
319
|
+ /**
|
|
|
320
|
+ * 生命周期函数--监听页面显示
|
|
|
321
|
+ */
|
|
|
322
|
+ onShow: function(options) {
|
309
|
let that = this;
|
323
|
let that = this;
|
310
|
- that.ifdoctorid();//判断是否有医生ID
|
|
|
311
|
- that.getArticleList();//获取文章列表
|
|
|
312
|
- that.getFilesNumber();//获取档案数量
|
|
|
313
|
- let openid = wx.getStorageSync('openid');//获取最新记录
|
|
|
314
|
- if (openid != '') {
|
|
|
315
|
- that.getLastFilesLog();
|
|
|
316
|
- }
|
|
|
317
|
- },
|
|
|
318
|
- /**
|
|
|
319
|
- * 生命周期函数--监听页面隐藏
|
|
|
320
|
- */
|
|
|
321
|
- onHide: function () {
|
|
|
322
|
-
|
|
|
323
|
- },
|
|
|
324
|
- /**
|
|
|
325
|
- * 生命周期函数--监听页面卸载
|
|
|
326
|
- */
|
|
|
327
|
- onUnload: function () {
|
|
|
328
|
-
|
|
|
329
|
- },
|
324
|
+ wx.login({
|
|
|
325
|
+ success: (res) => {
|
|
|
326
|
+ let url = 'public/getSessionKey';
|
|
|
327
|
+ let params = {
|
|
|
328
|
+ code: res.code
|
|
|
329
|
+ }
|
|
|
330
|
+ app.post(url, params).then((res) => {
|
|
|
331
|
+ that.ifdoctorid(res.openid); //判断是否有医生ID
|
|
|
332
|
+ that.getArticleList(res.openid); //获取文章列表
|
|
|
333
|
+ that.getFilesNumber(res.openid); //获取档案数量
|
|
|
334
|
+ that.getLastFilesLog(res.openid);
|
|
|
335
|
+
|
|
|
336
|
+ }).catch((errMsg) => {
|
|
|
337
|
+ console.log(errMsg)
|
|
|
338
|
+ })
|
|
|
339
|
+ }
|
|
|
340
|
+ })
|
|
|
341
|
+ },
|
|
|
342
|
+ /**
|
|
|
343
|
+ * 生命周期函数--监听页面隐藏
|
|
|
344
|
+ */
|
|
|
345
|
+ onHide: function() {
|
330
|
|
346
|
|
331
|
- /**
|
|
|
332
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
333
|
- */
|
|
|
334
|
- onPullDownRefresh: function () {
|
|
|
335
|
-
|
|
|
336
|
- },
|
347
|
+ },
|
|
|
348
|
+ /**
|
|
|
349
|
+ * 生命周期函数--监听页面卸载
|
|
|
350
|
+ */
|
|
|
351
|
+ onUnload: function() {
|
337
|
|
352
|
|
338
|
- /**
|
|
|
339
|
- * 页面上拉触底事件的处理函数
|
|
|
340
|
- */
|
|
|
341
|
- onReachBottom: function () {
|
|
|
342
|
-
|
|
|
343
|
- },
|
353
|
+ },
|
344
|
|
354
|
|
345
|
- /**
|
|
|
346
|
- * 用户点击右上角分享
|
|
|
347
|
- */
|
|
|
348
|
- onShareAppMessage: function () {
|
|
|
349
|
-
|
|
|
350
|
- }
|
355
|
+ /**
|
|
|
356
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
357
|
+ */
|
|
|
358
|
+ onPullDownRefresh: function() {
|
|
|
359
|
+
|
|
|
360
|
+ },
|
|
|
361
|
+
|
|
|
362
|
+ /**
|
|
|
363
|
+ * 页面上拉触底事件的处理函数
|
|
|
364
|
+ */
|
|
|
365
|
+ onReachBottom: function() {
|
|
|
366
|
+
|
|
|
367
|
+ },
|
|
|
368
|
+
|
|
|
369
|
+ /**
|
|
|
370
|
+ * 用户点击右上角分享
|
|
|
371
|
+ */
|
|
|
372
|
+ onShareAppMessage: function() {
|
|
|
373
|
+
|
|
|
374
|
+ }
|
351
|
}) |
375
|
}) |