1234567891011121314151617181920212223242526272829303132333435363738 |
- angular.module('push')
- .controller('addChatFriendsCtrl', function ($scope, UtilService, ScienceCircleService) {
- if($scope.app){
- $scope.setStatusBar(0);
- }
- $scope.searchuser = {key: ""};
- $scope.shownone = false;
- // 搜索用户
- $scope.searchUser = function () {
- if (!UtilService.isDefined($scope.searchuser.key)) {
- return;
- }
- $scope.showLoadingToast();
- ScienceCircleService.searchUser($scope.searchuser.key, 1).then(function (response) {
- console.log(response);
- $scope.userList = response.data.user;
- if ($scope.userList.length < 1) {
- $scope.shownone = true;
- } else {
- $scope.shownone = false;
- }
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- $scope.clearSearch = function () {
- $scope.searchuser.key = "";
- };
- // 进入个人主页
- $scope.goChatPublisher = function (userId) {
- $scope.go('publisher', {Id: userId});
- };
- });
|