|
@@ -208,7 +208,7 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
|
|
|
if (response.success === 1 && response.message === '查询成功') {
|
|
|
_this.picker = response.items.map(function (item) {return item.departmentname;});
|
|
|
_this.picker.unshift('全部科室');
|
|
|
- console.log("picker: ", _this.picker);
|
|
|
+ uni.setStorageSync('departmentList', _this.picker);
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: '科室数据获取失败,请重试...',
|
|
@@ -273,6 +273,11 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
|
|
|
},
|
|
|
onShow: function onShow() {
|
|
|
this.getList();
|
|
|
+ var departmentList = uni.getStorageSync('departmentList');
|
|
|
+ if (departmentList) {
|
|
|
+ this.picker = departmentList;
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.getAllDepartments();
|
|
|
} };exports.default = _default;
|
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|