user.service.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. UserLoginAuthApplets(data = {}) {
  13. return this.AjaxService.post({
  14. url: '/user/login/auth/applets',
  15. data,
  16. isLoading: false,
  17. })
  18. }
  19. /* 邀请码授权登录 */
  20. InvitationCodeLogin(data = {}) {
  21. return this.AjaxService.post({
  22. url: '/user/login/auth/invitation',
  23. data,
  24. isLoading: true,
  25. isStatus: false,
  26. })
  27. }
  28. /* 个人机构注册 */
  29. UserRegisterClub(data = {}) {
  30. return this.AjaxService.post({
  31. url: '/user/register/club',
  32. data,
  33. isLoading: true,
  34. })
  35. }
  36. /* 供应商注册 */
  37. SupplierAppletsRegistered(data = {}) {
  38. return this.AjaxService.post({
  39. url: '/user/register/shop',
  40. data,
  41. isLoading: true,
  42. })
  43. }
  44. /**
  45. * 账号登录
  46. * @param mobileOrEmail 邮箱或手机
  47. * @param password 密码
  48. * @param source 来源 PC与小程序传:'www'crm就传'crm'
  49. */
  50. AorganizationLogin(data = {}) {
  51. return this.AjaxService.post({
  52. url: '/user/login/password',
  53. data,
  54. isLoading: true,
  55. isStatus: true,
  56. })
  57. }
  58. /* 查询机构资料*/
  59. OrganizationUpdateModifyInfo(data = {}) {
  60. return this.AjaxService.get({
  61. url: '/user/club/info',
  62. data,
  63. isLoading: true,
  64. })
  65. }
  66. /* 协销拉机构上线(查询暂时数据)*/
  67. UseRregisterTemporaryInfo(data = {}) {
  68. return this.AjaxService.get({
  69. url: '/user/register/temporary/data',
  70. data,
  71. isLoading: true,
  72. })
  73. }
  74. /* 机构升级资质机构 */
  75. OrganizationRegister(data = {}) {
  76. return this.AjaxService.post({
  77. url: '/user/register/club/upgrade',
  78. data,
  79. isLoading: true,
  80. })
  81. }
  82. /* 机构提交资料修改 */
  83. OrganizationUpdate(data = {}) {
  84. return this.AjaxService.post({
  85. url: '/user/club/info/update',
  86. data,
  87. isLoading: true,
  88. })
  89. }
  90. /* 供应商资料信息-数据回显 */
  91. SupplierShopInfo(data = {}) {
  92. return this.AjaxService.get({
  93. url: '/user/shop/info',
  94. data,
  95. isLoading: true,
  96. })
  97. }
  98. /* 供应商修改申请信息保存 */
  99. SupplierUpdateCompanyInfo(data = {}) {
  100. return this.AjaxService.post({
  101. url: '/user/register/shop/apply',
  102. data,
  103. isLoading: true,
  104. })
  105. }
  106. /* 供应商资料信息-提交修改 */
  107. SupplierModifiedData(data = {}) {
  108. return this.AjaxService.post({
  109. url: '/user/shop/info/update',
  110. data,
  111. isLoading: true,
  112. })
  113. }
  114. /**
  115. *运营人员绑定微信
  116. */
  117. BindingWechat(data = {}) {
  118. return this.AjaxService.post({
  119. url: '/user/login/auth/bind',
  120. data,
  121. isLoading: true,
  122. })
  123. }
  124. /*个人机构取消提示*/
  125. CancelPrompt(data = {}) {
  126. return this.AjaxService.get({
  127. url: '/user/register/guide',
  128. data,
  129. isLoading: false,
  130. })
  131. }
  132. /**
  133. * 找回密码&修改密码
  134. * @param: mobileOrEmail 手机号或邮箱
  135. * @param: password 密码
  136. * @param: passwordConfirm 用户确认密码
  137. * @param: smsCode 短信验证码
  138. * @param: status 1:手机号找回,2:邮箱找回
  139. */
  140. ModifyMobilePassword(data = {}) {
  141. return this.AjaxService.post({
  142. url: '/user/update/password',
  143. data,
  144. isLoading: true,
  145. })
  146. }
  147. /**
  148. * 更换手机号
  149. * @param: mobile 原手机号
  150. * @param: newMobile 新手机号
  151. * @param: smsCode 原手机号验证码
  152. * @param: newSmsCode 新手机号验证码
  153. * @param: userId 用户userId
  154. */
  155. UserUpdateMobile(data = {}) {
  156. return this.AjaxService.post({
  157. url: '/user/update/mobile',
  158. data,
  159. isLoading: true,
  160. })
  161. }
  162. /**
  163. * @机构-地址列表
  164. * @param:userId 用户ID(必传),
  165. * @param:pageNum 页码
  166. * @param:pageSize 每页条数
  167. */
  168. QueryAddressList(data = {}) {
  169. return this.AjaxService.get({
  170. url: '/order/address/list',
  171. data,
  172. isLoading: true,
  173. })
  174. }
  175. /**
  176. * @机构-添加&&修改地址
  177. * @param:userId 用户ID(必传),
  178. * @param:地址信息,
  179. */
  180. AddressSave(data = {}) {
  181. return this.AjaxService.post({
  182. url: '/order/address/save',
  183. data,
  184. isLoading: true,
  185. })
  186. }
  187. /**
  188. * @机构-删除地址
  189. * @param:userId 用户ID(必传),
  190. * @param:地址信息,
  191. */
  192. DeleteAddress(data = {}) {
  193. return this.AjaxService.post({
  194. url: '/order/address/delete',
  195. data,
  196. isLoading: true,
  197. })
  198. }
  199. /**
  200. * @机构-个人中心
  201. * @param:userId 用户ID(必传),
  202. */
  203. PersonalInfo(data = {}) {
  204. return this.AjaxService.get({
  205. url: '/personalCenter/myCentre',
  206. data,
  207. isLoading: false,
  208. })
  209. }
  210. /**
  211. * @机构-获取账户余额明细
  212. * @param:userId 用户ID(必传),
  213. */
  214. GetAccountInfo(data = {}) {
  215. return this.AjaxService.get({
  216. url: '/user/center/balance',
  217. data,
  218. isLoading: true,
  219. })
  220. }
  221. /* 运营人员管理-列表 */
  222. QueryOperatorList(data = {}) {
  223. return this.AjaxService.get({
  224. url: '/user/operation/list',
  225. data,
  226. isLoading: true,
  227. })
  228. }
  229. /* 运营人员管理-添加 */
  230. PostAddOperator(data = {}) {
  231. return this.AjaxService.post({
  232. url: '/user/operation/save',
  233. data,
  234. isLoading: true,
  235. })
  236. }
  237. /* 运营人员管理-删除 */
  238. PostDeleteOperator(data = {}) {
  239. return this.AjaxService.post({
  240. url: '/user/operation/delete',
  241. data,
  242. isLoading: true,
  243. })
  244. }
  245. /* 运营人员管理-更新邀请码 */
  246. PostUpdateOperatorCode(data = {}) {
  247. return this.AjaxService.post({
  248. url: '/user/operation/code/update',
  249. data,
  250. isLoading: true,
  251. })
  252. }
  253. /**
  254. *@协销帮机构注册 待注册列表
  255. *@param userId 协销用户userId
  256. *@param searchName 关键词
  257. *@param pageNum 页码
  258. *@param pageSize 条数
  259. */
  260. SellerUserTemporaryClub(data = {}) {
  261. return this.AjaxService.get({
  262. url: '/user/seller/temporary/club',
  263. data,
  264. isLoading: true,
  265. })
  266. }
  267. /**
  268. *@协销待注册列表 删除操作
  269. *@param ID
  270. */
  271. SellerDeleteUserTemporaryClub(data = {}) {
  272. return this.AjaxService.post({
  273. url: '/user/seller/delete/temporary/club',
  274. data,
  275. isLoading: true,
  276. })
  277. }
  278. /**
  279. *@获取采美豆状态
  280. *@userId userId
  281. */
  282. GetHomeObtainBeans(data = {}) {
  283. return this.AjaxService.get({
  284. url: '/user/club/obtain/beans',
  285. data,
  286. isLoading: false,
  287. })
  288. }
  289. /**
  290. *@获取机构个人中心
  291. *@userId userId
  292. */
  293. GetClubObtainCenter(data = {}) {
  294. return this.AjaxService.get({
  295. url: '/user/club/home',
  296. data,
  297. isLoading: false,
  298. })
  299. }
  300. /**
  301. *@机构采美豆收支明细
  302. *@param userId 机构用户userId
  303. *@param year 年份
  304. *@param month 月份
  305. *@param type 收支类型:全部0 1收入 2支出
  306. *@param pageNum 页码
  307. *@param pageSize 条数
  308. */
  309. GetUserClubBeansList(data = {}) {
  310. return this.AjaxService.get({
  311. url: '/user/club/beans/history',
  312. data,
  313. isLoading: false,
  314. })
  315. }
  316. /**
  317. *@机构资料备注列表
  318. *@param clubId 机构用户clubId
  319. *@param pageNum 页码
  320. *@param pageSize 条数
  321. */
  322. getUserClubRemarksList(data = {}) {
  323. return this.AjaxService.get({
  324. url: '/user/club/remarks/list',
  325. data,
  326. isLoading: true,
  327. })
  328. }
  329. /**
  330. *@机构资料备注保存
  331. *@param clubId 机构用户clubId
  332. */
  333. getUserClubRemarksSave(data = {}) {
  334. return this.AjaxService.post({
  335. url: '/user/club/remarks/save',
  336. data,
  337. isLoading: true,
  338. })
  339. }
  340. /**
  341. *@机构资料备注详情
  342. *@param remarksId 备注Id
  343. */
  344. getUserClubRemarksDetail(data = {}) {
  345. return this.AjaxService.get({
  346. url: '/user/club/remarks/detail',
  347. data,
  348. isLoading: true,
  349. })
  350. }
  351. /**
  352. *@机构资料备注删除
  353. *@param remarksId 备注Id
  354. */
  355. getUserClubRemarksDelete(data = {}) {
  356. return this.AjaxService.post({
  357. url: '/user/club/remarks/delete',
  358. data,
  359. isLoading: true,
  360. })
  361. }
  362. /**
  363. *@添加潜在客户咨询人
  364. *@param name 机构用户clubId
  365. *@param serviceProviderId 协销Id
  366. */
  367. getUserClubVisitorSave(data = {}) {
  368. return this.AjaxService.get({
  369. url: '/user/club/remarks/visitor/save',
  370. data,
  371. isLoading: false,
  372. })
  373. }
  374. /**
  375. *@修改潜在客户咨询人名称
  376. *@param questionMan 姓名
  377. *@param questionManId 咨询人Id
  378. *@param serviceProviderId 协销Id
  379. */
  380. getUserClubVisitorUpdate(data = {}) {
  381. return this.AjaxService.get({
  382. url: '/user/club/remarks/visitor/update',
  383. data,
  384. isLoading: false,
  385. })
  386. }
  387. /**
  388. *@潜在客户列表
  389. *@param serviceProviderId 机构用户clubId
  390. *@param pageNum 页码
  391. *@param pageSize 条数
  392. */
  393. getUserClubVisitorList(data = {}) {
  394. return this.AjaxService.get({
  395. url: '/user/club/remarks/visitor/list',
  396. data,
  397. isLoading: true,
  398. })
  399. }
  400. /**
  401. *@潜在客户列表
  402. *@param questionManId 咨詢人ID
  403. *@param pageNum 页码
  404. *@param pageSize 条数
  405. */
  406. getUserClubVisitorRecordlist(data = {}) {
  407. return this.AjaxService.get({
  408. url: '/user/club/remarks/visitor/recordlist',
  409. data,
  410. isLoading: true,
  411. })
  412. }
  413. /**
  414. *@潜在客户信息保存
  415. *@param remarksId 記錄ID
  416. *@param questionManId 咨詢人ID
  417. *@param serviceProviderId 协销ID
  418. *@param remarks 文字
  419. *@param fileList 文件
  420. *@param imageList 图片
  421. *@param pageNum 页码
  422. *@param pageSize 条数
  423. */
  424. getUserClubVisitorSaveAdd(data = {}) {
  425. return this.AjaxService.post({
  426. url: '/user/club/remarks/save/visit',
  427. data,
  428. isLoading: true,
  429. })
  430. }
  431. /**
  432. *@咨询人记录删除
  433. *@param remarksId 备注Id
  434. */
  435. getUserRemarksVisitDelete(data = {}) {
  436. return this.AjaxService.post({
  437. url: '/user/club/remarks/delete/visit',
  438. data,
  439. isLoading: true,
  440. })
  441. }
  442. /**
  443. *@咨询人记录详情
  444. *@param remarksId 备注Id
  445. */
  446. getUserRemarksVisitDetail(data = {}) {
  447. return this.AjaxService.get({
  448. url: '/user/club/remarks/detail/visit',
  449. data,
  450. isLoading: true,
  451. })
  452. }
  453. /**
  454. *@同步咨询人至机构
  455. *@param questionManId 备注Id
  456. */
  457. getUserRemarksConcactVisit(data = {}) {
  458. return this.AjaxService.post({
  459. url: '/user/club/remarks/concact/visit',
  460. data,
  461. isLoading: true,
  462. loadText: '同步中...'
  463. })
  464. }
  465. /**
  466. *@会员中心
  467. *@param userId 用户Id
  468. */
  469. getUserSuperCenter(data = {}) {
  470. return this.AjaxService.get({
  471. url: '/user/super/center',
  472. data,
  473. isLoading: false,
  474. })
  475. }
  476. /**
  477. *@会员购买记录
  478. *@param userId 用户Id
  479. *@param pageNum 页码
  480. *@param pageSize 条数
  481. */
  482. getUserSuperHistory(data = {}) {
  483. return this.AjaxService.get({
  484. url: '/user/super/history',
  485. data,
  486. isLoading: true,
  487. })
  488. }
  489. /**
  490. *@超级会员套餐
  491. */
  492. getUserSuperPackage(data = {}) {
  493. return this.AjaxService.get({
  494. url: '/user/super/package',
  495. data,
  496. isLoading: true,
  497. })
  498. }
  499. }