user.js 13 KB

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