Commit 5dcbd32e authored by youjie's avatar youjie

no message

parent 3d4dc5e1
......@@ -17,6 +17,7 @@
</view>
</view>
<scroll-view scroll-y class="sku-box">
<!--
<view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i" v-if="x.isdateformat==0">
<view class="sku-title">{{ x.attr_group_name }} </view>
<view>
......@@ -29,24 +30,12 @@
<text class="val">{{ y.attr_name }}</text>
</view>
</view>
</view>
<view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==1">
</view> -->
<view class="sku-item" v-for="(x, i) in g.attr_groups" v-if="x.isdateformat==0">
<!--x.isdateformat=1 改成日历模式 -->
<view class="sku-title">{{ x.attr_group_name }} </view>
<view>
<!--
<view class="sku-chi" :style="{
background: y.attr_id == x.checkId ? mc : '#eee',
color: y.attr_id == x.checkId ? '#FFF' : '#333'
}"
:class="{ disable: notStockGood.indexOf(y.attr_id) != -1 }"
v-for="(y, yi) in x.attr_list"
:key="yi" @click="clickSkuItemHandler(yi, i)">
<image :src="y.pic_url" class="img" v-if="i == 0 && y.pic_url"></image>
<text class="val">{{ y.attr_name }}</text>
</view> -->
<calendar @finish="chosenDateResult" :immediately="true" :defaultDate="currentPrice.startDate" :priceList="x.attr_list"></calendar>
</view>
</view>
</scroll-view>
......
......@@ -318,10 +318,9 @@ export default {
let d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
if (x.attr_name == `${year}-${m}-${d}`) {
isexsit = true;
// days.push(12)
days.push(12)
// if (x.remainNum > 0) {
// days.push(this.$utils.getretailer() ? x.b2BPrice : x.b2CPrice);
//days.push(x.b2CPrice);
// days.push(x.Price);
// } else {
// days.push(-1);
// }
......@@ -442,121 +441,6 @@ export default {
if (this.immediately) {
this.submit();
}
return;
if (line == 0 && index + 1 < this.nowDay) return;
//如果有入住情况和价格则需要进行一些列的判断
if (this.priceStauts.length > 0) {
if (
(this.start.length == 0 && this.priceStauts[line][index] < 0) ||
(this.end.length > 0 && this.priceStauts[line][index] < 0)
) {
return uni.showToast({
title: "该日期已被预订",
icon: "none",
});
}
if (
(this.start.length > 0 && line < this.start[0]) ||
(line == this.start[0] && this.start[1] > index)
) {
if (this.priceStauts[line][index] < 0)
return uni.showToast({
title: "该日期已被预订",
icon: "none",
});
this.start = [line, index];
this.end = [];
return;
}
if (this.start.length > 0 && this.end.length == 0) {
if (this.start[0] - line == 0) {
for (var j = this.start[1]; j < index; j++) {
if (this.priceStauts[line][j] < 0)
return uni.showToast({
title: "很抱歉,所选时间没有报价",
icon: "none",
mask: true,
});
}
} else {
//如果不在同一个月份有三种情况需要处理
for (var i = this.start[0]; i <= line; i++) {
//开始日期到开始日期当月的最大日期是否包含无房情况
if (i == this.start[0]) {
for (
var j = this.start[1];
j < this.priceStauts[i].length;
j++
) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选时间没有报价",
icon: "none",
mask: true,
});
}
} else if (i == line) {
//结束日期到当月结束日期之前是否包含无房情况
for (var j = 0; j < index; j++) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选时间没有报价",
icon: "none",
mask: true,
});
}
} else {
//中间间隔的月份需要检查每一天是否包含无房情况
for (var j = 0; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选时间没有报价",
icon: "none",
mask: true,
});
}
}
}
}
}
}
//如果没有入住时间
if (this.start.length == 0) {
//填充入住时间
this.start = [line, index];
} else if (
this.start.length > 0 &&
this.start[0] == line &&
this.start[1] == index &&
this.end.length == 0
) {
return;
} else {
//如果没有离开时间
if (this.end.length == 0) {
//如果有价格和入住离开情况则需要进行判断所选的离店时间时候包含无房日期
if (
line < this.start[0] ||
(line == this.start[0] && index < this.start[1])
) {
this.end = this.start;
this.start = [line, index];
} else {
//如果离开时间比入住时间晚则填充
this.end = [line, index];
}
} else {
//如果有离开时间则清空离开时间重新填充入住时间
this.start = [line, index];
this.end = [];
}
}
},
//设置日历
setDate() {
......@@ -599,31 +483,17 @@ export default {
},
//确定入住离店事件提交
submit() {
console.log(this.start)
console.log(this.date,'--------start')
let m = this.date[this.start[0]].month;
m = m > 9 ? m : "0" + m;
let m = this.activeMonth.Month;
let d = this.isFestival(this.start[0], this.start[1], true);
d = d > 9 ? d : "0" + d;
var obj = {
/* startYMD: this.date[this.start[0]].year + this.type + this.date[this.start[0]].month + this.type + this.isFestival(
this.start[0], this.start[1]),
startMD: this.date[this.start[0]].month + this.type + this.isFestival(this.start[0], this.start[1]),
startDay: this.startDay,
startWeek: this.startWeek,
endYMD: this.date[this.end[0]].year + this.type + this.date[this.end[0]].month + this.type + this.isFestival(this
.end[0], this.end[1]),
emdMD: this.date[this.end[0]].month + this.type + this.type + this.isFestival(this.end[0], this.end[1]),
endDay: this.endDay,
endWeek: this.endWeek,
day: this.day */
startWeek: this.startWeek,
start: this.date[this.start[0]].year + this.type + m + this.type + d,
startDay: m + "-" + d,
};
let tempPrice = {};
this.priceList.forEach((x, i) => {
console.log(x.startDate, obj.start);
if (obj.start == x.startDate) {
obj.priceObj = i;
}
......
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