const util = require("../../../utils/util.js");
const app = getApp();
Component({
  options:{
    addGlobalClass:true
  },
  properties: {
    show:{
      type: Boolean,
      observer: function (newVal, oldVal) {
        this.setData({ show: newVal });
      }
    },
    type: {
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ type: newVal });
      }
    },
    price: {
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ price: newVal });
      }
    },
    orderid: {
      type: String,
      observer: function (newVal, oldVal) {
        this.setData({ orderid: newVal });
      }
    },
    groupid: {
      type: String,
      observer: function (newVal, oldVal) {
        this.setData({ groupid: newVal });
      }
    },
    aid: {
      type: String,
      observer: function (newVal, oldVal) {
        this.setData({ aid: newVal });
      }
    },
    sid:{
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ sid: newVal });
      }
    },
    pid:{
      type: String,
      observer: function (newVal, oldVal) {
        this.setData({ pid: newVal });
      }
    },
    groupbook:{
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ groupbook: newVal });
      }
    },
    channel: {
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ channel: newVal });
      }
    },
    status: {
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ status: newVal });
      }
    },
    channelTimes: {
      type: Number,
      observer: function (newVal, oldVal) {
        this.setData({ channelTimes: newVal });
      }
    },
    invitefbtn:{
      type: Boolean,
      observer: function (newVal, oldVal) {
        console.log(newVal, oldVal)
        this.setData({ invitefbtn: newVal });
      }
    },
  },
  data: {
    show:true,
    price:0
  },
  methods:{
    close(){
      this.setData({show:false})
    },
    invite(){
      let channelinfo=this.data.channelTimes==1?('&channel='+this.data.channel+'&channelTimes='+this.data.channelTimes):'';
      console.log(channelinfo)
      util.navigator('/pages/product/activity/bill?id='+this.data.aid+
      '&orderid='+this.data.orderid+
      '&groupid='+this.data.groupid+
      '&status='+this.data.status+
      '&groupbook='+this.data.groupbook+
      channelinfo +
      '&sid='+this.data.sid+
      '&pid='+this.data.pid
      );
    },
  }
  
})