// pages/about/about.js
const app = getApp(),
  { hostname, business_id } = app.globalData

Page({

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

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getStoreInfo()
  },
  // 获取商店信息
  getStoreInfo() {
    let that = this
    wx.request({
      url: hostname + 'Goods/get_business_info',
      data: { business_id },
      header: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' },
      method: 'POST',
      dataType: 'JSON',
      success: function (res) {
        let storeInfo = JSON.parse(res.data).data
        that.setData({ storeInfo })
        wx.setStorageSync('address', storeInfo.business_address)
      },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
  //转发
  onShareAppMessage: function (res) {
    return {
      title: 'Bingo果汁冰',
      path: '/pages/index/index',
      success: function (res) {
        // 转发成功
      },
    }
  }
})