收藏
回答

previewImage打开图片一直转圈圈?

使用previewImage预览图片,第一次打开能加载,关闭后,在打开就转圈圈,在关闭后,在打开就好了就反复出现,偶尔能打开,偶尔不能。

const previewUrls = urls.map(item => item.url).filter(Boolean)

    if (previewUrls.length === 0) {

      Taro.showToast({

        title: '暂无图片可预览',

        icon: 'none'

      })

      return

    }

    const currentIndex = urls.findIndex(item => item.id === id)

    console.log('currentIndex', previewUrls[currentIndex])

    Taro.previewImage({

      urls: previewUrls,

      showmenu: false,

      current: currentIndex >= 0 ? previewUrls[currentIndex] : previewUrls[0],

 })


回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    2025-07-21

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2025-07-21
    有用
    回复
  • L
    L
    2025-07-18

    图片地址,是请求阿里云OSS获取的地址。访问地址能够下载到图片。

    2025-07-18
    有用
    回复
登录 后发表内容