|
|
@ -1060,14 +1060,10 @@ |
|
|
that.mallAds = res.result.mallAds |
|
|
that.mallAds = res.result.mallAds |
|
|
for(let i=0;i<that.mallAds.length;i++){ |
|
|
for(let i=0;i<that.mallAds.length;i++){ |
|
|
if(that.mallAds[i].position == 'home_top'){ |
|
|
if(that.mallAds[i].position == 'home_top'){ |
|
|
|
|
|
|
|
|
// 判断字符串中是否包含逗号 |
|
|
// 判断字符串中是否包含逗号 |
|
|
if (that.mallAds[i].adImage.indexOf(',') !== -1) { |
|
|
if (that.mallAds[i].adImage.indexOf(',') !== -1) { |
|
|
// 有逗号:先按逗号分割,再过滤掉空字符串或纯空白字符串,最后映射为 {pic: url} 对象数组 |
|
|
// 有逗号:先按逗号分割,再过滤掉空字符串或纯空白字符串,最后映射为 {pic: url} 对象数组 |
|
|
that.adList = that.mallAds[i].adImage |
|
|
that.adList = that.mallAds[i].adImage.split(',').filter(item => item.trim() !== '').map(url => ({ |
|
|
.split(',') |
|
|
|
|
|
.filter(item => item.trim() !== '') // 过滤掉空项 |
|
|
|
|
|
.map(url => ({ |
|
|
|
|
|
pic: url.trim() |
|
|
pic: url.trim() |
|
|
})); |
|
|
})); |
|
|
} else { |
|
|
} else { |
|
|
@ -1107,6 +1103,7 @@ |
|
|
}).catch((res) => {}); |
|
|
}).catch((res) => {}); |
|
|
}, |
|
|
}, |
|
|
goAdPage(item) { |
|
|
goAdPage(item) { |
|
|
|
|
|
console.log('hahahahah',item) |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: item.linkUrl + item.linkParams |
|
|
url: item.linkUrl + item.linkParams |
|
|
}) |
|
|
}) |
|
|
|