QuestApi.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. const Api = require('../net/Api');
  2. class QuestApi {
  3. //获取主线任务
  4. static getMainTask(success, fail) {
  5. let url = "/task/mainTask.do";
  6. let requestBody = {
  7. url: url,
  8. data: {},
  9. success: success,
  10. fail: fail,
  11. complete: () => {
  12. }
  13. };
  14. Api.httpGet(requestBody);
  15. }
  16. //获取主线任务
  17. static getDailyTask(success, fail) {
  18. let url = "/daily/getUserDailyInfo";
  19. let requestBody = {
  20. url: url,
  21. data: {},
  22. success: success,
  23. fail: fail,
  24. complete: () => {
  25. }
  26. };
  27. Api.httpGet(requestBody);
  28. }
  29. static postDailyDegreeReward(degree, success, fail) {
  30. let url = "/daily/getDailyDegreeReward";
  31. let data = {
  32. degree: degree
  33. };
  34. let requestBody = {
  35. url: url,
  36. data: data,
  37. success: success,
  38. fail: fail,
  39. complete: () => {
  40. }
  41. };
  42. Api.httpPost(requestBody);
  43. }
  44. //领取每日任务奖励
  45. static postGetDailyTaskReward(taskId, success, fail) {
  46. let url = "/daily/getDailyTaskReward";
  47. let data = {
  48. id: taskId
  49. };
  50. let requestBody = {
  51. url: url,
  52. data: data,
  53. success: success,
  54. fail: fail,
  55. complete: () => {
  56. }
  57. };
  58. Api.httpPost(requestBody);
  59. }
  60. //领取每日任务额外奖励
  61. static postGetDailyDegreeReward(count, success, fail) {
  62. let url = "/daily/getDailyDegreeReward";
  63. let data = {
  64. degree: count
  65. };
  66. let requestBody = {
  67. url: url,
  68. data: data,
  69. success: success,
  70. fail: fail,
  71. complete: () => {
  72. }
  73. };
  74. Api.httpPost(requestBody);
  75. }
  76. }
  77. module.exports = QuestApi;