- 发布:2022-02-19 17:33
- 更新:2022-02-25 16:12
- 阅读:783
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.3.9
浏览器平台: 微信内置浏览器
浏览器版本: 1.05
项目创建方式: HBuilderX
App下载地址或H5⽹址: https://yfedu.yflndx.com/pages/details/teacher?id=7
操作步骤:
预期结果:
实际结果:
bug描述:
模拟器内(IOS)和真机(IOS)无法显示预览图。
代码如下:
previewFcImage(index) {
uni.previewImage({
urls: this.teacherInfos.fc_images.map(item => {
return item
}),
current: this.teacherInfos.fc_images[index],
indicator: 'number',
})
},
previewCertImage(img) {
let imgArr = []
this.teacherInfos.certificate.forEach(item => {
imgArr.push(item.img)
})
uni.previewImage({
urls: imgArr,
current: img,
indicator: 'number',
loop: true,
success: () => {
uni.showToast({
title: '111',
icon: 'none'
})
},
fail: () => {
uni.showToast({
title: '预览图片失败',
icon: 'none'
})
}
})
},
<u-swiper :list="teacherInfos.fc_images"
:height="`${calcHeight ? calcHeight : '100rpx'}`"
@change="onSwiperChangeHandler"
@click="previewFcImage"
previousMargin="0"
nextMargin="0"
circular>
</u-swiper>
<view class="certificate">
<view class="certificate-li" v-for="(item,index) in teacherInfos.certificate" :key="index">
<view class="img">
<image :src="item.img" mode="" @click="previewCertImage(item.img)"></image>
</view>
<text>{{item.intro}}</text>
</view>
</view>
6***@qq.com (作者)
路径是对的,并且试过encode,都没用,安卓系统下正常
2022-02-22 11:02