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

组合下单页面开发

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