user.service.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. UserWechatAuthorLogin(data = {}) {
  13. return this.AjaxService.get({
  14. url: '/user/he/authorization',
  15. data,
  16. isLoading: false,
  17. isStatus: false,
  18. isHost:true
  19. })
  20. }
  21. /* 手机号验证码登录 */
  22. UserMobileLogin(data = {}) {
  23. return this.AjaxService.post({
  24. url: '/user/he/mobile/login',
  25. data,
  26. isLoading: false,
  27. isStatus: false
  28. })
  29. }
  30. /**
  31. * @地址列表查询
  32. * @param:userId 用户ID(必传),
  33. * @param:pageNum 页码
  34. * @param:pageSize 每页条数
  35. */
  36. QueryAddressList(data = {}) {
  37. return this.AjaxService.get({
  38. url: '/other/findAddress',
  39. data,
  40. isLoading: false
  41. })
  42. }
  43. /**
  44. * @添加&&修改地址
  45. */
  46. AddOtherSaveAddress(data = {}) {
  47. return this.AjaxService.post({
  48. url: '/other/saveAddress',
  49. data,
  50. isLoading: true
  51. })
  52. }
  53. /**
  54. * @删除地址
  55. * @param:addressId 地址ID,,
  56. */
  57. DeleteOtherAddress(data = {}) {
  58. return this.AjaxService.get({
  59. url: '/other/deleteAddress',
  60. data,
  61. isLoading: true
  62. })
  63. }
  64. /**
  65. * @设置默认地址
  66. * @param:userId 用户ID(必传),
  67. * @param:addressId 地址ID,
  68. */
  69. SetDefaultOtherAddress(data = {}) {
  70. return this.AjaxService.get({
  71. url: '/other/defaultAddress',
  72. data,
  73. isLoading: false
  74. })
  75. }
  76. /**
  77. * @设置默认地址
  78. * @param:userId 用户ID(必传),
  79. * @param:addressId 地址ID,
  80. */
  81. GetUserOrderTotal(data = {}) {
  82. return this.AjaxService.get({
  83. url: '/order/order/total',
  84. data,
  85. isLoading: false
  86. })
  87. }
  88. }