user.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 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 getMenuData() {
  23. return request.get('menu/date');
  24. }
  25. /**
  26. * 登录成功后更新公众号用户信息
  27. */
  28. export function updateWechatInfo(data) {
  29. return request.get('v2/user/wechat', data);
  30. }
  31. /**
  32. * 设置用户分享
  33. *
  34. */
  35. export function userShare() {
  36. return request.post('user/share');
  37. }
  38. /**
  39. * h5用户登录
  40. * @param data object 用户账号密码
  41. */
  42. export function loginH5(data) {
  43. return request.post("login", data, {
  44. noAuth: true
  45. });
  46. }
  47. /**
  48. * h5用户手机号登录
  49. * @param data object 用户手机号 也只能
  50. */
  51. export function loginMobile(data) {
  52. return request.post("login/mobile", data, {
  53. noAuth: true
  54. });
  55. }
  56. /**
  57. * 验证码key
  58. */
  59. export function getCodeApi() {
  60. return request.get("verify_code", {}, {
  61. noAuth: true
  62. });
  63. }
  64. /**
  65. * h5用户发送验证码
  66. * @param data object 用户手机号
  67. */
  68. export function registerVerify(data) {
  69. return request.post("register/verify", data, {
  70. noAuth: true
  71. });
  72. }
  73. /**
  74. * h5用户手机号注册
  75. * @param data object 用户手机号 验证码 密码
  76. */
  77. export function register(data) {
  78. return request.post("register", data, {
  79. noAuth: true
  80. });
  81. }
  82. /**
  83. * 用户手机号修改密码
  84. * @param data object 用户手机号 验证码 密码
  85. */
  86. export function registerReset(data) {
  87. return request.post("register/reset", data, {
  88. noAuth: true
  89. });
  90. }
  91. /**
  92. * 获取用户中心菜单
  93. *
  94. */
  95. export function getMenuList() {
  96. return request.get("menu/user", {}, {
  97. noAuth: true
  98. });
  99. }
  100. /*
  101. * 签到用户信息
  102. * */
  103. export function postSignUser(sign) {
  104. return request.post("sign/user", sign);
  105. }
  106. /**
  107. * 获取签到配置
  108. *
  109. */
  110. export function getSignConfig() {
  111. return request.get('sign/config')
  112. }
  113. /**
  114. * 获取签到列表
  115. * @param object data
  116. */
  117. export function getSignList(data) {
  118. return request.get('sign/list', data);
  119. }
  120. /**
  121. * 用户签到
  122. */
  123. export function setSignIntegral() {
  124. return request.post('sign/integral')
  125. }
  126. /**
  127. * 签到列表(年月)
  128. * @param object data
  129. *
  130. */
  131. export function getSignMonthList(data) {
  132. return request.get('sign/month', data)
  133. }
  134. /**
  135. * 签到日历
  136. * @param {Object} data
  137. */
  138. export function getSignCalendar(data) {
  139. return request.get('sign/calendar', data)
  140. }
  141. /**
  142. * 活动状态
  143. *
  144. */
  145. export function userActivity() {
  146. return request.get('user/activity');
  147. }
  148. /*
  149. * 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)这个接口暂时废弃
  150. * */
  151. export function getCommissionInfo(q, types) {
  152. return request.get("spread/commission/" + types, q);
  153. }
  154. // 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
  155. export function moneyList(q, types) {
  156. return request.get("v2/user/money_list/" + types, q);
  157. }
  158. /*
  159. * 积分记录
  160. * */
  161. export function getIntegralList(q) {
  162. return request.get("integral/list", q);
  163. }
  164. /**
  165. * 获取分销海报图片
  166. *
  167. */
  168. export function spreadBanner() {
  169. //#ifdef H5 || APP-PLUS
  170. return request.get('spread/banner', {
  171. type: 2
  172. });
  173. //#endif
  174. //#ifdef MP
  175. return request.get('spread/banner', {
  176. type: 1
  177. });
  178. //#endif
  179. }
  180. /**
  181. *
  182. * 获取推广用户一级和二级
  183. * @param object data
  184. */
  185. export function spreadPeople(data) {
  186. return request.post('spread/people', data);
  187. }
  188. /**
  189. *
  190. * 推广佣金/提现总和
  191. * @param int type
  192. */
  193. export function spreadCount(type) {
  194. return request.get('spread/count/' + type);
  195. }
  196. /*
  197. * 推广数据
  198. * */
  199. export function getSpreadInfo() {
  200. return request.get("commission");
  201. }
  202. /**
  203. *
  204. * 推广订单
  205. * @param object data
  206. */
  207. export function spreadOrder(data) {
  208. return request.post('spread/order', data);
  209. }
  210. /*
  211. * 获取推广人排行
  212. * */
  213. export function getRankList(q) {
  214. return request.get("rank", q);
  215. }
  216. /*
  217. * 获取佣金排名
  218. * */
  219. export function getBrokerageRank(q) {
  220. return request.get("brokerage_rank", q);
  221. }
  222. /**
  223. * 提现申请
  224. * @param object data
  225. */
  226. export function extractCash(data) {
  227. return request.post('extract/cash', data)
  228. }
  229. /**
  230. * 提现银行/提现最低金额
  231. *
  232. */
  233. export function extractBank() {
  234. return request.get('extract/bank');
  235. }
  236. /**
  237. * 会员等级列表
  238. *
  239. */
  240. export function userLevelGrade() {
  241. return request.get('user/level/grade');
  242. }
  243. /**
  244. * 获取某个等级任务
  245. * @param int id 任务id
  246. */
  247. export function userLevelTask(id) {
  248. return request.get('user/level/task/' + id);
  249. }
  250. /**
  251. * 检查用户是否可以成为会员
  252. *
  253. */
  254. export function userLevelDetection() {
  255. return request.get('user/level/detection');
  256. }
  257. /**
  258. *
  259. * 地址列表
  260. * @param object data
  261. */
  262. export function getAddressList(data) {
  263. return request.get('address/list', data);
  264. }
  265. /**
  266. * 设置默认地址
  267. * @param int id
  268. */
  269. export function setAddressDefault(id) {
  270. return request.post('address/default/set', {
  271. id: id
  272. })
  273. }
  274. /**
  275. * 修改 添加地址
  276. * @param object data
  277. */
  278. export function editAddress(data) {
  279. return request.post('address/edit', data);
  280. }
  281. /**
  282. * 删除地址
  283. * @param int id
  284. *
  285. */
  286. export function delAddress(id) {
  287. return request.post('address/del', {
  288. id: id
  289. })
  290. }
  291. /**
  292. * 获取单个地址
  293. * @param int id
  294. */
  295. export function getAddressDetail(id) {
  296. return request.get('address/detail/' + id);
  297. }
  298. /**
  299. * 修改用户信息
  300. * @param object
  301. */
  302. export function userEdit(data) {
  303. return request.post('user/edit', data);
  304. }
  305. /*
  306. * 退出登录
  307. * */
  308. export function getLogout() {
  309. return request.get("logout");
  310. }
  311. /*
  312. * 充值订单信息
  313. * */
  314. export function rechargeAPi(data) {
  315. return request.post("recharge/recharge", data);
  316. }
  317. /*
  318. * 充值支付
  319. * */
  320. export function rechargePayAPi(data) {
  321. return request.post("recharge/pay", data);
  322. }
  323. /**
  324. * 获取默认地址
  325. *
  326. */
  327. export function getAddressDefault() {
  328. return request.get('address/default');
  329. }
  330. /**
  331. * 充值金额选择
  332. */
  333. export function getRechargeApi() {
  334. return request.get("recharge/index");
  335. }
  336. /**
  337. * 登陆记录
  338. */
  339. export function setVisit(data) {
  340. return request.post('user/set_visit', {
  341. ...data
  342. }, {
  343. noAuth: true
  344. });
  345. }
  346. /**
  347. * 客服列表
  348. */
  349. export function serviceList() {
  350. return request.get("user/service/list");
  351. }
  352. /**
  353. * 客服详情
  354. */
  355. export function getChatRecord(data) {
  356. return request.get("v2/user/service/record", data);
  357. }
  358. /**
  359. * 静默绑定推广人
  360. * @param {Object} puid
  361. */
  362. export function spread(puid) {
  363. return request.post("user/spread", puid);
  364. }
  365. /**
  366. * 会员详情
  367. */
  368. export function getlevelInfo() {
  369. return request.get("user/level/info");
  370. }
  371. /**
  372. * 会员经验列表
  373. */
  374. export function getlevelExpList(data) {
  375. return request.get("user/level/expList", data);
  376. }
  377. /**
  378. * 修改用户信息
  379. * @param {Object} data
  380. */
  381. export function updateUserInfo(data) {
  382. return request.post('v2/user/user_update', data);
  383. }
  384. /**
  385. * 微信直接手机号登录
  386. */
  387. export function phoneWxSilenceAuth(data) {
  388. return request.post('v2/phone_wx_silence_auth', data, {
  389. noAuth: true
  390. });
  391. }
  392. /**
  393. * 小程序直接手机号登录
  394. */
  395. export function phoneSilenceAuth(data) {
  396. return request.post('v2/phone_silence_auth', data, {
  397. noAuth: true
  398. });
  399. }
  400. /**
  401. * 用户发票列表
  402. * @param {Object} data
  403. */
  404. export function invoiceList(data) {
  405. return request.get('v2/invoice', data, {
  406. noAuth: true
  407. });
  408. }
  409. /**
  410. * 用户添加|修改发票
  411. * @param {Object} data
  412. */
  413. export function invoiceSave(data) {
  414. return request.post('v2/invoice/save', data, {
  415. noAuth: true
  416. });
  417. }
  418. /**
  419. * 用户删除发票
  420. * @param {Object} data
  421. */
  422. export function invoiceDelete(id) {
  423. return request.get('v2/invoice/del/' + id);
  424. }
  425. /**
  426. * 获取用户默认发票
  427. * @param {Object} type
  428. */
  429. export function invoiceDefault(type) {
  430. return request.get('v2/invoice/get_default/' + type);
  431. }
  432. /**
  433. * 用户单个发票详情
  434. * @param {Object} id
  435. */
  436. export function invoiceDetail(id) {
  437. return request.get('v2/invoice/detail/' + id);
  438. }
  439. /**
  440. * 订单申请开票
  441. * @param {Object} id
  442. */
  443. export function invoiceOrder(data) {
  444. return request.post('v2/order/make_up_invoice', data);
  445. }
  446. /**
  447. * 订单详情中申请开票
  448. * @param {Object} id
  449. */
  450. export function makeUpinvoice(data) {
  451. return request.post('v2/order/make_up_invoice', data);
  452. }
  453. /**
  454. * 会员卡主界面
  455. */
  456. export function memberCard() {
  457. return request.get('user/member/card/index');
  458. }
  459. /**
  460. * 卡密领取会员卡
  461. * @param {Object} data
  462. */
  463. export function memberCardDraw(data) {
  464. return request.post('user/member/card/draw', data);
  465. }
  466. /**
  467. * 购买会员卡
  468. * @param {Object} data
  469. */
  470. export function memberCardCreate(data) {
  471. return request.post('user/member/card/create', data);
  472. }
  473. /**
  474. * 购买会员卡支付
  475. * @param {Object} data
  476. */
  477. export function memberCardPayApi(data) {
  478. return request.post('user/member/card/pay', data);
  479. }
  480. /**
  481. * 会员优惠券
  482. */
  483. export function memberCouponsList(page, limit) {
  484. return request.get('user/member/coupons/list', {
  485. page,
  486. limit
  487. });
  488. }
  489. /**
  490. * svip推荐商品
  491. * @param {Object} id
  492. */
  493. export function groomList(id, data) {
  494. return request.get(`groom/list/${id}`, data);
  495. }
  496. /**
  497. * 付费会员结束
  498. * @param {Object} data
  499. */
  500. export function memberOverdueTime(data) {
  501. return request.get('user/member/overdue/time', data);
  502. }
  503. /**
  504. * 新版分享海报信息获取
  505. */
  506. export function spreadMsg() {
  507. return request.get('user/spread_info');
  508. }
  509. /**
  510. * 已邀请/已下单好友
  511. */
  512. export function agentUserList(type, page, limit) {
  513. return request.get(`v2/agent/agent_user_list/${type}?page=${page}&limit=${limit}`);
  514. }
  515. /**
  516. * 获取用户推广获得收益,佣金轮播,分销规则
  517. */
  518. export function agentInfo() {
  519. return request.get(`v2/agent/agent_info`);
  520. }
  521. /**
  522. * 图片链接转base64
  523. */
  524. export function imgToBase(data) {
  525. return request.post('image_base64', data);
  526. }
  527. /**
  528. * 获取小程序二维码
  529. */
  530. export function routineCode(data) {
  531. return request.get('user/routine_code', data);
  532. }
  533. /**
  534. * 消息中心
  535. */
  536. export function serviceRecord(data) {
  537. return request.get('user/message', data);
  538. }
  539. /**
  540. * 消息中心-站内信列表
  541. */
  542. export function messageSystem(data) {
  543. return request.get('user/message_system/list', data);
  544. }
  545. /**
  546. * 消息中心-站内信列表详情
  547. */
  548. export function getMsgDetails(id) {
  549. return request.get('user/message_system/detail/' + id);
  550. }
  551. /**
  552. * 苹果账号登录
  553. * @param {Object} data
  554. */
  555. export function appleLogin(data) {
  556. return request.post('apple_login', data, {
  557. noAuth: true
  558. });
  559. }
  560. /*
  561. * 获取隐私协议
  562. * */
  563. export function getUserAgreement(type) {
  564. return request.get(`user_agreement/${type}`, {}, {
  565. noAuth: true
  566. });
  567. }
  568. /*
  569. * 获取分销说明
  570. * */
  571. export function getDistributionInfo(type) {
  572. return request.get(`agreement/2`, {}, {
  573. noAuth: true
  574. });
  575. }
  576. /**
  577. * 获取分销等级列表
  578. * @param int id 任务id
  579. */
  580. export function agentLevelList() {
  581. return request.get('v2/agent/level_list');
  582. }
  583. /**
  584. * 获取分销任务列表
  585. * @param int id 任务id
  586. */
  587. export function agentLevelTaskList(id) {
  588. return request.get('v2/agent/level_task_list?id=' + id);
  589. }
  590. /**
  591. * 获取定位详细地址
  592. * @param int id
  593. *
  594. */
  595. export function getGeocoder(data) {
  596. return request.get(`geoLbscoder?location=${data.lat},${data.long}`, {}, {
  597. noAuth: true
  598. });
  599. }
  600. /**
  601. * 获取当前定位选中的地址
  602. * @param int id
  603. *
  604. */
  605. export function getCityList(address) {
  606. return request.get('v2/cityList', {
  607. address
  608. }, {
  609. noAuth: true
  610. });
  611. }
  612. /**
  613. * 获取版权
  614. *
  615. */
  616. export function getCopyRight() {
  617. return request.get('get_copyright', {}, {
  618. noAuth: true
  619. });
  620. }
  621. /**
  622. * 获取code码
  623. * @param int id
  624. *
  625. */
  626. export function getRandCode() {
  627. return request.get('user/rand_code');
  628. }
  629. /**
  630. * 注销用户
  631. * @param int id
  632. *
  633. */
  634. export function cancelUser() {
  635. return request.get('cancel/user');
  636. }
  637. /**
  638. * 获取激活会员卡需要的信息
  639. * @param int id
  640. *
  641. */
  642. export function levelInfo() {
  643. return request.get('user/level/activate_info');
  644. }
  645. /**
  646. * 用户激活会员卡
  647. * @param int id
  648. *
  649. */
  650. export function levelActivate(data) {
  651. return request.post('user/level/activate', data);
  652. }
  653. /**
  654. * 用户设置签到提醒
  655. */
  656. export function signRemind(status) {
  657. return request.get(`sign/remind/${status}`);
  658. }
  659. /**
  660. * 供应商入住
  661. * @param data
  662. *
  663. */
  664. export function spplyCreateApi(id, data) {
  665. return request.post(`user/apply/supplier/${id}`, data);
  666. }
  667. /**
  668. * 供应商详情接口
  669. *
  670. */
  671. export function userApply(id) {
  672. return request.get("user/apply/" + id);
  673. }
  674. /**
  675. * 供应商记录接口
  676. *
  677. */
  678. export function recordList() {
  679. return request.get("user/apply/record");
  680. }
  681. /**
  682. * 文章点赞
  683. *
  684. */
  685. export function articleStarApi(id, data) {
  686. return request.get(`article/like/${id}`, data);
  687. }
  688. // 获取认证信息
  689. export function rate(data) {
  690. return request.get('rate',data);
  691. }
  692. //实名认证获取验证码
  693. export function checkUser(data) {
  694. return request.post('user/check',data);
  695. }
  696. export function realName(data) {
  697. return request.post('rname',data);
  698. }
  699. /*
  700. * 绿积分记录
  701. * */
  702. export function getGreedIntegralList(q) {
  703. return request.get("green_integral/list", q);
  704. }
  705. /*
  706. * 绿积分转账
  707. * */
  708. export function setGreedIntegralList(q) {
  709. return request.post("green/transfer", q);
  710. }
  711. /*
  712. * 绿积分购买
  713. * */
  714. export function getGreedUserList(q) {
  715. return request.get("green/list", q);
  716. }
  717. /*
  718. * 红积分记录
  719. * */
  720. export function getRedIntegralList(q) {
  721. return request.get("red_integral/list", q);
  722. }
  723. /*
  724. * 红积分转佣金
  725. * */
  726. export function setRedIntegralList(q) {
  727. return request.post("trans/brokerage", q);
  728. }
  729. export function energyExchange(q) {
  730. return request.post("money/transfer", q);
  731. }
  732. export function brokerageImport(q) {
  733. return request.post("import/brokerage", q);
  734. }
  735. // 获取首页信息
  736. export function loadIndexs(data) {
  737. return request.get('index',data);
  738. }