AccountOrderCheckingDetailService.js 1.5 KB
"use strict";
var AccountOrderCheckingDetailService = angular.module('AccountOrderCheckingDetailService',[]);

AccountOrderCheckingDetailService.service("AccountOrderCheckingDetailService", [
	'$rootScope',
	'BaseService',
	function ($rootScope,BaseService) {
		var _service = {
				orders:[],
				orderDetailBean:[],
				//获取订单列表
				orderPagerList:function(queryParam){
					BaseService.request({
						url:BaseService.url.accountOrderPager_url,
						method:'post',
						mark:true,
						data:queryParam,
						fn:function(response) {
							if(response.code == 0) {
								_service.orders = response.data;
								$rootScope.$broadcast('orders.list');
							}
						}
					});
				},
				//获取订单详情
				orderDetail:function(orderCode){
					BaseService.request({
						url:BaseService.url.accountOrder_detail_url+orderCode,
						method:'POST',
						mark:true,
						fn:function(response) {
							if(response.code == 0) {
								_service.orderDetailBean = response.data;
								$rootScope.$broadcast('orders.detail');
							}
						}
					});
				},
				//获取订单状态列表
				statusList:function(){
					BaseService.request({
						url:BaseService.url.accountOrder_status_url,
						method:'post',
						mark:true,
						fn:function(response) {
							if(response.code == 0) {
								_service.orderStatusList = response.data;
								$rootScope.$broadcast('orders.orderStatusList');
							}
						}
					});
				},
		};
		return _service;
	}]);