SendMessagesService.js
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"use strict";
var SendMessagesService = angular.module('SendMessagesService',[]);
SendMessagesService.service("SendMessagesService", [
'$rootScope',
'BaseService',
function ($rootScope,BaseService) {
var _service = {
operations:[],
operationPager:function(condition){
BaseService.request({
url:BaseService.url.operationPager_url,
method:'post',
mark:true,
data:condition,
fn:function(response) {
if(response.code == 0) {
_service.operations = response.data;
$rootScope.$broadcast('operation.list');
}
}
});
},
sendSms:function (sms,callback) {
BaseService.request({
url:BaseService.url.sendSms_url,
method:'post',
data:sms,
mark:true,
fn:function(data){
if(callback) {
callback.call(this,data);
}
BaseService.updateAlert(data.message,data.code);
}
});
}
}
return _service;
}]);