长按二维码图片 预览只有一个加载的图标
发布于 6 年前 作者 minjin 16880 次浏览 来自 问答

<view>

  <image class=‘backgroudImg’ src=’…/…/images/introduce/companyIntroduce.png’ mode=‘widthFix’>

 

    <view>

      <!-- <image class=‘iosImg’ src=’…/…/images/introduce/ios.png’ catchtap=‘iosLink’></image> -->

    </view>

    <view >

      <image class=‘iosImg’ src="/images/introduce/timg.png"  catchlongpress=“iosLink”></image>

    </view>

    <view>

      <!-- <image class=‘androidImg’ src=’…/…/images/introduce/图层1@2x_3.png’ catchtap=‘androidLink’></image> -->

    </view>

  </image>

</view>

js

// pages/introduce/introduce.js

Page({

  /**

   * 页面的初始数据

   */

  data: {

  },

  iosLink:function(){

    wx.previewImage({

      content: ‘/images/introduce/timg.png’,

      urls: [’/images/introduce/timg.png’]// 需要预览的图片http链接列表

    })

  },

  androidLink:function(){

  },

  /**

   * 生命周期函数–监听页面加载

   */

  // onLoad: function (options) {

  //   var that = this

  //   var scene_img = ‘…/…/images/introduce/timg.png’ //这里添加图片的地址

  //   that.setData({

  //     scene: scene_img

  //   })

  // }

})

2 回复

绝对地址试过了 也不好使

图片地址不对,要绝对地址~

wx.previewImage({  current: '', // 当前显示图片的http链接
  urls: [] // 需要预览的图片http链接列表})
回到顶部