myservice.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. (function (app) {
  2. app.factory('myService', ['$http', 'config', "util", function ($http, config, util) {
  3. return {
  4. logout:function(){
  5. return $http({
  6. url:config.server + "api/auth/logout",
  7. method:"get"
  8. })
  9. },
  10. setPassword: function (password) {
  11. return $http({
  12. url: config.server + '/api/auth/password',
  13. method: "post",
  14. data: { password: password }
  15. })
  16. },
  17. testcharge:function(number,type){
  18. return $http({
  19. url:config.server + "api/my/recharge?coin="+number,
  20. method:"post"
  21. })
  22. },
  23. charge:function(number,type){
  24. return $http({
  25. url:config.server + "api/pay/charge",
  26. method:"post",
  27. data: { number:number,goods:1,type:type}
  28. })
  29. },
  30. orderStatus:function(number,type){
  31. return $http({
  32. url:config.server + "api/pay/order_status",
  33. method:"get",
  34. data: { number:number,goods:1,type:type}
  35. })
  36. },
  37. orderIos:function(number){
  38. return $http({
  39. url:config.server + "api/pay/order_ios",
  40. method:"get",
  41. data: { number:number}
  42. })
  43. },
  44. setting:function(){
  45. return $http({
  46. url:config.server + "api/my/setting",
  47. method:"get"
  48. })
  49. },
  50. systemInfo:function(){
  51. return $http({
  52. url:config.server + "api/my/dream_info",
  53. method:"get"
  54. })
  55. },
  56. replyMy:function(){
  57. return $http({
  58. url:config.server + "api/my/sup_info",
  59. method:"get"
  60. })
  61. },
  62. collect:function(){
  63. return $http({
  64. url:config.server + "api/my/collection",
  65. method:"get"
  66. })
  67. },
  68. myDream:function(){
  69. return $http({
  70. url:config.server + "api/my/dream",
  71. method:"get"
  72. })
  73. },
  74. myReplay:function(data){
  75. return $http({
  76. url: config.server + '/api/my/my_reply',
  77. method: "post",
  78. data: data
  79. })
  80. },
  81. sendLetter:function(data){
  82. return $http({
  83. url: config.server + '/api/my/letter/store',
  84. method: "post",
  85. data: data
  86. })
  87. },
  88. letterDetail:function(id){
  89. return $http({
  90. url: config.server + 'api/my/letter/show?id=' + id,
  91. method: "get"
  92. })
  93. },
  94. myMes:function(){
  95. return $http({
  96. url:config.server + "api/my/persona",
  97. method:"get"
  98. })
  99. },
  100. myInfo:function(){
  101. return $http({
  102. url:config.server + "api/my/show",
  103. method:"get"
  104. })
  105. },
  106. replayMes:function(data){
  107. return $http({
  108. url:config.server + "api/interaction/comment",
  109. method:"post",
  110. data:data
  111. })
  112. },
  113. toprofile:function(){
  114. return $http({
  115. url:config.server + "api/my/persona",
  116. method:"get"
  117. })
  118. },
  119. myMaterial:function(){
  120. return $http({
  121. url:config.server + "api/my/update",
  122. method:"get"
  123. })
  124. },
  125. saveMaterial:function(data){
  126. return $http({
  127. url:config.server + "api/my/update",
  128. method:"post",
  129. data:data
  130. })
  131. },
  132. attention:function(){
  133. return $http({
  134. url:config.server + "api/my/care",
  135. method:"get"
  136. })
  137. },
  138. careMe:function(){
  139. return $http({
  140. url:config.server + "api/my/careme",
  141. method:"get"
  142. })
  143. },
  144. toMyUserDetail:function(id){
  145. return $http({
  146. url:config.server + "api/user/show?user_id=" + id ,
  147. method:"get"
  148. })
  149. },
  150. addAccount:function(data){
  151. return $http({
  152. url:config.server + "api/my/bank/create",
  153. method:"post",
  154. data:data
  155. })
  156. },
  157. showAccount:function(){
  158. return $http({
  159. url:config.server + "api/my/bank/list",
  160. method:"get"
  161. })
  162. },
  163. destroyAccount:function(id){
  164. return $http({
  165. url:config.server + "api/my/bank/delete?id=" + id ,
  166. method:"get"
  167. })
  168. },
  169. withdraw:function(data){
  170. return $http({
  171. url:config.server + "api/my/cash",
  172. method:"post",
  173. data:data
  174. })
  175. },
  176. contact:function(data){
  177. return $http({
  178. url:config.server + "api/my/suggest",
  179. method:"post",
  180. data:data
  181. })
  182. },
  183. payExplain:function(){
  184. return $http({
  185. url:config.server + "api/my/account_log",
  186. method:"get"
  187. })
  188. },
  189. addQrcode:function(data){
  190. return $http({
  191. url:config.server + "api/my/bank/qrcode",
  192. method:"post",
  193. data:data
  194. })
  195. },
  196. aboutMiao:function(){
  197. return $http({
  198. url:config.server + "api/my/miao",
  199. method:"get"
  200. })
  201. },
  202. messageInfo:function(){
  203. return $http({
  204. url:config.server + "api/my/info",
  205. method:"get"
  206. })
  207. },
  208. notRead:function(){
  209. return $http({
  210. url:config.server + "api/my/read",
  211. method:"get"
  212. })
  213. },
  214. letter:function(){
  215. return $http({
  216. url:config.server + "api/my/system_info",
  217. method:"get"
  218. })
  219. },
  220. sure_meet:function(dream_id,value){
  221. return $http({
  222. url:config.server + "api/my/sure_meet?dream_id=" + dream_id + '&value=' + value,
  223. method:"get"
  224. })
  225. },
  226. sure_meet2:function(to_user_id,value){
  227. return $http({
  228. url:config.server + "api/my/sure_meet2?to_user_id=" + to_user_id + '&value=' + value,
  229. method:"get"
  230. })
  231. }
  232. };
  233. }]);
  234. })(angular.module('app.services'));