// subPackage/page/pages/valueCardInfo/valueCardInfo.js
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
wxService.page({

  /**
   * 页面的初始数据
   */
  data: {
    checked : false,
    showModal : false,
    buyType : '2',//现金支付 2 积分兑换
  },

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

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

  },
  //修改选中状态
  onTapSwitchChecked(){
    this.data.checked = !this.data.checked;
    this.setData({
      checked: this.data.checked
    });
  },
  //关闭modal
  onTapCloseModal(){
    this.setData({
      showModal : false,
    });
  },
  //查看rule
  onTapViewRule(){
    this.setData({
      showModal : true
    })
  },
  //同意并阅读
  onTapModalAgree(){
    this.setData({
      showModal: false,
      checked : true,
    });
  },
  //立即购买
  onTapBuy(){
    if(!this.data.checked){
      return ;
    }


  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

})