<template>
  <div class="mainPage">
    <div class="title">健身卡详情</div>
    <div class="content">
      <div class="message">
        <div>
          <span>会所健身体验卡</span>
          <span class="sub">(可在城的空间健身房和游泳池使用)</span>
        </div>
        <div>
          <span>有效时间</span>
          <span>{{toolClass.dateFormat(gymCardDetail.EndDate)}}</span>
        </div>
      </div>
      <div class="rule">
        <div>使用规则</div>
        <div>{{gymCardDetail.CardUseRule}}</div>
      </div>
      <div class="line">
        <img :src="Artboard" alt="" width="100%">
      </div>
      <div class="qr-code" style="margin-top:.1rem;">
        <qrCode :msg='msg' v-if="msg"></qrCode>
      </div>
    </div>
  </div>
</template>

<script>
import qrCode from '../../../components/qrCodeCard/qrCodeCard'
import Artboard from '../../../common/icon/Artboard.png'
import { createNamespacedHelpers } from 'vuex'
const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
export default {
  data () {
    return {
      msg: '',
      Artboard,
      time: '2018年3月17日'
    }
  },
  methods: {

  },
  computed: {
    ...mapCardState({
      gymCardDetail: x => x.gymCardDetail
    })
  },
  components: {
    qrCode
  },
  created () {
    this.getgymCardDetail({ customerGymId: this.$route.query.CustomerGymId }).then(() => {
      this.msg = this.gymCardDetail.CustomerGymId
    })
  },
  methods: {
    ...mapCardActions(['getgymCardDetail'])
  }
}
</script>

<style lang="scss" scoped>
@import 'page.scss';
</style>
