api.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. import request from "./index.js"
  2. import store from "../store/index.js"
  3. //接口管理
  4. // 第一版接口 开始
  5. // 登录接口
  6. function login(tel, pwd) {
  7. return request('data/api.login/in', {
  8. phone: tel,
  9. password: pwd
  10. }, 'POST')
  11. }
  12. // 图形验证
  13. function graphVer() {
  14. return request('data/api.login/captcha')
  15. }
  16. // 验证码登录接口
  17. function loginVer(tel, verify) {
  18. return request('data/api.login/phone', {
  19. phone: tel,
  20. verify: verify
  21. })
  22. }
  23. // 注册
  24. function register(tel, pwd, repwd, code, icode, pay_password) {
  25. return request('data/api.login/register', {
  26. phone: tel,
  27. password: pwd,
  28. true_password: repwd,
  29. verify: code,
  30. invite_code: icode,
  31. pay_password: pay_password
  32. })
  33. }
  34. // 发送验证码
  35. function smsCode(tel, captcha, uniqid) {
  36. return request('data/api.login/sendsms', {
  37. phone: tel,
  38. captcha,
  39. uniqid
  40. })
  41. }
  42. // 忘记密码
  43. function forget(tel, code, pwd, repwd) {
  44. return request('data/api.login/change', {
  45. phone: tel,
  46. verify: code,
  47. password: pwd,
  48. true_password: repwd
  49. })
  50. }
  51. // 获取用户信息
  52. function get_user_info() {
  53. request('data/api.auth.center/get').then(res => {
  54. if (res.code == 1) {
  55. uni.setStorageSync("user_info", res.data)
  56. uni.setStorageSync("token", res.data.token.token)
  57. } else {
  58. uni.showToast({
  59. title: res.info,
  60. icon: "none"
  61. })
  62. setTimeout(() => {
  63. uni.reLaunch({
  64. url: "/pages/login/login"
  65. })
  66. }, 1500)
  67. }
  68. })
  69. }
  70. // 首页 热门推荐
  71. function popular(limit, page, name = "") {
  72. return request('data/api.auth.collection/getHot', {
  73. limit,
  74. page,
  75. name
  76. }, "GET")
  77. }
  78. //首页 最新发布
  79. function new_list(limit, page) {
  80. return request('data/api.auth.collection/getNew', {
  81. limit,
  82. page
  83. }, "GET")
  84. }
  85. //藏品详情
  86. function collection_info(id) {
  87. return request('data/api.auth.collection/getInfo', {
  88. id
  89. }, "GET")
  90. }
  91. //首页 盲盒专区
  92. function box_list(limit, page, name = "") {
  93. return request('data/api.auth.Bind/getBindList', {
  94. limit,
  95. page,
  96. name
  97. }, "GET")
  98. }
  99. //盲盒详情
  100. function box_info(id) {
  101. return request("data/api.auth.Bind/getBindInfo", {
  102. id
  103. }, "GET")
  104. }
  105. //我的盲盒
  106. function my_box(limit, page) {
  107. return request("data/api.auth.Bind/getUserBox", {
  108. limit,
  109. page,
  110. }, "GET")
  111. }
  112. //开盲盒
  113. function open_box(id) {
  114. return request("data/api.auth.bind/openBox", {
  115. id
  116. }, "GET")
  117. }
  118. // 生成订单
  119. function create_order(id, Ticket, RandStr) {
  120. // console.log(JSON.stringify(uni.signStr))
  121. return request("data/api.auth.collection/buy", {
  122. id,
  123. Ticket,
  124. RandStr
  125. }, "POST")
  126. }
  127. //余额支付
  128. function balancepay(order_no, pay_password) {
  129. return request("data/api.auth.collection/payment", {
  130. order_no,
  131. payment_code: "M7659936020981218107",
  132. pay_password
  133. })
  134. }
  135. //支付宝支付
  136. function zfbpay(order_no) {
  137. return request("data/api.auth.collection/payment", {
  138. order_no,
  139. payment_code: "2",
  140. type: "2",
  141. pay_type: "1"
  142. })
  143. }
  144. //微信支付
  145. function wxpay(order_no) {
  146. return request("data/api.auth.collection/payment", {
  147. order_no,
  148. payment_code: "1",
  149. type: "2",
  150. pay_type: "1"
  151. })
  152. }
  153. //盲盒余额支付
  154. function box_balancepay(order_no, pay_password) {
  155. return request("data/api.auth.bind/payment", {
  156. order_no,
  157. payment_code: "M7659936020981218107",
  158. pay_password
  159. })
  160. }
  161. //盲盒支付宝支付
  162. function box_zfbpay(order_no) {
  163. return request("data/api.auth.bind/payment", {
  164. order_no,
  165. payment_code: "2",
  166. type: "2",
  167. pay_type: "1"
  168. })
  169. }
  170. //盲盒微信支付
  171. function box_wxpay(order_no) {
  172. return request("data/api.auth.bind/payment", {
  173. order_no,
  174. payment_code: "1",
  175. type: "2",
  176. pay_type: "1"
  177. })
  178. }
  179. //藏馆
  180. function collection(limit, page) {
  181. return request("data/api.auth.collection/getList", {
  182. limit,
  183. page
  184. }, "GET")
  185. }
  186. //藏馆详情
  187. function collection2_info(id) {
  188. return request("data/api.auth.collection/getCangInfo", {
  189. id
  190. }, "GET")
  191. }
  192. //修改个人信息
  193. function set_user_info(nickname, headimg) {
  194. return request('data/api.auth.center/set', {
  195. nickname,
  196. headimg,
  197. })
  198. }
  199. //我的藏品
  200. function mycollection(limit, page, status) {
  201. return request("data/api.auth.collection/getUserCollection", {
  202. limit,
  203. page,
  204. status
  205. }, "GET")
  206. }
  207. // 意见反馈
  208. function feedback(imgs, content) {
  209. return request('data/api.auth.center/message', {
  210. imgs,
  211. content
  212. })
  213. }
  214. //验证原手机
  215. function oldtel(phone, verify) {
  216. return request('data/api.auth.center/verifyPhone', {
  217. phone,
  218. verify
  219. })
  220. }
  221. //验证新手机
  222. function newtel(phone, verify) {
  223. return request('data/api.auth.center/changePhone', {
  224. phone,
  225. verify
  226. })
  227. }
  228. //购买盲盒 生成订单
  229. function createboxorder(id) {
  230. return request("data/api.auth.Bind/buy", {
  231. id
  232. })
  233. }
  234. //实名认证
  235. function authentication(username, card, captcha, uniqid) {
  236. return request("data/api.auth.center/auth", {
  237. username,
  238. card,
  239. captcha,
  240. uniqid
  241. })
  242. }
  243. //我的团队
  244. function team(limit) {
  245. return request("data/api.auth.center/getFrom", {
  246. limit: 200,
  247. page: 1
  248. }, "GET")
  249. }
  250. //关于我们
  251. function about() {
  252. return request("data/api.data/aboutUs")
  253. }
  254. //隐私政策 用户协议
  255. function aboutall() {
  256. return request("data/api.data/getAbout")
  257. }
  258. //首页轮播图
  259. function banner() {
  260. return request("data/api.data/getSlider")
  261. }
  262. //订单列表
  263. function order_list(limit, page, status) {
  264. return request("data/api.auth.center/getOrderList", {
  265. limit,
  266. page,
  267. status
  268. }, "GET")
  269. }
  270. //搜索用户 手机或者hash值
  271. function search_user(phone) {
  272. return request("data/api.auth.collection/getNews", {
  273. phone
  274. }, "GET")
  275. }
  276. //赠送 藏品id 手机号或者hash 支付密码
  277. function givesome(id, phone, password) {
  278. return request("data/api.auth.collection/giving", {
  279. id,
  280. phone,
  281. password
  282. })
  283. }
  284. //赠送 盲盒id 手机号或者hash 支付密码
  285. function givesome_box(id, phone, password) {
  286. return request("data/api.auth.bind/giving", {
  287. id,
  288. phone,
  289. password
  290. })
  291. }
  292. //获取转赠记录
  293. function get_increase_all(limit, page, type) {
  294. return request("data/api.auth.center/givLog", {
  295. limit,
  296. page,
  297. type
  298. }, "GET")
  299. }
  300. //获取最新一条公告
  301. function get_notice() {
  302. return request("data/api.news/newArticle", {}, "GET")
  303. }
  304. //获取公告列表
  305. function get_notice_list(class_id) {
  306. return request("data/api.news/getItem", {
  307. class_id
  308. }, "GET")
  309. }
  310. //获取公告详情
  311. function get_notice_info(id) {
  312. return request("data/api.news/getInfo", {
  313. id
  314. }, "GET")
  315. }
  316. //查询订单是否排队
  317. function get_islineup(order_no) {
  318. return request("data/api.auth.collection/searchOrder", {
  319. order_no
  320. })
  321. }
  322. // 第一版接口 结束
  323. // 第二版市场合成部分
  324. //合成列表
  325. function compound_list(limit, page) {
  326. return request("data/api.auth.Synthetic/getSynList", {
  327. limit,
  328. page
  329. }, "GET")
  330. }
  331. //合成点进去详情
  332. function compound_details(id, password) {
  333. return request("data/api.auth.Synthetic/getInfo", {
  334. id
  335. }, "GET")
  336. }
  337. //合成
  338. function compound(id, collection_user_id) {
  339. return request("data/api.auth.Synthetic/syn", {
  340. id,
  341. collection_user_id
  342. })
  343. }
  344. //合成记录
  345. function compound_history(limit, page) {
  346. return request("data/api.auth.Synthetic/getSynLog", {
  347. limit,
  348. page
  349. }, "GET")
  350. }
  351. //市场列表 type 1藏品 2盲盒 goods_id藏品或者盲盒id
  352. function market_list(limit, page, type, goods_id, sort, name = "", is_guan, series_id) {
  353. return request("data/api.auth.mark/getUserMark", {
  354. limit,
  355. page,
  356. type,
  357. goods_id,
  358. sort: sort + '',
  359. name,
  360. is_guan,
  361. series_id
  362. }, "GET")
  363. }
  364. //市场详情
  365. function market_details(id) {
  366. return request("data/api.auth.mark/getMarkInfo", {
  367. id
  368. }, "GET")
  369. }
  370. //获取藏品
  371. function get_collection(limit, page) {
  372. return request("data/api.auth.mark/getCollect", {
  373. limit,
  374. page
  375. }, "GET")
  376. }
  377. //获取盲盒
  378. function get_box(limit, page) {
  379. return request("data/api.auth.mark/getBox", {
  380. limit,
  381. page
  382. }, "GET")
  383. }
  384. //转售
  385. function resale(price, type, id, password) {
  386. return request("data/api.auth.mark/sell", {
  387. price,
  388. type,
  389. id,
  390. password
  391. })
  392. }
  393. //市场生成订单
  394. function create_market_order(id) {
  395. return request("data/api.auth.mark/addOrder", {
  396. id
  397. })
  398. }
  399. //市场支付 余额支付
  400. function market_paybalance(order_no, pay_password) {
  401. return request("data/api.auth.mark/payment", {
  402. order_no,
  403. payment_code: "M7659936020981218107",
  404. pay_password
  405. })
  406. }
  407. //市场支付 支付宝支付
  408. function market_payzfb(order_no) {
  409. return request("data/api.auth.mark/payment", {
  410. order_no,
  411. payment_code: "2",
  412. type: "2",
  413. pay_type: "1"
  414. })
  415. }
  416. //市场支付 微信支付
  417. function market_paywx(order_no) {
  418. return request("data/api.auth.mark/payment", {
  419. order_no,
  420. payment_code: "1",
  421. type: '2',
  422. pay_type: '1'
  423. })
  424. }
  425. //我的钱包 充值
  426. function recharge(money) {
  427. return request("data/api.auth.TopUp/addOrder", {
  428. money,
  429. })
  430. }
  431. //我的钱包 余额支付 支付
  432. function wallet_paybalance(order_id) {
  433. // return request("data/api.auth.TopUp/payment", {
  434. // order_id,
  435. // payment_code: "M7531241478305643555"
  436. // })
  437. }
  438. //我的钱包 支付宝支付 支付
  439. function wallet_paywx(order_id) {
  440. return request("data/api.auth.TopUp/payment", {
  441. order_id,
  442. payment_code: "M7625469023871354552",
  443. p_type: 2
  444. })
  445. }
  446. //我的钱包 微信支付 支付
  447. function wallet_payzfb(order_id) {
  448. return request("data/api.auth.TopUp/payment", {
  449. order_id,
  450. payment_code: "M7625469023871354552",
  451. p_type: 1,
  452. pay_type: 1
  453. })
  454. }
  455. //我的钱包 提现 type:alipay_account支付宝 wechat_wallet微信 amount:数量 alipay_user:支付宝姓名 alipay_code:微信或者支付宝账号
  456. function wallet_with(data) {
  457. return request("/data/api.auth.Transfer/add", data)
  458. }
  459. //余额明细
  460. function mx(limit, page) {
  461. return request("data/api.auth.center/msgAccount", {
  462. limit,
  463. page
  464. })
  465. }
  466. //转售记录
  467. function resale_history(limit, page) {
  468. return request("data/api.auth.mark/getSellLog", {
  469. limit,
  470. page
  471. }, "GET")
  472. }
  473. //取消转售
  474. function cancel_resale(id) {
  475. return request("data/api.auth.mark/undo", {
  476. id
  477. }, "GET")
  478. }
  479. //修改支付密码 验证码 旧支付密码 新支付密码 确认支付密码
  480. function update_paypass(verify, oldPwd, newPwd, truePwd) {
  481. return request("data/api.auth.center/setPayPwd", {
  482. verify,
  483. oldPwd,
  484. newPwd,
  485. truePwd
  486. })
  487. }
  488. // 排行榜
  489. function reak(limit, page) {
  490. return request('data/api.auth.rank/rank', {
  491. limit,
  492. page
  493. }, "GET")
  494. }
  495. // 商品编号
  496. function getGoodsList(page, limit, sort, jin, goods_id) {
  497. return request('data/api.auth.mark/getGoodsList', {
  498. page,
  499. limit,
  500. sort,
  501. jin,
  502. goods_id
  503. }, "GET")
  504. }
  505. //藏品折叠
  506. function collection_fold(limit, page, name) {
  507. return request("data/api.auth.collection/getUserCollection1", {
  508. limit,
  509. page,
  510. name
  511. }, "GET")
  512. }
  513. function collection_fold_info(collection_id, limit, page) {
  514. return request("data/api.auth.collection/getInfo1", {
  515. collection_id,
  516. limit,
  517. page
  518. }, "GET")
  519. }
  520. // 首页发售订阅
  521. function subscribe() {
  522. return request('data/api.auth.collection/subscribe', {}, "GET")
  523. }
  524. // 取消藏品订单
  525. function cancel1(order_id) {
  526. return request('data/api.auth.order/cancel1', {
  527. order_id
  528. })
  529. }
  530. // 藏品寄售
  531. function jishou(id) {
  532. return request('data/api.auth.collection/jishou', {
  533. id
  534. }, "GET")
  535. }
  536. // 第二版市场合成部分
  537. // 抽签预约
  538. function appointment(id) {
  539. return request('data/api.auth.draw/draw', {
  540. id
  541. })
  542. }
  543. function reMsg(id) {
  544. return request('/data/api.auth.center/reMsg', {
  545. id
  546. })
  547. }
  548. function msgList(limit, page) {
  549. return request('/data/api.auth.center/msgList', {
  550. limit,
  551. page
  552. })
  553. }
  554. // 获取标签
  555. function getMark1(get_type) {
  556. return request('data/api.News/getMark', {
  557. get_type
  558. }, 'GET')
  559. }
  560. // 咨询内容
  561. function getItem1(type, limit, page, mark) {
  562. return request('data/api.News/getItem', {
  563. type,
  564. limit,
  565. page,
  566. mark
  567. }, 'GET')
  568. }
  569. // 辟谣墙列表
  570. function piyaoList() {
  571. return request('data/api.News/piyaoList', {})
  572. }
  573. // 我要提问
  574. function piyaoConsult(imgs, matter, content, is_anonymous) {
  575. return request('data/api.auth.Center/piyaoConsult', {
  576. imgs,
  577. matter,
  578. content,
  579. is_anonymous
  580. })
  581. }
  582. // 我的水晶
  583. function Integral() {
  584. return request('data/api.auth.Integral/get', {})
  585. }
  586. // 商品详情
  587. function goodsInfo(id) {
  588. return request('data/api.auth.Integral/goodsInfo', {
  589. id
  590. })
  591. }
  592. // 盲盒记录
  593. function getBindOpen(id, limit, page) {
  594. return request('data/api.auth.bind/getBindOpen', {
  595. id,
  596. limit,
  597. page
  598. }, 'GET')
  599. }
  600. // 创作者列表
  601. function Creator(id, limit, page) {
  602. return request('data/api.data/Creator', {
  603. id,
  604. limit,
  605. page
  606. }, 'GET')
  607. }
  608. // 藏品详情的寄售记录
  609. function transferRecord(limit, page, collection_id, order_no) {
  610. return request('data/api.auth.mark/transferRecord', {
  611. limit,
  612. page,
  613. collection_id,
  614. order_no
  615. }, 'GET')
  616. }
  617. // 品牌方
  618. function Brand(limit, page) {
  619. return request('data/api.data/Brand', {
  620. limit,
  621. page
  622. }, 'GET')
  623. }
  624. // 首页精选活动
  625. function baseMode() {
  626. return request('data/api.data/baseMode', {
  627. }, 'GET')
  628. }
  629. // 商品详情
  630. function IntegralgoodsInfo(id) {
  631. return request('data/api.auth.Integral/goodsInfo', {
  632. id
  633. })
  634. }
  635. // 积分账单
  636. function bill(page, limit, type, date, types) {
  637. return request('data/api.auth.Integral/bill', {
  638. page,
  639. limit,
  640. type,
  641. date,
  642. types
  643. })
  644. }
  645. function user_coll(coll_id) {
  646. return request('data/api.auth.Center/user_coll', {
  647. coll_id
  648. })
  649. }
  650. function heList(coll_id) {
  651. return request('data/api.auth.Synthetic/heList', {
  652. coll_id
  653. }, 'GET')
  654. }
  655. // 抽签预约
  656. function collectionAppointment(collection_id) {
  657. return request('data/api.auth.draw/collectionAppointment', {
  658. collection_id
  659. }, 'GET')
  660. }
  661. function getUserMessage(pages, limit) {
  662. return request('data/api.auth.news/getUserMessage', {
  663. pages,
  664. limit
  665. }, 'GET')
  666. }
  667. function Ismessage() {
  668. return request('data/api.auth.news/Ismessage', {}, 'GET')
  669. }
  670. function confirmColl(id, collection_id, collection_user_id) {
  671. return request('data/api.auth.Synthetic/confirmColl', {
  672. id,
  673. collection_id,
  674. collection_user_id
  675. }, 'GET')
  676. }
  677. // 市场分类
  678. function getCategory(limit) {
  679. return request('data/api.auth.mark/getCategory', {
  680. limit
  681. }, 'GET')
  682. }
  683. function open() {
  684. return request('data/api.auth.Center/open', {
  685. })
  686. }
  687. function getHot() {
  688. return request('/data/api.auth.Draw/getHot', {
  689. }, 'GET')
  690. }
  691. export default {
  692. getHot,
  693. open,
  694. getCategory,
  695. confirmColl,
  696. Ismessage,
  697. getUserMessage,
  698. collectionAppointment,
  699. heList,
  700. user_coll,
  701. bill,
  702. IntegralgoodsInfo,
  703. baseMode,
  704. Brand,
  705. transferRecord,
  706. Creator,
  707. getBindOpen,
  708. goodsInfo,
  709. Integral,
  710. piyaoConsult,
  711. piyaoList,
  712. getItem1,
  713. getMark1,
  714. msgList,
  715. reMsg,
  716. appointment,
  717. cancel1,
  718. login,
  719. register,
  720. smsCode,
  721. get_user_info,
  722. forget,
  723. feedback,
  724. popular,
  725. new_list,
  726. box_list,
  727. collection_info,
  728. create_order,
  729. balancepay,
  730. zfbpay,
  731. jishou,
  732. wxpay,
  733. box_balancepay,
  734. box_zfbpay,
  735. box_wxpay,
  736. box_info,
  737. collection,
  738. mycollection,
  739. collection2_info,
  740. set_user_info,
  741. oldtel,
  742. newtel,
  743. createboxorder,
  744. authentication,
  745. team,
  746. about,
  747. aboutall,
  748. loginVer,
  749. banner,
  750. order_list,
  751. search_user,
  752. givesome,
  753. my_box,
  754. get_increase_all,
  755. get_notice,
  756. get_notice_list,
  757. get_notice_info,
  758. open_box,
  759. get_islineup,
  760. givesome_box,
  761. // 第一部分结束
  762. compound_list,
  763. compound_details,
  764. compound,
  765. compound_history,
  766. market_list,
  767. market_details,
  768. get_collection,
  769. get_box,
  770. resale,
  771. create_market_order,
  772. market_paybalance,
  773. market_payzfb,
  774. market_paywx,
  775. recharge,
  776. wallet_paybalance,
  777. wallet_payzfb,
  778. wallet_paywx,
  779. wallet_with,
  780. mx,
  781. resale_history,
  782. cancel_resale,
  783. update_paypass,
  784. reak,
  785. getGoodsList,
  786. collection_fold,
  787. collection_fold_info,
  788. subscribe,
  789. graphVer
  790. }