<template>
  <view class="page">
    <view class="title">
      <view class="name">{{ data.name }}</view>
      <image :src="data.logo" class="logo"></image>
    </view>
    <view class="content">
      <view class="content-title">权益介绍</view>
      <view v-html="data.intro" />
    </view>
  </view>
</template>

<script>
import { getVipDetail } from "@/lib/api/vip";

export default {
  name: "VipDetail",
  data() {
    return {
      id: 0,
      data: null,
    };
  },
  onLoad(data) {
    this.id = data.id;
    this.getVipDetail();
  },
  methods: {
    async getVipDetail() {
      const data = await getVipDetail(this.id);
      this.data = data.data;
    },
  },
};
</script>

<style lang="scss">
page {
  background: #f5f5f5;
}
.title {
  display: flex;
  align-items: center;
  margin: 40rpx;
  padding: 40rpx;
  background-color: #fff;
  border-radius: 20rpx;
  .name {
    flex: 1;
    font-weight: bold;
  }
  .logo {
    display: block;
    width: 160rpx;
    height: 160rpx;
  }
}
.content {
  padding: 30rpx 40rpx;
  font-size: 28rpx;
  line-height: 1.5;
  background-color: #fff;
  .content-title {
    margin-bottom: 20rpx;
    font-size: 36rpx;
  }
}
</style>
