var t = getApp();
Component({
  /*** 页面的初始数据***/
  data: {
    yu_e_show: 0,
    iurl: t.globalData.setting.imghost,
    width: 0,
    success: null, //成功的回调
    cancle: null, //取消的回调
    title: null, //标题
    s_text: null, //确定的提示语
    c_text: null, //取消的提示语

    is_show_txt:0,
  },

  methods: {
    open: function(title, s_text, c_text, success, cancle) {
      this.setData({
        title: title,
        s_text: s_text,
        c_text: c_text,
        yu_e_show: 1
      })
      this.data.success = success;
      this.data.cancle = cancle;


      var ck1=title.indexOf('购买该礼包');
      var ck2=title.indexOf('兑换该礼包');
      var ck3=title.indexOf('领取该礼包');

      if(ck1>0 || ck2>0 || ck3>0){
        this.setData({
          is_show_txt:1
        })
      }

    },
    open_cancel: function (yu_e_show){
         this.setData({
           yu_e_show: yu_e_show
         })
    },
    go_sure: function() {
      this.setData({ yu_e_show: 0})
      if(this.data.success) this.data.success();

    },
    go_cancle: function() {
      this.setData({ yu_e_show: 0})
      if(this.data.cancle) this.data.cancle();
    },
    close_yu_e: function() {
      this.setData({
        yu_e_show: 0
      })
    }
  }

})