mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 09:26:45 +08:00
轮播图跳转
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<view class="index-banner">
|
||||
<u-swiper
|
||||
:list="resonimg"
|
||||
keyName="image"
|
||||
@change="change"
|
||||
@click="click"
|
||||
></u-swiper>
|
||||
@@ -16,7 +17,7 @@
|
||||
<course-list :items="courseDataList"></course-list>
|
||||
</view>
|
||||
<view style="margin:30upx 0 60upx 0">
|
||||
<image style="width: 100%;height:220upx" :src="fileUrl+placeholderImg.image" mode=""></image>
|
||||
<image @click="imgJup()" style="width: 100%;height:220upx" :src="fileUrl+placeholderImg.image" mode=""></image>
|
||||
</view>
|
||||
<view class="ranking-list">
|
||||
<view class="recommend-index-title">
|
||||
@@ -144,11 +145,18 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
imgJup() {
|
||||
if(this.placeholderImg.JumpUrl){
|
||||
window.open(this.placeholderImg.JumpUrl);
|
||||
}
|
||||
},
|
||||
click(e) {
|
||||
// console.log(e,'444')
|
||||
let JumpUrl = this.resonimg[e].JumpUrl;
|
||||
if(JumpUrl){
|
||||
window.open(JumpUrl);
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
// console.log(e,'333')
|
||||
},
|
||||
couresreso() {
|
||||
let key = 'mobileIndex1';
|
||||
@@ -157,7 +165,12 @@
|
||||
if(res.result.content && res.result.content.length>10){
|
||||
let lmj = JSON.parse(res.result.content)
|
||||
lmj.forEach(item=>{
|
||||
this.resonimg.push(this.fileUrl+item.image);
|
||||
this.resonimg.push(
|
||||
{
|
||||
image: this.fileUrl+item.image,
|
||||
JumpUrl: item.JumpUrl,
|
||||
}
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user