my.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. (function (app) {
  2. app.controller('myCtrl', ["$scope","$ionicTabsDelegate", "$state", "$http", "storage", "myService", "common", "config", "msg","$timeout"
  3. , function ($scope,$ionicTabsDelegate, $state, $http, storage, myService, common, config, msg, $timeout) {
  4. $scope.$on('$ionicView.beforeEnter', function (viewResult) {
  5. $ionicTabsDelegate.showBar(true);
  6. myService.myInfo().then(function(result){
  7. $scope.user = result.data.data
  8. });
  9. });
  10. $scope.setAvator = function () {
  11. common.setAvator().then(function (result) {
  12. var response = JSON.parse(result.response);
  13. $timeout(function () {
  14. $scope.user.avatar = config.imgServer + response.data.md5;
  15. });
  16. });
  17. };
  18. }]);
  19. app.controller('profileCtrl', ["$scope", "$timeout","$ionicTabsDelegate","$state","$filter", "storage", "myService", "msg", "common"
  20. , function ($scope, $timeout, $ionicTabsDelegate, $state, $filter, storage, myService, msg, common) {
  21. $scope.$on('$ionicView.beforeEnter', function () {
  22. $ionicTabsDelegate.showBar(false);
  23. });
  24. $scope.setAvator = function () {
  25. common.setAvator().then(function (result) {
  26. var response = JSON.parse(result.response);
  27. $timeout(function () {
  28. $scope.vm.avatar = config.imgServer + response.data.md5;
  29. });
  30. });
  31. };
  32. //保存个人信息
  33. $scope.vm={
  34. pic:"",
  35. sex:"",
  36. signture:"",
  37. emotion:"",
  38. job:"",
  39. tall:""
  40. };
  41. $scope.$on('$ionicView.beforeEnter', function () {
  42. msg.loading();
  43. myService.myInfo().then(function(result){
  44. // alert(JSON.stringify(result.data.data));
  45. $scope.vm = result.data.data;
  46. $scope.vm.sex = $scope.vm.sex+'';
  47. $scope.vm.emotion = $scope.vm.emotion+'';
  48. if($scope.vm.birthday){
  49. var arr1 = $scope.vm.birthday.split("-");
  50. $scope.vm.birthday1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]);
  51. }
  52. msg.hide();
  53. },function(error){
  54. msg.hide();
  55. // msg.error(error.data.message);
  56. })
  57. });
  58. $scope.saveMaterial = function(){
  59. var data = {
  60. sex:$scope.vm.sex,
  61. signture:$scope.vm.signture,
  62. emotion:$scope.vm.emotion,
  63. work:$scope.vm.work,
  64. height:$scope.vm.height,
  65. city:$scope.vm.city
  66. };
  67. if($scope.vm.birthday1){
  68. data.birthday = $filter('date')($scope.vm.birthday1, "yyyy-MM-dd");
  69. }
  70. if($scope.vm.avatar){
  71. data.pic = $scope.vm.avatar;
  72. }
  73. msg.loading('提交中...');
  74. myService.saveMaterial(data).then(function(result){
  75. msg.hide();
  76. msg.success("保存成功!");
  77. $state.go('app.my');
  78. myService.myInfo();
  79. },function(error){
  80. msg.hide();
  81. msg.error(error.data.message);
  82. })
  83. }
  84. }]);
  85. app.controller('settingCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  86. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  87. $scope.$on('$ionicView.beforeEnter', function () {
  88. $ionicTabsDelegate.showBar(false);
  89. });
  90. //退出登陆
  91. $scope.logout = function(){
  92. storage.remove("token");
  93. storage.remove("user");
  94. $state.go("login");
  95. }
  96. }]);
  97. app.controller('aboutMiaoCtrl', ["$scope","$ionicTabsDelegate","$timeout", "$state", "myService", "msg","storage"
  98. , function ($scope,$ionicTabsDelegate,$timeout, $state,myService, msg, storage) {
  99. $scope.$on('$ionicView.beforeEnter', function () {
  100. $scope.aboutMiao();
  101. });
  102. $scope.aboutMiao = function(){
  103. myService.aboutMiao().then(function(result){
  104. $scope.items = result.data.data;
  105. debugger;
  106. },function(error){
  107. msg.error(error.data.message)
  108. })
  109. };
  110. }]);
  111. app.controller('withdrawCtrl', ["$scope","$ionicTabsDelegate","$timeout", "$state", "myService", "msg","storage"
  112. , function ($scope,$ionicTabsDelegate, $timeout,$state,myService, msg, storage) {
  113. $scope.vm={
  114. pay:"",
  115. cash:""
  116. };
  117. $scope.$on("$ionicView.enter",function(){
  118. myService.showAccount().then(function(result){
  119. var items = result.data.data;
  120. $scope.pays=[];
  121. angular.forEach(items,function(item){
  122. var value=item.bank_name+"(";
  123. var len=item.bank_number.length;
  124. var txt1=item.bank_number.substr(0,len-4).replace(/\d+/g,'**');
  125. var txt2=item.bank_number.substr(len-4,4);
  126. value=value+txt1+txt2+")";
  127. $scope.pays.push({id:item.id,value:value});
  128. })
  129. },function(error){
  130. msg.error(error.data.message)
  131. })
  132. });
  133. $scope.withdraw = function(){
  134. var data = {
  135. data:{
  136. bank_id:$scope.vm.pay.id,
  137. cash:$scope.vm.cash
  138. }
  139. };
  140. myService.withdraw(data).then(function(result){
  141. msg.text("提现申请已提交");
  142. $timeout(function () {
  143. $state.go("app.my");
  144. },1000);
  145. },function(error){
  146. })
  147. }
  148. }]);
  149. app.controller('payoutCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  150. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  151. }]);
  152. app.controller('payExplainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  153. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  154. $scope.$on('$ionicView.beforeEnter', function () {
  155. $scope.payExplain();
  156. });
  157. $scope.payExplain = function(){
  158. myService.payExplain().then(function(result){
  159. $scope.items = result.data.data;
  160. },function(error){
  161. msg.error(error.data.message)
  162. })
  163. };
  164. }]);
  165. app.controller('explainCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  166. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  167. }]);
  168. app.controller('contactCtrl', ["$scope","$ionicTabsDelegate", "$timeout","$state", "myService", "msg","storage"
  169. , function ($scope,$ionicTabsDelegate, $timeout,$state,myService, msg, storage) {
  170. $scope.vm={
  171. content:"",
  172. email:""
  173. };
  174. $scope.contact = function(){
  175. var data={
  176. data:{
  177. content:$scope.vm.content,
  178. email:$scope.vm.email
  179. }
  180. };
  181. myService.contact(data).then(function(result){
  182. msg.text("发送成功");
  183. $timeout(function(){
  184. $state.go("app.my");
  185. },1000);
  186. },function(error){
  187. msg.error(error.data.message);
  188. })
  189. }
  190. }]);
  191. app.controller('attentionCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  192. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  193. $scope.$on('$ionicView.beforeEnter', function () {
  194. myService.attention().then(function(result){
  195. $scope.users = result.data.data;
  196. },function(error){
  197. })
  198. });
  199. $scope.toMyUserDetail = function (id) {
  200. myService.toMyUserDetail(id).then(function(result){
  201. $scope.items = result.data.data;
  202. $state.go('app.attention_Detail',{id:id,items:$scope.items});
  203. },function(error){
  204. //msg.error(msg.data.error)
  205. })
  206. };
  207. }]);
  208. app.controller('attention_DetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
  209. , function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
  210. var id = $stateParams.id;
  211. $scope.items = $stateParams.items;
  212. $scope.dream_id = $scope.items.near_dream.id;
  213. $scope.$on('$ionicView.beforeEnter', function () {
  214. $ionicTabsDelegate.showBar(false);
  215. });
  216. $scope.attentionUser = function(id,is_care){
  217. homeService.attentionUser(id,is_care).then(function(result){
  218. $scope.items.is_care=result.data.data;
  219. })
  220. };
  221. $scope.cancelSupport = function () {
  222. $scope.tosupport = false;
  223. $scope.toshare = false;
  224. };
  225. $scope.toshare = false;
  226. $scope.share = function ($event) {
  227. $event.stopPropagation();
  228. $scope.toshare = true;
  229. };
  230. $scope.toDetail = function (dream_id) {
  231. if($scope.items.near_dream==null){
  232. msg.alert("当前梦想","该用户没有当前梦想");
  233. }
  234. if($scope.items.near_dream!=null){
  235. var dream_id = $scope.items.near_dream.id;
  236. $state.go('app.my_dreamdetail',{id:dream_id});
  237. }
  238. };
  239. $scope.toOldDream = function(){
  240. if($scope.items.dreams.length==0){
  241. msg.alert("曾经的梦想","该用户没有曾经的梦想");
  242. }
  243. if($scope.items.dreams.length!=0){
  244. $state.go("app.myOldDream",{user_id:$scope.items.user.id});
  245. }
  246. };
  247. $scope.toSupportDream = function(){
  248. if($scope.items.sup_dreams.length==0){
  249. msg.alert("支持的梦想","该用户没有支持的梦想");
  250. }
  251. if($scope.items.sup_dreams.length!=0){
  252. $state.go("app.mySupportDream",{user_id:$scope.items.user.id});
  253. }
  254. };
  255. $scope.collectionDream = function(is_collection){
  256. homeService.collectionDream(id,is_collection).then(function(result){
  257. $scope.user.is_collection=result.data.data;
  258. })
  259. };
  260. }]);
  261. app.controller('mySupportDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
  262. , function ($scope,homeService,$stateParams, $state, msg) {
  263. var user_id = $stateParams.user_id;
  264. $scope.$on('$ionicView.beforeEnter',function(){
  265. $scope.toUserDetail(user_id);
  266. });
  267. $scope.toUserDetail = function(user_id){
  268. homeService.toUserDetail(user_id).then(function(result){
  269. $scope.items = result.data.data;
  270. $scope.user = result.data.data.user;
  271. $scope.dreams = $scope.user.sup_dream;
  272. },function(error){
  273. })
  274. };
  275. $scope.toDetail = function(){
  276. $state.go("app.attention_Detail",{user_id:user_id,items:$scope.items})
  277. }
  278. }]);
  279. app.controller('myOldDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
  280. , function ($scope,homeService,$stateParams, $state, msg) {
  281. var user_id = $stateParams.user_id;
  282. $scope.$on('$ionicView.beforeEnter',function(){
  283. $scope.toUserDetail(user_id);
  284. });
  285. $scope.toUserDetail = function(user_id){
  286. homeService.toUserDetail(user_id).then(function(result){
  287. $scope.items = result.data.data;
  288. $scope.user = result.data.data.user;
  289. $scope.dreams = $scope.user.sup_dream;
  290. },function(error){
  291. })
  292. };
  293. $scope.toDetail = function(){
  294. $state.go("app.attention_Detail",{user_id:user_id,items:$scope.items})
  295. };
  296. }]);
  297. app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  298. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  299. }]);
  300. app.controller('personalLetterCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
  301. , function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
  302. $scope.$on('$ionicView.beforeEnter', function () {
  303. myService.letter().then(function(result){
  304. $scope.comments = result.data.data;
  305. },function(error){
  306. });
  307. });
  308. }]);
  309. app.controller('rechargeCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg"
  310. , function ($scope, $ionicTabsDelegate,$state, myService, msg) {
  311. $scope.$on('$ionicView.beforeEnter', function () {
  312. $ionicTabsDelegate.showBar(false);
  313. myService.myInfo().then(function(result){
  314. $scope.vm = result.data.data;
  315. $scope.vm.money = '';
  316. $scope.vm.payType = 1;
  317. })
  318. });
  319. $scope.payExplain = function(){
  320. $state.go("app.payExplain")
  321. };
  322. $scope.withdraw = function(){
  323. $state.go("app.withdraw")
  324. };
  325. //充值
  326. $scope.recharge = function(money){
  327. if (!$scope.vm.money) {
  328. msg.text('请输入充值金额');
  329. return;
  330. }
  331. myService.recharge(money).then(function (result) {
  332. //todo:result需要返回支付宝或者微信的签名信息
  333. var payInfo = result.data;
  334. if ($scope.vm.payType == 1) { //支付宝
  335. cordova.plugins.AliPay.pay(payInfo, function success(e) {
  336. //e.resultStatus 状态代码 e.result 本次操作返回的结果数据 e.memo 提示信息
  337. //e.resultStatus 9000 订单支付成功 ;8000 正在处理中 调用function success
  338. //e.resultStatus 4000 订单支付失败 ;6001 用户中途取消 ;6002 网络连接出错 调用function error
  339. //当e.resultStatus为9000时,请去服务端验证支付结果
  340. $scope.clicksub = false;
  341. if (e.resultStatus == '9000') {
  342. alert(orderID);
  343. //支付成功
  344. // $state.go('app.my');
  345. } else {
  346. msg.error("支付失败");
  347. // msg.error("支付失败:" + JSON.stringify(e));
  348. }
  349. }, function error(e) {
  350. $scope.clicksub = false;
  351. // msg.error("支付失败:" + JSON.stringify(e));
  352. msg.error("支付失败");
  353. });
  354. }
  355. if ($scope.vm.payType == 2) { //微信
  356. var obj = JSON.parse(payInfo);
  357. var params = {
  358. partnerid: obj.partnerid, // merchant id
  359. prepayid: obj.prepayid, // prepay id
  360. noncestr: obj.noncestr, // nonce
  361. timestamp: obj.timestamp, // timestamp
  362. sign: obj.sign, // signed string
  363. };
  364. Wechat.sendPaymentRequest(params, function (r) {
  365. $scope.clicksub = false;
  366. courseService.orderStatus(orderID, $scope.paytype).then(function (result) {
  367. // alert(result);
  368. //支付成功
  369. // $state.go('app.my');
  370. }, function (erro) {
  371. msg.alert("支付反馈失败:" + JSON.stringify(erro));
  372. });
  373. }, function (reason) {
  374. $scope.clicksub = false;
  375. msg.alert("支付失败:" + JSON.stringify(reason));
  376. });
  377. }
  378. // msg.text("充值成功");
  379. // $state.go('app.my');
  380. });
  381. }
  382. }]);
  383. app.controller('payCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg"
  384. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  385. $scope.$on('$ionicView.beforeEnter', function () {
  386. myService.myInfo().then(function(result){
  387. $scope.vm = result.data.data;
  388. $scope.vm.money = '';
  389. })
  390. });
  391. $scope.payExplain = function(){
  392. $state.go("app.explain")
  393. };
  394. $scope.withdraw = function(){
  395. $state.go("app.payout")
  396. };
  397. //充值
  398. $scope.recharge = function(money){
  399. myService.recharge(money).then(function(result){
  400. msg.text("充值成功");
  401. $state.go('app.my');
  402. });
  403. }
  404. }]);
  405. app.controller('accountCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg"
  406. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  407. $scope.$on('$ionicView.beforeEnter', function () {
  408. $ionicTabsDelegate.showBar(false);
  409. $scope.showAccount();
  410. });
  411. $scope.showAccount = function(){
  412. myService.showAccount().then(function(result){
  413. $scope.items = result.data.data;
  414. },function(error){
  415. msg.error(error.data.message);
  416. })
  417. };
  418. $scope.destroyAccount = function(id){
  419. myService.destroyAccount(id).then(function(result){
  420. msg.text("删除成功");
  421. $scope.showAccount();
  422. },function(error){
  423. msg.error(error.data.message);
  424. })
  425. }
  426. }]);
  427. app.controller('my_account_addCtrl', ["$scope","common","$ionicTabsDelegate", "$state", "myService", "msg"
  428. , function ($scope,common,$ionicTabsDelegate, $state, myService, msg) {
  429. $scope.addpict = function () {
  430. common.chooseImage().then(function (img) {
  431. common.uploadFiles(img,1).then(function (result) {
  432. var response = JSON.parse(result.response);
  433. var file = response.data.file;
  434. $scope.imgs.push(config.imgServer+file);
  435. }, function (error) {
  436. msg.error('图片上传失败');
  437. });
  438. }, function (error) {
  439. console.log('图片选择失败');
  440. });
  441. };
  442. $scope.imgs=[];
  443. $scope.deletefile = function (file) {
  444. var index = $scope.imgs.indexOf(file);
  445. $scope.imgs.splice(index, 1);
  446. common.deletefile(file).then(function () {
  447. })
  448. };
  449. $scope.vm={
  450. bank_name:'',
  451. bank_number:'',
  452. bank_phone:'',
  453. bank_user:''
  454. };
  455. $scope.addAccount = function () {
  456. var data = {
  457. data:{
  458. bank_name:$scope.vm.bank_name,
  459. bank_number:$scope.vm.bank_number,
  460. bank_phone:$scope.vm.bank_phone,
  461. bank_user:$scope.vm.bank_user
  462. }
  463. };
  464. msg.loading('保存中...');
  465. myService.addAccount(data).then(function (result) {
  466. msg.hide();
  467. $state.go('app.my_account');
  468. }, function (error) {
  469. msg.hide();
  470. msg.error(error.data.message);
  471. });
  472. };
  473. $scope.addQrcode = function(){
  474. var data = {
  475. data:{
  476. bank_name:$scope.vm.bank_name,
  477. //bank_number:$scope.imgs
  478. bank_number:"https://www.baidu.com/img/bd_logo1.png"
  479. }
  480. };
  481. myService.addQrcode(data).then(function(result){
  482. msg.text("添加成功",true);
  483. $timeout(function () {
  484. $state.go("app.my_account");
  485. }, 1000);
  486. },function(error){
  487. msg.error(error.data.message);
  488. })
  489. }
  490. }]);
  491. app.controller('messageCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
  492. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  493. $scope.$on('$ionicView.beforeEnter', function () {
  494. $ionicTabsDelegate.showBar(false);
  495. myService.messageInfo().then(function(result){
  496. $scope.infos = result.data.data;
  497. },function(error){
  498. });
  499. });
  500. //系统消息
  501. $scope.systemInfo = function(){
  502. $state.go("app.my_message_sys");
  503. };
  504. $scope.notRead = function(){
  505. myService.notRead().then(function(result){
  506. },function(error){
  507. })
  508. };
  509. //回复我的
  510. $scope.replyMy = function(){
  511. $state.go("app.my_message_reply");
  512. };
  513. $scope.personalLetter = function(){
  514. $state.go("app.personalLetter");
  515. }
  516. }]);
  517. app.controller('dreamCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
  518. , function ($scope, $ionicTabsDelegate,$state, myService, msg) {
  519. $scope.$on('$ionicView.beforeEnter', function () {
  520. $ionicTabsDelegate.showBar(false);
  521. myService.myDream().then(function(result){
  522. $scope.dreams = result.data.data;
  523. });
  524. myService.myInfo().then(function(result){
  525. $scope.user = result.data.data
  526. });
  527. });
  528. $scope.toDetail = function (id) {
  529. $state.go('app.my_dreamdetail',{id:id});
  530. };
  531. }]);
  532. app.controller('collectCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg"
  533. , function ($scope, $ionicTabsDelegate,$state, myService, msg) {
  534. $scope.$on('$ionicView.beforeEnter', function () {
  535. $ionicTabsDelegate.showBar(false);
  536. myService.collect().then(function(result){
  537. $scope.dreams = result.data.data.dreams;
  538. });
  539. });
  540. $scope.toDetail = function (id) {
  541. $state.go('app.my_dreamdetail',{id:id});
  542. };
  543. }]);
  544. app.controller('messageSysCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
  545. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  546. $scope.$on('$ionicView.beforeEnter', function () {
  547. myService.systemInfo().then(function(result){
  548. $scope.sysInfos = result.data.data;
  549. },function(error){
  550. });
  551. });
  552. }]);
  553. /* app.controller('sysCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
  554. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  555. $scope.$on('$ionicView.beforeEnter', function () {
  556. myService.systemInfo().then(function(result){
  557. $scope.sysInfos = result.data.data;
  558. },function(error){
  559. });
  560. });
  561. }]);*/
  562. /* app.controller('letterCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
  563. , function ($scope,$ionicTabsDelegate, $state, myService, msg) {
  564. }]);*/
  565. app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg", "$ionicModal"
  566. , function ($scope,$ionicTabsDelegate, $state, myService, msg, $ionicModal) {
  567. $scope.$on('$ionicView.beforeEnter', function () {
  568. myService.replyMy().then(function(result){
  569. $scope.comments = result.data.data;
  570. },function(error){
  571. });
  572. });
  573. $ionicModal.fromTemplateUrl('my-modal.html', {
  574. scope: $scope,
  575. animation: 'slide-in-up'
  576. }).then(function (modal) {
  577. $scope.modal = modal;
  578. });
  579. $scope.openModal = function () {
  580. $scope.modal.show();
  581. };
  582. $scope.closeModal = function () {
  583. $scope.modal.hide();
  584. };
  585. //我的回复
  586. $scope.vm={
  587. content:"",
  588. comment_id:""
  589. };
  590. $scope.myReplay = function(){
  591. var data = {
  592. content:$scope.vm.content,
  593. comment_id:$scope.vm.id
  594. };
  595. myService.myReplay(data).then(function(result){
  596. },function(error){
  597. });
  598. $scope.modal.hide();
  599. }
  600. }]);
  601. })(angular.module('app.controllers'));