index.js 1020 Bytes
// pages/me/index.js
import App from '../../utils/api';
import util from '../../utils/util'
const {regeneratorRuntime} = global
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hasSellerBook:false,
  },
  enter_params:'',
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{
      this.enter_params=res.data;
      this.setData({
        hasSellerBook:res.data,
      })
    })
  },

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

  },

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

  },

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

  },

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

  },

  gotoSellerBook(){
    util.cache('islove','book');
    wx.reLaunch({
      url:util.http_build_query(this.enter_params,'/pages/book/b_index')
    })
  }
})