//.js

Page({


  /**

   * 页面的初始数据

   */

  data: {

    currentTab: 0,

    

    imgalist0: [ 'https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/309586315285779976.jpg',

      'https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/e6b5f06c7655fd7fa9699987c4578641_u%3D1837457002%2C1490875854%26fm%3D27%26gp%3D0.jpg' 

              ],

    imgalist1: ['https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/e6b5f06c7655fd7fa9699987c4578641_u%3D1837457002%2C1490875854%26fm%3D27%26gp%3D0.jpg',

      'https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/309586315285779976.jpg' 

    ],

    imgalist2: ['https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/309586315285779976.jpg',

'https://lg-1c7jwm16-1257218715.cos.ap-shanghai.myqcloud.com/309586315285779976.jpg'

    ]

  

  },

   /** 

     * 预览图片

     */

  previewImage: function (e) {

    var current = e.target.dataset.src;

    wx.previewImage({

      current: current, // 当前显示图片的http链接

      urls: this.data.imgalist0,

      urls: this.data.imgalist1,

      urls: this.data.imgalist2,// 需要预览的图片http链接列表

    })

  }

  })

  

  

  

  

  

  

<!--pages/index/index/tb/tb.wxml-->

<view class="swiper-tab">

    <view class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">第一个</view>

    <view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">第二个</view>

    <view class="swiper-tab-item {{currentTab==2?'active':''}}" data-current="2" bindtap="clickTab">第三个</view>

</view>


<view>

<swiper current="{{curr

展开全部
收起
2回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • guten元

    14人对此回答表示赞同

    把三个数组合并在一起然后再赋值urls

    展开
    14
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Silje

    1人对此回答表示赞同

    urls:["图一","图二","图三"]

    展开
    1
    11回复
    发布于 6年前

    评论(11)

    收起评论

    • 佩奇他小弟 2019-02-24 19:16

      我写的时候没注意你名字我写的是imagelist你写的是imgalist

      回复
    • luyishisan13 2019-02-26 16:27

      data:{

      回复
    • 雾里看花 2019-02-28 19:35

      请自行检查拼写……

      回复
    • Sahil 2019-03-02 12:16

      VM1445:1thirdScriptError

      回复
    • Mateo 2019-03-04 19:10

      可以是可以了,就是实现不了我想要点击图片预览,长按图片保存,收藏,分享好友的功能啦!

      回复
    • Fiona徐诗吟 2019-03-06 21:02


      回复
    • Roberto一帆 2019-03-08 12:33

      /**

      回复
    • Mia 2019-03-10 12:34

      截图看看你写的呢,另外也截图看看报错呢

      回复
    • 雪先生 2019-03-12 23:25

      实现不了,编译器说是无名错误,为什么?

      回复
    • Eleanor 2019-03-14 18:40

      letlist=this.data.imagelist0.concat(this.data.imagelist1,this.data.imagelist2)

      回复
    • lele 2019-03-16 10:15

      好像这样不行,因为里面的data里的imgalist0,imgalist1,imgalist2,的值传递给谁呀!

      回复
    加载更多
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部