// 代课下单 import http from './http.js' import $API from '@/http/classApi.js' import appConfig from '@/config/appConfig.js' import { Base64 } from 'js-base64' import infoBox from '@/commons/utils/infoBox.js' const request=http.request /** * 获取当前台桌订单信息 * @returns */ export function getCart(params) { return request({ url: `/api/place/cart`, method: "get", params:{ shopId: uni.getStorageSync('shopId'), ...params } }); } /** * 已上架商品列表 * @returns */ export function getGoodsLists(params) { return request({ url: `/api/place/activate`, method: "get", params:{ shopId: uni.getStorageSync('shopId'), ...params } }); } /** * 点单 * @returns */ export function addCart(data) { return request({ url: `/api/place/addCart`, method: "post", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 清空购物车/支付订单 * @returns */ export function $clearCart(data) { return request({ url: `/api/place/clearCart`, method: "delete", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 删除购物车某个商品 * @returns */ export function $removeCart(data) { return request({ url: `/api/place/removeCart`, method: "delete", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 更新规格 * @returns */ export function $updateCart(data) { return request({ url: `/api/place/updateCart`, method: "put", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 批量打包 * @returns */ export function $allPack(data) { return request({ url: `/api/place/pack`, method: "put", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 获取取餐号 * @returns */ export function $getMasterId(data) { return request({ url: `/api/place/masterId`, method: "get", params:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 支付方式获取 * @returns */ export function $getPayType(data) { return request({ url: `/api/place/payType`, method: "get", params:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 创建订单 * @returns */ export function $createOrder(data) { return request({ url: `/api/place/order`, method: "post", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 挂起订单 * @returns */ export function $cacheOrder(data) { return request({ url: `/api/place/pending`, method: "post", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } /** * 获取已挂起订单 * @returns */ export function $getCacheOrder(data) { return request({ url: `/api/place/pending/cart`, method: "get", params:{ shopId: uni.getStorageSync('shopId'), ...data } }); } // 会员点单/取消会员点单 export function $setUser(data) { return request({ url: `/api/place/updateVip`, method: "put", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } // 删除订单 export function $delOrder(data) { return request({ url: `/api/place/order`, method: "delete", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); } // 支付订单 export function $payOrder(data) { return request({ url: '/api/place/pay', method: "put", data:{ shopId: uni.getStorageSync('shopId'), ...data } }); }