<template>
  <div class="uc_vip_container">
    <div class="banner">
      <view class="banner_text">
        <text>{{ userinfo['level_name'] }}</text>
      </view>
    </div>

    <div class="content">
      <div class="title">
        <text>我的会员权益</text>
      </div>

      <!--      权益列表-->
      <van-row gutter="10" class="benefit-row">
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_1.png" alt="" class="icon1">
            <view>
              <text class="title">会员卡</text>
            </view>
            <view>
              <text class="subtitle">{{ datas.card }}张</text>
            </view>
          </view>
        </van-col>
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_2.png" alt="" class="icon2">
            <view>
              <text class="title">核销时间{{ datas.play_time }}分钟</text>
            </view>
            <view>
              <text class="subtitle">游玩限期{{ datas.validity }}个月</text>
            </view>
          </view>
        </van-col>
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_3.png" alt="" class="icon3">
            <view>
              <text class="title">参与活动</text>
            </view>
            <view>
              <text class="subtitle">{{ datas.activity }}个月内</text>
            </view>
          </view>
        </van-col>
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_4.png" alt="" class="icon4">
            <view>
              <text class="title">租售产品</text>
            </view>
            <view>
              <text class="subtitle">租{{ datas.lease_num }}套每天{{ datas.lease_time }}分钟</text>
            </view>
          </view>
        </van-col>
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_5.png" alt="" class="icon5">
            <view>
              <text class="title">参与课程</text>
            </view>
            <view>
              <text class="subtitle">{{ datas.course }}个月</text>
            </view>
          </view>
        </van-col>
        <van-col span="8">
          <view class="benefit">
            <img src="https://img.shuimuai.com/quanyi_icon_6.png" alt="" class="icon6">
            <view>
              <text class="title">邀请有奖</text>
            </view>
            <view>
              <text class="subtitle">{{ datas.activity }}个月</text>
            </view>
          </view>
        </van-col>
      </van-row>


      <!--      权益描述-->
      <view class="desc" v-html="datas.content">
      </view>
    </div>
  </div>
</template>

<script>

import {vipPowerLevel} from "../../../requests/vip";
import utils from '../../../utils/index'

var $this
export default {
  name: "uc_vip_container",
  components: {},
  data() {
    return {
      datas: [],
      userinfo: {},
    }
  },
  methods: {
    //获取页面数据初始化
    getData() {
      vipPowerLevel().then((res) => {
        let $data = res.data;
        $this.datas = $data.data
      })
    }
  }
  ,
  mounted() {
    $this.getData()
    $this.userinfo = wx.getStorageSync('userinfo')
    $this.userinfo['level_name'] = utils.get_level_name($this.userinfo['level'])
  },
  created() {
    $this = this;
  },
  onLoad() {
  }
}
</script>

<style scoped>
.banner {
  width: 100%;
  height: 100px;
  background-image: url("https://img.shuimuai.com/web/banner_huiyuan.png");
  background-size: 100% 100%;
  background-position: center;
}

.uc_vip_container .content {
  padding: 10px;
}

.uc_vip_container .content .title {
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #6B6B6B;
  line-height: 24px;

}

/*权益grid*/
.benefit {
  text-align: center;
  margin-top: 20px;
}

.benefit .icon:first-child {
  width: 44px;
  height: 31px;
}

.benefit .title {
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #6B6B6B;
  line-height: 20px;

}

.benefit .subtitle {
  font-size: 10px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #6B6B6B;
}

.desc {
  margin: 30px 0px;
  width: 355px;
  height: 273px;
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #6B6B6B;
  line-height: 20px;
  padding: 15px;
}

.banner_text {
  width: 100%;
  height: 17px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #FFFFFF;
  text-align: center;
  padding-top: 60px;

}

.icon1 {
  width: 44px;
  height: 31px;
}

.icon2 {
  width: 35px;
  height: 37px;
}

.icon3 {
  width: 45px;
  height: 43px;
}

.icon4 {
  width: 34px;
  height: 39px;
}

.icon5 {
  width: 37px;
  height: 32px;
}

.icon6 {
  width: 33px;
  height: 36px;
}
</style>
