// packageE/community_buying/index/index.js
var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    infoData: {},
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getData();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    let language = wx.getStorageSync("langIndex");
    this.setData({ language: language.en });
  },

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

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

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

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},
  gotoGroupBuying() {
    wx.navigateTo({
      url: "/packageE/community_buying/group_buying/group_buying",
    });
  },
  gotoMyInfo() {
    wx.navigateTo({
      url: "/packageE/community_buying/edit_info/edit_info",
    });
  },
  gotoOrder() {
    wx.navigateTo({
      url: "/packageE/community_buying/buying_order/buying_order",
    });
  },
  gotoReward() {
    wx.navigateTo({
      url: "/packageC/selfCarry/selfCarry_reward/selfCarry_reward",
    });
  },

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

  getData() {
    let urlStr = app.getNetAddresss(
      "plugin.package-deliver.frontend.deliver.getDeliverBonusAmount"
    );
    app._postNetWork({
      url: urlStr,
      success: (resdata) => {
        var res = resdata.data;
        if (res.result == 1) {
          this.setData({ infoData: res.data });
        }
      },
    });
  },

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