问题修复

This commit is contained in:
2025-09-29 20:56:16 +08:00
parent 32ca45a5f3
commit 44c3e1e8b4
6 changed files with 96 additions and 34 deletions

View File

@@ -15,12 +15,12 @@
<view class="name"> {{ item.name }} </view> <view class="name"> {{ item.name }} </view>
<view class="method_list_bom" v-if="item.type == 1"> <view class="method_list_bom" v-if="item.type == 1">
<text class="balance"> <text class="balance">
当前余额{{orderVIP?orderVIP.amount:0}}</text> 当前余额{{orderVIP?(orderVIP.amount||0):0}}</text>
<text class="topUpNow" @click="goRecharge">去充值</text> <text class="topUpNow" @click="goRecharge">去充值</text>
</view> </view>
</view> </view>
</view> </view>
<up-radio activeColor="#E8AD7B" icon-size="18" size="18" :name="item.type"> <up-radio :disabled="returnDisabled(item)" activeColor="#E8AD7B" icon-size="18" size="18" :name="item.type">
</up-radio> </up-radio>
</view> </view>
</view> </view>
@@ -75,6 +75,11 @@
return false return false
} }
} }
watch(()=>props.disablePayType,(newval)=>{
console.log('watch:props.disablePayType',newval);
},{
immediate:true
})
const orderVIP = ref(null) const orderVIP = ref(null)
const emits = defineEmits(['customevent', 'groupChange']); const emits = defineEmits(['customevent', 'groupChange']);
@@ -145,10 +150,11 @@
} }
const item=paymentMethodList.value.find(v=>v.type==type) const item=paymentMethodList.value.find(v=>v.type==type)
if(item&&returnDisabled(item)){ if(item&&returnDisabled(item)){
return uni.showToast({ uni.showToast({
title:"当前支付方式不可用", title:"当前支付方式不可用",
icon:'none' icon:'none'
}) })
return
} }
// if (props.payAmount <= 0 && type != 1) { // if (props.payAmount <= 0 && type != 1) {
// return; // return;

View File

@@ -350,8 +350,12 @@ onShow(async () => {
console.error('获取经纬度失败',error); console.error('获取经纬度失败',error);
} }
}); });
indexsRef.value.getVipConfig(); const shopId=uni.cache.get('shopId')
if(shopId){
indexsRef.value.getVipConfig();
}
} catch (error) { } catch (error) {
} }

View File

@@ -51,7 +51,7 @@
订单备注 订单备注
</view> </view>
<view class="u-m-t-18 "> <view class="u-m-t-18 ">
<up-textarea border="none" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="listinfo.remark" <up-textarea border="none" placeholder="请填写口味、偏好等要求" type="textarea" v-model="orderRemarker"
:clearable="true" /> :clearable="true" />
</view> </view>
</view> </view>
@@ -214,18 +214,37 @@
rechargeId.value = e rechargeId.value = e
} }
function updateChargeSel(e) { function updateChargeSel(newval) {
rechargeItem.value = e console.log('updateChargeSel', newval);
} rechargeItem.value = newval
watch(() => rechargeItem.value.id, (newval) => {
//充值并付款时只能微信支付 //充值并付款时只能微信支付
if (newval) { if (newval && newval.id) {
disablePayType.value = ['余额支付'] disablePayType.value = ['余额支付']
paymentMethodref.value.groupChanges(2) paymentMethodref.value.groupChanges(2)
} else { } else {
disablePayType.value = [] 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) { async function onMessage(Message) {
cartStore.onMessage(Message, cartsSocket) cartStore.onMessage(Message, cartsSocket)
@@ -242,6 +261,7 @@
}) })
console.log('onMessage:APIgetOrderById', res); console.log('onMessage:APIgetOrderById', res);
if (res) { if (res) {
orderRemarker.value=res.remark;
// cartStore.carts=[]; // cartStore.carts=[];
// cartStore.setOldOrder(res) // cartStore.setOldOrder(res)
} }
@@ -349,6 +369,8 @@
// 霸王餐 // 霸王餐
const isBwc = ref(false) const isBwc = ref(false)
//订单备注
const orderRemarker = ref('')
// 订单详情 // 订单详情
const listinfo = reactive({ const listinfo = reactive({
combinedArray: [], combinedArray: [],
@@ -383,6 +405,7 @@
}) : await APIhistoryOrder({ }) : await APIhistoryOrder({
tableCode: options.tableCode tableCode: options.tableCode
}) })
orderRemarker.value=res.remark;
if (res && res.tableCode) { if (res && res.tableCode) {
socketInitPar.table_code = res.tableCode socketInitPar.table_code = res.tableCode
let tableRes = await getTableInfo({ let tableRes = await getTableInfo({
@@ -652,7 +675,7 @@
// packFee: packFee.value, //打包费 // packFee: packFee.value, //打包费
packFee: packfee.value, //打包费 packFee: packfee.value, //打包费
originAmount: shifu.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费 originAmount: shifu.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费
remark: '', //备注 remark: orderRemarker.value, //备注
placeNum: listinfo.id ? (listinfo.placeNum * 1 + 1) : 1, //当前订单下单次数 placeNum: listinfo.id ? (listinfo.placeNum * 1 + 1) : 1, //当前订单下单次数
waitCall: '', //是否等叫 0 否 1 等叫 waitCall: '', //是否等叫 0 否 1 等叫
orderId: listinfo.id || '', orderId: listinfo.id || '',
@@ -725,6 +748,7 @@
const res1 = await APIgetOrderById({ const res1 = await APIgetOrderById({
orderId: res.id orderId: res.id
}) })
orderRemarker.value=res1.remark;
cartStore.setOldOrder(res1) cartStore.setOldOrder(res1)
} }
nextTick(goToPay) nextTick(goToPay)
@@ -873,7 +897,7 @@
newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减 newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减
newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore
.consumeDiscount.id : '', .consumeDiscount.id : '',
remark: listinfo.remark, //用户备注 remark: orderRemarker.value, //用户备注
} }
console.log('topay checkOrderPay', checkOrderPay); console.log('topay checkOrderPay', checkOrderPay);
try { try {
@@ -956,7 +980,7 @@
newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减 newCustomerDiscountAmount: cartStore.orderCostSummary.newUserDiscount, //新客立减
newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore.consumeDiscount newCustomerDiscountId: cartStore.orderCostSummary.newUserDiscount > 0 ? cartStore.consumeDiscount
.id : '', .id : '',
remark: listinfo.remark, //用户备注 remark: orderRemarker.value, //用户备注
} }
try { try {
await storeMemberpay.balancePayOrder({ await storeMemberpay.balancePayOrder({
@@ -967,6 +991,10 @@
buyerRemark: '', buyerRemark: '',
returnUrl: '' returnUrl: ''
}) })
uni.showToast({
title: '支付成功',
icon: 'none'
})
} catch (error) { } catch (error) {
//TODO handle the exception //TODO handle the exception
} }
@@ -1079,6 +1107,7 @@
options.tableCode = res.tableCode options.tableCode = res.tableCode
cartStore.setSeatFeeConfig('personCount', res.seatNum) cartStore.setSeatFeeConfig('personCount', res.seatNum)
cartStore.setDinnerType(res.dineMode || 'dine-in') cartStore.setDinnerType(res.dineMode || 'dine-in')
orderRemarker.value=res.remark;
} }
} }
//获取店铺信息 //获取店铺信息
@@ -1102,8 +1131,10 @@
} }
} }
const shopUserInfo = ref({})
onLoad((opt) => { onLoad((opt) => {
init(opt) init(opt)
shopUserInfo.value = uni.cache.get('shopUserInfo')
}) })
</script> </script>
@@ -1576,25 +1607,25 @@
} }
} }
.orderInfo { .orderInfo {
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 18rpx 18rpx 18rpx 18rpx;
margin-top: 32rpx; margin-top: 32rpx;
padding: 32rpx 34rpx; padding: 32rpx 34rpx;
.t { .t {
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
flex-shrink: 0; flex-shrink: 0;
} }
.info { .info {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #666666; color: #666666;
} }
} }
</style> </style>

View File

@@ -13,7 +13,7 @@
<view class="color-333 font-16 font-700">密码支付</view> <view class="color-333 font-16 font-700">密码支付</view>
<view class="font-12 color-999 u-m-t-4">关闭时使用余额支付将会直接扣除不再进行确认</view> <view class="font-12 color-999 u-m-t-4">关闭时使用余额支付将会直接扣除不再进行确认</view>
</view> </view>
<up-switch v-model="form.isOpen" active-color="#FFD158" :inactive-value="0" <up-switch v-model="form.usePayPwd" active-color="#FFD158" :inactive-value="0" @change="usePayPwdChange"
:active-value="1"></up-switch> :active-value="1"></up-switch>
</view> </view>
<view class="color-333 font-16 font-700" style="margin-top: 60rpx;">密码支付</view> <view class="color-333 font-16 font-700" style="margin-top: 60rpx;">密码支付</view>
@@ -74,13 +74,15 @@
shopInfo: uni.cache.get('orderVIP'), shopInfo: uni.cache.get('orderVIP'),
shopId: '' shopId: ''
}) })
const userInfo=uni.cache.get('userInfo')
const form = reactive({ const form = reactive({
mobile: uni.cache.get('orderVIP').phone, mobile: uni.cache.get('orderVIP').phone,
password: '', password: '',
payPassword: '', payPassword: '',
checkCode: '', checkCode: '',
isOpen: 1 usePayPwd: userInfo.usePayPwd
}) })
const datalist = reactive({ const datalist = reactive({
@@ -94,6 +96,7 @@
}) })
const CodeRegister = async () => { const CodeRegister = async () => {
console.log('CodeRegister');
const res = await APIusercode({ const res = await APIusercode({
// post 手机验证码 // post 手机验证码
phone: form.mobile phone: form.mobile
@@ -195,7 +198,8 @@
let res = await APIuserpwd({ let res = await APIuserpwd({
checkPayPwd: form.payPassword, checkPayPwd: form.payPassword,
payPwd: form.password, payPwd: form.password,
code: form.checkCode code: form.checkCode,
usePayPwd:form.usePayPwd
}) })
// * 获取会员信息 // * 获取会员信息
await storeuser.actionsproductqueryProduct() await storeuser.actionsproductqueryProduct()
@@ -203,6 +207,16 @@
uni.navigateBack() uni.navigateBack()
} }
} }
async function usePayPwdChange(){
uni.showLoading()
await APIuserpwd({
usePayPwd:form.usePayPwd
})
uni.showToast({
title:'修改成功'
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -250,7 +264,7 @@
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #5082fd; color: #5082fd;
z-index: 1;
.yzm { .yzm {
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
background: #E5E5E5; background: #E5E5E5;

View File

@@ -132,6 +132,7 @@ export const Memberpay = defineStore('memberpay', {
buyerRemark: data.buyerRemark, buyerRemark: data.buyerRemark,
userId: uni.cache.get('userInfo').id || '' userId: uni.cache.get('userInfo').id || ''
}) })
console.log('actionsltPayOrder:res',res);
if(!res){ if(!res){
console.log('支付失败'); console.log('支付失败');
reject(false) reject(false)

View File

@@ -163,6 +163,12 @@ export function returnCouponCanUse(args) {
reason: "当前选中的券不可与其他券同享" reason: "当前选中的券不可与其他券同享"
}; };
} }
if(selCoupon.length>0&&!coupon.otherCouponShare){
return {
canUse: false,
reason: "当前选中的券不可与其他券同享"
};
}
// 没有符合条件的商品 // 没有符合条件的商品
if (!isDikouAll && canCalcGoodsArr.length === 0) { if (!isDikouAll && canCalcGoodsArr.length === 0) {