<template>
  <div class="mainPage">
    <div class="title">体验卡详情</div>
    <div class="content" v-if="info !== null">
      <div class="message">
        <div>
          <span>{{info.CustomerCardName}}</span>
        </div>
        <div>
          <span>有效时间</span>
          <span>{{toolClass.dateFormat(info.StartDate,'yyyy-MM-dd') + '~' + toolClass.dateFormat(info.EndDate,'yyyy-MM-dd')}}</span>
        </div>
      </div>
      <div class="rule">
        <div>使用规则</div>
        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.CardUseInstruction}}</pre>
      </div>
      <div class="line">
        <img :src="Artboard" alt="" width="100%">
      </div>
    </div>
  </div>
</template>

<script>
import Artboard from '../../../common/icon/Artboard.png'
import { createNamespacedHelpers } from 'vuex'
const { mapActions: mapCardActions } = createNamespacedHelpers('card')
export default {
  data () {
    return {
      msg: '',
      Artboard,
      time: '2018年3月17日',
      info: null,
    }
  },
  created () {
    this.getCardInfo({ id: this.$route.query.id }).then((res) => {
      console.log(JSON.stringify(res))
      this.info = res
    })
  },
  methods: {
    ...mapCardActions(['getCardInfo'])
  }
}
</script>

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