Commit 5273d112 authored by 潘永坪's avatar 潘永坪

组合下单详情以及bug修复

parent e36a52c1
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<text class="no-time" v-if="item.timeList&&item.timeList.length==0"> 该日票种已售罄,请选择其他日期 </text> <text class="no-time" v-if="!item.timeList||item.timeList.length==0"> 该日票种已售罄,请选择其他日期 </text>
<text class="no-time" v-if="!item.startDate || !item.endDate"> 请先选游玩日期 </text> <text class="no-time" v-if="!item.startDate || !item.endDate"> 请先选游玩日期 </text>
<view class="timeMore" @click="showTime(item,index)"> <view class="timeMore" @click="showTime(item,index)">
<view class="time-more-content"> <view class="time-more-content">
...@@ -278,19 +278,13 @@ ...@@ -278,19 +278,13 @@
<calendar ref="calendar" @dateConfig="dateConfig" :dateList="chooseDateList" v-show="chooseDateList.length > 0"></calendar> <calendar ref="calendar" @dateConfig="dateConfig" :dateList="chooseDateList" v-show="chooseDateList.length > 0"></calendar>
<buyKnow ref="buyKnow" :buyKnowData="buyKnowData"></buyKnow> <buyKnow ref="buyKnow" :buyKnowData="buyKnowData"></buyKnow>
<detail <detail
ref="detail" ref="detail"
:sellTotal='sellTotal' :productList="productList"
:merchantName="productIfo.merchantName" :sellTotal="sellTotal"
:name="productIfo.name"
:buyNum="buyNum"
:sellingPrice="sellingPrice"
:chooseService="chooseService"
:productDepositTotal="productDepositTotal"
:chooseCouponObj="chooseCouponObj"
></detail> ></detail>
<chooseArea <chooseArea
v-if="showChooseArea" v-if="showChooseArea"
:areaList="productIfo.productAreaList" :areaList="productAreaList"
@areaSure="areaSure" @areaSure="areaSure"
:sortArr="sortArr" :sortArr="sortArr"
:defaultAreaCode="defaultAreaCode" :defaultAreaCode="defaultAreaCode"
...@@ -338,7 +332,7 @@ ...@@ -338,7 +332,7 @@
import calendar from '../scenicComponents/calendar' //日历组件 import calendar from '../scenicComponents/calendar' //日历组件
import buyKnow from '@/components/buyKnow.vue' //购票须知 import buyKnow from '@/components/buyKnow.vue' //购票须知
import orderCoupon from '@/components/orderCoupon' //优惠券 import orderCoupon from '@/components/orderCoupon' //优惠券
import detail from '../scenicComponents/detail.vue' //明细弹窗 import detail from '../scenicComponents/combiDetail.vue' //明细弹窗
import chooseArea from '../scenicComponents/chooseArea' //选择站点 import chooseArea from '../scenicComponents/chooseArea' //选择站点
import contactList from '../scenicComponents/contactList' //联系人弹窗 import contactList from '../scenicComponents/contactList' //联系人弹窗
import editContacts from '../scenicComponents/editContacts' //编辑联系人弹窗 import editContacts from '../scenicComponents/editContacts' //编辑联系人弹窗
...@@ -364,10 +358,6 @@ export default { ...@@ -364,10 +358,6 @@ export default {
companyId: '', //公司Id companyId: '', //公司Id
productList:[],//初始化产品数据 productList:[],//初始化产品数据
productIdList:[],//产品id列表入参 productIdList:[],//产品id列表入参
sortArr: [], //多个站点排号信息列表
sortIfo: '', //单个站点排号信息
sortInforPop: false, //一个站点时获取排队信息弹窗
showChooseArea: false, //控制选择站点弹窗显示隐藏
timeActive: 10000, //时间下标,默认不选中 timeActive: 10000, //时间下标,默认不选中
buyKnowData: '', //购买须知数据 buyKnowData: '', //购买须知数据
editContact: '', //编辑联系人传值对象 editContact: '', //编辑联系人传值对象
...@@ -393,6 +383,12 @@ export default { ...@@ -393,6 +383,12 @@ export default {
originalTotal:0,//原价总价 originalTotal:0,//原价总价
sellTotal:0,//卖价总价 sellTotal:0,//卖价总价
maxBookNum:999,//最大购买数量 maxBookNum:999,//最大购买数量
productAreaList:[],//长江索道选择站点数据
sortArr: [], //多个站点排号信息列表
sortIfo: '', //单个站点排号信息
sortInforPop: false, //一个站点时获取排队信息弹窗
showChooseArea: false, //控制选择站点弹窗显示隐藏
defaultAreaCode:'',//默认站点
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -520,10 +516,18 @@ export default { ...@@ -520,10 +516,18 @@ export default {
//需要排号 //需要排号
if(item.isFetch==1){ if(item.isFetch==1){
this.areaIndex=index this.areaIndex=index
this.sortUpDown(item.merchantVo.code) this.sortUpDown(item)
} }
//默认选择每个产品第一个日期的值 //默认选择每个产品第一个日期的值
this.dateChoose(item,item.priceStockList[0],0) this.dateChoose(item,item.priceStockList[0],0)
//解决如果班次票不是第一个产品时,dateChoose方法里面不会执行下面代码
if(item.productType==3){
//productType=3为场次票
item.cruisePlanId=''
item.timeActive=10000
this.timeActive=10000
this.getTimeStock(item)
}
}else{ }else{
uni.showToast({title: '没有库存',icon: 'none'}) uni.showToast({title: '没有库存',icon: 'none'})
this.maxBookNum=0 this.maxBookNum=0
...@@ -546,9 +550,9 @@ export default { ...@@ -546,9 +550,9 @@ export default {
}) })
}, },
//---排号是否上下架---已修改 //---排号是否上下架---已修改
sortUpDown(merchantCode) { sortUpDown(item) {
let data = { let data = {
merchantCode //商户code merchantCode:item.merchantVo.code //商户code
} }
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
...@@ -556,39 +560,43 @@ export default { ...@@ -556,39 +560,43 @@ export default {
}) })
this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => { this.$request('distribution/distribution/findNewFetchInfoFromSceinc', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
this.sortArr = res.data.data this.sortArr = res.data.data||[]
let data = res.data let data = res.data
this.productList.forEach(item=>{ item.areaObj={}
if(item.productAreaList.length>1){ if(item.productAreaList.length>1){
//有库存并且需要选择两个站点以上的票种,显示区域组件 //有库存并且需要选择两个站点以上的票种,显示区域组件
for (let item2 in data.main) { for (let key in data.main) {
if (data.main[item2].sceneSortStatus == '1'){ if (data.main[key].sceneSortStatus == '1'){
//上架 //上架
item.areaUp = true item.areaUp = true
if(item.defaultAreaCode){ this.productAreaList=item.productAreaList
//有默认的站点 if(item.defaultAreaCode){
item.areaObj={} //有默认的站点
item.areaObj.areaCode=item.areaCode this.defaultAreaCode=item.defaultAreaCode
item.areaObj.areaName=item.areaName item.productAreaList.forEach(item2=>{
}else{ if(item2.areaCode==item.defaultAreaCode){
item.areaObj={} item.areaObj.areaCode=item2.areaCode
} item.areaObj.areaName=item2.areaName
//暂时下面只适应长江索道 }
this.showChooseArea = true })
} }
} //暂时下面只适应长江索道
}else if (item.productAreaList.length == 1) { this.showChooseArea = true
//只有一个站点时,直接选中站点(现目前还没有一个站点的景区) }
for (let item in data.main) { }
if (data.main[item].sceneSortStatus == '1') { }
//上架 if (item.productAreaList.length == 1) {
item.areaUp = true //只有一个站点时,直接选中站点(现目前还没有一个站点的景区)
item.areaObj.areaCode = item.productAreaList[0].areaCode for (let item in data.main) {
item.areaObj.areaName = item.productAreaList[0].areaName if (data.main[item].sceneSortStatus == '1') {
} //上架
} item.areaUp = true
} item.areaObj.areaCode = item.productAreaList[0].areaCode
}) item.areaObj.areaName = item.productAreaList[0].areaName
}
}
}
} }
}) })
}, },
...@@ -607,7 +615,7 @@ export default { ...@@ -607,7 +615,7 @@ export default {
}) })
this.$request('distribution/distribution/getTimeStock', data).then(res => { this.$request('distribution/distribution/getTimeStock', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
item.timeList=res.data item.timeList=res.data||[]
//增加一个时间Number字段,用于判断当前时间大于班次结束时间时,显示售罄 //增加一个时间Number字段,用于判断当前时间大于班次结束时间时,显示售罄
item.timeList.forEach(item2=>{ item.timeList.forEach(item2=>{
let text=parseFloat((item2.last/item2.total).toFixed(2))||0 let text=parseFloat((item2.last/item2.total).toFixed(2))||0
...@@ -695,7 +703,6 @@ export default { ...@@ -695,7 +703,6 @@ export default {
//---获取排号信息---暂时未使用 //---获取排号信息---暂时未使用
getSortInfor(merchantCode) { getSortInfor(merchantCode) {
let data = { let data = {
areaCode: this.areaObj.areaCode,
merchantCode //商户code merchantCode //商户code
} }
uni.showLoading({ uni.showLoading({
...@@ -717,6 +724,7 @@ export default { ...@@ -717,6 +724,7 @@ export default {
}, },
//---获取子组件的传值---已修改 //---获取子组件的传值---已修改
areaSure(data) { areaSure(data) {
console.log(this.areaIndex)
this.productList[this.areaIndex].areaObj=data this.productList[this.areaIndex].areaObj=data
}, },
//---展示选择站点---已修改 //---展示选择站点---已修改
...@@ -758,18 +766,15 @@ export default { ...@@ -758,18 +766,15 @@ export default {
this.$refs.calendar.defaultDate=item.chooseDate//日历组件选中日期 this.$refs.calendar.defaultDate=item.chooseDate//日历组件选中日期
item.endDate=item2.endTime//开始日期 item.endDate=item2.endTime//开始日期
item.startDate=item2.startTime//结束日期 item.startDate=item2.startTime//结束日期
if(item.productType==3){
//productType=3为场次票
item.cruisePlanId=''
item.timeActive=10000
this.timeActive=10000
uni.$u.throttle(()=>{
this.getTimeStock(item)
this.initCoupon(item)
},3000)
}
uni.$u.throttle(()=>{ uni.$u.throttle(()=>{
this.initCoupon(item) this.initCoupon(item)
if(item.productType==3){
//productType=3为场次票
item.cruisePlanId=''
item.timeActive=10000
this.timeActive=10000
this.getTimeStock(item)
}
},3000) },3000)
this.computedPrice() this.computedPrice()
//解决点击日期无反应的情况 //解决点击日期无反应的情况
......
<template> <template>
<view class="area-box"> <view class="area-bg">
<view class="top" @click="closeSon()"> <view class="area-wrap">
<view class="top-left"> <view class="top" @click="closeSon()">
选择(索道)出发站点 <view class="top-left">
</view> 选择(索道)出发站点
<view>
<u-icon name="close" bold></u-icon>
</view>
</view>
<!-- 没有默认站点时-->
<template v-if="!defaultAreaCode">
<view class="bottom">
<view class="bottom1">
<view>
您所在位置距离“{{areaList[distanceIndex].areaName}}”较近
</view>
<view class="bottom1-choose">
建议选择<text>{{areaList[distanceIndex].areaName}}</text>
</view>
<view class="bottom1-btn">
<text class="btn" @click="chooseArea(item)" v-for="(item,index) of areaList" :key="index">
{{item.areaName}}
</text>
</view>
</view> </view>
<view>
<view class="bottom2"> <u-icon name="close" bold></u-icon>
<image src="../static/scenic/chooseArea.jpg" mode="widthFix"></image>
<view style="margin-top: 20rpx;">选错站点可导致排队号码无效。</view>
<view>若无法确定站点,请向索道工作人员咨询。</view>
</view> </view>
</view> </view>
<!-- 没有默认站点时-->
<view class="pop-wrap" v-show="showPop"> <template v-if="!defaultAreaCode">
<view class="pop-content"> <view class="bottom">
<view> <view class="bottom1">
<text> <view>
选择的站点是: 所在位置距离“{{areaList[distanceIndex].areaName}}”较近
</text> </view>
<text> <view class="bottom1-choose">
{{areaObj.areaName}} 建议选择<text>{{areaList[distanceIndex].areaName}}</text>
</view>
</text> <view class="bottom1-btn">
<text class="btn" @click="chooseArea(item)" v-for="(item,index) of areaList" :key="index">
{{item.areaName}}
</text>
</view>
</view> </view>
<template v-if="sortIfo"> <view class="bottom2">
<image src="../static/scenic/chooseArea.jpg" mode="widthFix"></image>
<view style="margin-top: 20rpx;">选错站点可导致排队号码无效。</view>
<view>若无法确定站点,请向索道工作人员咨询。</view>
</view>
</view>
<view class="pop-wrap" v-show="showPop">
<view class="pop-content">
<view> <view>
<text> <text>
当前排队人数 您选择的站点是
</text> </text>
<text> <text>
{{sortIfo.peopleNumber}} {{areaObj.areaName}}
</text> </text>
</view> </view>
<view> <template v-if="sortIfo">
<view>
<text>
当前排队人数:
</text>
<text>
{{sortIfo.peopleNumber}}
</text>
</view>
<view>
<text>
预计进入排队等候区时间:
</text>
<text>
{{sortIfo.sortTotalTime}}
</text>
</view>
</template>
<!-- <view>
<text> <text>
预计进入排队等候区时间 退票规则
</text> </text>
<text> <text>
{{sortIfo.sortTotalTime}} 不可退
</text>
</view> -->
<view>
返程时,根据现场情况需重新取号
</view>
<view v-if="!sortIfo" style="font-size:32rpx;color:#FC6703;">
未找到本站信息,请根据现场大屏幕信息合理购票
</view>
<view style="text-align: center;">
<text class="btn" @click="hidePop()" style="color: #555;margin-right: 48rpx;">
取消
</text>
<text class="btn" @click="sure()">
确定
</text> </text>
</view> </view>
</template>
<!-- <view>
<text>
退票规则:
</text>
<text>
不可退
</text>
</view> -->
<view>
返程时,根据现场情况需重新取号
</view>
<view v-if="!sortIfo" style="font-size:32rpx;color:#FC6703;">
未找到本站信息,请根据现场大屏幕信息合理购票
</view> </view>
<view style="text-align: center;">
<text class="btn" @click="hidePop()" style="color: #555;margin-right: 48rpx;">
取消
</text>
<text class="btn" @click="sure()">
确定
</text>
</view>
</view> </view>
</template>
<!-- 有默认站点时 -->
<view v-else class="defaultArea">
<view>
<text>
当前站点:
</text>
<text>
{{areaObj.areaName}}
</text>
</view>
<view>
<text>
当前排队人数:
</text>
<text>
{{sortIfo.peopleNumber}}
</text>
</view>
<view>
<text>
预计进入排队等候区时间:
</text>
<text>
{{sortIfo.sortTotalTime}}
</text>
</view>
<!-- <view>
<text>
退票规则:
</text>
</view> <text>
</template> 不可退
<!-- 有默认站点时 --> </text>
<view v-else class="defaultArea"> </view> -->
<view> <view>
<text> <image src="../static/scenic/chooseArea.jpg" mode="widthFix"></image>
当前站点: </view>
</text>
<text>
{{areaObj.areaName}}
</text>
</view>
<view>
<text>
当前排队人数:
</text>
<text>
{{sortIfo.peopleNumber}}
</text>
</view>
<view>
<text>
预计进入排队等候区时间:
</text>
<text>
{{sortIfo.sortTotalTime}}
</text>
</view>
<!-- <view>
<text>
退票规则:
</text>
<text> <view>
不可退 <a class="btn" @click="closeSon()">确定</a>
</text> </view>
</view> --> </view>
<view>
<image src="../static/scenic/chooseArea.jpg" mode="widthFix"></image>
</view>
<view>
<a class="btn" @click="closeSon()">确定</a>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -172,12 +175,20 @@ export default { ...@@ -172,12 +175,20 @@ export default {
created() { created() {
//如果有默认站点 //如果有默认站点
if(this.defaultAreaCode&&this.sortArr.length>0){ if(this.defaultAreaCode&&this.sortArr.length>0){
//获取排号信息
this.sortArr.forEach(item=>{ this.sortArr.forEach(item=>{
if(item.projectId==this.defaultAreaCode){ if(item.projectId==this.defaultAreaCode){
this.sortIfo=item this.sortIfo=item
this.sortIfo.peopleNumber = Math.max(item.sortTotalCapacity-item.showEnd,0) this.sortIfo.peopleNumber = Math.max(item.sortTotalCapacity-item.showEnd,0)
} }
}) })
//获取站点信息
this.areaList.forEach(item=>{
if(item.areaCode==this.defaultAreaCode){
this.areaObj.areaCode=item.areaCode
this.areaObj.areaName=item.areaName
}
})
return return
} }
uni.getLocation({ uni.getLocation({
...@@ -247,14 +258,22 @@ export default { ...@@ -247,14 +258,22 @@ export default {
font-size:32rpx; font-size:32rpx;
font-weight: bold; font-weight: bold;
} }
.area-box{ .area-bg{
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index:99; z-index:99;
background:rgba(0,0,0,0.4);
padding-top: 100rpx;
}
.area-wrap{
height: 100%;
display: flex;
flex-direction: column;
background: #ECF3FE; background: #ECF3FE;
border-radius: 20rpx;
} }
.top{ .top{
display: flex; display: flex;
...@@ -263,6 +282,7 @@ export default { ...@@ -263,6 +282,7 @@ export default {
height: 80rpx; height: 80rpx;
align-items: center; align-items: center;
padding: 0 24rpx; padding: 0 24rpx;
border-radius: 20rpx;
} }
.top-left{ .top-left{
flex: 1; flex: 1;
......
<template>
<u-popup :show="showPop" :round="20" @close="showPop = false" closeable>
<view class="son-wrap">
<view class="detail-title"> 费用明细 </view>
<view style="flex: 1; overflow-y: scroll">
<view v-for="(item, index) of productList" :key="index" class="list-wrap">
<view class="list">
<view> {{ item.merchantName }}({{ item.name }}) </view>
<view>
¥{{ item.sellingPrice }}x{{ item.buyNum }}
<!-- <small v-if="item.deposit">
押金:¥{{ item.deposit }}
<span v-if="item.depositType == 2">x{{ item.buyNum }}</span>
</small> -->
</view>
</view>
<view class="list" v-if="item.chooseCouponObj && item.chooseCouponObj.savedMoney > 0">
<view></view>
<view>
<text style="font-size:36rpx;">
{{ parseFloat(item.chooseCouponObj.savedMoney.toFixed(2))}}
</text>
</view>
</view>
</view>
<view class="detail-bottom">
<text> 合计 </text>
<text> ¥{{ sellTotal }} </text>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: ['productList', 'sellTotal'],
data() {
return {
showPop: false, //控制弹窗显示隐藏
}
},
methods: {
//---展示该组件
showDetail() {
this.showPop = true
}
}
}
</script>
<style scoped="scoped" lang="scss">
.son-wrap {
position: relative;
height: 65vh;
display: flex;
flex-direction: column;
}
.detail-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
padding: 30rpx 24rpx;
border-radius: 20rpx 20rpx 0 0;
}
.list-wrap {
border-bottom: 1px solid #f0f0f0;
padding: 0 30rpx;
}
.list{
height:120rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.list view:last-child {
text-align: right;
flex-shrink: 0;
margin-left:20rpx;
}
.detail-bottom {
display: flex;
justify-content: space-between;
color: $red;
font-weight: bold;
align-items: center;
padding:40rpx 30rpx;
font-size: 32rpx;
}
</style>
...@@ -176,13 +176,14 @@ export default { ...@@ -176,13 +176,14 @@ export default {
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: 999; z-index: 999;
padding-top: 120rpx; padding-top: 100rpx;
} }
.list-wrap{ .list-wrap{
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #ffffff; background: #ffffff;
border-radius: 20rpx;
} }
.top-num{ .top-num{
height: 100rpx; height: 100rpx;
......
...@@ -146,13 +146,14 @@ export default { ...@@ -146,13 +146,14 @@ export default {
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: 1000; z-index: 1000;
padding-top: 120rpx; padding-top: 100rpx;
} }
.edit-wrap{ .edit-wrap{
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #ffffff; background: #ffffff;
border-radius: 20rpx;
} }
.return { .return {
height: 100rpx; height: 100rpx;
......
...@@ -697,7 +697,7 @@ export default { ...@@ -697,7 +697,7 @@ export default {
}) })
this.$request('distribution/distribution/getTimeStock', data).then(res => { this.$request('distribution/distribution/getTimeStock', data).then(res => {
if (res.code == '00') { if (res.code == '00') {
this.timeList = res.data this.timeList = res.data||[]
this.timeList.forEach((item, index) => { this.timeList.forEach((item, index) => {
//增加一个时间Number字段,用于判断当前时间大于班次结束时间时,显示售罄 //增加一个时间Number字段,用于判断当前时间大于班次结束时间时,显示售罄
let text=parseFloat((item.last/item.total).toFixed(2))||0 let text=parseFloat((item.last/item.total).toFixed(2))||0
......
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