Commit b5d1a654 authored by 罗超's avatar 罗超

修改BUG

parent ecb232b4
......@@ -14,7 +14,13 @@
</view>
<view class="row items-center" v-for="(x,i) in showGuests" style="padding: 30rpx 0;">
<u-checkbox-group>
<u-checkbox :disabled="!x.Checked && !canChecked && x.year>1" shape="circle" v-model="x.Checked" active-color="#B99846"></u-checkbox>
<u-checkbox
:disabled="!x.Checked && !canChecked && x.year>1"
shape="circle"
v-model="x.Checked"
@change="checkedChange"
active-color="#B99846"
></u-checkbox>
</u-checkbox-group>
<view class="col q-ml-md q-mr-md" @click="setCheckStatusHandle(x)">
<view class="row items-center">
......@@ -74,11 +80,7 @@
components:{GuestList},
computed: {
showGuests() {
this.guests.forEach(x=>{
if(x.Checked) x.Display=true
})
const r = this.guests.filter(x=>x.Display)
return r
return this.guests.filter(x => x.Checked || x.Display);
},
crCount(){
const r = this.guests.filter(x=>x.year>=12 && x.Checked)
......@@ -115,25 +117,44 @@
},
created() {
if(uni.getStorageSync('guest')){
this.guests = uni.getStorageSync('guest').filter(x=>x.Id!='')
// this.guests = uni.getStorageSync('guest').filter(x=>x.Id!='')
this.guests.forEach((x,i)=>{
x.Checked=false
x.Display=i==0
})
this.calcYearHandle()
// this.guests.forEach((x,i)=>{
// x.Checked=false
// x.Display=i==0
// })
// this.calcYearHandle()
this.guests = uni.getStorageSync('guest')
.filter(x => x.Id != '')
.map((x, i) => ({
...x,
Checked: false,
Display: i === 0,
year: this.calculateAge(x.BirthDay)
}));
this.chosenGuest = this.guests.slice(0, 1)
}
},
methods:{
setCheckStatusHandle(x){
if(!x.Checked && !this.canChecked && x.year>1) return
// if(!x.Checked && !this.canChecked && x.year>1) return
const g = this.guests.find(t=>x.Id==t.Id)
if(g){
g.Checked = !g.Checked
}
// const g = this.guests.find(t=>x.Id==t.Id)
// if(g){
// g.Checked = !g.Checked
// }
//console.log('setCheckStatusHandle',x.Checked)
if (!x.Checked && !this.canChecked && x.year > 1) return;
const index = this.guests.findIndex(t => x.Id === t.Id);
if (index !== -1) {
// 使用 Vue.set 或替换整个对象确保响应性
this.$set(this.guests, index, {
...this.guests[index],
Checked: !this.guests[index].Checked,
Display: true // 确保选中后显示在列表中
});
}
},
chosenListHandle(){
this.listVisible=true
......
......@@ -379,7 +379,7 @@
</view>
<view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items">
<view class="label"> 在线支付 </view>
<view class="label"> 商品总价 </view>
<view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ total }}</text>
<text class="red">{{ price }}</text>
......@@ -677,7 +677,14 @@
Income: 0,
Refund: 0,
MallBaseId: this.userInfo.MallBaseId,
CreateBy:0
};
// #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
msg.CreateBy = this.customer.salesBaseInfo.employeeId
}
// #endif
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
......@@ -1184,6 +1191,11 @@
// #endif
orderForm: 4,// 订单来源 4-小程序
};
// #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
msg.CreateBy = this.customer.salesBaseInfo.employeeId
}
// #endif
if (this.realCurrentPriceInfo.priceUnion) {
msg.DepartureCityId = this.realCurrentPriceInfo.priceUnion.unionCityId
msg.IsIntermodal = 1
......
......@@ -446,17 +446,10 @@
</view>
<view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items">
<view class="label"> 在线支付 </view>
<view class="label"> 商品总价 </view>
<view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ orderData.model.GuestNum }}</text>
<text class="red">
<template v-if=" orderData.model.DiscountMoney&&orderData.model.DiscountMoney>0">
{{ Number(orderData.model.PreferPrice) -Number(orderData.model.DiscountMoney)}}
</template>
<template v-else>
{{ orderData.model.PreferPrice }}
</template>
</text>
<text class="red">{{ orderData.model.PreferPrice }}</text>
</view>
</view>
<view class="form-items" style="border-bottom: none">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment