diff --git a/api/cons.js b/api/cons.js index f901b9e..8667c70 100644 --- a/api/cons.js +++ b/api/cons.js @@ -177,4 +177,4 @@ export function stockCheck(data, urlType = 'product') { ...data } }) -} \ No newline at end of file +} diff --git a/api/order.js b/api/order.js index 65594c9..17bc333 100644 --- a/api/order.js +++ b/api/order.js @@ -8,7 +8,7 @@ const request = http.request export function getOrderList(data, urlType = 'order') { return request({ url: `${urlType}/admin/order`, - method: "POST", + method: "GET", data: { ...data } @@ -28,6 +28,7 @@ export function getHistoryOrder(data, urlType = 'order') { } }) } + /** * 生成订单 * @returns diff --git a/api/pay.js b/api/pay.js new file mode 100644 index 0000000..083b5d0 --- /dev/null +++ b/api/pay.js @@ -0,0 +1,72 @@ +import http from '@/http/http.js' +const request = http.request + +/** + * 获取店铺订单支付URL + * @returns + */ +export function getOrderPayUrl(data, urlType = 'order') { + return request({ + url: `${urlType}/pay/shopPayApi/orderPayUrl`, + method: "GET", + data: { + ...data + } + }) +} + +/** + * 扫码支付 + * @returns + */ +export function scanPay(data, urlType = 'order') { + return request({ + url: `${urlType}/pay/scanPay`, + method: "POST", + data: { + ...data + } + }) +} + +/** + * 现金支付 + * @returns + */ +export function cashPay(data, urlType = 'order') { + return request({ + url: `${urlType}/pay/cashPay`, + method: "POST", + data: { + ...data + } + }) +} + +/** + * 扫码/储值支付 + * @returns + */ +export function microPay(data, urlType = 'order') { + return request({ + url: `${urlType}/pay/microPay`, + method: "POST", + data: { + ...data + } + }) +} + +/** + * 会员支付 + * @returns + */ +export function vipPay(data, urlType = 'order') { + return request({ + url: `${urlType}/pay/vipPay`, + method: "POST", + data: { + ...data + } + }) +} diff --git a/api/printer.js b/api/printer.js index 04e03fc..d62bac0 100644 --- a/api/printer.js +++ b/api/printer.js @@ -61,9 +61,12 @@ export function updatePrinter(data, urlType = 'account') { * 删除打印机 * @returns */ -export function delPrinter(id, urlType = 'account') { +export function delPrinter(data, urlType = 'account') { return request({ - url: `${urlType}/admin/product/vendor/${id}`, + url: `${urlType}/admin/printer`, method: "DELETE", + data: { + ...data + } }) } diff --git a/api/product.js b/api/product.js index 1bf179b..2ad3404 100644 --- a/api/product.js +++ b/api/product.js @@ -99,7 +99,7 @@ export function updateProduct(data, urlType = 'product') { * 绑定耗材 * @returns */ -export function productBind(data, urlType = 'product') { +export function productBindCons(data, urlType = 'product') { return request({ url: `${urlType}/admin/product/bind`, method: "POST", @@ -181,6 +181,20 @@ export function updateSpec(data, urlType = 'product') { }) } +/** + * 快捷添加商品规格 + * @returns + */ +export function addSpecQuic(data, urlType = 'product') { + return request({ + url: `${urlType}/admin/prod/spec/quickAdd`, + method: "POST", + data: { + ...data + } + }) +} + /** * 删除商品规格 * @returns diff --git a/api/shop.js b/api/shop.js index 9057116..ecdb059 100644 --- a/api/shop.js +++ b/api/shop.js @@ -28,3 +28,31 @@ export function editShopInfo(data, urlType = 'account') { } }) } + +/** + * 获取当前店铺拓展参数 + * @returns + */ +export function getShopExtend(data, urlType = 'account') { + return request({ + url: `${urlType}/admin/shopExtend`, + method: "GET", + data: { + ...data + } + }) +} + +/** + * 获取当前店铺拓展参数 + * @returns + */ +export function editShopExtend(data, urlType = 'account') { + return request({ + url: `${urlType}/admin/shopExtend`, + method: "PUT", + data: { + ...data + } + }) +} diff --git a/api/shopUser.js b/api/shopUser.js index 262ea5a..c8baf47 100644 --- a/api/shopUser.js +++ b/api/shopUser.js @@ -29,6 +29,20 @@ export function shopUserList(data, urlType = 'account') { }) } +/** + * 获取店铺用户详情 + * @returns + */ +export function shopUserDetail(data, urlType = 'account') { + return request({ + url: `${urlType}/admin/shopUser/detail`, + method: "GET", + data: { + ...data + } + }) +} + /** * 获取店铺用户新增 * @returns diff --git a/api/table.js b/api/table.js index bb9f52c..0c1138d 100644 --- a/api/table.js +++ b/api/table.js @@ -36,7 +36,7 @@ export function getShopTableDetail(data, urlType = 'account') { export function shopTableBind(data, urlType = 'account') { return request({ url: `${urlType}/admin/shopTable/bind`, - method: "GET", + method: "POST", data: { ...data } diff --git a/commons/utils/goodsUtil.js b/commons/utils/goodsUtil.js index 52eb4c3..fe7f5dc 100644 --- a/commons/utils/goodsUtil.js +++ b/commons/utils/goodsUtil.js @@ -27,7 +27,7 @@ export function isTui(item) { return item.status == 'return' || item.status == 'refund' || item.status == 'refunding' } export function isGift(item) { - return !isTui(item) && item.gift + return !isTui(item) && item.payAmount<=0 } export function numSum(arr) { const sum = arr.reduce((a, b) => { diff --git a/components/my-components/edit-discount.vue b/components/my-components/edit-discount.vue index 2e2c5ac..ae05ada 100644 --- a/components/my-components/edit-discount.vue +++ b/components/my-components/edit-discount.vue @@ -44,24 +44,15 @@ + \ No newline at end of file diff --git a/pageProduct/index/components/edit-price.vue b/pageProduct/index/components/edit-price.vue index f4c77eb..99e5d36 100644 --- a/pageProduct/index/components/edit-price.vue +++ b/pageProduct/index/components/edit-price.vue @@ -10,9 +10,9 @@ 商品名称 - {{data.name}} + {{data.name}} - - - \ No newline at end of file diff --git a/pagesOrder/detail/components/list.vue b/pagesOrder/detail/components/list.vue index f81280b..d2d6406 100644 --- a/pagesOrder/detail/components/list.vue +++ b/pagesOrder/detail/components/list.vue @@ -17,8 +17,7 @@ 份菜品 - 第{{ order.placeNum }}次下单 - + 第{{ order.placeNum }}次下单 @@ -39,7 +38,7 @@ - + @@ -49,7 +48,7 @@ custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;"> - + @@ -62,8 +61,8 @@ {{item.productSkuName||''}} - - 备注:{{item.note}} + + 备注:{{item.remark}} @@ -86,15 +85,7 @@ - + X{{item.number||item.num}} @@ -117,10 +108,6 @@ - @@ -143,7 +130,6 @@ 已优惠¥{{youhuiAllPrice}} - 小计¥ @@ -178,13 +164,13 @@ @@ -226,14 +212,6 @@ {{productCouponDiscountAmount }} - 积分抵扣 @@ -303,7 +281,45 @@ } } }) - + /** + * 转桌/并桌 + */ + function rotatingTables() { + let arr = [] + props.data.forEach(ele => { + ele.info.forEach(res => { + // 头像 coverImg + res.coverImg = res.productImg + // 名字 name + res.name = res.productName + // 金额 salePrice + res.salePrice = res.price + // 数量 number + res.number = res.num + res.masterId = props.orderInfo.masterId + res.useType = props.orderInfo.useType + res.tableId = props.orderInfo.tableId + arr.push(res) + }) + }) + uni.navigateTo({ + url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr) + '&tableId=' + props + .orderInfo.tableId + }) + } + /** + * 计算菜品数量 + */ + const goodsNumber = computed(() => { + let result = 0 + result = props.data.reduce((a, b) => { + const bTotal = b.info.reduce((prve, cur) => { + return prve + (cur.number || cur.num) * 1; + }, 0); + return a + bTotal + }, 0) + return result + }) function returnProductCoupPrice(item) { if (!item.isMember) { return item.price * item.num @@ -337,17 +353,14 @@ } function returnTotalMoney(item) { - return (item.price * item.num).toFixed(2) + return (item.payAmount * item.num).toFixed(2) } const canTuiKuanPrice = computed(() => { const goodsTotal = props.data.reduce((prve, cur) => { - // const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{ - // return a+b.priceAmount*1 - // },0) const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId) .reduce((a, b) => { - return a + b.priceAmount * 1 + return a + b.payAmount * 1 }, 0) return prve + curTotal }, 0) @@ -357,12 +370,9 @@ }) const TuiKuanPrice = computed(() => { return props.data.reduce((prve, cur) => { - // const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{ - // return a+b.priceAmount*1 - // },0) const curTotal = cur.info.filter(v => isTui(v) && !v.userCouponId) .reduce((a, b) => { - return a + b.priceAmount * 1 + return a + b.payAmount * 1 }, 0) return prve + curTotal }, 0) @@ -371,29 +381,27 @@ return props.data.reduce((prve, cur) => { const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId) .reduce((a, b) => { - return a + b.priceAmount * 1 + return a + b.payAmount * 1 }, 0) return prve + curTotal }, 0) }) const cantuiSeatFee = computed(() => { - let seatFee = props.orderInfo.seatInfo ? (props.orderInfo.seatInfo.priceAmount) : 0 + let seatFee = props.orderInfo.seatInfo ? (props.orderInfo.seatInfo.seatAmount) : 0 const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100 seatFee = Math.floor((props.orderInfo.amount - props.orderInfo.refundAmount) * bili * 100) / 100 return seatFee }) function returnCanTuiMoney(item) { - return props.orderInfo.status == 'unpaid' ? item.priceAmount : item.priceAmount + return props.orderInfo.status == 'unpaid' ? item.payAmount : item.payAmount if (props.orderInfo.status == 'unpaid') { return returnTotalMoney(item) } else { if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) { return item.canReturnAmount - // const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100 - // return Math.floor((allPrice.value)*bili*100)/100 } else { - return item.priceAmount + return item.payAmount } } } @@ -414,7 +422,7 @@ if (res) { emits('tuikuan', { ...item, - priceAmount: item.priceAmount + payAmount: item.payAmount }, index) } }) @@ -426,10 +434,10 @@ const seatFeePrice = computed(() => { - if (!props.seatFee.priceAmount) { + if (!props.seatFee.seatAmount) { return 0 } - const n = props.seatFee.priceAmount * (isTui(props.seatFee) ? 0 : 1) + const n = props.seatFee.seatAmount * (isTui(props.seatFee) ? 0 : 1) return n.toFixed(2) }) const discountAmount = computed(() => { @@ -528,8 +536,8 @@ const goodsPrice = props.data.reduce((prve, cur) => { const curTotal = cur.info.reduce((a, b) => { - return a + (b.status == 'unpaid' ? b.priceAmount : b.status == 'return' ? 0 : b - .priceAmount * 1) + return a + (b.status == 'unpaid' ? b.payAmount : b.status == 'return' ? 0 : b + .payAmount * 1) }, 0) return prve + curTotal }, 0) @@ -539,47 +547,15 @@ const n = goodsOriginAllPrice.value - youhuiAllPrice.value return (n < 0 ? 0 : n).toFixed(2) } - const returnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.returnAmount ? props.orderInfo - .seatInfo.returnAmount : 0 + const returnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.seatAmount ? props.orderInfo + .seatInfo.seatAmount : 0 const canReturnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.canReturnAmount ? props .orderInfo.seatInfo.canReturnAmount : 0 - const total = props.orderInfo.amount - (returnAmount ? returnAmount : canReturnAmount) + const total = props.orderInfo.amount - (seatAmount ? seatAmount : canReturnAmount) return (total <= 0 ? 0 : total).toFixed(2) }) - - function rotatingTables() { - let arr = [] - props.data.forEach(ele => { - ele.info.forEach(res => { - // 头像 coverImg - res.coverImg = res.productImg - // 名字 name - res.name = res.productName - // 金额 salePrice - res.salePrice = res.price - // 数量 number - res.number = res.num - res.masterId = props.orderInfo.masterId - res.useType = props.orderInfo.useType - res.tableId = props.orderInfo.tableId - arr.push(res) - }) - }) - uni.navigateTo({ - url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr) + '&tableId=' + props - .orderInfo.tableId - }) - } - const goodsNumber = computed(() => { - let result = 0 - result = props.data.reduce((a, b) => { - const bTotal = b.info.reduce((prve, cur) => { - return prve + (cur.number || cur.num) * 1; - }, 0); - return a + bTotal - }, 0) - return result - }) + +