|
|
@ -97,8 +97,9 @@ |
|
|
|
<text>优惠券</text> |
|
|
|
<view style="display: flex;align-items: center;"> |
|
|
|
<view class="add-btn" v-if="!coupon">选择优惠券</view> |
|
|
|
<view style="display: flex;align-items: center;color: #6A8A2D;font-weight: bold;" v-if="coupon && coupon.CouponActivity"> |
|
|
|
<view>-¥{{coupon.CouponActivity.discounts/100}}</view> |
|
|
|
<view style="display: flex;align-items: center;color: #6A8A2D;font-weight: bold;" v-if="coupon && coupon.activity"> |
|
|
|
<view v-if="coupon.activity.discount_type == 'pricebreak'">-¥{{coupon.activity.money/100}}</view> |
|
|
|
<view v-else>{{coupon.activity.fold}}折</view> |
|
|
|
</view> |
|
|
|
<img src="https://static.ticket.sz-trip.com/changyoutaihu/images/user/rightIcon.png" class="icon-coupon"> |
|
|
|
</view> |
|
|
@ -121,17 +122,17 @@ |
|
|
|
<view class="popup-content-date"> |
|
|
|
<view class="popup-content-title flex"> |
|
|
|
<view class="flex-1 w-1rpx text-overflow"> |
|
|
|
{{skuInfo.title}} |
|
|
|
{{skuInfo.sku_name}} |
|
|
|
</view> |
|
|
|
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="closePopupRule" |
|
|
|
style="width: 31rpx;height: 31rpx;" class="flex-shrink-0"> |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
<view class="swipe-box" style="height: 347rpx;" v-if="skuInfo.list_images"> |
|
|
|
<view class="swipe-box" style="height: 347rpx;" v-if="skuInfo.listimg && skuInfo.listimg.length > 0"> |
|
|
|
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular |
|
|
|
indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff" |
|
|
|
@change="popSwiperChange" :current="0"> |
|
|
|
<swiper-item v-for="(item, index) in skuInfo.list_images.split(',')" :key="item.id"> |
|
|
|
<swiper-item v-for="(item, index) in skuInfo.listimg" :key="item.id"> |
|
|
|
<view class="swiper-item" style="height: 347rpx;"> |
|
|
|
<image class="item-img pop-swiper-image" :src="showImg(item)" mode="aspectFill"> |
|
|
|
</image> |
|
|
@ -140,13 +141,13 @@ |
|
|
|
</swiper> |
|
|
|
|
|
|
|
<view class="swiper-pointer" style="right:30rpx;bottom: 20rpx;"> |
|
|
|
{{popSwiperCurrent}}/{{skuInfo.list_images.split(',').length}} |
|
|
|
{{popSwiperCurrent}}/{{skuInfo.listimg.length}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="pop-detail-container"> |
|
|
|
<view class="pop-detail-title">房型信息</view> |
|
|
|
<view v-html="formateRichText(skuInfo.use_explain)"></view> |
|
|
|
<view v-html="formateRichText(skuInfo.sku_name)"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -188,6 +189,7 @@ |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.coupon = this.$store.state.user.coupon |
|
|
|
console.log(this.coupon) |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.initOrderDate() |
|
|
@ -252,10 +254,10 @@ |
|
|
|
this.price = ((disfferMoney * this.buyNum) || 0).toFixed(2) |
|
|
|
|
|
|
|
if(this.coupon) { |
|
|
|
if (this.coupon.percent == 0) { |
|
|
|
disfferMoney = disfferMoney - this.coupon.CouponActivity.discounts |
|
|
|
if (this.coupon.activity.discount_type == 'pricebreak') { |
|
|
|
disfferMoney = disfferMoney - this.coupon.activity.money |
|
|
|
} else{ |
|
|
|
disfferMoney = disfferMoney - (disfferMoney * this.coupon.CouponActivity.percent/100) |
|
|
|
disfferMoney = disfferMoney - (disfferMoney * this.coupon.activity.fold/10) |
|
|
|
} |
|
|
|
} |
|
|
|
return disfferMoney < 0 ? 0 : disfferMoney |
|
|
@ -294,28 +296,29 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let goods = [] |
|
|
|
let goodsItem = { |
|
|
|
num: this.buyNum, |
|
|
|
specifications_id: this.skuInfo.id, |
|
|
|
let data = { |
|
|
|
coupon_id: this.coupon ? this.coupon.id : null, |
|
|
|
product_list: [ |
|
|
|
{ |
|
|
|
type: 'hotel', |
|
|
|
customer_name: roomNames.toString(), |
|
|
|
reserve_mobile: this.phone, |
|
|
|
product_id: this.skuInfo.product_id, |
|
|
|
sku_id: this.skuInfo.id, |
|
|
|
start_date: this.selectDate.startDay, |
|
|
|
end_date: this.selectDate.endDay, |
|
|
|
product_num: this.buyNum |
|
|
|
} |
|
|
|
goods.push(goodsItem) |
|
|
|
|
|
|
|
let data = { |
|
|
|
goods: goods, |
|
|
|
reserve_name: roomNames.toString(), |
|
|
|
reserve_phone: this.phone, |
|
|
|
coupon_id: this.coupon ? this.coupon.id : null, |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
this.Post({ |
|
|
|
method: 'POST', |
|
|
|
data: JSON.stringify(data) |
|
|
|
}, '/api/order/place').then(res => { |
|
|
|
}, '/api/order/create').then(res => { |
|
|
|
console.log('成功'); |
|
|
|
if (res.code == 1) { |
|
|
|
return; |
|
|
|
uni.removeStorageSync('hotelOrderInfo') |
|
|
|
this.Post({ |
|
|
|
order_id: res.data.order_id, |
|
|
|