user.service.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. UseRregisterTemporaryInfo (data = {}) {
  72. return this.AjaxService.get({
  73. url:'/user/register/temporary/data',
  74. data,
  75. isLoading: true,
  76. isHost:true
  77. })
  78. }
  79. /* 机构升级会员机构 */
  80. OrganizationRegister (data = {}) {
  81. return this.AjaxService.post({
  82. url:'/user/register/club/upgrade',
  83. data,
  84. isLoading: true,
  85. isHost:true
  86. })
  87. }
  88. /* 机构提交资料修改 */
  89. OrganizationUpdate (data = {}) {
  90. return this.AjaxService.post({
  91. url:'/user/club/info/update',
  92. data,
  93. isLoading: true,
  94. isHost:true
  95. })
  96. }
  97. /* 供应商资料信息-数据回显 */
  98. SupplierShopInfo (data = {}) {
  99. return this.AjaxService.get({
  100. url:'/user/shop/info',
  101. data,
  102. isLoading: true,
  103. isHost:true
  104. })
  105. }
  106. /* 供应商修改申请信息保存 */
  107. SupplierUpdateCompanyInfo (data = {}) {
  108. return this.AjaxService.post({
  109. url:'/user/register/shop/apply',
  110. data,
  111. isLoading: true,
  112. isHost:true
  113. })
  114. }
  115. /* 供应商资料信息-提交修改 */
  116. SupplierModifiedData (data = {}) {
  117. return this.AjaxService.post({
  118. url:'/user/shop/info/update',
  119. data,
  120. isLoading: true,
  121. isHost:true
  122. })
  123. }
  124. /**
  125. *运营人员绑定微信
  126. */
  127. BindingWechat (data = {}) {
  128. return this.AjaxService.post({
  129. url:'/user/login/auth/bind',
  130. data,
  131. isLoading: true,
  132. isHost:true
  133. })
  134. }
  135. /*普通机构取消提示*/
  136. CancelPrompt (data = {}) {
  137. return this.AjaxService.get({
  138. url:'/user/register/guide',
  139. data,
  140. isLoading: false ,
  141. isHost:true
  142. })
  143. }
  144. /**
  145. * 找回密码&修改密码
  146. * @param: mobileOrEmail 手机号或邮箱
  147. * @param: password 密码
  148. * @param: passwordConfirm 用户确认密码
  149. * @param: smsCode 短信验证码
  150. * @param: status 1:手机号找回,2:邮箱找回
  151. */
  152. ModifyMobilePassword (data = {}) {
  153. return this.AjaxService.post({
  154. url:'/user/update/password',
  155. data,
  156. isLoading: true ,
  157. isHost:true
  158. })
  159. }
  160. /**
  161. * 更换手机号
  162. * @param: mobile 原手机号
  163. * @param: newMobile 新手机号
  164. * @param: smsCode 原手机号验证码
  165. * @param: newSmsCode 新手机号验证码
  166. * @param: userId 用户userId
  167. */
  168. UserUpdateMobile (data = {}) {
  169. return this.AjaxService.post({
  170. url:'/user/update/mobile',
  171. data,
  172. isLoading: true ,
  173. isHost:true
  174. })
  175. }
  176. /**
  177. * @机构-地址列表
  178. * @param:userId 用户ID(必传),
  179. * @param:pageNum 页码
  180. * @param:pageSize 每页条数
  181. */
  182. QueryAddressList (data = {}) {
  183. return this.AjaxService.get({
  184. url:'/personalCenter/findAddress',
  185. data,
  186. isLoading: true ,
  187. })
  188. }
  189. /**
  190. * @机构-添加&&修改地址
  191. * @param:userId 用户ID(必传),
  192. * @param:地址信息,
  193. */
  194. AddNewAddress (data = {}) {
  195. return this.AjaxService.post({
  196. url:'/personalCenter/saveAddress',
  197. data,
  198. isLoading: true ,
  199. })
  200. }
  201. /**
  202. * @机构-删除地址
  203. * @param:userId 用户ID(必传),
  204. * @param:地址信息,
  205. */
  206. DeleteNewAddress (data = {}) {
  207. return this.AjaxService.get({
  208. url:'/personalCenter/deleteAddress',
  209. data,
  210. isLoading: true ,
  211. })
  212. }
  213. /**
  214. * @机构-个人中心
  215. * @param:userId 用户ID(必传),
  216. */
  217. PersonalInfo (data = {}) {
  218. return this.AjaxService.get({
  219. url:'/personalCenter/myCentre',
  220. data,
  221. isLoading: false ,
  222. })
  223. }
  224. /**
  225. * @机构-获取账户余额明细
  226. * @param:userId 用户ID(必传),
  227. */
  228. GetAccountInfo (data = {}) {
  229. return this.AjaxService.get({
  230. url:'/personalCenter/touchBalance',
  231. data,
  232. isLoading: true ,
  233. })
  234. }
  235. /* 运营人员管理-列表 */
  236. QueryOperatorList (data = {}) {
  237. return this.AjaxService.get({
  238. url:'/user/operation/list',
  239. data,
  240. isLoading: true ,
  241. isHost:true
  242. })
  243. }
  244. /* 运营人员管理-添加 */
  245. PostAddOperator (data = {}) {
  246. return this.AjaxService.post({
  247. url:'/user/operation/save',
  248. data,
  249. isLoading: true ,
  250. isHost:true
  251. })
  252. }
  253. /* 运营人员管理-删除 */
  254. PostDeleteOperator (data = {}) {
  255. return this.AjaxService.post({
  256. url:'/user/operation/delete',
  257. data,
  258. isLoading: true ,
  259. isHost:true
  260. })
  261. }
  262. /* 运营人员管理-更新邀请码 */
  263. PostUpdateOperatorCode (data = {}) {
  264. return this.AjaxService.post({
  265. url:'/user/operation/code/update',
  266. data,
  267. isLoading: true ,
  268. isHost:true
  269. })
  270. }
  271. /* 机构购物车简单列表*/
  272. GetUserCartNumber (data = {}) {
  273. return this.AjaxService.get({
  274. url:'/shoppingCart/header/cart',
  275. data,
  276. isLoading: true ,
  277. })
  278. }
  279. }