index.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. import ajax from "../utils/request.js";
  2. import requestOrther from "../utils/requestOrther.js";
  3. /**
  4. * 商品列表
  5. * @returns {AjaxPromise}
  6. */
  7. export function goodsList(data) {
  8. return ajax({
  9. url: "/goods/list",
  10. method: "get",
  11. data,
  12. });
  13. }
  14. /**
  15. * 排队列表
  16. * @returns {AjaxPromise}
  17. */
  18. export function orderList(data) {
  19. return ajax({
  20. url: "/orders/queue",
  21. method: "get",
  22. data,
  23. });
  24. }
  25. /**
  26. * 预约
  27. * @returns {AjaxPromise}
  28. */
  29. export function apply(data) {
  30. return ajax({
  31. url: "/orders/add-app",
  32. method: "post",
  33. data,
  34. });
  35. }
  36. export function applyreal(data) {
  37. return ajax({
  38. url: "/orders/add-house",
  39. method: "post",
  40. data,
  41. });
  42. }
  43. /**
  44. * 取消预约
  45. * @returns {AjaxPromise}
  46. */
  47. export function cancel(data) {
  48. return ajax({
  49. url: "/orders/cancel",
  50. method: "get",
  51. data,
  52. });
  53. }
  54. /**
  55. * 取消预约
  56. * @returns {AjaxPromise}
  57. */
  58. export function advance(data) {
  59. return ajax({
  60. url: "/orders/to-house",
  61. method: "get",
  62. data,
  63. });
  64. }
  65. /**
  66. * 跳过
  67. * @returns {AjaxPromise}
  68. */
  69. export function skip(data) {
  70. return ajax({
  71. url: "/orders/skip",
  72. method: "GET",
  73. data,
  74. });
  75. }
  76. /**
  77. * 下一个
  78. * @returns {AjaxPromise}
  79. */
  80. export function nextone(data) {
  81. return ajax({
  82. url: "/orders/finish",
  83. method: "GET",
  84. data,
  85. });
  86. }
  87. /**
  88. * 预约时段
  89. * @returns {AjaxPromise}
  90. */
  91. export function applyrang(data) {
  92. return ajax({
  93. url: "/time-segment/list",
  94. method: "GET",
  95. data,
  96. });
  97. }
  98. /**
  99. * 获取app用户名
  100. * @returns {AjaxPromise}
  101. */
  102. export function getAPPUser(data, header) {
  103. return requestOrther({
  104. url: "/seeyon/thirdpartyController.do",
  105. method: "GET",
  106. header,
  107. data,
  108. });
  109. }
  110. /**
  111. * 获取apptoken
  112. * @returns {AjaxPromise}
  113. */
  114. export function getAPPToken(urldata) {
  115. return requestOrther({
  116. url: "/seeyon/rest/token/" + urldata,
  117. method: "GET",
  118. });
  119. }
  120. /**
  121. * 获取app登录人员信息
  122. * @returns {AjaxPromise}
  123. */
  124. export function getAPPUserDetail(data) {
  125. return requestOrther({
  126. url: "/seeyon/rest/orgMember",
  127. method: "GET",
  128. data,
  129. });
  130. }
  131. /**
  132. * 获取当前打烊规则
  133. * @returns {AjaxPromise}
  134. */
  135. export function getRule(data) {
  136. return ajax({
  137. url: "/stop-rule/list",
  138. method: "POST",
  139. data,
  140. });
  141. }
  142. /**
  143. * 更新当前打烊规则
  144. * @returns {AjaxPromise}
  145. */
  146. export function upRule(data) {
  147. return ajax({
  148. url: "/stop-rule/edit",
  149. method: "POST",
  150. data,
  151. });
  152. }
  153. /**
  154. * 菜单列表
  155. * @returns {AjaxPromise}
  156. */
  157. export function menulist(data) {
  158. return ajax({
  159. urlType: "menuURL",
  160. url: "/menu/recently",
  161. method: "GET",
  162. data,
  163. });
  164. }
  165. export function jsonDataRanking(data) {
  166. return ajax({
  167. urlType: "dataJSON",
  168. url: `/data/oa-rank/${data.url}.json`,
  169. method: "GET",
  170. data: data.data || undefined,
  171. });
  172. }
  173. export function infoDate() {
  174. return ajax({
  175. urlType: "dataJSON",
  176. url: `/data/oa-rank/info.json`,
  177. method: "GET",
  178. });
  179. }
  180. export function getCoffeeGoods(data) {
  181. return ajax({
  182. urlType: "coffee",
  183. url: `/getGoods?${data || ""}`,
  184. method: "GET",
  185. });
  186. }
  187. export function getCoffeeTypes() {
  188. return ajax({
  189. urlType: "coffee",
  190. url: `/getTypes`,
  191. method: "GET",
  192. });
  193. }
  194. export function getAddrees(data) {
  195. return ajax({
  196. urlType: "coffee",
  197. url: `/addressList?phone=${data.phone}`,
  198. method: "GET",
  199. });
  200. }
  201. export function getAddreesOne() {
  202. return ajax({
  203. urlType: "coffee",
  204. url: `/addressOne`,
  205. method: "GET",
  206. });
  207. }
  208. export function pushOrder(data) {
  209. return ajax({
  210. urlType: "coffee",
  211. url: `/pushOrder`,
  212. method: "POST",
  213. data,
  214. });
  215. }
  216. export function pushAddress(data) {
  217. return ajax({
  218. urlType: "coffee",
  219. url: `/addressPush`,
  220. method: "POST",
  221. data,
  222. });
  223. }
  224. export function editAddress(data) {
  225. return ajax({
  226. urlType: "coffee",
  227. url: `/addressEdit`,
  228. method: "POST",
  229. data,
  230. });
  231. }
  232. export function deleteAddress(data) {
  233. return ajax({
  234. urlType: "coffee",
  235. url: `/addressDetele`,
  236. method: "DELETE",
  237. data,
  238. });
  239. }
  240. export function listOrder(data) {
  241. const { page, size } = data;
  242. return ajax({
  243. urlType: "coffee",
  244. url: `/listOrder?page=${page}&size=${size}`,
  245. method: "GET",
  246. });
  247. }
  248. export function jsonZhou(data) {
  249. return ajax({
  250. urlType: "cxzx",
  251. url: `/zhoubao/data/${data.start}-${data.end}ctmt.json`,
  252. method: "GET",
  253. });
  254. }
  255. export default {};