api.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // 方法名定义 API:属于api级别的作用 getMachine:接口的作用 例如:API_getMachine
  2. // 获取机器开关机状态
  3. export const API_getMachine = (params) => uni.$u.http.get('/WX-SERVER/tEquipment/equipmentStatus', {
  4. params
  5. })
  6. // 查询商品列表
  7. export const API_selectProductList = (params) => uni.$u.http.post('/SZWL-SERVER/tProduct/selectProductList', params)
  8. // 获取openid
  9. export const API_getOpenid = (params, custom) => uni.$u.http.get('/WX-SERVER/tSzsmWx/getOpenid', {
  10. params,
  11. custom
  12. })
  13. // 获取手机号
  14. export const API_getPhone = (params) => uni.$u.http.get('/WX-SERVER/tSzsmWx/getPhone', {
  15. params
  16. })
  17. // 请求支付
  18. export const API_repayment = (param, params) => uni.$u.http.post('/PAY-SERVER/tOrder/carsPayXCX', param, {
  19. params
  20. })
  21. // 获取优惠码
  22. export const API_getCode = (params, custom) => uni.$u.http.get('/SZWL-SERVER/tPromoCode/getCode', {
  23. params,
  24. custom
  25. })
  26. // 获取订单
  27. export const API_getOrderlist = (params) => uni.$u.http.post('/ORDER-SERVER/tOrder/getOrderlist', params)
  28. // 获取用户信息
  29. export const API_getUserInfo = (params) => uni.$u.http.get('/WX-SERVER/tSzsmWx/getUserInfo', {
  30. params
  31. })
  32. // 获取5元优惠券
  33. export const API_getConpon = (params, custom) => uni.$u.http.get('/SZWL-SERVER/tPromoCode/addYHJ', {
  34. params,
  35. custom
  36. })
  37. // 获取优惠券列表
  38. export const API_getConponList = (params, custom) => uni.$u.http.get('/SZWL-SERVER/tPromoCode/getYHJList', {
  39. params,
  40. custom
  41. })
  42. // 获取取餐码
  43. export const API_postMealCode = (params) => uni.$u.http.post(`/ORDER-SERVER/tOrder/getMealCode?sn=${params}`)
  44. // 检查是否已经领取优惠券
  45. export const API_getCheckYHJList = (params) => uni.$u.http.get('/SZWL-SERVER/tPromoCode/checkYHJList', {
  46. params
  47. })
  48. // 退款
  49. export const API_refuse = (params) => uni.$u.http.get('/SZWL-SERVER/tOrder/refuseByXcu', {
  50. params
  51. })
  52. // 设置订阅取餐通知
  53. export const API_setDingYue = (params) => uni.$u.http.get('/WX-SERVER/tSzsmWx/setDingYue', {
  54. params
  55. })