MyVip.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <el-row>
  3. <el-col :md="12">
  4. <el-card class="box-card">
  5. <div slot="header" class="clearfix">
  6. <h3>我的小会员</h3>
  7. </div>
  8. <div class="text item">
  9. <el-row>
  10. <StampBadge
  11. style="position: absolute; top: 0; right: 0"
  12. size="middle"
  13. color="success"
  14. content="已支付"
  15. :rotate="45"
  16. />
  17. <el-button
  18. size="medium"
  19. type="success"
  20. @click="handleVip"
  21. >开通 VIP</el-button>
  22. </el-row>
  23. </div>
  24. </el-card>
  25. </el-col>
  26. <el-col>
  27. <div style="width: 500px; height: 100px; position: relative">
  28. <StampBadge
  29. size="small"
  30. color="warning"
  31. content="大会员"
  32. :rotate="0"
  33. />
  34. </div>
  35. </el-col>
  36. </el-row>
  37. </template>
  38. <script>
  39. import StampBadge from '@/components/StampBadge'
  40. import { vip } from '@/api/account'
  41. export default {
  42. name: 'MyVip',
  43. components: { StampBadge },
  44. data() {
  45. return {
  46. }
  47. },
  48. created() {
  49. document.title = '我的小会员'
  50. },
  51. mounted() {
  52. },
  53. methods: {
  54. handleVip() {
  55. vip().then(resp => {
  56. if (resp.code === 0) {
  57. this.$notify.info({
  58. message: 'VIP 已开通',
  59. duration: 3000
  60. })
  61. }
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped>
  68. </style>