user.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  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 redMoneyRecordList(q) {
  157. return request.post("/v1/re/money/redMoneyRecordList", q);
  158. }
  159. /*
  160. * 红色积分记录after
  161. * */
  162. export function getBalanceList(q) {
  163. return request.post("/v1/balance/page", q);
  164. }
  165. /**
  166. * 获取分销海报图片
  167. *
  168. */
  169. export function spreadBanner() {
  170. //#ifdef H5 || APP-PLUS
  171. return request.get('spread/banner', {
  172. type: 2
  173. });
  174. //#endif
  175. //#ifdef MP
  176. return request.get('spread/banner', {
  177. type: 1
  178. });
  179. //#endif
  180. }
  181. /**
  182. *
  183. * 获取推广用户一级和二级
  184. * @param object data
  185. */
  186. export function spreadPeople(data) {
  187. return request.post('spread/people', data);
  188. }
  189. /**
  190. *
  191. * 推广佣金/提现总和
  192. * @param int type
  193. */
  194. export function spreadCount(type) {
  195. return request.get('spread/count/' + type);
  196. }
  197. /*
  198. * 推广数据
  199. * */
  200. export function getSpreadInfo() {
  201. return request.get("commission");
  202. }
  203. /**
  204. *
  205. * 推广订单
  206. * @param object data
  207. */
  208. export function spreadOrder(data) {
  209. return request.post('spread/order', data);
  210. }
  211. /**
  212. *
  213. * 事业部/推广订单
  214. * @param object data
  215. */
  216. export function divisionOrder(data) {
  217. return request.post('division/order', data);
  218. }
  219. /*
  220. * 获取推广人排行
  221. * */
  222. export function getRankList(q) {
  223. return request.get("rank", q);
  224. }
  225. /*
  226. * 获取佣金排名
  227. * */
  228. export function getBrokerageRank(q) {
  229. return request.get("brokerage_rank", q);
  230. }
  231. /**
  232. * 提现申请
  233. * @param object data
  234. */
  235. export function extractCash(data) {
  236. return request.post('extract/cash', data)
  237. }
  238. /**
  239. * 提现银行/提现最低金额
  240. *
  241. */
  242. export function extractBank() {
  243. return request.get('extract/bank');
  244. }
  245. /**
  246. * 会员等级列表
  247. *
  248. */
  249. export function userLevelGrade() {
  250. return request.get('user/level/grade');
  251. }
  252. /**
  253. * 获取某个等级任务
  254. * @param int id 任务id
  255. */
  256. export function userLevelTask(id) {
  257. return request.get('user/level/task/' + id);
  258. }
  259. /**
  260. * 检查用户是否可以成为会员
  261. *
  262. */
  263. export function userLevelDetection() {
  264. return request.get('user/level/detection');
  265. }
  266. /**
  267. *
  268. * 地址列表
  269. * @param object data
  270. */
  271. export function getAddressList(data) {
  272. return request.get('address/list', data);
  273. }
  274. /**
  275. * 设置默认地址
  276. * @param int id
  277. */
  278. export function setAddressDefault(id) {
  279. return request.post('address/default/set', {
  280. id: id
  281. })
  282. }
  283. /**
  284. * 修改 添加地址
  285. * @param object data
  286. */
  287. export function editAddress(data) {
  288. return request.post('address/edit', data);
  289. }
  290. /**
  291. * 删除地址
  292. * @param int id
  293. *
  294. */
  295. export function delAddress(id) {
  296. return request.post('address/del', {
  297. id: id
  298. })
  299. }
  300. /**
  301. * 获取单个地址
  302. * @param int id
  303. */
  304. export function getAddressDetail(id) {
  305. return request.get('address/detail/' + id);
  306. }
  307. /**
  308. * 修改用户信息
  309. * @param object
  310. */
  311. export function userEdit(data) {
  312. return request.post('user/edit', data);
  313. }
  314. /*
  315. * 退出登录
  316. * */
  317. export function getLogout() {
  318. return request.get("v1/logout");
  319. }
  320. /**
  321. * 小程序充值
  322. *
  323. */
  324. export function rechargeRoutine(data) {
  325. return request.post('recharge/routine', data)
  326. }
  327. /*
  328. * 公众号充值
  329. * */
  330. export function rechargeWechat(data) {
  331. return request.post("recharge/wechat", data);
  332. }
  333. /**
  334. * 获取默认地址
  335. *
  336. */
  337. export function getAddressDefault() {
  338. return request.get('address/default');
  339. }
  340. /**
  341. * 充值金额选择
  342. */
  343. export function getRechargeApi() {
  344. return request.get("recharge/index");
  345. }
  346. /**
  347. * 登陆记录
  348. */
  349. export function setVisit(data) {
  350. return request.post('user/set_visit', {
  351. ...data
  352. }, {
  353. noAuth: true
  354. });
  355. }
  356. /**
  357. * 客服列表
  358. */
  359. export function serviceList() {
  360. return request.get("user/service/list");
  361. }
  362. /**
  363. * 客服详情
  364. */
  365. export function getChatRecord(data) {
  366. return request.get("v2/user/service/record", data);
  367. }
  368. /**
  369. * 静默绑定推广人
  370. * @param {Object} puid
  371. */
  372. export function spread(puid) {
  373. return request.post("user/spread", puid);
  374. }
  375. /**
  376. * 会员详情
  377. */
  378. export function getlevelInfo() {
  379. return request.get("user/level/info");
  380. }
  381. /**
  382. * 会员经验列表
  383. */
  384. export function getlevelExpList(data) {
  385. return request.get("user/level/expList", data);
  386. }
  387. /**
  388. * 修改用户信息
  389. * @param {Object} data
  390. */
  391. export function updateUserInfo(data) {
  392. return request.post('v2/user/user_update', data);
  393. }
  394. /**
  395. * 微信直接手机号登录
  396. */
  397. export function phoneWxSilenceAuth(data) {
  398. return request.post('v2/phone_wx_silence_auth', data, {
  399. noAuth: true
  400. });
  401. }
  402. /**
  403. * 小程序直接手机号登录
  404. */
  405. export function phoneSilenceAuth(data) {
  406. return request.post('v2/phone_silence_auth', data, {
  407. noAuth: true
  408. });
  409. }
  410. /**
  411. * 用户发票列表
  412. * @param {Object} data
  413. */
  414. export function invoiceList(data) {
  415. return request.get('v2/invoice', data, {
  416. noAuth: true
  417. });
  418. }
  419. /**
  420. * 用户添加|修改发票
  421. * @param {Object} data
  422. */
  423. export function invoiceSave(data) {
  424. return request.post('v2/invoice/save', data, {
  425. noAuth: true
  426. });
  427. }
  428. /**
  429. * 用户删除发票
  430. * @param {Object} data
  431. */
  432. export function invoiceDelete(id) {
  433. return request.get('v2/invoice/del/' + id);
  434. }
  435. /**
  436. * 获取用户默认发票
  437. * @param {Object} type
  438. */
  439. export function invoiceDefault(type) {
  440. return request.get('v2/invoice/get_default/' + type);
  441. }
  442. /**
  443. * 用户单个发票详情
  444. * @param {Object} id
  445. */
  446. export function invoiceDetail(id) {
  447. return request.get('v2/invoice/detail/' + id);
  448. }
  449. /**
  450. * 订单申请开票
  451. * @param {Object} id
  452. */
  453. export function invoiceOrder(data) {
  454. return request.post('v2/order/make_up_invoice', data);
  455. }
  456. /**
  457. * 订单详情中申请开票
  458. * @param {Object} id
  459. */
  460. export function makeUpinvoice(data) {
  461. return request.post('v2/order/make_up_invoice', data);
  462. }
  463. /**
  464. * 会员卡主界面
  465. */
  466. export function memberCard() {
  467. return request.get('user/member/card/index');
  468. }
  469. /**
  470. * 卡密领取会员卡
  471. * @param {Object} data
  472. */
  473. export function memberCardDraw(data) {
  474. return request.post('user/member/card/draw', data);
  475. }
  476. /**
  477. * 购买会员卡
  478. * @param {Object} data
  479. */
  480. export function memberCardCreate(data) {
  481. return request.post('user/member/card/create', data);
  482. }
  483. /**
  484. * 会员优惠券
  485. */
  486. export function memberCouponsList() {
  487. return request.get('user/member/coupons/list');
  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. * 图片链接转base64
  511. */
  512. export function imgToBase(data) {
  513. return request.post('image_base64', data);
  514. }
  515. /**
  516. * 获取小程序二维码
  517. */
  518. export function routineCode(data) {
  519. return request.get('user/routine_code', data);
  520. }
  521. /**
  522. * 消息中心
  523. */
  524. export function serviceRecord(data) {
  525. return request.get('user/record', data);
  526. }
  527. /**
  528. * 消息中心-站内信列表
  529. */
  530. export function messageSystem(data) {
  531. return request.get('user/message_system/list', data);
  532. }
  533. /**
  534. * 消息中心-站内信列表详情
  535. */
  536. export function getMsgDetails(id) {
  537. return request.get('user/message_system/detail/' + id);
  538. }
  539. /**
  540. * 消息中心-消息已读/删除
  541. */
  542. export function msgLookDel(data) {
  543. return request.get('user/message_system/edit_message', data);
  544. }
  545. /**
  546. * 苹果账号登录
  547. * @param {Object} data
  548. */
  549. export function appleLogin(data) {
  550. return request.post('apple_login', data, {
  551. noAuth: true
  552. });
  553. }
  554. /*
  555. * 获取隐私协议
  556. * */
  557. export function getUserAgreement(type) {
  558. return request.get(`get_agreement/${type}`, {}, {
  559. noAuth: true
  560. });
  561. }
  562. /**
  563. * 获取分销等级列表
  564. * @param int id 任务id
  565. */
  566. export function agentLevelList() {
  567. return request.get('v2/agent/level_list');
  568. }
  569. /**
  570. * 获取分销任务列表
  571. * @param int id 任务id
  572. */
  573. export function agentLevelTaskList(id) {
  574. return request.get('v2/agent/level_task_list?id=' + id);
  575. }
  576. /**
  577. * 获取代付详情
  578. * @param int id 任务id
  579. */
  580. export function friendDetail(id) {
  581. return request.get('order/friend_detail?order_id=' + id);
  582. }
  583. /**
  584. * 员工列表
  585. * @param object data
  586. *
  587. */
  588. export function clerkPeople(data) {
  589. return request.get('agent/get_staff_list', data)
  590. }
  591. /**
  592. *
  593. * 员工比例
  594. * @param object data
  595. */
  596. export function setClerkPercent(data) {
  597. return request.post('agent/set_staff_percent', data);
  598. }
  599. /**
  600. *
  601. * 删除员工
  602. * @param object data
  603. */
  604. export function delClerkPercent(id) {
  605. return request.get(`agent/del_staff/${id}`);
  606. }
  607. /**
  608. * 注销用户
  609. * @param int id
  610. *
  611. */
  612. export function cancelUser() {
  613. return request.get('user_cancel');
  614. }