代客下单问题修复,积分上传问题修复

This commit is contained in:
2025-12-12 17:56:26 +08:00
parent 9a0164eff6
commit 6f1864771d
29 changed files with 12071 additions and 7571 deletions

View File

@@ -69,6 +69,8 @@
</view>
</view>
</view>
</view>
</template>
@@ -552,4 +554,9 @@ const showOldPrice = computed(() => {});
text-decoration: line-through;
text-align: right;
}
.total{
padding-top: 32rpx;
border-top: 1px solid #EDEDED;
text-align: right;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,6 @@
<template>
<view>
<view class="card_box">
<view class="card_head_box">
<view class="card_head_item" v-for="(item,index) in 8" :key="index"></view>
</view>
<!-- 先付款 -->
<view class="tabBox" v-if="listinfo.status == 'unpaid'">
@@ -44,6 +41,21 @@
</view>
</view> -->
</view>
<view class="tabBox" v-else-if="listinfo.tableName">
<view class="table" >
<view class="table_left">
<image class="icon"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png"
mode="aspectFill" />
<text class="title">桌台</text>
</view>
<view class="value" v-if="listinfo.tableName"> {{ listinfo.tableName || '' }} </view>
</view>
</view>
<view class="card">
<!-- 订单头部 -->
<view class="card_item" v-for="(value, key) in listinfo.detailMap" :key="key">
@@ -162,31 +174,57 @@
</view>
</view>
</block>
<block v-else>
<!-- <block v-else>
<view class="cell-item column" v-if="listinfo.discountInfo">
<view class="label">优惠折扣</view>
<view class="val column">
<view class="productCoupon" v-for="(item,index) in listinfo.discountInfo" :key="index">
<view class="name">{{item.name}}</view>
<!-- <view class="num">{{item.amount}}</view> -->
<view class="amount" style="margin-left: 10rpx;">{{item.amount}}</view>
</view>
</view>
</view>
</block>
</block> -->
<view class="total-wrap" v-if="listinfo.status == 'unpaid'">
<view>总计</view>
<view class="price"> {{listinfo.totalCost}} </view>
<text>总计</text>
<text class="u-font-32"></text>
<text class="price"> {{listinfo.totalCost}} </text>
</view>
<view class="total-wrap" v-else>
<view>实付</view>
<view class="price"> {{listinfo.payAmount}} </view>
<view>实付</view>
<text class="u-font-32"></text>
<text class="price"> {{listinfo.payAmount}} </text>
</view>
</view>
</view>
<view class="disocunt " v-if="showDiscount">
<view class="row" v-if="listinfo.productCouponDiscountAmount">
<text class="t">商品券</text>
<text class="info price">-{{listinfo.productCouponDiscountAmount}}</text>
</view>
<view class="row" v-if="listinfo.otherCouponDiscountAmount">
<text class="t">优惠券</text>
<text class="price">-{{listinfo.otherCouponDiscountAmount}}</text>
</view>
<view class="row" v-if="listinfo.pointsDiscountAmount">
<text class="t">积分抵扣</text>
<text class="price">-{{listinfo.pointsDiscountAmount}}</text>
</view>
<view class="row" v-if="listinfo.discountActAmount">
<text class="t">满减活动</text>
<text class="price">-{{listinfo.discountActAmount}}</text>
</view>
<view class="row" v-if="listinfo.newCustomerDiscountAmount">
<text class="t">新客立减</text>
<text class="price">-{{listinfo.newCustomerDiscountAmount}}</text>
</view>
</view>
<view class="orderInfo">
<view class="row" @click="copyHandle(listinfo.orderNo)">
<text class="t">订单编号</text>
@@ -295,6 +333,7 @@
])
const props = defineProps({
freeCheck: {
type: Boolean
@@ -330,6 +369,47 @@
})
/**
* 判断一个对象里的某些属性是否存在且值不等于0满足其中一个就返回true否则false
* @param {Object} obj - 要检测的目标对象若为非对象类型直接返回false
* @param {Array<string>} keys - 要检测的属性名数组(若为非数组/空数组直接返回false
* @returns {boolean} 满足条件返回true否则返回false
*/
function isObjHasPropertyAndNotNull(obj, keys) {
console.log(obj)
// 1. 边界校验obj必须是有效对象keys必须是非空数组
if (
!obj || // 排除null/undefined
typeof obj !== 'object' || // 排除字符串/数字/布尔等非对象类型
!Array.isArray(keys) || // 确保keys是数组
keys.length === 0 // 空数组直接返回false
) {
return false;
}
// 2. 遍历所有要检测的属性
for (const key of keys) {
console.log(obj[key])
// 检查属性是否是对象自身的(排除原型链上的属性) + 属性值不等于0
if (obj.hasOwnProperty(key) && obj[key] !== 0) {
return true; // 只要有一个满足立即返回true
}
}
// 3. 所有属性都不满足条件
return false;
}
const showDiscount = computed(() => {
const keys = ['productCouponDiscountAmount', 'otherCouponDiscountAmount',
'pointsDiscountAmount', 'discountActAmount', 'newCustomerDiscountAmount'
]
if (isObjHasPropertyAndNotNull(props.listinfo, keys)) {
return true
}
return false
})
const is_type = ref(0)
// 监听送餐/打包切换
const tabClick = (item, index) => {
@@ -477,14 +557,12 @@
<style lang="scss" scoped>
.card_box {
background-color: #fff;
// box-shadow: 0rpx 8rpx 12rpx 2rpx rgba(87,86,86,0.35);
position: relative;
width: 100%;
height: 100%;
// box-shadow: 0rpx 4rpx 12rpx 2rpx rgba(87,86,86,0.35);
border-radius: 18rpx;
padding-bottom: 32rpx;
.tabBox {
width: 100%;
margin-top: 52rpx;
@@ -1050,7 +1128,31 @@
}
}
.disocunt{
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;overflow: hidden;
margin-top: 32rpx;
.row{
padding: 16rpx 24rpx;
display: flex;
justify-content: space-between;
.t {
font-weight: bold;
font-size: 28rpx;
color: #333333;
flex-shrink: 0;
}
.info {
font-weight: 400;
font-size: 28rpx;
color: #666666;
}
}
.price {
color: #FF1C1C;
}
}
.orderInfo {
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
@@ -1129,4 +1231,6 @@
}
}
}
</style>

View File

@@ -5,9 +5,7 @@
<view class="left">
<view class="icon">优惠</view>
<view class="text">
充值消费{{ freeDineConfig.rechargeTimes }}订单满{{
freeDineConfig.rechargeThreshold
}}元可用本单立享免单</view
充值消费{{ freeDineConfig.rechargeTimes }}本单立享免单</view
>
</view>
<view @click.stop="()=>{}">
@@ -92,12 +90,11 @@ const changeFree = (e) => {
font-weight: 500;
font-size: 20rpx;
color: #ffffff;
margin-right: 12rpx;
margin-right: 18rpx;
}
.text {
width: 80%;
font-weight: 500;
font-weight: 700;
font-size: 28rpx;
color: #333333;
}