You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue.js 2.7 kB

10 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
10 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
10 years ago
​
​
​
​
​
​
​
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common',
  2. function($scope, $http, $routeParams, auth, common){
  3. var vm = $scope;
  4. vm.previewImgUrls = [];
  5. common.init({
  6. id: $routeParams.id,
  7. scope: $scope,
  8. at_enabled: true,
  9. type: 'issues',
  10. replyType: 'Issue',
  11. urlName: 'issues',
  12. loadCallback: function(data){
  13. console.log(data.data);
  14. if(data.status == -1){
  15. $scope.showtip = true;
  16. return;
  17. }
  18. //回复级别 0 一级回复 1 二级回复
  19. replytype = data.type;
  20. page = data.page;
  21. var parseImgAttachment = function(attachments){
  22. var urls = [];
  23. if(!attachments){
  24. return urls;
  25. }
  26. for(var i = attachments.length-1; i>=0; i--){
  27. if(attachments[i].filename.match('.jpg$')=='.jpg' || attachments[i].filename.match('.png$')=='.png'){
  28. urls.push(attachments[i].download_url);
  29. attachments.splice(i, 1);
  30. }
  31. }
  32. return urls;
  33. };
  34. if (replytype == 0){
  35. if (page == 0){
  36. $scope.object = data.data;
  37. $scope.page = 0;
  38. $scope.is_public = data.is_public;
  39. $scope.previewImgUrls = parseImgAttachment($scope.object.attachments);
  40. }
  41. else{
  42. $scope.object.all_children = $scope.object.all_children.concat(data.data.all_children);
  43. }
  44. $scope.has_more = $scope.object.all_children.length < $scope.object.comment_count;
  45. console.log($scope.has_more);
  46. }
  47. else{
  48. comment_id = data.data.id;
  49. for (var i in $scope.object.all_children) {
  50. var comment = $scope.object.all_children[i];
  51. if(comment.id == comment_id){
  52. // comment.parents_reply_top = comment.parents_reply_top.concat(data.data.parents_reply_top);
  53. comment.parents_reply_top = data.data.parents_reply_top.concat(comment.parents_reply_top);
  54. }
  55. }
  56. }
  57. },
  58. replyCallback: function(){
  59. }
  60. });
  61. $scope.previewImg = function(index){
  62. console.log(index);
  63. wx.previewImage({
  64. current: $scope.previewImgUrls[index], // 当前显示图片的http链接
  65. urls: $scope.previewImgUrls // 需要预览的图片http链接列表
  66. });
  67. }
  68. }]);

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...