user.service.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /**
  85. * @机构-获取账户余额明细
  86. * @param:userId 用户ID(必传),
  87. */
  88. GetAccountInfo (data = {}) {
  89. return this.AjaxService.get({
  90. url:'/personalCenter/touchBalance',
  91. data,
  92. isLoading: true ,
  93. })
  94. }
  95. }