user.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  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/userInfo/get');
  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.post('v1/address/list', data);
  273. }
  274. /**
  275. * 设置默认地址
  276. * @param int id
  277. */
  278. export function setAddressDefault(id) {
  279. return request.get('v1/address/defaultSet?id='+id, null)
  280. }
  281. /**
  282. * 修改 添加地址
  283. * @param object data
  284. */
  285. export function editAddress(data) {
  286. return request.post('address/edit', data);
  287. }
  288. /**
  289. * 删除地址
  290. * @param int id
  291. *
  292. */
  293. export function delAddress(id) {
  294. return request.get('v1/address/removeById?id='+id,null)
  295. }
  296. /**
  297. * 获取单个地址
  298. * @param int id
  299. */
  300. export function getAddressDetail(id) {
  301. return request.get('address/detail/' + id);
  302. }
  303. /**
  304. * 修改用户信息
  305. * @param object
  306. */
  307. export function userEdit(data) {
  308. return request.post('v1/userInfo/save', data);
  309. }
  310. /*
  311. * 退出登录
  312. * */
  313. export function getLogout() {
  314. return request.get("v1/logout");
  315. }
  316. /**
  317. * 小程序充值
  318. *
  319. */
  320. export function rechargeRoutine(data) {
  321. return request.post('recharge/routine', data)
  322. }
  323. /*
  324. * 公众号充值
  325. * */
  326. export function rechargeWechat(data) {
  327. return request.post("recharge/wechat", data);
  328. }
  329. /**
  330. * 获取默认地址
  331. *
  332. */
  333. export function getAddressDefault() {
  334. return request.get('address/default');
  335. }
  336. /**
  337. * 充值金额选择
  338. */
  339. export function getRechargeApi() {
  340. return request.get("recharge/index");
  341. }
  342. /**
  343. * 登陆记录
  344. */
  345. export function setVisit(data) {
  346. return request.post('user/set_visit', {
  347. ...data
  348. }, {
  349. noAuth: true
  350. });
  351. }
  352. /**
  353. * 客服列表
  354. */
  355. export function serviceList() {
  356. return request.get("user/service/list");
  357. }
  358. /**
  359. * 客服详情
  360. */
  361. export function getChatRecord(data) {
  362. return request.get("v2/user/service/record", data);
  363. }
  364. /**
  365. * 静默绑定推广人
  366. * @param {Object} puid
  367. */
  368. export function spread(puid) {
  369. return request.post("user/spread", puid);
  370. }
  371. /**
  372. * 会员详情
  373. */
  374. export function getlevelInfo() {
  375. return request.get("user/level/info");
  376. }
  377. /**
  378. * 会员经验列表
  379. */
  380. export function getlevelExpList(data) {
  381. return request.get("user/level/expList", data);
  382. }
  383. /**
  384. * 修改用户信息
  385. * @param {Object} data
  386. */
  387. export function updateUserInfo(data) {
  388. return request.post('v2/user/user_update', data);
  389. }
  390. /**
  391. * 微信直接手机号登录
  392. */
  393. export function phoneWxSilenceAuth(data) {
  394. return request.post('v2/phone_wx_silence_auth', data, {
  395. noAuth: true
  396. });
  397. }
  398. /**
  399. * 小程序直接手机号登录
  400. */
  401. export function phoneSilenceAuth(data) {
  402. return request.post('v2/phone_silence_auth', data, {
  403. noAuth: true
  404. });
  405. }
  406. /**
  407. * 用户发票列表
  408. * @param {Object} data
  409. */
  410. export function invoiceList(data) {
  411. return request.get('v2/invoice', data, {
  412. noAuth: true
  413. });
  414. }
  415. /**
  416. * 用户添加|修改发票
  417. * @param {Object} data
  418. */
  419. export function invoiceSave(data) {
  420. return request.post('v2/invoice/save', data, {
  421. noAuth: true
  422. });
  423. }
  424. /**
  425. * 用户删除发票
  426. * @param {Object} data
  427. */
  428. export function invoiceDelete(id) {
  429. return request.get('v2/invoice/del/' + id);
  430. }
  431. /**
  432. * 获取用户默认发票
  433. * @param {Object} type
  434. */
  435. export function invoiceDefault(type) {
  436. return request.get('v2/invoice/get_default/' + type);
  437. }
  438. /**
  439. * 用户单个发票详情
  440. * @param {Object} id
  441. */
  442. export function invoiceDetail(id) {
  443. return request.get('v2/invoice/detail/' + id);
  444. }
  445. /**
  446. * 订单申请开票
  447. * @param {Object} id
  448. */
  449. export function invoiceOrder(data) {
  450. return request.post('v2/order/make_up_invoice', data);
  451. }
  452. /**
  453. * 订单详情中申请开票
  454. * @param {Object} id
  455. */
  456. export function makeUpinvoice(data) {
  457. return request.post('v2/order/make_up_invoice', data);
  458. }
  459. /**
  460. * 会员卡主界面
  461. */
  462. export function memberCard() {
  463. return request.get('user/member/card/index');
  464. }
  465. /**
  466. * 卡密领取会员卡
  467. * @param {Object} data
  468. */
  469. export function memberCardDraw(data) {
  470. return request.post('user/member/card/draw', data);
  471. }
  472. /**
  473. * 购买会员卡
  474. * @param {Object} data
  475. */
  476. export function memberCardCreate(data) {
  477. return request.post('user/member/card/create', data);
  478. }
  479. /**
  480. * 会员优惠券
  481. */
  482. export function memberCouponsList() {
  483. return request.get('user/member/coupons/list');
  484. }
  485. /**
  486. * svip推荐商品
  487. * @param {Object} id
  488. */
  489. export function groomList(id, data) {
  490. return request.get(`groom/list/${id}`, data);
  491. }
  492. /**
  493. * 付费会员结束
  494. * @param {Object} data
  495. */
  496. export function memberOverdueTime(data) {
  497. return request.get('user/member/overdue/time', data);
  498. }
  499. /**
  500. * 新版分享海报信息获取
  501. */
  502. export function spreadMsg() {
  503. return request.get('user/spread_info');
  504. }
  505. /**
  506. * 图片链接转base64
  507. */
  508. export function imgToBase(data) {
  509. return request.post('image_base64', data);
  510. }
  511. /**
  512. * 获取小程序二维码
  513. */
  514. export function routineCode(data) {
  515. return request.get('user/routine_code', data);
  516. }
  517. /**
  518. * 消息中心
  519. */
  520. export function serviceRecord(data) {
  521. return request.get('user/record', data);
  522. }
  523. /**
  524. * 消息中心-站内信列表
  525. */
  526. export function messageSystem(data) {
  527. return request.get('user/message_system/list', data);
  528. }
  529. /**
  530. * 消息中心-站内信列表详情
  531. */
  532. export function getMsgDetails(id) {
  533. return request.get('user/message_system/detail/' + id);
  534. }
  535. /**
  536. * 消息中心-消息已读/删除
  537. */
  538. export function msgLookDel(data) {
  539. return request.get('user/message_system/edit_message', data);
  540. }
  541. /**
  542. * 苹果账号登录
  543. * @param {Object} data
  544. */
  545. export function appleLogin(data) {
  546. return request.post('apple_login', data, {
  547. noAuth: true
  548. });
  549. }
  550. /*
  551. * 获取隐私协议
  552. * */
  553. export function getUserAgreement(type) {
  554. return request.get(`get_agreement/${type}`, {}, {
  555. noAuth: true
  556. });
  557. }
  558. /**
  559. * 获取分销等级列表
  560. * @param int id 任务id
  561. */
  562. export function agentLevelList() {
  563. return request.get('v2/agent/level_list');
  564. }
  565. /**
  566. * 获取分销任务列表
  567. * @param int id 任务id
  568. */
  569. export function agentLevelTaskList(id) {
  570. return request.get('v2/agent/level_task_list?id=' + id);
  571. }
  572. /**
  573. * 获取代付详情
  574. * @param int id 任务id
  575. */
  576. export function friendDetail(id) {
  577. return request.get('order/friend_detail?order_id=' + id);
  578. }
  579. /**
  580. * 员工列表
  581. * @param object data
  582. *
  583. */
  584. export function clerkPeople(data) {
  585. return request.get('agent/get_staff_list', data)
  586. }
  587. /**
  588. *
  589. * 员工比例
  590. * @param object data
  591. */
  592. export function setClerkPercent(data) {
  593. return request.post('agent/set_staff_percent', data);
  594. }
  595. /**
  596. *
  597. * 删除员工
  598. * @param object data
  599. */
  600. export function delClerkPercent(id) {
  601. return request.get(`agent/del_staff/${id}`);
  602. }
  603. /**
  604. * 注销用户
  605. * @param int id
  606. *
  607. */
  608. export function cancelUser() {
  609. return request.get('user_cancel');
  610. }