|
@@ -136,7 +136,7 @@ const response:any = await requestDataPromise('/client/indexData', {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
const templateData = response.data.template.class;
|
|
const templateData = response.data.template.class;
|
|
-console.log(templateData)
|
|
|
|
|
|
+//console.log(templateData)
|
|
//2.2.1循环一下模板数据,把所有需要请求后端内容的组件里面imgSize和textSize拿出来
|
|
//2.2.1循环一下模板数据,把所有需要请求后端内容的组件里面imgSize和textSize拿出来
|
|
const getIndex = ref<number>(0);
|
|
const getIndex = ref<number>(0);
|
|
for(let item of templateData){
|
|
for(let item of templateData){
|
|
@@ -177,36 +177,37 @@ if (mkdata.code == 200) {
|
|
for(let item of mkdata.data){
|
|
for(let item of mkdata.data){
|
|
childData.value.push(item.child)
|
|
childData.value.push(item.child)
|
|
}
|
|
}
|
|
- //把data中的childData拿出来
|
|
|
|
- //console.log(childData.value)
|
|
|
|
let dataSort = ref<number>(0);
|
|
let dataSort = ref<number>(0);
|
|
|
|
+ const childDataLength = childData.value.length;
|
|
|
|
+ //如果当前循环的这个组件数据长度已经超过了所有子频道的总数居量,则从0开始循环
|
|
|
|
+ //此操作是为了防止B端创建的组件数超过了后台的导航数量
|
|
for(let item of templateData){
|
|
for(let item of templateData){
|
|
if(item.sectorName == 'scrollTextSector'){
|
|
if(item.sectorName == 'scrollTextSector'){
|
|
- item.componentList[0].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[0].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
}
|
|
}
|
|
if(item.sectorName == 'manyPictureSector'){
|
|
if(item.sectorName == 'manyPictureSector'){
|
|
- item.componentList[0].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[0].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
- item.componentList[1].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[1].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
}
|
|
}
|
|
if(item.sectorName == 'commentSector'){
|
|
if(item.sectorName == 'commentSector'){
|
|
- item.componentList[0].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[0].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
- item.componentList[1].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[1].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
}
|
|
}
|
|
if(item.sectorName == 'listSector'){
|
|
if(item.sectorName == 'listSector'){
|
|
- item.componentList[0].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[0].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
- item.componentList[1].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[1].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
- item.componentList[2].componentData.data = childData.value[dataSort.value]
|
|
|
|
|
|
+ item.componentList[2].componentData.data = childData.value[dataSort.value % childDataLength];
|
|
dataSort.value++;
|
|
dataSort.value++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- console.log(templateData)
|
|
|
|
|
|
+ //console.log(templateData)
|
|
}
|
|
}
|
|
//2.5广告数据
|
|
//2.5广告数据
|
|
const adData:any = ref([]);
|
|
const adData:any = ref([]);
|