{"size": 1003, "ext": "js", "max_stars_repo_path": "GankCamp/pages/detail/detail.js", "max_stars_repo_name": "MisterZhouZhou/webchatDemo", "max_stars_repo_stars_event_min_datetime": "2019-03-04T08:39:54.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-04T08:39:54.000Z", "max_issues_repo_path": "GankCamp/pages/detail/detail.js", "max_issues_repo_name": "MisterZhouZhou/webchatDemo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "GankCamp/pages/detail/detail.js", "max_forks_repo_name": "MisterZhouZhou/webchatDemo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 12.3827160494, "max_line_length": 90, "alphanum_fraction": 0.5104685942}
// pages/detail/detail.js
var collections;

Page({

  /**
   * 页面的初始数据
   */
  data: {
    title: '',
    url: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    collections = wx.getStorageSync('collections') || []
    this.setData({
      title: options.title,
      url: options.url
    })
  },

  collection: function (e) {
    collections.unshift({ url: this.data.url, title: this.data.title, ctime: new Date() })
    wx.setStorage({
      key: "collections",
      data: collections
    })
  },

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

  },

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

  },

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

  },

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

  },

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

  },

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

  },

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

  }
})