storeEnterCommunity.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. (function(vc){
  2. vc.extends({
  3. data:{
  4. storeEnterCommunityInfo:{
  5. communityInfo:[],
  6. errorInfo:''
  7. }
  8. },
  9. _initMethod:function(){
  10. },
  11. _initEvent:function(){
  12. vc.on('storeEnterCommunity','openStoreEnterCommunity',function(_params){
  13. $('#storeEnterCommunityModel').modal('show');
  14. vc.component.listNoEnterCommunity();
  15. });
  16. },
  17. methods:{
  18. _saveEnterCommunity:function(){
  19. var param = {};
  20. vc.component.storeEnterCommunityInfo.errorInfo = "";
  21. vc.http.post(
  22. 'storeEnterCommunity',
  23. 'enterCommunity',
  24. JSON.stringify(param),
  25. {
  26. emulateJSON:true
  27. },
  28. function(json,res){
  29. //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
  30. if(res.status == 200){
  31. //关闭model
  32. $('#storeEnterCommunityModel').modal('hide');
  33. vc.emit('enterCommunity','listMyCommunity',{});
  34. return ;
  35. }
  36. vc.component.storeEnterCommunityInfo.errorInfo = json;
  37. },
  38. function(errInfo,error){
  39. console.log('请求失败处理');
  40. vc.component.storeEnterCommunityInfo.errorInfo = errInfo;
  41. });
  42. },
  43. listNoEnterCommunity:function(){
  44. vc.loading('open');
  45. var param = {
  46. params:{
  47. msg:'123'
  48. }
  49. }
  50. //发送get请求
  51. vc.http.get('storeEnterCommunity',
  52. 'listNoEnterCommunity',
  53. param,
  54. function(json,res){
  55. vc.component.storeEnterCommunityInfo.communityInfo=JSON.parse(json);
  56. vc.loading('close');
  57. },function(errInfo,error){
  58. console.log('请求失败处理');
  59. vc.loading('close');
  60. }
  61. );
  62. },
  63. _saveEnterCommunity:function(_communityInfo){
  64. var _param = {
  65. communityId:_communityInfo.communityId
  66. };
  67. //发送get请求
  68. vc.http.post('storeEnterCommunity',
  69. '_saveEnterCommunity',
  70. JSON.stringify(vc.component.registerInfo),
  71. {
  72. emulateJSON:true
  73. },
  74. function(json,res){
  75. if(res.status == 200){
  76. vc.jumpToPage("/flow/login");
  77. return ;
  78. }
  79. vc.component.storeEnterCommunityInfo.errorInfo = json;
  80. },function(errInfo,error){
  81. console.log('请求失败处理');
  82. vc.component.storeEnterCommunityInfo.errorInfo = json;
  83. }
  84. );
  85. }
  86. }
  87. });
  88. })(window.vc);