user.service.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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: true ,
  148. isHost:true
  149. })
  150. }
  151. /**
  152. * 更换手机号
  153. * @param: mobile 原手机号
  154. * @param: newMobile 新手机号
  155. * @param: smsCode 原手机号验证码
  156. * @param: newSmsCode 新手机号验证码
  157. * @param: userId 用户userId
  158. */
  159. UserUpdateMobile (data = {}) {
  160. return this.AjaxService.post({
  161. url:'/user/update/mobile',
  162. data,
  163. isLoading: true ,
  164. isHost:true
  165. })
  166. }
  167. /**
  168. * @机构-地址列表
  169. * @param:userId 用户ID(必传),
  170. * @param:pageNum 页码
  171. * @param:pageSize 每页条数
  172. */
  173. QueryAddressList (data = {}) {
  174. return this.AjaxService.get({
  175. url:'/personalCenter/findAddress',
  176. data,
  177. isLoading: true ,
  178. })
  179. }
  180. /**
  181. * @机构-添加&&修改地址
  182. * @param:userId 用户ID(必传),
  183. * @param:地址信息,
  184. */
  185. AddNewAddress (data = {}) {
  186. return this.AjaxService.post({
  187. url:'/personalCenter/saveAddress',
  188. data,
  189. isLoading: true ,
  190. })
  191. }
  192. /**
  193. * @机构-删除地址
  194. * @param:userId 用户ID(必传),
  195. * @param:地址信息,
  196. */
  197. DeleteNewAddress (data = {}) {
  198. return this.AjaxService.get({
  199. url:'/personalCenter/deleteAddress',
  200. data,
  201. isLoading: true ,
  202. })
  203. }
  204. /**
  205. * @机构-个人中心
  206. * @param:userId 用户ID(必传),
  207. */
  208. PersonalInfo (data = {}) {
  209. return this.AjaxService.get({
  210. url:'/personalCenter/myCentre',
  211. data,
  212. isLoading: false ,
  213. })
  214. }
  215. /**
  216. * @机构-获取账户余额明细
  217. * @param:userId 用户ID(必传),
  218. */
  219. GetAccountInfo (data = {}) {
  220. return this.AjaxService.get({
  221. url:'/personalCenter/touchBalance',
  222. data,
  223. isLoading: true ,
  224. })
  225. }
  226. /* 运营人员管理-列表 */
  227. QueryOperatorList (data = {}) {
  228. return this.AjaxService.get({
  229. url:'/user/operation/list',
  230. data,
  231. isLoading: true ,
  232. isHost:true
  233. })
  234. }
  235. /* 运营人员管理-添加 */
  236. PostAddOperator (data = {}) {
  237. return this.AjaxService.post({
  238. url:'/user/operation/save',
  239. data,
  240. isLoading: true ,
  241. isHost:true
  242. })
  243. }
  244. /* 运营人员管理-删除 */
  245. PostDeleteOperator (data = {}) {
  246. return this.AjaxService.post({
  247. url:'/user/operation/delete',
  248. data,
  249. isLoading: true ,
  250. isHost:true
  251. })
  252. }
  253. /* 运营人员管理-更新邀请码 */
  254. PostUpdateOperatorCode (data = {}) {
  255. return this.AjaxService.post({
  256. url:'/user/operation/code/update',
  257. data,
  258. isLoading: true ,
  259. isHost:true
  260. })
  261. }
  262. /* 机构购物车简单列表*/
  263. GetUserCartNumber (data = {}) {
  264. return this.AjaxService.get({
  265. url:'/shoppingCart/header/cart',
  266. data,
  267. isLoading: true ,
  268. })
  269. }
  270. }