Commit b5d1a654 authored by 罗超's avatar 罗超

修改BUG

parent ecb232b4
...@@ -14,7 +14,13 @@ ...@@ -14,7 +14,13 @@
</view> </view>
<view class="row items-center" v-for="(x,i) in showGuests" style="padding: 30rpx 0;"> <view class="row items-center" v-for="(x,i) in showGuests" style="padding: 30rpx 0;">
<u-checkbox-group> <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> </u-checkbox-group>
<view class="col q-ml-md q-mr-md" @click="setCheckStatusHandle(x)"> <view class="col q-ml-md q-mr-md" @click="setCheckStatusHandle(x)">
<view class="row items-center"> <view class="row items-center">
...@@ -74,11 +80,7 @@ ...@@ -74,11 +80,7 @@
components:{GuestList}, components:{GuestList},
computed: { computed: {
showGuests() { showGuests() {
this.guests.forEach(x=>{ return this.guests.filter(x => x.Checked || x.Display);
if(x.Checked) x.Display=true
})
const r = this.guests.filter(x=>x.Display)
return r
}, },
crCount(){ crCount(){
const r = this.guests.filter(x=>x.year>=12 && x.Checked) const r = this.guests.filter(x=>x.year>=12 && x.Checked)
...@@ -115,25 +117,44 @@ ...@@ -115,25 +117,44 @@
}, },
created() { created() {
if(uni.getStorageSync('guest')){ 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)=>{ // this.guests.forEach((x,i)=>{
x.Checked=false // x.Checked=false
x.Display=i==0 // x.Display=i==0
}) // })
this.calcYearHandle() // 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) this.chosenGuest = this.guests.slice(0, 1)
} }
}, },
methods:{ methods:{
setCheckStatusHandle(x){ 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) // const g = this.guests.find(t=>x.Id==t.Id)
if(g){ // if(g){
g.Checked = !g.Checked // g.Checked = !g.Checked
} // }
//console.log('setCheckStatusHandle',x.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(){ chosenListHandle(){
this.listVisible=true this.listVisible=true
......
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
</view> </view>
<view class="jz_form" style="margin: 40rpx 0; padding: 0"> <view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items"> <view class="form-items">
<view class="label"> 在线支付 </view> <view class="label"> 商品总价 </view>
<view class="val f14 regular" style="text-align: right"> <view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ total }}</text> <text style="margin-right: 30rpx">{{ total }}</text>
<text class="red">{{ price }}</text> <text class="red">{{ price }}</text>
...@@ -677,7 +677,14 @@ ...@@ -677,7 +677,14 @@
Income: 0, Income: 0,
Refund: 0, Refund: 0,
MallBaseId: this.userInfo.MallBaseId, 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) => { this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo) this.orderInfo =JSON.parse(res.data.sPayInfo)
...@@ -1184,6 +1191,11 @@ ...@@ -1184,6 +1191,11 @@
// #endif // #endif
orderForm: 4,// 订单来源 4-小程序 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) { if (this.realCurrentPriceInfo.priceUnion) {
msg.DepartureCityId = this.realCurrentPriceInfo.priceUnion.unionCityId msg.DepartureCityId = this.realCurrentPriceInfo.priceUnion.unionCityId
msg.IsIntermodal = 1 msg.IsIntermodal = 1
......
...@@ -446,17 +446,10 @@ ...@@ -446,17 +446,10 @@
</view> </view>
<view class="jz_form" style="margin: 40rpx 0; padding: 0"> <view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items"> <view class="form-items">
<view class="label"> 在线支付 </view> <view class="label"> 商品总价 </view>
<view class="val f14 regular" style="text-align: right"> <view class="val f14 regular" style="text-align: right">
<text style="margin-right: 30rpx">{{ orderData.model.GuestNum }}</text> <text style="margin-right: 30rpx">{{ orderData.model.GuestNum }}</text>
<text class="red"> <text class="red">{{ orderData.model.PreferPrice }}</text>
<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>
</view> </view>
</view> </view>
<view class="form-items" style="border-bottom: none"> <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