This commit is contained in:
YeMingfei666 2024-10-25 16:03:42 +08:00
commit 146e6a617c
6 changed files with 356 additions and 204 deletions

View File

@ -5,7 +5,10 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
# 测试
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
#预发布
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
# 生产
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'

View File

@ -3,13 +3,13 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
# 测试
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# 生产
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# 预发布接口
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
# 如果接口是 http 形式, wss 需要改为 ws

View File

@ -450,3 +450,14 @@ export function $returnOrder(data) {
}
});
}
//获取台桌详情状态
export function $returnTableDetail(data) {
return request({
url: '/api/tbShopTable/state',
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
...data
}
});
}

View File

@ -118,6 +118,7 @@ export default {
number: "0",
show: false,
timer: null,
payPar:{}
};
},
watch: {
@ -136,18 +137,10 @@ export default {
this.$refs.refInputCode.focus();
});
} else {
this.getPayUrl()
this.tips = "请用户使用微信/支付宝扫描付款码";
this.startGetOrderInfo();
this.$nextTick(() => {
QRCode.toCanvas(
this.$refs.canvas,
this.paymentQrcode,{width: 160,
height: 160,},
function (error) {
console.log(error);
}
);
});
}
},
number(newval) {
@ -193,14 +186,28 @@ export default {
this.close();
this.$emit("confirm", this.form.code);
},
getPayUrl(){
$getOrderPayUrl(this.payPar).then((res) => {
console.log(res);
this.paymentQrcode = res;
this.$nextTick(() => {
QRCode.toCanvas(
this.$refs.canvas,
this.paymentQrcode,{width: 160,
height: 160,},
function (error) {
console.log(error);
}
);
});
});
},
open(data) {
this.show = true;
this.form.money = Number(this.price).toFixed(2);
this.payPar=data
if (this.openSwitch) {
$getOrderPayUrl({ orderId: this.order.id||data.id,payAmount:this.form.money||data.settlementAmount }).then((res) => {
console.log(res);
this.paymentQrcode = res;
});
// this.getPayUrl();
}
this.$nextTick(() => {
this.$refs.refInputCode.focus();

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,13 @@
//判断商品是否可以下单
export function isCanBuy(goods,isStock) {
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
export function isCanBuy(skuGoods,goods) {
if(goods.typeEnum=='normal'){
//单规格
return goods.isGrounding&&goods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
}else{
//多规格
return goods.isGrounding&&goods.isPauseSale==0&&skuGoods.isGrounding&&skuGoods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
}
}
// 一个数组是否包含另外一个数组全部元素
@ -15,6 +22,8 @@ export function arrayContainsAll(arr1, arr2) {
//n项 n-1项组合生成全部结果
export function generateCombinations(arr, k) {
console.log(arr)
console.log(k)
let result = [];
function helper(index, current) {