Commit a38ab5d0 authored by youjie's avatar youjie

no message

parent 5169b7fa
......@@ -16,7 +16,8 @@
</view>
</view>
</view>
<scroll-view scroll-y class="sku-box">
<scroll-view scroll-y class="sku-box"
:style="{'max-height':x.isdateformat==1?'400px':'300px'}">
<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>
......@@ -47,7 +48,10 @@
<!--x.isdateformat=1 改成日历模式 -->
<view class="sku-title">{{ x.attr_group_name }} </view>
<view>
<calendar @finish="chosenDateResult" :immediately="true" :priceList="x.attr_list"></calendar>
<calendar @finish="chosenDateResult"
:defaultDate="x.attr_list[0].attr_name"
:immediately="true"
:priceList="x.attr_list"></calendar>
</view>
</view>
</scroll-view>
......@@ -123,7 +127,6 @@
data() {
return {
currentPrice: {},
goodimage: '',
goodprice: '',
goodamount: '',
......@@ -247,13 +250,14 @@
},
methods: {
chosenDateResult(result) {
// console.log(result, '----result')
// return
// let price
// this.g.attr_groups.forEach(x => {
// price = x.attr_list[result.priceObj]
// })
// this.currentPrice = price;
console.log(result,'---')
for(let index=0;index<this.g.attr_groups.length;index++){
for(let j=0;j<this.g.attr_groups[index].attr_list.length;j++){
if(this.g.attr_groups[index].attr_list[j].attr_name==result.start){
this.clickSkuItemHandler(j,index)
}
}
}
},
getfu() {
let fucolor = this.colorRgb(this.fu);
......@@ -619,7 +623,6 @@
.goodsku .sku-box {
padding: 0;
/* max-height: 300px; */
max-height: 400px;
overflow: hidden;
overflow-y: auto;
display: block;
......
......@@ -12,16 +12,11 @@
:style="{'color':active==item.Id?mainColor:''}"
@click="changeHandler(item.Id)">
<view>{{item.Name}}</view>
<text class="fontw100" :style="{'color':mainColor}">¥1521
<text class="fontw100" :style="{'color':mainColor}">¥{{item.minprices}}
<text></text>
</text>
<view class="tabsLine" :style="{'background':active==item.Id?mainColor:''}"></view>
</view>
<!-- <u-tabs :is-scroll="true" name="Name" :list="d"
:active-color="mainColor"
:current="active" @change="changeHandler"
:type-style="2" :show-bar="true"
:bold="false" height="50" duration="0"></u-tabs> -->
</view>
<view class="week">
<view></view>
......@@ -92,6 +87,7 @@
backgroundColor:
line == end[0] && index == end[1] ? '#111' : '',
color: line == end[0] && index == end[1] ? '#FFFFFF' : '',
background: line == start[0] && index == start[1]?mainColor:''
}"
>
<view style="padding-top: 2px; padding-bottom: 2px">{{
......@@ -102,6 +98,7 @@
<view
style="font-size: 12px; padding-bottom: 3px"
v-if="priceStauts.length > 0"
>
<view v-if="priceStauts[line][index] > 0"
>{{ priceStauts[line][index] }}</view
......@@ -223,17 +220,36 @@ export default {
this.priceStauts = this.initPrice();
this.mainColor = this.$uiConfig.mainColor;
let ThisYearMonth = ''
for(let i=0;i<4;i++){
let Month = Dates.getMonth()+(i+1)
let Year = Dates.getFullYear()
let Month = Dates.getMonth()+(i+1)
if(ThisYearMonth&&ThisYearMonth==12){
Year = Dates.getFullYear()+1
}
if(Month==12) ThisYearMonth = Month
let obj = {
Id: i,
Year,
Month,
Name: Month+'月'
Name: Month+'月',
prices:[],
minprices: 0,
}
this.d.push(obj)
}
for(let i = 0;i<this.priceList.length;i++){
let datas = this.priceList[i].attr_name.split('-')
for(let j = 0;j<this.d.length;j++){
let m = this.d[j].Month>9?this.d[j].Month:'0'+this.d[j].Month
if(datas[1]==m){
this.d[j].prices.push(this.priceList[i].newPrice)
}
}
}
this.d.forEach(x=>{
x.minprices = Math.min.apply(null,x.prices)
})
this.activeMonth = this.d[0]
// #ifdef MP-ALIPAY
uni.setNavigationBarTitle({
......@@ -296,13 +312,13 @@ export default {
changeHandler(i) {
console.log(i)
this.active = i;
this.$emit('getMonth')
this.activeMonth = this.d.find(x=>{
return x.Id == i
})
console.log(this.activeMonth,'----',this.d)
},
initPrice() {
console.log(this.priceList,'==-----priceList')
//年份
var year = new Date().getFullYear();
let data = [];
......@@ -314,16 +330,16 @@ export default {
for (var j = 0; j < new Date(year, month + 1, 0).getDate(); j++) {
let isexsit = false;
this.priceList.forEach((x) => {
let m = month + 1 > 9 ? month + 1 : "0" + (month + 1);
let d = j + 1 > 9 ? j + 1 : "0" + (j + 1);
if (x.attr_name == `${year}-${m}-${d}`) {
isexsit = true;
days.push(12)
// if (x.remainNum > 0) {
// days.push(x.Price);
// } else {
// days.push(-1);
// }
if (x.newStock > 0) {
days.push(x.newPrice);
} else {
days.push(-1);
}
}
});
if (!isexsit) {
......@@ -438,7 +454,7 @@ export default {
this.start = [line, index];
}
if (this.immediately) {
if (this.priceStauts[line][index]&&this.immediately) {
this.submit();
}
},
......@@ -483,8 +499,7 @@ export default {
},
//确定入住离店事件提交
submit() {
console.log(this.date,'--------start')
let m = this.activeMonth.Month;
let m = this.activeMonth.Month>9?this.activeMonth.Month:'0'+this.activeMonth.Month;//this.date[0].month>9?this.date[0].month:'0'+this.date[0].month;
let d = this.isFestival(this.start[0], this.start[1], true);
d = d > 9 ? d : "0" + d;
var obj = {
......@@ -562,7 +577,7 @@ export default {
/* 入住离开时间的color */
.bg-orange {
background: #111111 !important;
/* background: #111111 !important; */
border-radius: 6px !important;
}
......
......@@ -503,7 +503,7 @@
secondary: "",
detailContent: "",
recommend: [],
showSku: true,
showSku: false,
ot: 0,
currentSku: {},
isExsitGoods: true,
......
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