diff --git a/components/paymentMethod.vue b/components/paymentMethod.vue index bfe6202..739ec35 100644 --- a/components/paymentMethod.vue +++ b/components/paymentMethod.vue @@ -15,12 +15,12 @@ {{ item.name }} - 当前余额¥{{orderVIP?orderVIP.amount:0}} + 当前余额¥{{orderVIP?(orderVIP.amount||0):0}} 去充值 - + @@ -75,6 +75,11 @@ return false } } + watch(()=>props.disablePayType,(newval)=>{ + console.log('watch:props.disablePayType',newval); + },{ + immediate:true + }) const orderVIP = ref(null) const emits = defineEmits(['customevent', 'groupChange']); @@ -145,10 +150,11 @@ } const item=paymentMethodList.value.find(v=>v.type==type) if(item&&returnDisabled(item)){ - return uni.showToast({ + uni.showToast({ title:"当前支付方式不可用", icon:'none' }) + return } // if (props.payAmount <= 0 && type != 1) { // return; diff --git a/pages/index/index.vue b/pages/index/index.vue index bc39b1e..5f3165f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -350,8 +350,12 @@ onShow(async () => { console.error('获取经纬度失败',error); } }); - - indexsRef.value.getVipConfig(); + + const shopId=uni.cache.get('shopId') + if(shopId){ + indexsRef.value.getVipConfig(); + } + } catch (error) { } diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index df4e534..620b394 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -51,7 +51,7 @@ 订单备注: - @@ -214,18 +214,37 @@ rechargeId.value = e } - function updateChargeSel(e) { - rechargeItem.value = e - } - watch(() => rechargeItem.value.id, (newval) => { + function updateChargeSel(newval) { + console.log('updateChargeSel', newval); + rechargeItem.value = newval //充值并付款时只能微信支付 - if (newval) { + if (newval && newval.id) { disablePayType.value = ['余额支付'] paymentMethodref.value.groupChanges(2) } else { disablePayType.value = [] } - }) + + + if (!shopUserInfo.value.amount) { + disablePayType.value = ['余额支付'] + if (paymentMethodref.value) { + paymentMethodref.value.groupChanges(2) + } + console.log('watch: cartStore.orderCostSummary.finalPayAmount', disablePayType.value); + return + } + if (shopUserInfo.value.amount < newval) { + disablePayType.value = ['余额支付'] + if (paymentMethodref.value) { + paymentMethodref.value.groupChanges(2) + } + console.log('watch: cartStore.orderCostSummary.finalPayAmount', disablePayType.value); + return + } + disablePayType.value = [] + console.log('watch: cartStore.orderCostSummary.finalPayAmount', disablePayType.value); + } async function onMessage(Message) { cartStore.onMessage(Message, cartsSocket) @@ -242,6 +261,7 @@ }) console.log('onMessage:APIgetOrderById', res); if (res) { + orderRemarker.value=res.remark; // cartStore.carts=[]; // cartStore.setOldOrder(res) } @@ -349,6 +369,8 @@ // 霸王餐 const isBwc = ref(false) + //订单备注 + const orderRemarker = ref('') // 订单详情 const listinfo = reactive({ combinedArray: [], @@ -383,6 +405,7 @@ }) : await APIhistoryOrder({ tableCode: options.tableCode }) + orderRemarker.value=res.remark; if (res && res.tableCode) { socketInitPar.table_code = res.tableCode let tableRes = await getTableInfo({ @@ -652,7 +675,7 @@ // packFee: packFee.value, //打包费 packFee: packfee.value, //打包费 originAmount: shifu.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费 - remark: '', //备注 + remark: orderRemarker.value, //备注 placeNum: listinfo.id ? (listinfo.placeNum * 1 + 1) : 1, //当前订单下单次数 waitCall: '', //是否等叫 0 否 1 等叫 orderId: listinfo.id || '', @@ -725,6 +748,7 @@ const res1 = await APIgetOrderById({ orderId: res.id }) + orderRemarker.value=res1.remark; cartStore.setOldOrder(res1) } nextTick(goToPay) @@ -873,7 +897,7 @@ newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减 newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore .consumeDiscount.id : '', - remark: listinfo.remark, //用户备注 + remark: orderRemarker.value, //用户备注 } console.log('topay checkOrderPay', checkOrderPay); try { @@ -956,7 +980,7 @@ newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减 newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore.consumeDiscount .id : '', - remark: listinfo.remark, //用户备注 + remark: orderRemarker.value, //用户备注 } try { await storeMemberpay.balancePayOrder({ @@ -967,6 +991,10 @@ buyerRemark: '', returnUrl: '' }) + uni.showToast({ + title: '支付成功', + icon: 'none' + }) } catch (error) { //TODO handle the exception } @@ -1079,6 +1107,7 @@ options.tableCode = res.tableCode cartStore.setSeatFeeConfig('personCount', res.seatNum) cartStore.setDinnerType(res.dineMode || 'dine-in') + orderRemarker.value=res.remark; } } //获取店铺信息 @@ -1102,8 +1131,10 @@ } } + const shopUserInfo = ref({}) onLoad((opt) => { init(opt) + shopUserInfo.value = uni.cache.get('shopUserInfo') }) @@ -1576,25 +1607,25 @@ } } - + .orderInfo { background: #FFFFFF; border-radius: 18rpx 18rpx 18rpx 18rpx; margin-top: 32rpx; padding: 32rpx 34rpx; - - .t { - font-weight: bold; - font-size: 28rpx; - color: #333333; - flex-shrink: 0; - } - - .info { - font-weight: 400; - font-size: 28rpx; - color: #666666; - } - + + .t { + font-weight: bold; + font-size: 28rpx; + color: #333333; + flex-shrink: 0; + } + + .info { + font-weight: 400; + font-size: 28rpx; + color: #666666; + } + } \ No newline at end of file diff --git a/pages/user/member/setPassword.vue b/pages/user/member/setPassword.vue index 2887358..60d7e3f 100644 --- a/pages/user/member/setPassword.vue +++ b/pages/user/member/setPassword.vue @@ -13,7 +13,7 @@ 密码支付 关闭时,使用余额支付将会直接扣除,不再进行确认 - 密码支付 @@ -74,13 +74,15 @@ shopInfo: uni.cache.get('orderVIP'), shopId: '' }) + + const userInfo=uni.cache.get('userInfo') const form = reactive({ mobile: uni.cache.get('orderVIP').phone, password: '', payPassword: '', checkCode: '', - isOpen: 1 + usePayPwd: userInfo.usePayPwd }) const datalist = reactive({ @@ -94,6 +96,7 @@ }) const CodeRegister = async () => { + console.log('CodeRegister'); const res = await APIusercode({ // post 手机验证码 phone: form.mobile @@ -195,7 +198,8 @@ let res = await APIuserpwd({ checkPayPwd: form.payPassword, payPwd: form.password, - code: form.checkCode + code: form.checkCode, + usePayPwd:form.usePayPwd }) // * 获取会员信息 await storeuser.actionsproductqueryProduct() @@ -203,6 +207,16 @@ uni.navigateBack() } } + + async function usePayPwdChange(){ + uni.showLoading() + await APIuserpwd({ + usePayPwd:form.usePayPwd + }) + uni.showToast({ + title:'修改成功' + }) + }