审查视图

pages/homeblock/guanimg/guanimg.js 1.3 KB
lihongjuan authored
1
// pages/homeblock/guanimg/guanimg.js
lihongjuan authored
2
const app = getApp()
lihongjuan authored
3 4 5 6 7 8
Page({

  /**
   * 页面的初始数据
   */
  data: {
lihongjuan authored
9 10 11 12
    url: '',
    id: "",
    picture:[],
    banner:[]
lihongjuan authored
13 14 15 16 17
  },

  /**
   * 生命周期函数--监听页面加载
   */
lihongjuan authored
18
  onLoad: function(options) {
lihongjuan authored
19
    this.setData({
lihongjuan authored
20 21
      url: app.globalData.url,
      id: options.wineid
lihongjuan authored
22
    })
lihongjuan authored
23 24

    this.getguantu()
lihongjuan authored
25
  },
lihongjuan authored
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  //获取官图
  getguantu() {
    let that = this;
    let url = 'index/Wine/wine_images',
      params = {
        wine_id:that.data.id,

      }
    app.post(url, params).then((res) => {
      console.log(res);
      that.setData({
        banner:res.banner,
        picture: res.picture
      })

lihongjuan authored
42
lihongjuan authored
43 44 45 46
    }).catch((err) => {

    })
  },
lihongjuan authored
47 48 49
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
lihongjuan authored
50
  onReady: function() {
lihongjuan authored
51 52 53 54 55 56

  },

  /**
   * 生命周期函数--监听页面显示
   */
lihongjuan authored
57
  onShow: function() {
lihongjuan authored
58 59 60 61 62 63

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
lihongjuan authored
64
  onHide: function() {
lihongjuan authored
65 66 67 68 69 70

  },

  /**
   * 生命周期函数--监听页面卸载
   */
lihongjuan authored
71
  onUnload: function() {
lihongjuan authored
72 73 74 75 76 77

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
lihongjuan authored
78
  onPullDownRefresh: function() {
lihongjuan authored
79 80 81 82 83 84

  },

  /**
   * 页面上拉触底事件的处理函数
   */
lihongjuan authored
85
  onReachBottom: function() {
lihongjuan authored
86 87 88 89 90 91

  },

  /**
   * 用户点击右上角分享
   */
lihongjuan authored
92
  onShareAppMessage: function() {
lihongjuan authored
93 94 95

  }
})