user.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. /**
  12. * 获取用户信息
  13. *
  14. */
  15. export function getUserInfo() {
  16. return request.get('user');
  17. }
  18. /**
  19. * 设置用户分享
  20. *
  21. */
  22. export function userShare() {
  23. return request.post('user/share');
  24. }
  25. /**
  26. * h5用户登录
  27. * @param data object 用户账号密码
  28. */
  29. export function loginH5(data) {
  30. return request.post("login", data, {
  31. noAuth: true
  32. });
  33. }
  34. /**
  35. * h5用户手机号登录
  36. * @param data object 用户手机号 也只能
  37. */
  38. export function loginMobile(data) {
  39. return request.post("login/mobile", data, {
  40. noAuth: true
  41. });
  42. }
  43. /**
  44. * 验证码key
  45. */
  46. export function getCodeApi() {
  47. return request.get("verify_code", {}, {
  48. noAuth: true
  49. });
  50. }
  51. /**
  52. * h5用户发送验证码
  53. * @param data object 用户手机号
  54. */
  55. export function registerVerify(data) {
  56. return request.post("register/verify", data, {
  57. noAuth: true
  58. });
  59. }
  60. /**
  61. * h5用户手机号注册
  62. * @param data object 用户手机号 验证码 密码
  63. */
  64. export function register(data) {
  65. return request.post("register", data, {
  66. noAuth: true
  67. });
  68. }
  69. /**
  70. * 用户手机号修改密码
  71. * @param data object 用户手机号 验证码 密码
  72. */
  73. export function registerReset(data) {
  74. return request.post("register/reset", data, {
  75. noAuth: true
  76. });
  77. }
  78. /**
  79. * 获取用户中心菜单
  80. *
  81. */
  82. export function getMenuList() {
  83. return request.get("menu/user", {}, {
  84. noAuth: true
  85. });
  86. }
  87. /*
  88. * 签到用户信息
  89. * */
  90. export function postSignUser(sign) {
  91. return request.post("sign/user", sign);
  92. }
  93. /**
  94. * 获取签到配置
  95. *
  96. */
  97. export function getSignConfig() {
  98. return request.get('sign/config')
  99. }
  100. /**
  101. * 获取签到列表
  102. * @param object data
  103. */
  104. export function getSignList(data) {
  105. return request.get('sign/list', data);
  106. }
  107. /**
  108. * 用户签到
  109. */
  110. export function setSignIntegral() {
  111. return request.post('sign/integral')
  112. }
  113. /**
  114. * 签到列表(年月)
  115. * @param object data
  116. *
  117. */
  118. export function getSignMonthList(data) {
  119. return request.get('sign/month', data)
  120. }
  121. /**
  122. * 活动状态
  123. *
  124. */
  125. export function userActivity() {
  126. return request.get('user/activity');
  127. }
  128. /*
  129. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  130. * */
  131. export function getCommissionInfo(q, types) {
  132. return request.get("spread/commission/" + types, q);
  133. }
  134. /*
  135. * 积分记录
  136. * */
  137. export function getIntegralList(q) {
  138. return request.get("integral/list", q);
  139. }
  140. /**
  141. * 获取分销海报图片
  142. *
  143. */
  144. export function spreadBanner() {
  145. //#ifdef H5 || APP-PLUS
  146. return request.get('spread/banner', {
  147. type: 2
  148. });
  149. //#endif
  150. //#ifdef MP
  151. return request.get('spread/banner', {
  152. type: 1
  153. });
  154. //#endif
  155. }
  156. /**
  157. *
  158. * 获取推广用户一级和二级
  159. * @param object data
  160. */
  161. export function spreadPeople(data) {
  162. return request.post('spread/people', data);
  163. }
  164. /**
  165. *
  166. * 推广佣金/提现总和
  167. * @param int type
  168. */
  169. export function spreadCount(type) {
  170. return request.get('spread/count/' + type);
  171. }
  172. /*
  173. * 推广数据
  174. * */
  175. export function getSpreadInfo() {
  176. return request.get("commission");
  177. }
  178. /**
  179. *
  180. * 推广订单
  181. * @param object data
  182. */
  183. export function spreadOrder(data) {
  184. return request.post('spread/order', data);
  185. }
  186. /**
  187. *
  188. * 事业部/推广订单
  189. * @param object data
  190. */
  191. export function divisionOrder(data) {
  192. return request.post('division/order', data);
  193. }
  194. /*
  195. * 获取推广人排行
  196. * */
  197. export function getRankList(q) {
  198. return request.get("rank", q);
  199. }
  200. /*
  201. * 获取佣金排名
  202. * */
  203. export function getBrokerageRank(q) {
  204. return request.get("brokerage_rank", q);
  205. }
  206. /**
  207. * 提现申请
  208. * @param object data
  209. */
  210. export function extractCash(data) {
  211. return request.post('extract/cash', data)
  212. }
  213. /**
  214. * 提现银行/提现最低金额
  215. *
  216. */
  217. export function extractBank() {
  218. return request.get('extract/bank');
  219. }
  220. /**
  221. * 会员等级列表
  222. *
  223. */
  224. export function userLevelGrade() {
  225. return request.get('user/level/grade');
  226. }
  227. /**
  228. * 获取某个等级任务
  229. * @param int id 任务id
  230. */
  231. export function userLevelTask(id) {
  232. return request.get('user/level/task/' + id);
  233. }
  234. /**
  235. * 检查用户是否可以成为会员
  236. *
  237. */
  238. export function userLevelDetection() {
  239. return request.get('user/level/detection');
  240. }
  241. /**
  242. *
  243. * 地址列表
  244. * @param object data
  245. */
  246. export function getAddressList(data) {
  247. return request.get('address/list', data);
  248. }
  249. /**
  250. * 设置默认地址
  251. * @param int id
  252. */
  253. export function setAddressDefault(id) {
  254. return request.post('address/default/set', {
  255. id: id
  256. })
  257. }
  258. /**
  259. * 修改 添加地址
  260. * @param object data
  261. */
  262. export function editAddress(data) {
  263. return request.post('address/edit', data);
  264. }
  265. /**
  266. * 删除地址
  267. * @param int id
  268. *
  269. */
  270. export function delAddress(id) {
  271. return request.post('address/del', {
  272. id: id
  273. })
  274. }
  275. /**
  276. * 获取单个地址
  277. * @param int id
  278. */
  279. export function getAddressDetail(id) {
  280. return request.get('address/detail/' + id);
  281. }
  282. /**
  283. * 修改用户信息
  284. * @param object
  285. */
  286. export function userEdit(data) {
  287. return request.post('user/edit', data);
  288. }
  289. /*
  290. * 退出登录
  291. * */
  292. export function getLogout() {
  293. return request.get("logout");
  294. }
  295. /**
  296. * 小程序充值
  297. *
  298. */
  299. export function rechargeRoutine(data) {
  300. return request.post('recharge/routine', data)
  301. }
  302. /*
  303. * 公众号充值
  304. *
  305. */
  306. export function rechargeWechat(data) {
  307. return request.post("recharge/wechat", data);
  308. }
  309. /*
  310. * 公众号充值
  311. *
  312. */
  313. export function recharge(data) {
  314. return request.post("recharge/recharge", data);
  315. }
  316. /**
  317. * 获取默认地址
  318. *
  319. */
  320. export function getAddressDefault() {
  321. return request.get('address/default');
  322. }
  323. /**
  324. * 充值金额选择
  325. */
  326. export function getRechargeApi() {
  327. return request.get("recharge/index");
  328. }
  329. /**
  330. * 登陆记录
  331. */
  332. export function setVisit(data) {
  333. return request.post('user/set_visit', {
  334. ...data
  335. }, {
  336. noAuth: true
  337. });
  338. }
  339. /**
  340. * 客服列表
  341. */
  342. export function serviceList() {
  343. return request.get("user/service/list");
  344. }
  345. /**
  346. * 客服详情
  347. */
  348. export function getChatRecord(data) {
  349. return request.get("v2/user/service/record", data);
  350. }
  351. /**
  352. * 静默绑定推广人
  353. * @param {Object} puid
  354. */
  355. export function spread(puid) {
  356. return request.post("user/spread", puid);
  357. }
  358. /**
  359. * 会员详情
  360. */
  361. export function getlevelInfo() {
  362. return request.get("user/level/info");
  363. }
  364. /**
  365. * 会员经验列表
  366. */
  367. export function getlevelExpList(data) {
  368. return request.get("user/level/expList", data);
  369. }
  370. /**
  371. * 修改用户信息
  372. * @param {Object} data
  373. */
  374. export function updateUserInfo(data) {
  375. return request.post('v2/user/user_update', data);
  376. }
  377. /**
  378. * 微信直接手机号登录
  379. */
  380. export function phoneWxSilenceAuth(data) {
  381. return request.post('v2/phone_wx_silence_auth', data, {
  382. noAuth: true
  383. });
  384. }
  385. /**
  386. * 小程序直接手机号登录
  387. */
  388. export function phoneSilenceAuth(data) {
  389. return request.post('v2/phone_silence_auth', data, {
  390. noAuth: true
  391. });
  392. }
  393. /**
  394. * 用户发票列表
  395. * @param {Object} data
  396. */
  397. export function invoiceList(data) {
  398. return request.get('v2/invoice', data, {
  399. noAuth: true
  400. });
  401. }
  402. /**
  403. * 用户添加|修改发票
  404. * @param {Object} data
  405. */
  406. export function invoiceSave(data) {
  407. return request.post('v2/invoice/save', data, {
  408. noAuth: true
  409. });
  410. }
  411. /**
  412. * 用户删除发票
  413. * @param {Object} data
  414. */
  415. export function invoiceDelete(id) {
  416. return request.get('v2/invoice/del/' + id);
  417. }
  418. /**
  419. * 获取用户默认发票
  420. * @param {Object} type
  421. */
  422. export function invoiceDefault(type) {
  423. return request.get('v2/invoice/get_default/' + type);
  424. }
  425. /**
  426. * 用户单个发票详情
  427. * @param {Object} id
  428. */
  429. export function invoiceDetail(id) {
  430. return request.get('v2/invoice/detail/' + id);
  431. }
  432. /**
  433. * 订单申请开票
  434. * @param {Object} id
  435. */
  436. export function invoiceOrder(data) {
  437. return request.post('v2/order/make_up_invoice', data);
  438. }
  439. /**
  440. * 订单详情中申请开票
  441. * @param {Object} id
  442. */
  443. export function makeUpinvoice(data) {
  444. return request.post('v2/order/make_up_invoice', data);
  445. }
  446. /**
  447. * 会员卡主界面
  448. */
  449. export function memberCard() {
  450. return request.get('user/member/card/index');
  451. }
  452. /**
  453. * 卡密领取会员卡
  454. * @param {Object} data
  455. */
  456. export function memberCardDraw(data) {
  457. return request.post('user/member/card/draw', data);
  458. }
  459. /**
  460. * 购买会员卡
  461. * @param {Object} data
  462. */
  463. export function memberCardCreate(data) {
  464. return request.post('user/member/card/create', data);
  465. }
  466. /**
  467. * 会员优惠券
  468. */
  469. export function memberCouponsList() {
  470. return request.get('user/member/coupons/list');
  471. }
  472. /**
  473. * svip推荐商品
  474. * @param {Object} id
  475. */
  476. export function groomList(id, data) {
  477. return request.get(`groom/list/${id}`, data);
  478. }
  479. /**
  480. * 付费会员结束
  481. * @param {Object} data
  482. */
  483. export function memberOverdueTime(data) {
  484. return request.get('user/member/overdue/time', data);
  485. }
  486. /**
  487. * 新版分享海报信息获取
  488. *
  489. */
  490. export function spreadMsg() {
  491. return request.get('user/spread_info');
  492. }
  493. /**
  494. * 图片链接转base64
  495. *
  496. */
  497. export function imgToBase(data) {
  498. return request.post('image_base64', data);
  499. }
  500. /**
  501. * 获取小程序二维码
  502. *
  503. */
  504. export function routineCode(data) {
  505. return request.get('user/routine_code', data);
  506. }
  507. /**
  508. * 消息中心
  509. */
  510. export function serviceRecord(data) {
  511. return request.get('user/record', data);
  512. }
  513. /**
  514. * 消息中心-站内信列表
  515. */
  516. export function messageSystem(data) {
  517. return request.get('user/message_system/list', data);
  518. }
  519. /**
  520. * 消息中心-站内信列表详情
  521. */
  522. export function getMsgDetails(id) {
  523. return request.get('user/message_system/detail/' + id);
  524. }
  525. /**
  526. * 消息中心-消息已读/删除
  527. */
  528. export function msgLookDel(data) {
  529. return request.get('user/message_system/edit_message', data);
  530. }
  531. /**
  532. * 苹果账号登录
  533. * @param {Object} data
  534. */
  535. export function appleLogin(data) {
  536. return request.post('apple_login', data, {
  537. noAuth: true
  538. });
  539. }
  540. /*
  541. * 获取隐私协议
  542. * */
  543. export function getUserAgreement(type) {
  544. return request.get(`get_agreement/${type}`, {}, {
  545. noAuth: true
  546. });
  547. }
  548. /**
  549. * 获取分销等级列表
  550. * @param int id 任务id
  551. */
  552. export function agentLevelList() {
  553. return request.get('v2/agent/level_list');
  554. }
  555. /**
  556. * 获取分销任务列表
  557. * @param int id 任务id
  558. */
  559. export function agentLevelTaskList(id) {
  560. return request.get('v2/agent/level_task_list?id=' + id);
  561. }
  562. /**
  563. * 获取代付详情
  564. * @param int id 任务id
  565. */
  566. export function friendDetail(id) {
  567. return request.get('order/friend_detail?order_id=' + id);
  568. }
  569. /**
  570. * 员工列表
  571. * @param object data
  572. *
  573. */
  574. export function clerkPeople(data) {
  575. return request.get('agent/get_staff_list', data)
  576. }
  577. /**
  578. *
  579. * 员工比例
  580. * @param object data
  581. */
  582. export function setClerkPercent(data) {
  583. return request.post('agent/set_staff_percent', data);
  584. }
  585. /**
  586. *
  587. * 删除员工
  588. * @param object data
  589. */
  590. export function delClerkPercent(id) {
  591. return request.get(`agent/del_staff/${id}`);
  592. }
  593. /**
  594. * 注销用户
  595. * @param int id
  596. *
  597. */
  598. export function cancelUser() {
  599. return request.get('user_cancel');
  600. }
  601. /**
  602. * 获取多语言类型
  603. */
  604. export function getLangList() {
  605. return request.get('get_lang_type_list', {}, {
  606. noAuth: true
  607. })
  608. }
  609. /**
  610. * 获取多语言JSON
  611. */
  612. export function getLangJson() {
  613. return request.get('get_lang_json', {}, {
  614. noAuth: true
  615. })
  616. }
  617. /**
  618. * 获取多语言是否切换
  619. */
  620. export function getLangVersion() {
  621. return request.get('lang_version', {}, {
  622. noAuth: true
  623. })
  624. }
  625. /**
  626. *
  627. * 小程序绑定手机号
  628. * @param object data
  629. */
  630. export function mpBindingPhone(data) {
  631. return request.post('v2/routine/binding_phone', data);
  632. }