user.service.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * 这是用户业务逻辑的服务
  3. */
  4. export default class UserService {
  5. constructor(AjaxService) {
  6. Object.assign(this, {
  7. AjaxService
  8. })
  9. this.name = 'UserService'
  10. }
  11. /* 初始化授权登录 */
  12. userInfoLogin(data = {}) {
  13. return this.AjaxService.post({
  14. url: '/buyer/authorization',
  15. data,
  16. isLoading: false,
  17. isStatus: false
  18. })
  19. }
  20. /* 初始化个人中心数据 */
  21. userInfoPersonal(data = {}) {
  22. return this.AjaxService.get({
  23. url: '/buyer/personal',
  24. data,
  25. isLoading: false,
  26. isStatus: false
  27. })
  28. }
  29. /*维沙邀请码绑定*/
  30. userInvitation(data = {}) {
  31. return this.AjaxService.post({
  32. url: '/buyer/invitation/code',
  33. data,
  34. isLoading: false,
  35. isStatus: false
  36. })
  37. }
  38. /**
  39. * @地址列表查询
  40. * @param:userId 用户ID(必传),
  41. * @param:pageNum 页码
  42. * @param:pageSize 每页条数
  43. */
  44. QueryAddressList(data = {}) {
  45. return this.AjaxService.get({
  46. url: '/other/findAddress',
  47. data,
  48. isLoading: true
  49. })
  50. }
  51. /**
  52. * @添加&&修改地址
  53. */
  54. AddNewAddress(data = {}) {
  55. return this.AjaxService.post({
  56. url: '/other/saveAddress',
  57. data,
  58. isLoading: true
  59. })
  60. }
  61. /**
  62. * @删除地址
  63. * @param:addressId 地址ID,,
  64. */
  65. DeleteNewAddress(data = {}) {
  66. return this.AjaxService.get({
  67. url: '/other/deleteAddress',
  68. data,
  69. isLoading: true
  70. })
  71. }
  72. /**
  73. * @设置默认地址
  74. * @param:userId 用户ID(必传),
  75. * @param:addressId 地址ID,
  76. */
  77. DefaultAddress(data = {}) {
  78. return this.AjaxService.get({
  79. url: '/other/defaultAddress',
  80. data,
  81. isLoading: false
  82. })
  83. }
  84. }