Authored by 李奇

fixed: 商品详情页优化

... ... @@ -59,16 +59,10 @@
let temp = val.slice();
const len = temp.length;
if (len > 1 && len < 4) {
if (len > 1) {
temp.unshift(temp.splice(len - 1)[0]);
}
if (len >= 4) {
const sp = temp.splice(0, 2);
temp.push(sp[0]);
temp.push(sp[1]);
}
this.goodsList = temp;
this.slideCount = this.goodsList.length;
}
... ... @@ -91,24 +85,6 @@
this.activeIndex = this.calcIndex(idx);
},
calcIndex(realIdx){
const len = this.goods.length;
if (len >= 4) {
if (realIdx === len -1) {
realIdx = 0;
} else {
realIdx += 1;
}
if (realIdx < len -2) {
realIdx += 2;
} else if (realIdx === len -2) {
realIdx = 0;
} else {
realIdx = 1;
}
}
return realIdx;
},
show() {
... ...