user.service.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /**
  2. * 这是用户业务逻辑的服务
  3. */
  4. export default class UserService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'UserService'
  8. }
  9. /* 初始化授权登录 */
  10. UserLoginAuthApplets (data = {}) {
  11. return this.AjaxService.post({
  12. url: '/user/login/auth/applets',
  13. data,
  14. isLoading: false,
  15. isHost:true
  16. })
  17. }
  18. /* 邀请码授权登录 */
  19. InvitationCodeLogin (data = {}) {
  20. return this.AjaxService.post({
  21. url: '/user/login/auth/invitation',
  22. data,
  23. isLoading: true,
  24. isStatus: false,
  25. isHost:true
  26. })
  27. }
  28. /* 普通机构注册 */
  29. UserRegisterClub (data = {}) {
  30. return this.AjaxService.post({
  31. url:'/user/register/club',
  32. data,
  33. isLoading: true,
  34. isHost:true
  35. })
  36. }
  37. /* 供应商注册 */
  38. SupplierAppletsRegistered (data = {}) {
  39. return this.AjaxService.post({
  40. url:'/user/register/shop',
  41. data,
  42. isLoading: true,
  43. isHost:true
  44. })
  45. }
  46. /**
  47. * 账号登录
  48. * @param mobileOrEmail 邮箱或手机
  49. * @param password 密码
  50. * @param source 来源 PC与小程序传:'www'crm就传'crm'
  51. */
  52. AorganizationLogin (data = {}) {
  53. return this.AjaxService.post({
  54. url:'/user/login/password',
  55. data,
  56. isLoading: true ,
  57. isStatus: true,
  58. isHost:true
  59. })
  60. }
  61. /* 查询机构资料*/
  62. OrganizationUpdateModifyInfo (data = {}) {
  63. return this.AjaxService.get({
  64. url:'/user/club/info',
  65. data,
  66. isLoading: true,
  67. isHost:true
  68. })
  69. }
  70. /* 机构升级会员机构 */
  71. OrganizationRegister (data = {}) {
  72. return this.AjaxService.post({
  73. url:'/user/register/club/upgrade',
  74. data,
  75. isLoading: true,
  76. isHost:true
  77. })
  78. }
  79. /* 机构提交资料修改 */
  80. OrganizationUpdate (data = {}) {
  81. return this.AjaxService.post({
  82. url:'/user/club/info/update',
  83. data,
  84. isLoading: true,
  85. isHost:true
  86. })
  87. }
  88. /* 供应商资料信息-数据回显 */
  89. SupplierShopInfo (data = {}) {
  90. return this.AjaxService.get({
  91. url:'/user/shop/info',
  92. data,
  93. isLoading: true,
  94. isHost:true
  95. })
  96. }
  97. /* 供应商修改申请信息保存 */
  98. SupplierUpdateCompanyInfo (data = {}) {
  99. return this.AjaxService.post({
  100. url:'/user/register/shop/apply',
  101. data,
  102. isLoading: true,
  103. isHost:true
  104. })
  105. }
  106. /* 供应商资料信息-提交修改 */
  107. SupplierModifiedData (data = {}) {
  108. return this.AjaxService.post({
  109. url:'/user/shop/info/update',
  110. data,
  111. isLoading: true,
  112. isHost:true
  113. })
  114. }
  115. /**
  116. *运营人员绑定微信
  117. */
  118. BindingWechat (data = {}) {
  119. return this.AjaxService.post({
  120. url:'/user/login/auth/bind',
  121. data,
  122. isLoading: true,
  123. isHost:true
  124. })
  125. }
  126. /*普通机构取消提示*/
  127. CancelPrompt (data = {}) {
  128. return this.AjaxService.get({
  129. url:'/user/register/guide',
  130. data,
  131. isLoading: false ,
  132. isHost:true
  133. })
  134. }
  135. /**
  136. * 找回密码&修改密码
  137. * @param: mobileOrEmail 手机号或邮箱
  138. * @param: password 密码
  139. * @param: passwordConfirm 用户确认密码
  140. * @param: smsCode 短信验证码
  141. * @param: status 1:手机号找回,2:邮箱找回
  142. */
  143. ModifyMobilePassword (data = {}) {
  144. return this.AjaxService.post({
  145. url:'/user/update/password',
  146. data,
  147. isLoading: false ,
  148. isHost:true
  149. })
  150. }
  151. /**
  152. * @机构-地址列表
  153. * @param:userId 用户ID(必传),
  154. * @param:pageNum 页码
  155. * @param:pageSize 每页条数
  156. */
  157. QueryAddressList (data = {}) {
  158. return this.AjaxService.get({
  159. url:'/personalCenter/findAddress',
  160. data,
  161. isLoading: true ,
  162. })
  163. }
  164. /**
  165. * @机构-添加&&修改地址
  166. * @param:userId 用户ID(必传),
  167. * @param:地址信息,
  168. */
  169. AddNewAddress (data = {}) {
  170. return this.AjaxService.post({
  171. url:'/personalCenter/saveAddress',
  172. data,
  173. isLoading: true ,
  174. })
  175. }
  176. /**
  177. * @机构-删除地址
  178. * @param:userId 用户ID(必传),
  179. * @param:地址信息,
  180. */
  181. DeleteNewAddress (data = {}) {
  182. return this.AjaxService.get({
  183. url:'/personalCenter/deleteAddress',
  184. data,
  185. isLoading: true ,
  186. })
  187. }
  188. /**
  189. * @机构-个人中心
  190. * @param:userId 用户ID(必传),
  191. */
  192. PersonalInfo (data = {}) {
  193. return this.AjaxService.get({
  194. url:'/personalCenter/myCentre',
  195. data,
  196. isLoading: false ,
  197. })
  198. }
  199. /**
  200. * @机构-获取账户余额明细
  201. * @param:userId 用户ID(必传),
  202. */
  203. GetAccountInfo (data = {}) {
  204. return this.AjaxService.get({
  205. url:'/personalCenter/touchBalance',
  206. data,
  207. isLoading: true ,
  208. })
  209. }
  210. /* 运营人员管理-列表 */
  211. QueryOperatorList (data = {}) {
  212. return this.AjaxService.get({
  213. url:'/operation/list',
  214. data,
  215. isLoading: true ,
  216. })
  217. }
  218. /* 运营人员管理-添加 */
  219. PostAddOperator (data = {}) {
  220. return this.AjaxService.post({
  221. url:'/operation/add',
  222. data,
  223. isLoading: true ,
  224. })
  225. }
  226. /* 运营人员管理-删除 */
  227. PostDeleteOperator (data = {}) {
  228. return this.AjaxService.post({
  229. url:'/operation/delete',
  230. data,
  231. isLoading: true ,
  232. })
  233. }
  234. /* 运营人员管理-更新邀请码 */
  235. PostUpdateOperatorCode (data = {}) {
  236. return this.AjaxService.post({
  237. url:'/operation/updateInvitationCode',
  238. data,
  239. isLoading: true ,
  240. })
  241. }
  242. }