user.service.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: '/user/login/auth/applets',
  15. data,
  16. isLoading: false,
  17. isStatus: false,
  18. isHost:true
  19. })
  20. }
  21. /* 初始化个人中心数据 */
  22. userInfoPersonal(data = {}) {
  23. return this.AjaxService.get({
  24. url: '/buyer/personal',
  25. data,
  26. isLoading: false,
  27. isStatus: false
  28. })
  29. }
  30. /*维沙邀请码绑定*/
  31. userInvitation(data = {}) {
  32. return this.AjaxService.post({
  33. url: '/buyer/invitation/code',
  34. data,
  35. isLoading: false,
  36. isStatus: false
  37. })
  38. }
  39. /**
  40. * @地址列表查询
  41. * @param:userId 用户ID(必传),
  42. * @param:pageNum 页码
  43. * @param:pageSize 每页条数
  44. */
  45. QueryAddressList(data = {}) {
  46. return this.AjaxService.get({
  47. url: '/personalCenter/findAddress',
  48. data,
  49. isLoading: true
  50. })
  51. }
  52. /**
  53. * @添加&&修改地址
  54. */
  55. AddNewAddress(data = {}) {
  56. return this.AjaxService.post({
  57. url: '/other/saveAddress',
  58. data,
  59. isLoading: true
  60. })
  61. }
  62. /**
  63. * @删除地址
  64. * @param:addressId 地址ID,,
  65. */
  66. DeleteNewAddress(data = {}) {
  67. return this.AjaxService.get({
  68. url: '/other/deleteAddress',
  69. data,
  70. isLoading: true
  71. })
  72. }
  73. /**
  74. * @设置默认地址
  75. * @param:userId 用户ID(必传),
  76. * @param:addressId 地址ID,
  77. */
  78. DefaultAddress(data = {}) {
  79. return this.AjaxService.get({
  80. url: '/other/defaultAddress',
  81. data,
  82. isLoading: false
  83. })
  84. }
  85. }