user.js 11 KB

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