刘翔宇-旅管家 2 years ago
parent 941eda0e20
commit 5ec3b17cc5

@ -15,8 +15,7 @@
<view class="activityBox-row"> <view class="activityBox-row">
<text class="icon-shijian iconfont"></text> <text class="icon-shijian iconfont"></text>
<text>活动时间{{timeFormat(numberlist.start_time,"yyyy年MM月DD日")}} <text>活动时间{{timeFormat(numberlist.start_time,"yyyy年MM月DD日")}} {{getHm(numberlist.start_time)}}-{{getHm(numberlist.end_time)}}</text>
{{getHm(numberlist.start_time)}}-{{getHm(numberlist.end_time)}}</text>
</view> </view>
<!-- <view class="activityBox-row"> <!-- <view class="activityBox-row">

@ -42,7 +42,7 @@
</view> </view>
<view style="display: flex;flex-direction: column;"> <view style="display: flex;flex-direction: column;">
<block v-for="(k,index) in item.numbers"> <block v-for="(k,index) in item.numbers">
<view v-if="index<2" class="tag tag_green activityBox_btn activityBox_time"> <view v-if="index<2" class="tag tag_green activityBox_btn activityBox_time" style="margin-top: -5px;margin-bottom: 10px;">
<text style="margin-right:12rpx"> <text style="margin-right:12rpx">
{{timeFormat(k.start_time,"MM月DD日")}} {{timeFormat(k.start_time,"MM月DD日")}}
</text> </text>

@ -55,24 +55,31 @@
<text class="infoBox-titletxt">活动场次</text> <text class="infoBox-titletxt">活动场次</text>
</view> </view>
<view class="numbers"> <view class="numbers">
<u-radio-group placement="column" v-model="chooseNum" @change="numChange"> <view v-for="(item, index) in numbers" :key="index" @click="numChange(item)" class="numbersBox"
<view v-for="(item, index) in numbers" :key="index"> :class="{numbersBoxActive:item.checked}">
<u-radio activeColor="#EF9525" <view style="padding-left:50rpx;margin-bottom:10rpx">
:label="item.label" :disabled="item.disabled" :name="item.id"> <text style="margin-right:20rpx;font-size: 28rpx;font-weight: bold;">
</u-radio> {{item.label}}
<view style="padding-left:50rpx;margin-bottom:10rpx"> </text>
<text style="margin-right:20rpx"> </view>
限制人数{{item.total==0?'不限':item.total}} <view style="padding-left:50rpx;margin-bottom:10rpx">
</text> <text style="margin-right:20rpx">
<text> 活动时间{{item.time}}
已报名数{{item.has_total}} </text>
</text> </view>
<view style="padding-left:50rpx;margin-bottom:10rpx">
</view> <text style="margin-right:20rpx">
限制人数{{item.total==0?'不限':item.total}}
</text>
<text>
已报名数{{item.has_total}}
</text>
</view>
<view class="book-box-row-timeitem-status" v-if="item.checked">
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
</view> </view>
</view>
</u-radio-group>
</view> </view>
</view> </view>
</view> </view>
@ -168,14 +175,20 @@
this.showNumbers = false this.showNumbers = false
this.chooseNum = "" this.chooseNum = ""
}, },
numChange(val) { numChange(item) {
console.log(val) if(item.disabled) {
this.activity_number_id = val this.util.alert("您选择的产次不可预约!");
console.log("book?type=" + this.teamType + "&activity_id=" + this.id + "&activity_number_id=" + this return;
.activity_number_id) };
// uni.navigateTo({ var _numbers = this.numbers;
// url: "book?type=" + this.teamType + "&activity_id=" + this.id + "&activity_number_id="+this.activity_number_id for (var mod of _numbers) {
// }) mod.checked = false;
}
item.checked = true;
this.activity_number_id = item.id;
this.numbers = _numbers;
this.$forceUpdate()
}, },
tobook(type) { tobook(type) {
// this.showNumbers = true // this.showNumbers = true
@ -207,17 +220,27 @@
res.isCanBook = that.$moment(nt).isBefore(res.end_plan); res.isCanBook = that.$moment(nt).isBefore(res.end_plan);
that.list = res; that.list = res;
let numberArr = [] let numberArr = []
let nowTime = that.getNowTime() let nowTime = that.getNowTime();
var i = 0;
for (var m of res.numbers) { for (var m of res.numbers) {
m.label = m.name + "(" + that.timeFormat(m.start_time, "yyyy年MM月DD日") + " " + that m.label = m.name;
.getHm(m.start_time) + "-" + that.getHm(m.end_time) + ")" m.time = that.timeFormat(m.start_time, "yyyy年MM月DD日") + " " + that
if (m.has_total == m.total && m.total != 0 || that.compareDate(nowTime, m .getHm(m.start_time) + "-" + that.getHm(m.end_time);
.end_plan)) { if (that.compareDate(nowTime, m
m.disabled = true .end_plan)) {
m.disabled = true
}
if (m.has_total == m.total && m.total != 0){
m.disabled = true
} }
numberArr.push(m); numberArr.push(m);
if(that.chooseNum==""){ if (!m.disabled) {
that.chooseNum=m.id;
this.activity_number_id = (i == 0 ? m.id : '')
m.checked = i == 0;
i++;
} }
} }
that.numbers = numberArr that.numbers = numberArr
@ -346,4 +369,31 @@
.colortext { .colortext {
color: #D98012 color: #D98012
} }
.numbersBox {
border: #F7F6F4 1px solid;
border-radius: 5px;
background-color: #F7F6F4;
padding: 10px;
margin-bottom: 10px;
}
.numbersBoxActive {
border: #D98012 1px solid;
background-color: #FCF6E3;
position: relative;
}
.book-box-row-timeitem-status {
position: absolute;
right: 0;
top: 0;
background: #EF9525;
border-top-right-radius: 5rpx;
border-bottom-left-radius: 5rpx;
font-size: 20rpx;
color: #828282;
padding: 7rpx;
}
</style> </style>
Loading…
Cancel
Save