问题修复

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="method_list_bom" v-if="item.type == 1">
<text class="balance">
当前余额{{orderVIP?orderVIP.amount:0}}</text>
当前余额{{orderVIP?(orderVIP.amount||0):0}}</text>
<text class="topUpNow" @click="goRecharge">去充值</text>
</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>
</view>
</view>
@@ -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;

View File

@@ -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) {
}

View File

@@ -51,7 +51,7 @@
订单备注
</view>
<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" />
</view>
</view>
@@ -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')
})
</script>
@@ -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;
}
}
</style>

View File

@@ -13,7 +13,7 @@
<view class="color-333 font-16 font-700">密码支付</view>
<view class="font-12 color-999 u-m-t-4">关闭时使用余额支付将会直接扣除不再进行确认</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>
</view>
<view class="color-333 font-16 font-700" style="margin-top: 60rpx;">密码支付</view>
@@ -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:'修改成功'
})
}
</script>
<style lang="scss" scoped>
@@ -250,7 +264,7 @@
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #5082fd;
z-index: 1;
.yzm {
padding: 8rpx 20rpx;
background: #E5E5E5;

View File

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

View File

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