module.exports = Behavior({

  data:{
    balance_text:"余额",
    integral_text:"积分"
  },
  attached: function(){
    wx.getStorage({
      key: "yz_basic_info",
      success: (res)=> {
        this.setData({
          balance_text:res.data.balance||'余额',
          integral_text:res.data.point||'积分',
        });
        this.initCustomField();
      },
    });
  },
  methods:{
    initCustomField(){},
    gotoPage(evt){
      let name = evt.currentTarget.dataset.name;
      let dataset = evt.currentTarget.dataset;
      let url=`/packageF/storeManagement/${name}/${name}?`;
      for(let key in dataset){
        if(key!='name'){
          url += `${key}=${dataset[key]}&`;
        }
      }

      wx.navigateTo({
        url,
      });
    }
  }
});