退款客座费限制只能全选

This commit is contained in:
2024-10-31 11:08:58 +08:00
parent 1621a1feed
commit e8b5f1d2e7
3 changed files with 60 additions and 21 deletions

View File

@@ -5,21 +5,24 @@
<view>
{{data.productName}}
</view>
<view class="u-flex u-m-t-32">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer>
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :disabled="data.productId=='-999'">
<template #minus>
<view class="minus number-box-btn">
</view>
</template>
<template #input>
<view class="u-flex-1 u-row-center u-text-center input">
<up-input @change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
<up-input
:disabled="data.productId=='-999'"
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
v-model="number" border="none" type="number"></up-input>
</view>
</template>
<template #plus>
<view class="plus number-box-btn">
<up-icon name="plus" color="#999" size="16" bold></up-icon>
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
</view>
</template>
</up-number-box>
@@ -66,7 +69,11 @@
const props = defineProps({
data: {
type: Object,
default: () => {}
default: () => {
return {
productId:'-999'
}
}
},
show: {
type: Boolean,
@@ -143,6 +150,9 @@
function open() {
model.value.open()
if(props.data.productId=='-999'){
number.value=props.data.num
}
}
function close() {
@@ -191,7 +201,12 @@
::v-deep .uni-input-input {
text-align: center;
}
.gray{
.minus::after{
border-color: #ccc;
}
}
.minus {
&::after {
content: '';

View File

@@ -284,11 +284,13 @@
}
console.log(res.seatInfo);
orderDetail.seatFee = res.seatInfo|| {
name: '客座费',
number: res.seatCount,
totalNumber: res.seatCount,
priceAmount: res.seatAmount,
status:''
// name: '客座费',
// number: res.seatCount,
// num: res.seatCount,
// totalNumber: res.seatCount,
// priceAmount: res.seatAmount,
// status:'',
totalNumber:0,
}
orderDetail.goodsList = Object.entries(goodsMap).map(([key, value]) => ({
info: value,

View File

@@ -3,9 +3,13 @@
<view class="bg-fff u-p-24 border-r-12 u-flex u-row-between">
<view>全退</view>
<view>
<my-radio v-model="allTui"></my-radio>
<my-radio v-model="allTui" :disabled="option.productId=='-999'"></my-radio>
</view>
</view>
<view class="u-m-t-24 u-font-24 u-font-24">
<text class="color-red">*</text>
<text>客座费只能全退</text>
</view>
<view class="bg-fff border-r-12 list u-m-t-32">
<view class="u-flex u-row-between border-top item u-p-t-32 u-p-b-32"
v-for="(item,index) in orderDetail.goodsList" :key="index">
@@ -14,6 +18,15 @@
<view class="u-m-t-10 color-999 u-font-24">{{item.productSkuName||""}}</view>
<view class="u-m-t-10 color-999 u-font-24">最多可退×{{item.num}}</view>
</view>
<template v-if="option.productId=='-999'">
<view class="u-flex">
<view class="color-red">{{item.priceAmount}}</view>
<view class="u-flex u-m-l-32 u-col-center">
<view class="u-m-l-28 u-m-r-28">x{{item.number}}</view>
</view>
</view>
</template>
<template v-else>
<view class="u-flex">
<view class="color-red">{{item.priceAmount}}</view>
<view class="u-flex u-m-l-32 u-col-center">
@@ -23,6 +36,7 @@
name="plus-circle-fill"></up-icon>
</view>
</view>
</template>
</view>
</view>
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between">
@@ -139,6 +153,9 @@
}
function changeItem(item, step) {
if(item.productId=='-999'){
return
}
console.log(item);
let newval = item.number * 1 + step * 1;
if (newval <= 0) {
@@ -179,9 +196,14 @@
uni.navigateBack({delta:1})
},500)
}
const option=reactive({})
const option=reactive({
productId:'-999'
})
onLoad((opt) => {
Object.assign(option,opt)
if(opt.productId=='-999'){
allTui.value=true
}
if (Array.isArray(opt)) {
orderDetail.goodsList = opt
} else {