user.js 11 KB

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