用一个流氓办法确保显示历史搜索记录

This commit is contained in:
luchenqun 2017-04-10 20:11:44 +08:00
parent 27821c8936
commit 0dcc25b1a1
2 changed files with 10 additions and 8 deletions

View File

@ -33,7 +33,7 @@
**MySql**: 用来做数据存储。 **MySql**: 用来做数据存储。
**AngularJS**:大家都懂的。 **AngularJS**:大家都懂的。
**jQuery**: 大家都懂的。本来用了AngularJS是不需要再使用jQuery了的。但是有些功能AngularJS要大费周章才能完成jQuery一句代码就能解决。所以还是忍不住将它导入了进来。 **jQuery**: 大家都懂的。本来用了AngularJS是不需要再使用jQuery了的。但是有些功能AngularJS要大费周章才能完成jQuery一句代码就能解决。所以还是忍不住将它导入了进来。
**mongo**保存登陆的session。 **mongo**后台保存登陆的session。
**Semantic**由于没有美工人员自己开发的不想界面太丑用了这套UI。 **Semantic**由于没有美工人员自己开发的不想界面太丑用了这套UI。
5 目录结构 5 目录结构

View File

@ -187,12 +187,14 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
bookmarkService.userInfo({}) bookmarkService.userInfo({})
.then((data) => { .then((data) => {
$scope.searchHistory = JSON.parse(data.search_history || '[]'); $scope.searchHistory = JSON.parse(data.search_history || '[]');
for (var i = 1; i <= 100; i += 10) {
$timeout(function() { $timeout(function() {
$('.search-item').popup({ $('.search-item').popup({
on: 'focus', on: 'focus',
inline: true inline: true
}); });
}, 1000) }, 100 * i)
}
}) })
.catch((err) => { .catch((err) => {
toastr.error('获取信息失败。错误信息:' + JSON.stringify(err), "错误"); toastr.error('获取信息失败。错误信息:' + JSON.stringify(err), "错误");