shopdetail.js 2.1 KB
// pages/shopdetail/shopdetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      '/img/detailimg.png',
      '/img/detailimg.png',
      '/img/detailimg.png'
    ],
    indicatorDots: false,
    autoplay: true,
    interval: 2000,
    duration: 1000,
    currentSwiper: 0,
    hidewrapno: false,
    hidewraptrue: false
  },

  swiperChange: function(e) {
    this.setData({
      currentSwiper: e.detail.current
    })
  },
  morecomment() {
    wx.navigateTo({
      url: '/pages/morecoment/morecoment',
    })
  },
  xiangce() {
    wx.navigateTo({
      url: '/pages/morephoto/morephoto',
    })
  },
  // 隐藏遮罩层
  sure() {
    this.setData({
      hidewraptrue: false
    })
  },
  // 店铺详情
  comentdetail() {
    wx.navigateTo({
      url: '/pages/commentdetail/commentdetail',
    })
  },
  write(e) {
    let id = e.currentTarget.dataset.id;
    console.log(id)
    if (id == 1) {
      console.log(38843)
      this.setData({
        hidewraptrue: true
      })
    } else if (id == 2) {
      console.log(334)
      wx.navigateTo({
        url: '/pages/passPhotos/passPhotos?type=' + 1,
      })

    } else if (id == 3) {
      wx.navigateTo({
        url: '/pages/passPhotos/passPhotos?type=' + 2,
      })

    } else if (id == 4) {
      wx.navigateTo({
        url: '/pages/comment/comment',
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})