轮播图图片预览

This commit is contained in:
lnn19986213 2024-03-11 09:51:53 +08:00
parent 99062299fa
commit edcc5c39fe
15 changed files with 128 additions and 24 deletions

View File

@ -5,7 +5,7 @@
</view>
<view v-if="load == false">
<view class="top_swiper">
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit"></u-swiper>
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit" @click="previewImage"></u-swiper>
</view>
<view class="top_title">
标题
@ -94,6 +94,14 @@
uni.navigateTo({
url: "/pagesA/activeManage/qdList?type=" + type + '&activityId=' + this.id
})
},
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}

View File

@ -20,8 +20,8 @@
this.http.request('/auth/logout', {}, "GET").then(res => {
if (res.code == 200) {
uni.redirectTo({
// url: "/pages/pageHome/shwxLogin", //h5
url: '/pagesC/Login/Login' //
url: "/pages/pageHome/shwxLogin", //h5
// url: '/pagesC/Login/Login' //
})
}
}).catch(e => {

View File

@ -9,8 +9,8 @@
<image style="width: 100%;" :src="cover" mode="widthFix"></image>
</view> -->
<!-- 轮播图 -->
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px">
<view slot="indicator" class="indicator-num" imgMode="aspectFit">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num" >
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
</u-swiper>
@ -214,6 +214,14 @@
this.androidOpenPdf(this.contractUrl);
break;
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}

View File

@ -9,7 +9,7 @@
</view>
<view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit">
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -230,6 +230,14 @@
}
return 0;
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
},

View File

@ -9,7 +9,7 @@
</view>
<view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit">
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -168,6 +168,14 @@
if(aaa > 100){
this.value = '100'
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
},

View File

@ -10,8 +10,8 @@
</view> -->
<!-- 轮播图 -->
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="200">
<view slot="indicator" class="indicator-num" imgMode="aspectFit">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="200" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num" >
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
</u-swiper>
@ -322,6 +322,14 @@
});
})
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}
</script>

View File

@ -4,7 +4,7 @@
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="workDetail" v-if="load == false">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -88,7 +88,15 @@
});
})
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}
</script>

View File

@ -13,7 +13,7 @@
</view>
</view>
</view>
<u-swiper :list="list" indicator indicatorMode="dot" circular height="240" imgMode="aspectFit"></u-swiper>
<u-swiper :list="list" indicator indicatorMode="dot" circular height="240" imgMode="aspectFit" @click="previewImage"></u-swiper>
<view class="layout">
<!-- 文创展厅(功能不明先隐藏) -->
<view class="activityColumn">
@ -221,7 +221,15 @@
uni.navigateTo({
url: "/pagesC/AwardWinningWork/AwardDetail?id=" + String(id)
})
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
},
//
onPullDownRefresh() {

View File

@ -9,7 +9,7 @@
</view>
<view class="pageImg">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="e => currentNum = e.current"
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit">
indicatorStyle="right: 20px" height='440rpx' imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -223,6 +223,14 @@
icon: "none",
});
})
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}

View File

@ -2,7 +2,7 @@
<view>
<view class="help_bg_box">
<view class=" bg_img_box">
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit"></u-swiper>
<u-swiper :list="img" indicator indicatorMode="line" circular height="200" imgMode="aspectFit" @click="previewImage"></u-swiper>
</view>
</view>
<view class="header">
@ -345,6 +345,14 @@
icon: "none",
});
},
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}

View File

@ -4,7 +4,7 @@
<u-loading-page :loading="load"></u-loading-page>
</view>
<view class="workDetail" v-if="load == false">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit">
<u-swiper :list="list" :autoplay="true" @change="e => currentNum = e.current" indicatorStyle="right: 20px" height="300px" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -83,7 +83,15 @@
});
})
}
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}
</script>

View File

@ -10,7 +10,7 @@
:duration="duration">
<swiper-item v-for="(v,i) in img" :key="i">
<view class="swiper_box">
<image class="swiper_img" :src='img[i]' mode="aspectFit"></image>
<image class="swiper_img" :src='img[i]' mode="aspectFit" @click="previewImage(i)"></image>
</view>
</swiper-item>
</swiper>
@ -407,6 +407,14 @@
url: "/pagesA/msg/chat/chat?name=" + this.orderDet[0].userName + '&linkId=' + '' + '&toUser=' +
this.orderDet[0].id + '&toUserImg=' + this.orderDet[0].userImg
})
},
previewImage(index) {
let photoList = this.img
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
}
}

View File

@ -6,7 +6,7 @@
<view class="page" v-if="load == false">
<view class="pageImg" v-if="list.length > 0">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)"
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit">
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -74,6 +74,14 @@
});
})
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
},
};
</script>

View File

@ -6,7 +6,7 @@
<view class="page" v-if="load == false">
<view class="pageImg" v-if="list.length > 0">
<u-swiper v-if="list.length > 0" :list="list" :autoplay="true" @change="(e) => (currentNum = e.current)"
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit">
indicatorStyle="right: 20px" height="440rpx" imgMode="aspectFit" @click="previewImage">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list.length }}</text>
</view>
@ -96,6 +96,14 @@
});
})
},
previewImage(index) {
let photoList = this.list
uni.previewImage({
current: index, //
urls: photoList, // photoList
loop: true, //
})
}
},
};
</script>

View File

@ -5,10 +5,10 @@
export default {
config: {
baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "http://192.168.2.48:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域
// baseUrl: "https://yxx.ydool.net/h5/api", //线上
// baseUrl: "/h5/api", //h5
baseUrl: "/h5/api", //h5
header: {
'Content-Type': 'application/json;charset=UTF-8',
// 'Content-Type':'application/x-www-form-urlencoded'
@ -104,8 +104,8 @@ export default {
});
setTimeout(() => {
uni.navigateTo({
url: '/pagesC/Login/Login' //小程序跳转
// url: '/pages/pageHome/shwxLogin' //h5-山海万象跳转
// url: '/pagesC/Login/Login' //小程序跳转
url: '/pages/pageHome/shwxLogin' //h5-山海万象跳转
})
}, 1200)