api.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. import url from './index.js'
  2. const send = (data) => url.post('/api/sms/send', data);
  3. const mobilelogin = (data) => url.post('/api/user/mobilelogin', data);
  4. const passwordLogin = (data) => url.post('/api/user/login', data);
  5. const resetpwd = (data) => url.post('/api/user/resetpwd', data);
  6. const agreement = (data) => url.post('/api/common/agreement', data);
  7. // 提幣開關
  8. const checkSwitch = (data) => url.get('/api/index/checkSwitch', data);
  9. const checkSwitch2 = (data) => url.get('/api/index/checkSwitch2', data);
  10. // 首页接口
  11. const getPayKey = (data) => url.post('/api/wechat/getPayKey', data);
  12. const sumuv = (data) => url.post('/api/index/sumUv', {});
  13. const wechatLoginRedirect = (data) => url.post('/api/wechat/wechatLoginRedirect', data);
  14. const baseInfo = (data) => url.post('/api/index/baseInfo', data);
  15. const categoryList = (data) => url.post('/api/index/categoryList', data);
  16. const recommend = (data) => url.post('/api/index/recommend', data);
  17. const newestOpen = (data) => url.post('/api/index/newestOpen', data);
  18. const star = (data) => url.post('/api/index/star', data);
  19. const boxListByCategory = (data) => url.post('/api/index/boxListByCategory', data);
  20. const boxDetail = (data) => url.post('/api/index/boxDetail', data);
  21. const hotBox = (data) => url.post('/api/index/hotBox', data);
  22. const cheapBox = (data) => url.post('/api/index/cheapBox', data);
  23. const rechargeList = (data) => url.post('/api/index/rechargeList', data);
  24. const openByOrderTrade = (data) => url.get('/api/index/openByOrderTrade', data);
  25. const createRechargeOrder = (data) => url.post('/api/index/createRechargeOrder', data);
  26. const getServiceInfo = (data) => url.post('/api/index/getServiceInfo', data);
  27. const getWechatLoginUrl = (data) => url.post('/api/index/getWechatLoginUrl', data);
  28. const tryBoxDetail = (data) => url.post('/api/index/tryBoxDetail', data);
  29. const haveATry = (data) => url.post('/api/index/haveATry', data);
  30. const createOrder = (data) => url.post('/api/index/createOrder', data);
  31. const coinPay = (data) => url.post('/api/index/coinPay', data);
  32. const cmoneyPay = (data) => url.post('/api/index/cmoneyPay', data);
  33. const search = (data) => url.post('/api/index/search', data);
  34. const priceRange = (data) => url.post('/api/index/priceRange', data);
  35. // 个人中心
  36. const sList = (data) => url.post('/api/index/sList', data);
  37. const wechatMpAuth = (data) => url.post('/api/Auth_login_with_wechat/code', data)
  38. const wechatMpAuthLogin = (data) => url.post('/api/Auth_login_with_wechat/login', data)
  39. const openRecord = (data) => url.post('/api/user/openRecord', data);
  40. const myBox = (data) => url.post('/api/user/myBox', data);
  41. const myOrderList = (data) => url.post('/api/user/myOrderList', data);
  42. const userinfo = (data) => url.post('/api/user/userinfo', data);
  43. const myStar = (data) => url.post('/api/user/myStar', data);
  44. const cancelStar = (data) => url.post('/api/user/cancelStar', data);
  45. const myBalance = (data) => url.post('/api/user/myBalance', data);
  46. const myCoin = (data) => url.post('/api/user/myCoin', data);
  47. const myAddress = (data) => url.post('/api/user/myAddress', data);
  48. const addAddress = (data) => url.post('/api/user/addAddress', data);
  49. const editAddress = (data) => url.post('/api/user/editAddress', data);
  50. const deleteAddress = (data) => url.post('/api/user/deleteAddress', data);
  51. const exchange = (data) => url.post('/api/user/exchange', data);
  52. const checkDeliveryInfo = (data) => url.post('/api/user/checkDeliveryInfo', data);
  53. const applyDelivery = (data) => url.post('/api/user/applyDelivery', data);
  54. const searchHistory = (data) => url.post('/api/user/searchHistory', data);
  55. const getSettingInfo = (data) => url.post('/api/user/getSettingInfo', data);
  56. const changeInfo = (data) => url.post('/api/user/changeInfo', data);
  57. const deliveryOrderDetail = (data) => url.post('/api/user/deliveryOrderDetail', data);
  58. const confirmReceipt = (data) => url.post('/api/user/confirmReceipt', data);
  59. const moneyToCoin = (data) => url.post('/api/user/moneyToCoin', data);
  60. const getWithdrawalSetting = (data) => url.post('/api/user/getWithdrawalSetting', data);
  61. const withdrawal = (data) => url.post('/api/user/withdrawal', data);
  62. const bindWithdrawalAccount = (data) => url.post('/api/user/bindWithdrawalAccount', data);
  63. const bindMobile = (data) => url.post('/api/user/bindMobile', data);
  64. const getVgoods = (data) => url.get('/api/index/getVirData', data);
  65. //最新开盒轮播
  66. const lunbobox = (data) => url.get('/api/index/lunbobox', data);
  67. // 分销
  68. const getTotalCoin = () => url.get(`/api/retail/getTotalCoin`)
  69. const getRetailList = ({
  70. page,
  71. limit
  72. }) => url.post(`/api/retail/getRetailList`, {
  73. page,
  74. limit
  75. })
  76. const getTeamList = ({
  77. page,
  78. limit
  79. }) => url.post(`/api/retail/getTeamList`, {
  80. page,
  81. limit
  82. })
  83. const getTixianList = ({
  84. page,
  85. limit
  86. }) => url.post(`/api/retail/getTixianList`, {
  87. page,
  88. limit
  89. })
  90. //卡密
  91. const carpassDeposit = (data) => url.post('/api/carpass/deposit', data);
  92. const carpassList = (data) => url.get('/api/carpass/check', data);
  93. //获取金币和盒子数量
  94. const getUserCapital = (data) => url.get('/api/user/UserCapital', data);
  95. //转赠
  96. const echargez = (data) => url.post('/api/user/echargez', data);
  97. //转赠列表
  98. const echargezs = (data) => url.get('/api/user/echargezs', data);
  99. //获取跳转域名
  100. const getServiceurl = (data) => url.get('/api/index/getServiceurl', data);
  101. //金币提现
  102. const goldDeposit = (data) => url.post('/api/user/withdrawals', data)
  103. //用户注册
  104. const register = (data) => url.post('/api/user/register', data)
  105. //盒子飞出图片
  106. const boximages = (data) => url.post('/api/index/boximages', data)
  107. //提交晒图
  108. const setShai = (data) => url.post('/api/index/setShai', data)
  109. export default {
  110. checkSwitch, //提幣開關
  111. checkSwitch2, //提幣開關
  112. sumuv, //统计uv
  113. getVgoods, //假数据
  114. lunbobox, //最新开盒轮播
  115. send, //发送短信验证码
  116. agreement, //协议规则
  117. mobilelogin, //手机号登录
  118. passwordLogin, //密码登录
  119. resetpwd, //重置密码
  120. getPayKey, //微信信息
  121. wechatLoginRedirect, //微信绑定
  122. baseInfo, //首页基本信息
  123. categoryList, //分类列表
  124. recommend, //推荐盲盒
  125. newestOpen, //最新开箱盲盒列表
  126. star, // 点赞/取消点赞
  127. boxListByCategory, //通过分类查询盲盒列表
  128. boxDetail, //盲盒详情
  129. hotBox, //热门盲盒
  130. cheapBox, //低价专区
  131. rechargeList, //充值金额列表
  132. openByOrderTrade, //通过支付订单号开箱
  133. createRechargeOrder, //创建充值订单
  134. getServiceInfo, //获取客服信息
  135. getWechatLoginUrl, //微信登录
  136. tryBoxDetail, // 试试手气盲盒详情
  137. haveATry, //试玩
  138. createOrder, //创建订单
  139. coinPay, //金币支付
  140. cmoneyPay, //余额支付
  141. search, //搜索
  142. priceRange, //价格区间
  143. // 个人中心
  144. sList,
  145. wechatMpAuth, //获取oppid
  146. wechatMpAuthLogin,
  147. openRecord, //开箱记录
  148. myBox, //我的盒柜
  149. myOrderList, //我的订单
  150. deliveryOrderDetail, //发货订单详情
  151. confirmReceipt, //确认订单
  152. userinfo, //用户信息
  153. myStar, //我的收藏
  154. cancelStar, //删除收藏
  155. myBalance, //我的余额
  156. myCoin, //我的金币
  157. myAddress, //我的收货地址
  158. addAddress, //添加收货地址
  159. editAddress, //编辑收货地址
  160. deleteAddress, //删除收货地址
  161. exchange, //一键回收
  162. checkDeliveryInfo, //回收信息
  163. applyDelivery, //申请发货
  164. searchHistory, //搜索历史
  165. getSettingInfo, //获取设置信息
  166. changeInfo, //修改个人信息
  167. moneyToCoin, //余额转出到钱包
  168. getWithdrawalSetting, //查询提现绑定信息
  169. withdrawal, //申请提现
  170. bindWithdrawalAccount, //绑定提现账号
  171. bindMobile, //绑定手机号
  172. carpassDeposit, //充值卡密
  173. carpassList, //卡密充值记录
  174. getUserCapital,
  175. echargez, //转赠
  176. echargezs, //转赠列表
  177. getServiceurl, //获取跳转域名
  178. goldDeposit, //金币提现
  179. register, //注册
  180. boximages, //盒子飞出图片
  181. upload_image: (params) => {
  182. return new Promise((resolve, reject) => {
  183. uni.showLoading({
  184. title: '文件上传中'
  185. })
  186. uni.uploadFile({
  187. url: url.config.baseURL + '/api/common/upload', //仅为示例,非真实的接口地址
  188. filePath: params.path,
  189. header: {
  190. 'token': uni.getStorageSync('token')
  191. },
  192. name: 'file',
  193. success: (uploadFileRes) => {
  194. uni.hideLoading()
  195. if (JSON.parse(uploadFileRes.data).code === 1) {
  196. resolve(JSON.parse(uploadFileRes.data).data);
  197. } else {
  198. reject(JSON.parse(uploadFileRes.data))
  199. }
  200. }
  201. });
  202. });
  203. },
  204. getTotalCoin,
  205. getRetailList,
  206. getTeamList,
  207. getTixianList,
  208. setShai
  209. }