const config = require('../../config/config.js')
const Http = require('../../utils/http.js')
const HttpBasics = require('../../utils/HttpBasics.js')
const util = require('../../utils/util.js')
var app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    showDetailIf: true,
    creditNum:0,
    type:1,
    creditAmount:0,
    titleH:'',
    title:[]
  },
  goOn(){
    tt.navigateBack({
      delta: 1
    })
  },
  goBack(){
    tt.reLaunch({
      url: '/pages/index/index',
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onLoad: function (options) {
    console.log(options)
    if (options.titleH){
      this.setData({
        type: options.type,
        titleH: options.titleH,
        title: options.titleH.split(',')
      })
      tt.setNavigationBarTitle({
        title: '会员赠券'
      })
    }else{
      this.setData({
        creditNum: options.creditNum,
        type: options.type,
        creditAmount: options.creditAmount,
      })
      tt.setNavigationBarTitle({
        title: '会员积分'
      })
    }
    
    console.log(this.data.titleH, this.data.title)
  },
})