hh-doctor-sdk 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const doctorLoader = require('../../public/doctor-loader')
|
|
2
|
+
const cache = require('../../public/cache-data')
|
|
2
3
|
|
|
3
4
|
Page({
|
|
4
5
|
|
|
@@ -39,6 +40,9 @@ Page({
|
|
|
39
40
|
wx.statLog.sendStatLog(null, '打开咨询单列表界面')
|
|
40
41
|
const doctorId = wx.getStorageSync('doctorId') || ''
|
|
41
42
|
const isTest = (getApp().globalData.profileName || 'prod') == 'test'
|
|
43
|
+
cache.cache({
|
|
44
|
+
isTest: isTest
|
|
45
|
+
})
|
|
42
46
|
doctorLoader.loadDoctor({
|
|
43
47
|
doctorId: doctorId,
|
|
44
48
|
isTest: isTest,
|
|
@@ -17,14 +17,10 @@ function loadDoctor(options, callback) {
|
|
|
17
17
|
// 由于后续所有联网请求都需要doctorId所以在此缓存doctorId在联网公共参数会用到
|
|
18
18
|
if (doctorId === cache.doctorId() && cache.doctor() !== null) {
|
|
19
19
|
// 如果传入的doctorId和以前已经加载过的doctorId一致并且doctor数据不为空可以不再次加载doctor数据
|
|
20
|
-
cache.cache({
|
|
21
|
-
isTest: options.isTest || false
|
|
22
|
-
})
|
|
23
20
|
} else {
|
|
24
21
|
// 如果传入是新的doctorId,重新缓存doctorId并重置doctor为空
|
|
25
22
|
cache.cache({
|
|
26
23
|
doctorId: doctorId,
|
|
27
|
-
isTest: options.isTest || false,
|
|
28
24
|
doctor: null
|
|
29
25
|
})
|
|
30
26
|
}
|