Commit 83b83478 authored by 潘永坪's avatar 潘永坪

组合下单页面开发

parent 24e3e559
......@@ -8,7 +8,7 @@ import commonjs from 'common/common.js'
Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request
Vue.prototype.$wxurl = 'https://lx.pangdly.com/#/'
Vue.prototype.$wxurl = 'https://wx.pangdly.com/#/'
Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png'
Vue.use(uView)
uni.$u.config.unit = 'rpx'
......
<template>
<u-popup :show="showPop" :round="20" @close="showPop=false" closeable>
<u-popup :show="showPop" :round="20" @close="confirm()" closeable>
<view class="son-wrap">
<view class="time-title">
时间选择
......@@ -14,15 +14,17 @@
:key="index" v-if="item.last>0">
<view>
{{item.startPlanTime?item.startPlanTime.substr(0,5):""}}
<text v-if="item.endPlanTime">-</text>
{{item.endPlanTime?item.endPlanTime.substr(0,5):""}}
<text v-if="!item.saleOnlyShowFromDate">
-{{item.endPlanTime?item.endPlanTime.substr(0,5):""}}
</text>
</view>
<view>
剩余:{{item.last}}
<text v-if="item.copyLast!='余票充足'&&item.copyLast!='售罄'">剩余:</text>
{{item.copyLast}}
</view>
</view>
</view>
<view style="padding: 0.5rem 0rem;color: #FF0000;" v-else>
<view style="padding:50rpx 0;color: #FF0000;" v-else>
空空如也...
</view>
<view class="time-sure">
......@@ -37,7 +39,7 @@
<script>
export default {
props: ['chooseTimeList', 'chooseTimeData', 'timeActive'],
props: ['chooseTimeList', 'timeActive'],
watch: {
timeActive: { //父组件选中的下标
handler(newValue, oldValue) {
......@@ -53,25 +55,20 @@ export default {
return {
showPop: false, //控制该组件显示隐藏
active: 10000, //默认不选中
times: '', //时间
timeNumber: '', //当前时间转化为数字
}
},
methods: {
//---时间选择
chooseTime(i) {
this.active = i
this.times = this.chooseTimeList[i].startPlanTime
},
//---时间确认事件
confirm(date) {
confirm() {
this.showPop = false
this.$emit('timeConfig', this.times)
},
},
mounted() {
let times = new Date().Format('yyyy-MM-dd hh:mm:ss')
this.timeNumber = parseInt(this.$commonjs.changeTime(times))
if(this.active!=10000){
this.$emit('timeConfig', this.active)
}
}
}
}
</script>
......
......@@ -91,13 +91,13 @@
<view class="time-list" v-for="(item, index) of timeList" @click="chooseTime(index)" :class="{ on: timeActive == index }" :key="index">
<view>
{{ item.startPlanTime ? item.startPlanTime.substr(0, 5) : '' }}
<text v-if="item.endPlanTime&&!item.saleOnlyShowFromDate">
<text v-if="!item.saleOnlyShowFromDate">
-{{ item.endPlanTime ? item.endPlanTime.substr(0, 5) : '' }}
</text>
</view>
<view>
<text v-if="item.copyLast!='余票充足'&&item.copyLast!='售罄'">剩余:</text>
{{ item.last }}
{{ item.copyLast }}
</view>
<view v-if="timeActive == index" class="date-icon">
<u-icon name="checkmark" color="#ffffff"></u-icon>
......@@ -329,7 +329,7 @@
:sortArr="sortArr"
:defaultAreaCode="defaultAreaCode"
></chooseArea>
<times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :chooseTimeData="chooseTimeData" :timeActive="timeActive"></times>
<times ref="times" :chooseTimeList="timeList" @timeConfig="timeConfig" :timeActive="timeActive"></times>
<editContacts ref="editContacts" :editContact="editContact" :contactTotal="contactTotal"></editContacts>
<contactList
ref="contactList"
......@@ -420,7 +420,6 @@ export default {
chooseContact: [], //选中的游客信息列表
contactNum: 1, //需要选择几位联系人数量
cruisePlanId: '', //班次Id
chooseTimeData: '', //选中的时间传给子组件
timeNumber: '', //当前时间转化为数字
startDate: '', //开始日期
endDate: '', //结束日期
......@@ -589,7 +588,7 @@ export default {
})
this.dateChoose(index) //选中确认的日期
this.docQuery.selectAll('.date-list').boundingClientRect(data => {
this.dateScroll = (data[index].width + 4) * index
this.dateScroll = (data[index].width + 6) * index
}).exec()
},
//---展示更多时间
......@@ -601,7 +600,6 @@ export default {
if(this.timeList[i].copyLast!='售罄'){
this.timeActive = i
this.cruisePlanId = this.timeList[i].cruisePlanId //获取班次Id
this.chooseTimeData = this.timeList[i].startPlanTime
this.maxBookNum = Math.min(this.timeList[i].last, this.productIfo.maxBookNum) //获取剩余库存
//如果为班次票,开始时间为班次时间的开始时间,结束时间为班次时间的结束时间,班次时间的结束时间为空时,结束时间为班次时间的开始时间
this.startPlayTime = this.timeList[i].startPlanTime
......@@ -609,17 +607,11 @@ export default {
}
},
//---时间确认事件
timeConfig(data) {
let index = this.timeList.findIndex(item => {
return item.startPlanTime == data
})
if (index > -1) {
//子组件点击确认之后有选择的时间
this.chooseTime(index) //选中确认的日期
this.docQuery.selectAll('.time-list').boundingClientRect(data => {
this.timeScroll = (data[index].width + 4) * index
}).exec()
}
timeConfig(index) {
this.chooseTime(index) //选中确认的日期
this.docQuery.selectAll('.time-list').boundingClientRect(data => {
this.timeScroll = (data[index].width + 6) * index
}).exec()
},
//---获取点击的编辑联系人信息,传给编辑联系人组件
getEditContact(data) {
......@@ -1713,8 +1705,7 @@ export default {
max-width: 750rpx;
z-index: 10;
padding: 0 24rpx 0 40rpx;
box-sizing: border-box;
box-shadow: 0 0 3rpx #666666;
box-shadow: 0px 4px 12px rgba(0,0,0,0.16)
}
.bottom-left > text:first-child {
font-size: 28rpx;
......
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