my.js 26 KB

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