chenkainan 4 months ago
parent
commit
aec7343fd6
  1. 26
      pages/cart/cart.vue

26
pages/cart/cart.vue

@ -16,13 +16,12 @@
<view style="font-size: 27rpx;color: #7C7C7C;" @click.stop="delCartByShop(item,index)">删除</view> <view style="font-size: 27rpx;color: #7C7C7C;" @click.stop="delCartByShop(item,index)">删除</view>
</view> </view>
<uni-swipe-action-item v-for="(goods,goodsIndex) in item.goods" :key="goodsIndex" > <uni-swipe-action-item v-for="(goods,goodsIndex) in item.goods" :key="goodsIndex" >
<view class="cart-item" :style="{'padding-bottom':goods.product.type=='hotel'?'60rpx':'20rpx'}" <view class="cart-item" :style="{'padding-bottom':goods.product.type=='hotel'?'60rpx':'20rpx'}">
@click.stop="gotoDetailByType(goods.product)">
<view class="flex-between"> <view class="flex-between">
<view class="no-select" v-show="!goods.is_seld" @click.stop="changeGoodsSelect(goods,true)"></view> <view class="no-select" v-show="!goods.is_seld" @click.stop="changeGoodsSelect(goods,true)"></view>
<image class="select-img" v-show="goods.is_seld" @click.stop="changeGoodsSelect(goods,false)" src="https://static.ticket.sz-trip.com/uploads/20250617/c87afc2e461a01af35c71fb46ef0859d.png"></image> <image class="select-img" v-show="goods.is_seld" @click.stop="changeGoodsSelect(goods,false)" src="https://static.ticket.sz-trip.com/uploads/20250617/c87afc2e461a01af35c71fb46ef0859d.png"></image>
<view class="cart-img" style="position: relative;"> <view class="cart-img" style="position: relative;">
<image class="cart-img" :src="goods.sku.headimg" mode="aspectFill"></image> <image class="cart-img" :src="goods.sku.headimg" mode="aspectFill" @click.stop="gotoDetailByType(goods.product)"></image>
<view class="use-type"> <view class="use-type">
{{goods.sku.use_type==1?"自提":goods.sku.use_type==2?"核销": {{goods.sku.use_type==1?"自提":goods.sku.use_type==2?"核销":
goods.sku.use_type==3?"邮寄或自提":"邮寄"}} goods.sku.use_type==3?"邮寄或自提":"邮寄"}}
@ -218,7 +217,7 @@
if (v.sku.flag== "off") { if (v.sku.flag== "off") {
v.is_seld = false v.is_seld = false
} else { } else {
if (v.product.type == 'hotel'&&(!v.strat_time||!v.end_time)) { if (v.product.type == 'hotel'&&(!v.startDay||!v.endDay)) {
v.is_seld = false v.is_seld = false
} else { } else {
v.is_seld = true v.is_seld = true
@ -241,7 +240,7 @@
if (v.sku.flag== "off") { if (v.sku.flag== "off") {
v.is_seld = false v.is_seld = false
} else { } else {
if (v.product.type == 'hotel'&&(!v.strat_time||!v.end_time)) { if (v.product.type == 'hotel'&&(!v.startDay||!v.endDay)) {
v.is_seld = false v.is_seld = false
} else { } else {
v.is_seld = true v.is_seld = true
@ -263,7 +262,7 @@
if (item.sku.flag== "off") { if (item.sku.flag== "off") {
item.is_seld = false item.is_seld = false
} else { } else {
if (item.product.type == 'hotel'&&(!item.strat_time||!item.end_time)) { if (item.product.type == 'hotel'&&(!item.startDay||!item.endDay)) {
item.is_seld = false item.is_seld = false
uni.showToast({ uni.showToast({
title:'酒店产品需要选择时间', title:'酒店产品需要选择时间',
@ -322,6 +321,7 @@
judgeHotelTime (data) { judgeHotelTime (data) {
this.$set(this.selectHotel, "startDay", data.startDay) this.$set(this.selectHotel, "startDay", data.startDay)
this.$set(this.selectHotel, "endDay", data.endDay) this.$set(this.selectHotel, "endDay", data.endDay)
this.$set(this.selectHotel, "differDays", data.differDays)
this.$refs.calendarPopup.close(); this.$refs.calendarPopup.close();
return return
this.Post({ this.Post({
@ -332,6 +332,7 @@
if (res && res.code && res.data) { if (res && res.code && res.data) {
this.$set(this.selectHotel, "startDay", data.startDay) this.$set(this.selectHotel, "startDay", data.startDay)
this.$set(this.selectHotel, "endDay", data.endDay) this.$set(this.selectHotel, "endDay", data.endDay)
this.$set(this.selectHotel, "differDays", data.differDays)
this.$refs.calendarPopup.close(); this.$refs.calendarPopup.close();
} else { } else {
uni.showToast({ uni.showToast({
@ -382,7 +383,17 @@
sInfo: {...v.sku, buyNum: v.num} sInfo: {...v.sku, buyNum: v.num}
}) })
} else if (v.product.type == "hotel") { } else if (v.product.type == "hotel") {
hotelOrderList.push(v) console.log(v)
v.sku.selectDate = {
startDay: v.startDay,
endDay: v.endDay,
differDays: v.differDays
}
v.sku.buyNum = v.num
v.allSeldDate = []
hotelOrderList.push({
skuInfo: v.sku
})
} }
}) })
@ -391,6 +402,7 @@
this.$store.commit("changeTicketOrderList", ticketOrderList); this.$store.commit("changeTicketOrderList", ticketOrderList);
this.$store.commit("changeFoodOrderList", foodOrderList); this.$store.commit("changeFoodOrderList", foodOrderList);
this.$store.commit("changeHotelOrderList", hotelOrderList); this.$store.commit("changeHotelOrderList", hotelOrderList);
uni.setStorageSync('hotelOrderInfo', JSON.stringify(hotelOrderList))
// > > > // > > >
this.goCartNextPage(0) this.goCartNextPage(0)

Loading…
Cancel
Save