diff --git a/commons/utils/goodsUtil.js b/commons/utils/goodsUtil.js index b0e821d..8c7a802 100644 --- a/commons/utils/goodsUtil.js +++ b/commons/utils/goodsUtil.js @@ -2,7 +2,7 @@ export function canComputedPackFee(v) { return v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' } export function returnCanComputedGoodsArr(arr) { - return arr.filter(v=>canComputedPackFee(v)) + return arr.filter(v => canComputedPackFee(v)) } export function returnPackFee(arr) { return arr.reduce((prve, cur) => { @@ -10,18 +10,26 @@ export function returnPackFee(arr) { }, 0).toFixed(2) } -export function canTuicai(orderInfo,item){ - return orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'&& item.status!='return' +export function canTuicai(orderInfo, item) { + if (orderInfo.status == 'unpaid' && orderInfo.isPostpaid !== null && orderInfo.isPostpaid == 0) { + return false + } + return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return' } -export function canTuiKuan(orderInfo,item){ - return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding' +export function canTuiKuan(orderInfo, item) { + // 已完成的订单,也不是商品券抵扣才可以退款 + return orderInfo.status == 'closed' && item.status != 'return' && item.status != 'refund' && item.status != + 'refunding' && !item.userCouponId } -export function isTui(item){ - return item.status=='return'||item.status=='refund'||item.status=='refunding' +export function isTui(item) { + return item.status == 'return' || item.status == 'refund' || item.status == 'refunding' } -export function numSum(arr){ - const sum=arr.reduce((a,b)=>{ - return a+b*100 - },0) - return (sum/100).toFixed(2) +export function isGift(item) { + return !isTui(item) && item.gift +} +export function numSum(arr) { + const sum = arr.reduce((a, b) => { + return a + b * 100 + }, 0) + return (sum / 100).toFixed(2) } \ No newline at end of file diff --git a/commons/utils/safe-bottom.js b/commons/utils/safe-bottom.js index c8ed07d..9cfddc1 100644 --- a/commons/utils/safe-bottom.js +++ b/commons/utils/safe-bottom.js @@ -1,23 +1,32 @@ import { getCurrentInstance, } from 'vue'; -export function getElRect(elClass, dataVal) { - const instance = getCurrentInstance(); - return new Promise((resolve, reject) => { - const query = uni.createSelectorQuery().in(instance.proxy); +export async function getElRect(elClass, instance,option) { + instance = instance ? instance : getCurrentInstance(); + const query = uni.createSelectorQuery().in(instance.proxy); + try{ + const res= await getEle(query,elClass,option) + return res + }catch(e){ + console.log(e); + } +} +async function getEle(query,elClass,option){ + return new Promise((resolve, reject)=>{ query.select('.' + elClass).fields({ - size: true + size: true, + ...option }, res => { // 如果节点尚未生成,res值为null,循环调用执行 if (!res) { - setTimeout(() => { - getElRect(elClass); + return setTimeout(() => { + getEle(query,elClass,option); }, 10); - return; } resolve(res); }).exec(); }) + } export async function getSafeBottomHeight(className, height = 16) { diff --git a/components/my-components/my-date-pickerview.vue b/components/my-components/my-date-pickerview.vue index 0e1d466..0ea73ad 100644 --- a/components/my-components/my-date-pickerview.vue +++ b/components/my-components/my-date-pickerview.vue @@ -389,9 +389,10 @@ const year = years[arr[0]] const month = arr[1] + 1 const day = arr[2] + 1 - const hour = ('0' + arr[3]).slice(-2) - const min = ('0' + arr[4]).slice(-2) - const sen = ('0' + arr[5]).slice(-2) + const hour = ('0' + (arr[3]||0)).slice(-2) + console.log(hour) + const min = ('0' + (arr[4]||0)).slice(-2) + const sen = ('0' + (arr[5]||0)).slice(-2) if (isObj) { return new Date(year, month, day, hour, min, sen) } @@ -400,6 +401,7 @@ function confirm(e) { + console.log(value.value); const start = returnDateString(value.value) console.log(start); const end = returnDateString(value1.value) diff --git a/http/yskApi/Instead.js b/http/yskApi/Instead.js index 3221307..d964201 100644 --- a/http/yskApi/Instead.js +++ b/http/yskApi/Instead.js @@ -331,4 +331,62 @@ export function $returnOrder(data) { ...data } }); +} + +//获取订单可用优惠券 +export function $activateByOrderId(data) { + return request({ + url: '/api/tbShopCoupon/activateByOrderId', + method: "get", + params:{ + shopId: uni.getStorageSync("shopId"), + ...data + } + }); +} + +//会员积分列表 +export function $returnMemberPointsList(data) { + return request({ + url: '/api/points/member-points/page', + method: "get", + params:{ + shopId: uni.getStorageSync("shopId"), + ...data + } + }); +} + +// 会员积分账户信息 +export function $returnMemberPoints(memberId) { + return request({ + url: '/api/points/member-points/'+memberId, + method: "get", + params:{ + shopId: uni.getStorageSync("shopId"), + ...data + } + }); +} +//002-获取订单可用积分及抵扣金额(支付页面使用) +export function $calcUsablePoints(data) { + return request({ + url: '/api/points/member-points/calc-usable-points', + method: "get", + params:{ + shopId: uni.getStorageSync("shopId"), + ...data + } + }); +} +// 003-根据积分计算可抵扣金额 +export function $calcDeDuctionPoints(data) { + return request({ + url: '/api/points/member-points/calc-deduction-amount', + method: "get", + params:{ + shopId: uni.getStorageSync("shopId"), + ...data + } + }); } \ No newline at end of file diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 67aef22..2f109f3 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -17,10 +17,10 @@ import infoBox from "@/commons/utils/infoBox.js" import go from '@/commons/utils/go.js'; import { reject } from 'lodash'; // 测试服 -let baseUrl = 'https://admintestpapi.sxczgkj.cn' +// let baseUrl = 'https://admintestpapi.sxczgkj.cn' //预发布 -// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn' +let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn' //正式 // let baseUrl = 'https://cashieradmin.sxczgkj.cn' diff --git a/pageProduct/add-Product/add-Product - 副本.vue b/pageProduct/add-Product/add-Product - 副本.vue index f9ec7b6..e08499a 100644 --- a/pageProduct/add-Product/add-Product - 副本.vue +++ b/pageProduct/add-Product/add-Product - 副本.vue @@ -1,189 +1,845 @@ \ No newline at end of file diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue index e08499a..dad2fe6 100644 --- a/pageProduct/add-Product/add-Product.vue +++ b/pageProduct/add-Product/add-Product.vue @@ -846,7 +846,7 @@ }, { minLength: 1, - maxLength: 20, + maxLength: 40, errorMessage: '商品名称长度在 {minLength} 到 {maxLength} 个字符', } ] @@ -1375,7 +1375,7 @@ for (let i of FormData.specificationsGroup.selectSpec) { if (i.selectSpecResult.length) { skuSnap.push({ - label: i.name, + name: i.name, value: i.selectSpecResult.join(',') }) } diff --git a/pageProduct/index/components/edit-price.vue b/pageProduct/index/components/edit-price.vue index 79f676a..f4c77eb 100644 --- a/pageProduct/index/components/edit-price.vue +++ b/pageProduct/index/components/edit-price.vue @@ -227,7 +227,9 @@ // } onMounted(()=>{ + // #ifndef H5 refForm.value.setRules(rules) + // #endif }) diff --git a/pageProduct/index/components/edit-stock.vue b/pageProduct/index/components/edit-stock.vue index 79a407b..cbd9303 100644 --- a/pageProduct/index/components/edit-stock.vue +++ b/pageProduct/index/components/edit-stock.vue @@ -256,7 +256,9 @@ // } onMounted(()=>{ + // #ifndef H5 refForm.value.setRules(rules) + // #endif }) diff --git a/pageUser/index/components/user.vue b/pageUser/index/components/user.vue index 64fbe6f..8ef3fc6 100644 --- a/pageUser/index/components/user.vue +++ b/pageUser/index/components/user.vue @@ -38,7 +38,7 @@ - {{data.totalScore}} + {{data.accountPoints}} 积分 @@ -56,7 +56,7 @@ {{to2(allPrice*1+seatFeePrice*1+packFee*1) }} @@ -137,20 +165,93 @@ 重新打印 + + + 优惠详情 + + + 满减券抵扣 + + + {{orderInfo.fullCouponDiscountAmount}} + + + + 商品券抵扣 + + + {{orderInfo.productCouponDiscountAmount||productCoupPrice}} + + + + 积分抵扣 + + + {{orderInfo.pointsDiscountAmount}} + + + + + + + + \ No newline at end of file diff --git a/pagesOrder/pay-order/pay-order.vue b/pagesOrder/pay-order/pay-order.vue index ed2d9c2..cfd15d8 100644 --- a/pagesOrder/pay-order/pay-order.vue +++ b/pagesOrder/pay-order/pay-order.vue @@ -1,36 +1,76 @@