1.活动
parent
20b24ab4ee
commit
24f1ae8dfb
14
App.vue
14
App.vue
|
|
@ -1842,17 +1842,17 @@
|
|||
return color_obj[theme];
|
||||
},
|
||||
// 数组分组
|
||||
group_arry(array, subGroupLength) {
|
||||
group_arry(arry, sub_group_length) {
|
||||
let index = 0;
|
||||
let newArray = [];
|
||||
if (array.length > subGroupLength) {
|
||||
while (index < array.length) {
|
||||
newArray.push(array.slice(index, index += subGroupLength));
|
||||
let new_arry = [];
|
||||
if (arry.length > sub_group_length) {
|
||||
while (index < arry.length) {
|
||||
new_arry.push(arry.slice(index, index += sub_group_length));
|
||||
}
|
||||
} else {
|
||||
newArray = [array];
|
||||
new_arry = [arry];
|
||||
}
|
||||
return newArray;
|
||||
return new_arry;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
},
|
||||
// 数据处理
|
||||
handle_data() {
|
||||
this.swiperData = app.globalData.groupArry(this.propData, 10);
|
||||
this.swiperData = app.globalData.group_arry(this.propData, 10);
|
||||
},
|
||||
swiper_change(e) {
|
||||
this.current = e.detail.current
|
||||
|
|
|
|||
|
|
@ -107,13 +107,13 @@
|
|||
let swiperData = [];
|
||||
if (this.hotData.length % 2 == 0) {
|
||||
// 偶数
|
||||
swiperData = app.globalData.groupArry(item.d, 2);
|
||||
swiperData = app.globalData.group_arry(item.d, 2);
|
||||
} else {
|
||||
// 奇数
|
||||
if (this.hotData.length === i + 1) {
|
||||
swiperData = app.globalData.groupArry(item.d, 4);
|
||||
swiperData = app.globalData.group_arry(item.d, 4);
|
||||
} else {
|
||||
swiperData = app.globalData.groupArry(item.d, 2);
|
||||
swiperData = app.globalData.group_arry(item.d, 2);
|
||||
}
|
||||
}
|
||||
item.d = swiperData
|
||||
|
|
|
|||
Loading…
Reference in New Issue