This commit is contained in:
2024-09-23 18:22:02 +08:00
223 changed files with 8671 additions and 11415 deletions

View File

@@ -7,7 +7,18 @@ import {
} from 'js-base64'
import infoBox from '@/commons/utils/infoBox.js'
const request=http.request
const request = http.request
//就餐形式,默认堂食后付费
const useType = 'dine-in-after'
function getUseType() {
const type = uni.getStorageSync("useType")
return type ? type : useType
}
/**
* 获取当前台桌订单信息
* @returns
@@ -17,12 +28,12 @@ export function getCart(params) {
url: `/api/place/cart`,
method: "get",
params:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...params
}
});
}
/**
* 已上架商品列表
* @returns
@@ -32,7 +43,7 @@ export function getGoodsLists(params) {
url: `/api/place/activate`,
method: "get",
params:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...params
}
});
@@ -47,7 +58,8 @@ export function addCart(data) {
url: `/api/place/addCart`,
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -62,7 +74,8 @@ export function $clearCart(data) {
url: `/api/place/clearCart`,
method: "delete",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -77,7 +90,8 @@ export function $removeCart(data) {
url: `/api/place/removeCart`,
method: "delete",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -91,7 +105,7 @@ export function $updateCart(data) {
url: `/api/place/updateCart`,
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
@@ -105,7 +119,7 @@ export function $allPack(data) {
url: `/api/place/pack`,
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
@@ -119,7 +133,8 @@ export function $getMasterId(data) {
url: `/api/place/masterId`,
method: "get",
params:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -133,7 +148,7 @@ export function $getPayType(data) {
url: `/api/place/payType`,
method: "get",
params:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
@@ -147,7 +162,8 @@ export function $createOrder(data) {
url: `/api/place/order`,
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -163,7 +179,8 @@ export function $cacheOrder(data) {
url: `/api/place/pending`,
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -178,7 +195,8 @@ export function $getCacheOrder(data) {
url: `/api/place/pending/cart`,
method: "get",
params:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
@@ -190,7 +208,7 @@ export function $setUser(data) {
url: `/api/place/updateVip`,
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
@@ -201,7 +219,7 @@ export function $delOrder(data) {
url: `/api/place/order`,
method: "delete",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
@@ -212,8 +230,92 @@ export function $payOrder(data) {
url: '/api/place/pay',
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
}
//退单
export function $returnCart(data) {
return request({
url: '/api/place/returnCart',
method: "put",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
// 选择台桌
export function $choseTable(data) {
return request({
url: '/api/place/choseTable',
method: "put",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
// 用餐人数
export function $choseCount(data) {
return request({
url: '/api/place/choseCount',
method: "put",
data:{
shopId: uni.getStorageSync("shopId"),
useType: getUseType(),
...data
}
});
}
// 批量生成台桌
export function $fastCreateTable(data) {
return request({
url: '/api/tbShopTable/generate',
method: "post",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
//打印当前台桌订单
export function $printOrder(data) {
return request({
url: '/api/place/printOrder',
method: "post",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
//打印当前台桌菜品
export function $printDishes(data) {
return request({
url: '/api/place/printDishes',
method: "post",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
// 就餐模式切换
export function $changeUseType(data) {
return request({
url: '/api/place/choseModel',
method: "put",
data:{
shopId: uni.getStorageSync("shopId"),
...data
}
});
}

232
http/yskApi/consumable.js Normal file
View File

@@ -0,0 +1,232 @@
import http from './http.js'
const request = http.request
/**
* 查询耗材类型
* @returns
*/
export function gettbConsType(params) {
return request({
url: '/api/tbConsType',
method: "get",
params
});
}
/**
* 新增耗材类型
* @returns
*/
export function posttbConsType(data) {
return request({
url: '/api/tbConsType',
method: "post",
data
});
}
/**
* 修改耗材类型
* @returns
*/
export function puttbConsType(data) {
return request({
url: '/api/tbConsType',
method: "put",
data
});
}
/**
* 查询耗材信息
* @returns
*/
export function gettbConsInfo(params) {
// return request({
// url: '/api/tbConsInfo',
// method: "get",
// params
// });
return request({
url: "/api/viewConInfoFlow",
method: "get",
params: {
...params,
shopId: uni.getStorageSync("shopId"),
}
});
}
/**
* 耗材入库
* @returns
*/
export function posttbConsInfostockIn(data) {
return request({
url: '/api/tbConsInfo/stockIn',
method: "post",
data
});
}
/**
* 修改单位耗材值耗材
* @returns
*/
export function postapitbConsInfo(data) {
return request({
url: '/api/tbConsInfo',
method: "put",
data
});
}
/**
* 新增耗材信息
* @returns
*/
export function posttbConsInfo(data) {
return request({
url: '/api/tbConsInfo',
method: "post",
data
});
}
/**
* 查询查询耗材规格信息
* @returns
*/
export function getviewConSku(params) {
return request({
url: '/api/viewConSku',
method: "get",
params
});
}
/**
* 查询查询商品规格
* @returns
*/
export function gettbProductSpec(params) {
return request({
url: '/api/viewProductSkuShop',
method: "get",
params
});
}
/**
* 新增商品规格耗材信息
* @returns
*/
export function posttbProskuCon(data) {
return request({
url: '/api/tbProskuCon',
method: "post",
data
});
}
/**
* 新增商品规格耗材信息-修改后
* @returns
*/
export function posttbProskuCons(data) {
return request({
url: '/api/tbProskuCon',
method: "post",
data
});
}
/**
* 修改商品规格耗材信息状态
* @returns
*/
export function puttbProskuCon(data) {
return request({
url: '/api/tbProskuCon',
method: "put",
data
});
}
// 编辑单位耗材值
// export function puttbProskuCon(data) {
// return request({
// url: '/api/tbProskuCon',
// method: "put",
// data
// });
// }
/**
* 删除商品规格耗材信息状态
* @returns
*/
export function deletetbProskuCon(data) {
return request({
url: '/api/tbProskuCon',
method: "delete",
data
});
}
/**
* 查询耗材流水信息
* @returns
*/
export function gettbConsInfoFlow(params) {
return request({
url: '/api/tbConsInfoFlow',
method: "get",
params
});
}
/**
* 分组查询获取耗材流水信息
*/
export function viewConInfoFlow(data) {
return request({
url: "/api/viewConInfoFlow",
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
/**
* 查询耗材单位列表
*/
export function queryTbConUnitInfo(data) {
return request({
url: "/api/tbConUnit/queryTbConUnitInfo",
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
/**
* 新增耗材单位
*/
export function addtbConUnit(data) {
return request({
url: '/api/tbConUnit',
method: "post",
data: {
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
/**
* 修改耗材单位
*/
export function edittbConUnit(data) {
return request({
url: '/api/tbConUnit',
method: "put",
data: {
shopId: uni.getStorageSync("shopId"),
...data
}
});
}

View File

@@ -5,7 +5,17 @@ import {
Base64
} from 'js-base64'
import infoBox from '@/commons/utils/infoBox.js'
function objectToUrlParams(obj) {
let params = [];
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
let value = obj[key];
let param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
params.push(param);
}
}
return params.join('&');
}
/* 商品列表 */
export function $tbProduct(data) {
return http.req('/api/tbProduct', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
@@ -92,7 +102,8 @@ export function $getStocktakin(data){
* 上下架商品
*/
export function $updateGrounding(data){
return http.req('/api/stock/grounding', {...data,shopId:uni.getStorageSync('shopId')}, 'PUT')
const ajaxData={...data,shopId:uni.getStorageSync('shopId')}
return http.req('/api/stock/grounding'+`?${objectToUrlParams(ajaxData)}`, ajaxData, 'PUT')
}
@@ -107,3 +118,19 @@ export const $productSpec=new $API('/api/tbProductSpec',http.req)
// v2 api start
/* 商品列表 V2 */
export function $tbProductV2(data) {
return http.req('/api/tbProduct/list/v2', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
}
/* 耗材与商品绑定关系 */
export function $tbProskuConV2(data) {
return http.req('/api/tbProskuCon/V2', data, 'POST')
}
/* 修改商品相关(快捷接口) */
export function $updateProductData(data) {
return http.req('/api/stock/updateProductData', data, 'POST')
}
// v2 api end

View File

@@ -20,7 +20,7 @@ let baseUrl = 'https://admintestpapi.sxczgkj.cn'
const loadingShowTime = 200
function getHeader( type ){
function getHeader(){
const headerObject={}
headerObject["Authorization"] = storageManage.token()
return headerObject

93
http/yskApi/order.js Normal file
View File

@@ -0,0 +1,93 @@
import http from './http.js'
const request=http.request
/**
* 查询订单
* @param {*} data
* @returns
*/
export function tbOrderInfoData(data) {
return request({
url: "/api/tbOrderInfo/date",
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
/**
* 导出数据
* @param {*} data
* @returns
*/
export function tbOrderInfoDownload(data) {
return request({
url: "/api/tbOrderInfo/download",
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...data
},
responseType: "blob"
});
}
/**
* 通过Id查询订单
* @param {*} id
* @returns
*/
export function tbOrderInfoDetail(id) {
return request({
url: `/api/tbOrderInfo/${id}`,
method: "get"
});
}
/**
* 通过Id查询订单
* @param {*} createdAt
* @returns
*/
export function payCount(createdAt) {
console.log(createdAt);
return request({
url: `/api/tbOrderInfo/payCount`,
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
createdAt: createdAt
}
});
}
/**
* 订单列表
* @param {*} createdAt
* @returns
*/
export function tbGroupOrderInfo(params) {
return request({
url: `/api/tbGroupOrderInfo`,
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...params
}
});
}
/**
* 退单
* @param {*} data
* @returns
*/
export function returnGpOrder(data) {
return request({
url: `/api/tbGroupOrderInfo/returnGpOrder`,
method: "post",
data
});
}

View File

@@ -73,4 +73,663 @@ export function editShopExtend(data) {
...data
}
})
}
}
/**
* 商品列表
* @returns
*/
export function tbProduct(params) {
return request({
url: "/api/tbProduct",
method: "get",
params
});
}
/**
* 删除商品
* @returns
*/
export function tbProductDelete(data) {
return request({
url: "/api/tbProduct",
method: "delete",
data
});
}
/**
* 商品单位列表
* @returns
*/
export function tbShopUnit(params) {
return request({
url: "/api/tbShopUnit",
method: "get",
params
});
}
/**
* 店铺基本配置
* @returns
*/
export function tbShopCurrency(shopId) {
return request({
url: `/api/tbShopCurrency/${shopId}`,
method: "get"
});
}
/**
* 修改店铺信息
* @returns
*/
export function tbShopCurrencyPut(data) {
return request({
url: `/api/tbShopCurrency`,
method: "put",
data
});
}
/**
* 新增单位
* @returns
*/
export function tbShopUnitPost(data) {
return request({
url: `/api/tbShopUnit`,
method: "post",
data
});
}
/**
* 更改单位
* @returns
*/
export function tbShopUnitPut(data) {
return request({
url: `/api/tbShopUnit`,
method: "put",
data
});
}
/**
* 删除单位
* @returns
*/
export function tbShopUnitDelete(data) {
return request({
url: `/api/tbShopUnit`,
method: "delete",
data
});
}
/**
* 店铺基本配置
* @returns
*/
export function tbShopCurrencyGet(params) {
return request({
url: `/api/tbShopUnit`,
method: "get",
params:{
sort:'id',
shopId: uni.getStorageSync("shopId"),
...params,
}
});
}
/**
* 商品分类列表
* @returns
*/
export function tbShopCategoryGet(params) {
return request({
url: `/api/tbShopCategory`,
method: "get",
params
});
}
/**
* 新增、编辑分类/新增、编辑子分类
* @returns
*/
export function tbShopCategoryPost(data, method = "post") {
return request({
url: `/api/tbShopCategory`,
method: method,
data
});
}
/**
* 删除商品分类
* @returns
*/
export function tbShopCategoryDelete(data) {
return request({
url: `/api/tbShopCategory`,
method: "delete",
data
});
}
/**
* 规格增加
* @returns
*/
export function tbProductSpecPost(data) {
return request({
url: `/api/tbProductSpec`,
method: "post",
data
});
}
/**
* 规格列表
* @returns
*/
export function tbProductSpecGet(params) {
return request({
url: `/api/tbProductSpec`,
method: "get",
params
});
}
/**
* 规格更改
* @returns
*/
export function tbProductSpecPut(data) {
return request({
url: `/api/tbProductSpec`,
method: "put",
data
});
}
/**
* 删除规格
* @returns
*/
export function tbProductSpecDelete(data) {
return request({
url: `/api/tbProductSpec`,
method: "DELETE",
data
});
}
/**
* 新增分组
* @returns
*/
export function tbProductGroupPost(data) {
return request({
url: `/api/tbProductGroup`,
method: "post",
data
});
}
/**
* 更改分组
* @returns
*/
export function tbProductGroupPut(data) {
return request({
url: `/api/tbProductGroup`,
method: "PUT",
data
});
}
/**
* 商品分组列表
* @returns
*/
export function tbProductGroupGet(params) {
return request({
url: `/api/tbProductGroup`,
method: "get",
params
});
}
/**
* 商品列表根据分组中的商品id
* @returns
*/
export function productListGet(productGroup) {
return request({
url: `/api/tbProductGroup/${productGroup}`,
method: "get"
});
}
/**
* 删除分组
* @returns
*/
export function tbProductGroupDelete(data) {
return request({
url: `/api/tbProductGroup`,
method: "DELETE",
data
});
}
/**
* 添加商品
* @returns
*/
export function tbProductPost(data) {
return request({
url: `/api/tbProduct`,
method: "post",
data
});
}
/**
* 添加商品
* @returns
*/
export function tbProductPut(data) {
return request({
url: `/api/tbProduct`,
method: "put",
data
});
}
/**
* 商品详情(单个商品)
* product 商品id
* @returns
*/
export function tbProductGetDetail(product) {
return request({
url: `/api/tbProduct/${product}`,
method: "get"
});
}
/**
* 店铺列表
* @returns
*/
export function tbShopInfo(params) {
return request({
url: `/api/tbShopInfo`,
method: "get",
params
});
}
/**
* 增加激活码
* @returns
*/
export function tbMerchantRegisterPost(data) {
return request({
url: `/api/tbMerchantRegister`,
method: "post",
data
});
}
/**
* 激活码列表
* @returns
*/
export function tbMerchantRegisterList(data) {
return request({
url: `/api/tbMerchantRegister/list`,
method: "post",
data
});
}
/**
* 增加/编辑店铺
* @returns
*/
export function tbShopInfoPost(data, method = "post") {
return request({
url: `/api/tbShopInfo`,
method: method,
data
});
}
/**
* 详情(配置三方支付)
* @returns
*/
export function tbMerchantThirdApply(shopId) {
return request({
url: `/api/tbMerchantThirdApply/${shopId}`,
method: "get"
});
}
/**
* 修改第三方配置
* @returns
*/
export function tbMerchantThirdApplyPut(data) {
return request({
url: `/api/tbMerchantThirdApply`,
method: "put",
data
});
}
/**
* 设置热销商品
* @returns
*/
export function tbProductIsHot(params) {
return request({
url: `/api/tbProduct/isHot`,
method: "get",
params
});
}
/**
* 增加/编辑优惠券
* @returns
*/
export function tbMerchantCoupon(data, method = "post") {
return request({
url: `/api/tbMerchantCoupon`,
method: method,
data
});
}
/**
* 设置热销商品
* @returns
*/
export function tbMerchantCouponGet(params) {
return request({
url: `/api/tbMerchantCoupon`,
method: "get",
params
});
}
/**
* 设置热销商品
* @returns
*/
export function geocode(params) {
return request({
url: `/api/geocode`,
method: "get",
params
});
}
/**
* 新增、修改活动
* @returns
*/
export function modityActivate(data) {
return request({
url: `/shop/storage/modityActivate`,
method: "post",
data
});
}
/**
* 活动列表
* @returns
*/
export function findActivate(params) {
return request({
url: `/shop/storage/findActivate`,
method: "get",
params
});
}
// 获取店铺会员二维码
export function getwxacode(data) {
return request({
url: `/shop/storage/getwxacode`,
method: "post",
data
});
}
/**
* 商家用户列表
* @returns
*/
export function queryAllShopUser(params) {
return request({
url: `/api/tbShopUser/queryAllShopUser`,
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...params
}
});
}
/**
* 查询商家用户概述信息
* @returns
*/
export function queryAllShopInfo(params) {
return request({
url: `/api/tbShopUser/summary`,
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...params
}
});
}
/**
* 修改商品排序
* @returns
*/
export function upProSort(data) {
return request({
url: `/api/tbProduct/upProSort`,
method: "post",
data
});
}
/**
* 修改分组排序
* @returns
*/
export function upGroupSort(data) {
return request({
url: `/api/tbProductGroup/upGroupSort`,
method: "post",
data
});
}
/**
* 修改分类排序
* @returns
*/
export function upCategorySort(data) {
return request({
url: `/api/tbShopCategory/upCategorySort`,
method: "post",
data
});
}
/**
* 查询店铺充值记录
* @returns
*/
export function tbShopUserRecharge(params) {
return request({
url: `/api/tbShopUser/recharge`,
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...params
}
});
}
/**
* 导出充值记录
* @returns
*/
export function downloadTableRecharge(data) {
return request({
url: `/api/tbShopUser/recharge/download`,
method: "post",
data: {
shopId: uni.getStorageSync("shopId"),
...data
},
responseType: "blob"
});
}
/**
* 员工列表
* @returns
*/
export function tbPlussShopStaffGet(params) {
return request({
url: `/api/tbPlussShopStaff`,
method: "get",
params: {
shopId: uni.getStorageSync("shopId"),
...params
}
});
}
/**
* 角色列表
* @returns
*/
export function rolesGet() {
return request({
url: `/api/roles`,
method: "get"
});
}
/**
* 增加员工
* @returns
*/
export function tbPlussShopStaff(data) {
return request({
url: `/api/tbPlussShopStaff`,
method: data.id ? "put" : "post",
data: {
shopId: uni.getStorageSync("shopId"),
...data
}
});
}
/**
* 通过id获取员工信息
* @returns
*/
export function tbPlussShopStaffDetail(id) {
return request({
url: `/api/tbPlussShopStaff/${id}`,
method: "get"
});
}
/**
* 更改员工状态
* @returns
*/
export function updateStatus(data) {
return request({
url: `/api/tbPlussShopStaff/updateStatus`,
method: "put",
data
});
}
/**
* 员工删除
* @returns
*/
export function shopStaffDelete(data) {
return request({
url: `/api/tbPlussShopStaff`,
method: "delete",
data
});
}
//增减余额
export function midfiyAccount(data) {
return request({
url: `/api/tbShopUser/midfiyAccount`,
method: "post",
data
});
}
// 编辑用户
export function tbShopUseredit(data) {
return request({
url: `/api/tbShopUser`,
method: "put",
data
});
}
// 通过活动id获取赠送商品列表
export function activate(id) {
return request({
url: `shop/storage/activate/${id}`,
method: "get"
});
}
// 通过活动id获取赠送商品列表
export function queryShopUserFlow(params) {
return request({
url: `/api/tbShopUser/queryShopUserFlow`,
method: "get",
params
});
}
//新增
// 查询员工是否拥有权限
export function $hasPermission(params) {
return request({
url: '/api/tbShopPermission/hasPermission',
method: "get",
params:{
shopId: uni.getStorageSync("shopId"),
...params
}
});
}

View File

@@ -10,4 +10,5 @@ import infoBox from '@/commons/utils/infoBox.js'
/* 台桌区域 */
export const $tableArea=new $API('/api/tbShopArea',http.req)
/* 台桌 */
export const $table=new $API('/api/tbShopTable',http.req)
export const $table=new $API('/api/tbShopTable',http.req)

25
http/yskApi/user.js Normal file
View File

@@ -0,0 +1,25 @@
import http from './http.js'
const request=http.request
/**
* 用户详情
* @returns
*/
export function tbShopInfo(shopId) {
const _shopId=uni.getStorageSync('shopId')
return request({
url: `/api/tbShopInfo/${shopId||_shopId}`,
method: 'get'
})
}
/**
* 修改店铺信息
* @returns
*/
export function tbShopInfoPut(data) {
return request({
url: `/api/tbShopInfo`,
method: 'put',
data
})
}