刘翔宇-旅管家 3 years ago
parent 899876963e
commit 066c0cbdfe

@ -281,7 +281,7 @@
methods: {
init() {
//
this.$emit('monthSelected', this.selected)
//this.$emit('monthSelected', this.selected)
this.$nextTick(() => {
//
// nvue$nextTick100%

@ -80,13 +80,13 @@
<view class="box-footer-left">
<view class="box-button" @click="openAdd">
<u-icon name="plus" color="#EF9525"></u-icon>
<text class="box-button-txt">添加观众</text>
<text class="box-button-txt">添加参与人</text>
</view>
</view>
<view class="box-footer-right" v-if="type=='team'">
<view class="box-button" @click="selectFile">
<u-icon name="plus" color="#EF9525"></u-icon>
<text class="box-button-txt">批量导入观众</text>
<text class="box-button-txt">批量导入参与人</text>
</view>
</view>
</view>

@ -75,13 +75,16 @@
<view class="book-box-timerow">
<view class="book-box-row-timeitem" v-for="(item,index) in currentDate.rules"
:class="{'book-box-row-timeitem-on':item.checked}" :key="index"
@click="handleSelectTime(index)">
:class="{'book-box-row-timeitem-on':item.checked,'timeitem-none':item.remain_count==0}"
:key="index" @click="handleSelectTime(index)">
<view class="book-box-row-timeitem-status" v-if="item.checked">
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view>
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<view class="book-box-row-timeitem-txt">{{item.remain_count}}</view>
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0">
{{item.remain_count}}
</view>
<view class="book-box-row-timeitem-txt" v-else></view>
</view>
</view>
</view>
@ -195,8 +198,7 @@
this.showCalendar = false;
},
handleSelectDate(e) {
console.log(e)
if (e.length != 0 && (e[0] != this.currentDate.date)) {
if (e.length != 0) {
this.load3Day(e[0]);
this.showCalendar = false;
}
@ -242,26 +244,24 @@
m.checked = false;
}
cdate.checked = true;
let i = 0;
for (var m of cdate.rules) {
m.checked = false;
m.checked = i == 0
if (m.checked) {
this.currentTime = m;
}
i++;
}
this.loadDefaultTime(cdate.rules);
this.currentDate = cdate;
this.listDatePrice = list;
this.$forceUpdate();
},
handleSelectTime(index) {
var mod = this.currentDate.rules[index];
if (mod.remain_count == 0) {
this.util.toast("该时段已售罄");
return false
}
for (var m of this.currentDate.rules) {
m.checked = false;
}
this.currentDate.rules[index].checked = true;
this.currentTime = this.currentDate.rules[index];
mod.checked = true;
this.currentTime = mod;
this.$forceUpdate();
},
openActivity() {
@ -317,6 +317,15 @@
this.showBook = false;
},
tobook(type) {
if (this.util.isNull(this.currentDate.date)) {
this.util.toast("请选择预约的日期");
return false;
}
if (this.util.isNull(this.currentTime.id)) {
this.util.toast("请选择预约的时段");
return false;
}
uni.navigateTo({
url: "/pages/visit/book?from=" + type + "&currentDate=" + JSON.stringify(this.currentDate) +
"&currentTime=" + JSON.stringify(this.currentTime)
@ -378,26 +387,47 @@
m.week = "后天";
} else {
m.week = week;
}
if (m.date == selectDate ) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
let idx = 0;
for (var mod of m.rules) {
mod.checked = false;
mod.checked = idx == 0;
if (mod.checked) {
that.currentTime = mod;
}
idx++;
}
if (m.date == selectDate) {
if (m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
that.loadDefaultTime(m.rules);
} else {
uni.showToast({
icon: "none",
title: selectDate + "不可以预约",
complete() {
setTimeout(function() {
that.load3Day(that.$moment(selectDate).add('days', 1)
.format("yyyy-MM-DD"))
}, 2000)
}
}, 2000)
}
}
}
i++;
}
})
},
loadDefaultTime(rules) {
var that = this;
that.currentTime = {};
let isDefault = false;
for (var mod of rules) {
mod.checked = false;
if (!isDefault && mod.remain_count > 0) {
isDefault = true;
mod.checked = true;
that.currentTime = mod;
}
}
},
loadCalendar(sdate, edate, cb) {
var that = this;
this.util.request({
@ -422,7 +452,9 @@
@import url("@/static/css/bookbox.css");
.timeitem-none {
color: #ccc;
}
.content {

@ -67,7 +67,10 @@
<u-icon :name="(item.checked?'checkmark-circle-fill':'checkmark-circle')"
color="#EF9525">
</u-icon>
<view class="box-tiptxt" style="margin-left: 10rpx;">请认真阅读知悉并遵守实训基地预约停车须知</view>
<view class="box-tiptxt" style="margin-left: 10rpx;">
活动时间{{item.activity.start_time}}
报名数量{{item.total}}</text>
</view>
</view>
</block>
</view>
@ -101,7 +104,9 @@
checkUser: false,
car_type: 1,
type: "1",
car_park_id: 0
car_park_id: 0,
activity_order_id: "",
visit_order_id: ""
},
listOrder: [],
listActivtyOrder: [],
@ -148,17 +153,19 @@
index].time
this.form.time = this.$moment(this.listOrder[index].date + " " + this.listOrder[
index].time.split("-")[0]).format("YYYY-MM-DD hh:mm:ss");
this.orderid = this.listOrder[index].id;
this.form.visit_order_id = this.orderid = this.listOrder[index].id;
} else {
this.listActivtyOrder[index].checked = false
this.selectInfo = this.$moment(this.listActivtyOrder[index].date).format("MM月DD日") + " " + this
.listActivtyOrder[index].time
this.orderid = this.listActivtyOrder[index].id;
this.listActivtyOrder[index].checked = true
this.selectInfo = this.$moment(this.listActivtyOrder[index].activity.start_time).format("MM月DD日 hh:mm")
this.form.time = this.$moment(this.listActivtyOrder[index].activity.start_time).format("YYYY-MM-DD hh:mm:ss");
this.form.activity_order_id = this.orderid = this.listActivtyOrder[index].id;
}
this.orderType = type;
},
openselectorder() {
this.showSelectorder = false;
this.showSelectorder = true;
},
closeorder() {
this.showSelectorder = false;
@ -251,7 +258,6 @@
data: this.form,
method: "POST",
utilSuccess: function(res) {
console.log(res)
uni.showToast({
icon: "none",
title: "下单成功",

@ -44,12 +44,16 @@
<view class="book-box-timerow">
<view class="book-box-row-timeitem" v-for="(item,index) in currentDate.rules"
:class="{'book-box-row-timeitem-on':item.checked}" @click="handleSelectTime(index)">
:class="{'book-box-row-timeitem-on':item.checked,'timeitem-none':item.remain_count==0}"
:key="index" @click="handleSelectTime(index)">
<view class="book-box-row-timeitem-status" v-if="item.checked">
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view>
<view class="book-box-row-timeitem-txt">{{item.start_time+'-'+item.end_time}}</view>
<view class="book-box-row-timeitem-txt">{{item.remain_count}}</view>
<view class="book-box-row-timeitem-txt" v-if="item.remain_count>0">
{{item.remain_count}}
</view>
<view class="book-box-row-timeitem-txt" v-else></view>
</view>
</view>
</view>
@ -340,8 +344,8 @@
} else {
that.maxCount = res.team_max_count;
that.minCount = res.team_min_count;
}
}
that.form.total = that.minCount;
},
utilFail: function(res) {
@ -549,7 +553,7 @@
this.showCalendar = false;
},
handleSelectDate(e) {
if (this.showCalendar && e.length != 0 && e[0] != this.currentDate.date) {
if (this.showCalendar && e.length != 0 ) {
this.load3Day(e[0]);
this.showCalendar = false;
}
@ -601,27 +605,24 @@
m.checked = false;
}
cdate.checked = true;
let i = 0;
for (var m of cdate.rules) {
m.checked = false;
m.checked = i == 0
if (m.checked) {
this.currentTime = m;
}
i++;
}
this.loadDefaultTime(cdate.rules);
this.currentDate = cdate;
this.listDatePrice = list;
this.$forceUpdate();
},
handleSelectTime(index) {
for (var m of this.currentDate.rules) {
m.checked = false;
}
this.currentDate.rules[index].checked = true;
this.currentTime = this.currentDate.rules[index];
var mod = this.currentDate.rules[index];
if (mod.remain_count == 0) {
this.util.toast("该时段已售罄");
return false
}
for (var m of this.currentDate.rules) {
m.checked = false;
}
mod.checked = true;
this.currentTime = mod;
this.$forceUpdate();
},
load3Day(sdate) { //7
@ -653,27 +654,25 @@
m.week = week;
}
if (m.date == selectDate && m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
let idx = 0;
for (var mod of m.rules) {
mod.checked = false;
if (that.bcurrentTime) {
if (mod.id == that.bcurrentTime.id)
mod.checked = true;
that.currentTime = that.bcurrentTime;
} else {
mod.checked = idx == 0
if (mod.checked) {
that.currentTime = mod;
}
}
idx++;
}
} else {
selectDate = that.$moment(selectDate).add('days', 1).format("yyyy-MM-DD");
if (m.date == selectDate) {
if (m.is_open == 1) {
m.checked = true;
that.currentDate = m;
that.currentIndex = i;
that.loadDefaultTime(m.rules);
} else {
uni.showToast({
icon: "none",
title: selectDate + "不可以预约",
complete() {
setTimeout(function() {
that.load3Day(that.$moment(selectDate).add('days', 1)
.format("yyyy-MM-DD"))
}, 2000)
}
}, 2000)
}
}
i++;
}
@ -695,6 +694,21 @@
}
})
},
loadDefaultTime(rules) {
var that = this;
that.currentTime = {};
let isDefault = false;
for (var mod of rules) {
mod.checked = false;
if (!isDefault && mod.remain_count > 0) {
isDefault = true;
mod.checked = true;
that.currentTime = mod;
}
}
},
closeAdd() {
this.showAdd = false
},
@ -716,6 +730,10 @@
<style>
@import url("@/static/css/bookbox.css");
.timeitem-none {
color: #ccc;
}
.box-visitor-item {
display: flex;
justify-content: space-between;

Loading…
Cancel
Save