1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <view class="container clearfix">
- <image :src="imagePath" :class="imgClass" @click="previewImg" mode=""></image>
- </view>
- </template>
- <script>
- export default{
- data() {
- return{
- staticUrl: this.$Static,
- imagePath:'',
- imgClass:'',
- imageList:[],
- }
- },
- onLoad(option){
- this.imagePath = `${this.staticUrl}certificates/certificates-${option.id}.png`
- this.imgClass = `image-${option.id}`
- this.imageList.push(this.imagePath)
- },
- methods:{
- previewImg () {//顶部商品图片预览
- uni.previewImage({
- current: 0, //图片索引
- urls: this.imageList, //必须是http图片,本地图片无效
- longPressActions:''
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- background-color: #FFFFFF;
- }
- .container{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 24rpx;
- .image-1{
- width: 100%;
- height: 480rpx;
- }
- .image-2{
- width: 100%;
- height: 940rpx;
- }
- .image-3{
- width: 100%;
- height: 4294rpx;
- }
- }
- </style>
|