myservice.js 7.8 KB

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