Commit a41a7a3e authored by youjie's avatar youjie

优化最低价格

parent 5eecc271
......@@ -207,18 +207,7 @@
}
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.getMinPrice()
this.activeMonth = this.d[0]
// #ifdef MP-ALIPAY
uni.setNavigationBarTitle({
......@@ -278,9 +267,27 @@
},
priceList(newVal) {
this.priceStauts = this.initPrice();
this.getMinPrice()
}
},
methods: {
getMinPrice(){
this.d.forEach(x=>{
x.prices = []
})
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)
})
},
changeHandler(i) {
this.active = i;
this.$emit('getMonth')
......
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