user.service.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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:'/order/address/list',
  185. data,
  186. isLoading: true ,
  187. isHost:true
  188. })
  189. }
  190. /**
  191. * @机构-添加&&修改地址
  192. * @param:userId 用户ID(必传),
  193. * @param:地址信息,
  194. */
  195. AddressSave (data = {}) {
  196. return this.AjaxService.post({
  197. url:'/order/address/save',
  198. data,
  199. isLoading: true ,
  200. isHost:true
  201. })
  202. }
  203. /**
  204. * @机构-删除地址
  205. * @param:userId 用户ID(必传),
  206. * @param:地址信息,
  207. */
  208. DeleteAddress (data = {}) {
  209. return this.AjaxService.post({
  210. url:'/order/address/delete',
  211. data,
  212. isLoading: true ,
  213. isHost:true
  214. })
  215. }
  216. /**
  217. * @机构-个人中心
  218. * @param:userId 用户ID(必传),
  219. */
  220. PersonalInfo (data = {}) {
  221. return this.AjaxService.get({
  222. url:'/personalCenter/myCentre',
  223. data,
  224. isLoading: false ,
  225. })
  226. }
  227. /**
  228. * @机构-获取账户余额明细
  229. * @param:userId 用户ID(必传),
  230. */
  231. GetAccountInfo (data = {}) {
  232. return this.AjaxService.get({
  233. url:'/personalCenter/touchBalance',
  234. data,
  235. isLoading: true ,
  236. })
  237. }
  238. /* 运营人员管理-列表 */
  239. QueryOperatorList (data = {}) {
  240. return this.AjaxService.get({
  241. url:'/user/operation/list',
  242. data,
  243. isLoading: true ,
  244. isHost:true
  245. })
  246. }
  247. /* 运营人员管理-添加 */
  248. PostAddOperator (data = {}) {
  249. return this.AjaxService.post({
  250. url:'/user/operation/save',
  251. data,
  252. isLoading: true ,
  253. isHost:true
  254. })
  255. }
  256. /* 运营人员管理-删除 */
  257. PostDeleteOperator (data = {}) {
  258. return this.AjaxService.post({
  259. url:'/user/operation/delete',
  260. data,
  261. isLoading: true ,
  262. isHost:true
  263. })
  264. }
  265. /* 运营人员管理-更新邀请码 */
  266. PostUpdateOperatorCode (data = {}) {
  267. return this.AjaxService.post({
  268. url:'/user/operation/code/update',
  269. data,
  270. isLoading: true ,
  271. isHost:true
  272. })
  273. }
  274. /* 机构购物车简单列表*/
  275. GetUserCartNumber (data = {}) {
  276. return this.AjaxService.get({
  277. url:'/shoppingCart/header/cart',
  278. data,
  279. isLoading: true ,
  280. })
  281. }
  282. /**
  283. *@协销帮机构注册 待注册列表
  284. *@param userId 协销用户userId
  285. *@param searchName 关键词
  286. *@param pageNum 页码
  287. *@param pageSize 条数
  288. */
  289. SellerUserTemporaryClub (data = {}) {
  290. return this.AjaxService.get({
  291. url:'/user/seller/temporary/club',
  292. data,
  293. isLoading: true ,
  294. isHost:true
  295. })
  296. }
  297. /**
  298. *@协销待注册列表 删除操作
  299. *@param ID
  300. */
  301. SellerDeleteUserTemporaryClub (data = {}) {
  302. return this.AjaxService.post({
  303. url:'/user/seller/delete/temporary/club',
  304. data,
  305. isLoading: true ,
  306. isHost:true
  307. })
  308. }
  309. /**
  310. *@获取采美豆状态
  311. *@userId userId
  312. */
  313. GetHomeObtainBeans (data = {}) {
  314. return this.AjaxService.get({
  315. url:'/user/club/obtain/beans',
  316. data,
  317. isLoading: false,
  318. isHost:true
  319. })
  320. }
  321. /**
  322. *@获取机构个人中心
  323. *@userId userId
  324. */
  325. GetClubObtainCenter (data = {}) {
  326. return this.AjaxService.get({
  327. url:'/user/club/home',
  328. data,
  329. isLoading: false,
  330. isHost:true
  331. })
  332. }
  333. /**
  334. *@机构采美豆收支明细
  335. *@param userId 机构用户userId
  336. *@param year 年份
  337. *@param month 月份
  338. *@param type 收支类型:全部0 1收入 2支出
  339. *@param pageNum 页码
  340. *@param pageSize 条数
  341. */
  342. GetUserClubBeansList (data = {}) {
  343. return this.AjaxService.get({
  344. url:'/user/club/beans/history',
  345. data,
  346. isLoading: false,
  347. isHost:true
  348. })
  349. }
  350. }