增加用户是否可以自行支付功能

This commit is contained in:
2026-03-28 18:37:17 +08:00
parent 3f6b39f413
commit 5c2aa2b617
2 changed files with 86 additions and 36 deletions

View File

@@ -130,9 +130,19 @@
</up-button>
</template>
</view>
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders, 1000)">
{{ paymentmethod ? paymentmethod.name : "" }}
</view>
<template v-if="!loading">
<template v-if="cartStore.shopInfo.isUserPay">
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders, 1000)">
{{ paymentmethod ? paymentmethod.name : "" }}
</view>
</template>
<template v-else>
<view class="fixedview_tow disabled">
请前往吧台支付
</view>
</template>
</template>
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
取消订单
</view> -->
@@ -326,8 +336,8 @@
shop_id: uni.cache.get("shopId"),
time_dis_info: null
});
function socketInit() {
cartsSocket = useWebSocket();
@@ -1030,15 +1040,15 @@
// 跳转到加菜页面
function toJiacai() {
console.log("跳转到加菜页面");
const arr= getCurrentPages()
const arr = getCurrentPages()
console.log(arr);
if(arr.length>=2&&arr[arr.length-2]&&arr[arr.length-2].route=='pages/product/index'){
if (arr.length >= 2 && arr[arr.length - 2] && arr[arr.length - 2].route == 'pages/product/index') {
back();
}else{
uni.cache.set('tableCode',listinfo.tableCode)
uni.cache.set('shopId',listinfo.shopId)
} else {
uni.cache.set('tableCode', listinfo.tableCode)
uni.cache.set('shopId', listinfo.shopId)
uni.redirectTo({
url:'/pages/product/index?noJump=1'
url: '/pages/product/index?noJump=1'
})
}
}
@@ -1111,11 +1121,13 @@
}
const limitTimeDiscountRes = ref(null)
const rechargeConfig=ref(null)
const rechargeConfig = ref(null)
const loading=ref(true)
async function init(opt) {
const res1= await storeuser.actionsproductqueryProduct();
orderVIP.value=res1
console.log('orderVIP',orderVIP.value)
const res1 = await storeuser.actionsproductqueryProduct();
orderVIP.value = res1
console.log('orderVIP', orderVIP.value)
cartStore.clearOrderConfig();
Object.assign(options, opt);
listinfo.id = options.orderId;
@@ -1145,22 +1157,24 @@
}
}
//获取台桌信息
let tableRes = await getTableInfo({
tableCode: options.tableCode || "",
});
console.log("tableRes", tableRes);
listinfo.tableName = tableRes?tableRes.name:'';
listinfo.tableName = tableRes ? tableRes.name : '';
//获取店铺信息
const shopInfoRes = await APIusershopInfodetail({
shopId: options.shopId,
});
//智慧充值
const rechargeConfigRes=await rechargeApi.config({shopId: options.shopId})
if(rechargeConfigRes&&typeof rechargeConfigRes ==='object'){
rechargeConfig.value=rechargeConfigRes
const rechargeConfigRes = await rechargeApi.config({
shopId: options.shopId
})
if (rechargeConfigRes && typeof rechargeConfigRes === 'object') {
rechargeConfig.value = rechargeConfigRes
}
//获取积分配置
pointsApi.pointsConfig().then(res => {
@@ -1179,6 +1193,7 @@
if (shopInfoRes) {
cartStore.shopInfo = shopInfoRes.shopInfo;
}
loading.value=false
await cartStore.goodsInit();
// * 获取会员信息
await nextTick();
@@ -1286,7 +1301,7 @@
if (!isCanUseCharge.value) {
arr.add("余额支付");
}
if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
if (rechargeConfig.value && !rechargeConfig.value.isEnable) {
arr.add("余额支付");
}
@@ -1296,12 +1311,12 @@
watch(() => cartStore.limitTimeDiscount, (newval, oldval) => {
})
watch(()=>cartStore.limitTimeDiscount,(newval)=>{
socketInitPar.time_dis_info=newval
},{
deep:true,
immediate:true
watch(() => cartStore.limitTimeDiscount, (newval) => {
socketInitPar.time_dis_info = newval
}, {
deep: true,
immediate: true
})
/**
@@ -1813,7 +1828,16 @@
font-weight: 400;
font-size: 32rpx;
color: #ffffff;
padding: 14rpx 44rpx;
padding: 0 44rpx;
min-height: 72rpx;
line-height: 72rpx;
box-sizing: border-box;
&.disabled {
background-color: #eee;
color: #999;
font-size: 24rpx;
text-align: center;
}
}
.fixedview_tows {