std_material_info.js 734 B

12345678910111213141516171819202122232425262728293031
  1. app.controller('StdMaterialInfoCtrl', [ '$rootScope', '$scope','$stateParams', function($rootScope, $scope,$stateParams) {
  2. if ($stateParams == undefined || $stateParams.material_id == undefined) {
  3. $.alert('参数错误,无法获取图片详细信息', function() {
  4. $rootScope.goWechat();
  5. });
  6. return;
  7. }
  8. $scope.getMaterial = function(){
  9. $rootScope.ajaxRequest({
  10. url : '../enrol/std/material/find.htm',
  11. data: {
  12. material_id:$stateParams.material_id
  13. }
  14. }, function(response) {
  15. $scope.material = response.entity;
  16. });
  17. }
  18. $scope.uploadMaterial = function(){
  19. $rootScope.uploadStdMaterial($scope.material.material_type,function(){
  20. $scope.getMaterial();
  21. });
  22. }
  23. $scope.getMaterial();
  24. } ])