vip.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!--
  2. * @Description:
  3. * @Author: 欧阳承珺
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-11-02 10:18:11
  6. * @LastEditTime: 2022-11-17 09:32:10
  7. -->
  8. <template>
  9. <div>
  10. <div>
  11. <p class="py-15px text-20px leading-28px">会员购买记录</p>
  12. </div>
  13. <client-only>
  14. <el-table :data="tableData" :default-sort="{ prop: 'createDate', order: 'descending' }">
  15. <el-table-column label="类目" prop="totalPoints"></el-table-column>
  16. <el-table-column label="金额" prop="price"></el-table-column>
  17. <el-table-column label="订单编号"></el-table-column>
  18. <el-table-column label="时间" prop="createDate"></el-table-column>
  19. <!-- 表格无数据显示 -->
  20. <div slot="empty">
  21. <div class="table-empty"></div>
  22. <p class="text-14px" style="color:rgba(0,0,0,0.54)">没有任何消费记录</p>
  23. <p class="leading-20px mt-8px mb-100px text-14px" style="color:rgba(0,0,0,0.38)">每一分钱都花在了刀刃上</p>
  24. </div>
  25. </el-table>
  26. </client-only>
  27. </div>
  28. </template>
  29. <script>
  30. import { mapState } from 'vuex'
  31. export default {
  32. layout: 'userCenter',
  33. middleware: ['auth', 'user'],
  34. data() {
  35. return {
  36. tableData: []
  37. }
  38. },
  39. head() {
  40. return {
  41. title: '17PDF Reader - 个人中心',
  42. meta: [
  43. {
  44. name: 'keywords',
  45. content: 'PDFReader,pdfreader,17PDF Reader,pdf软件,PDF阅读器,文件扫描'
  46. },
  47. {
  48. hid: 'description',
  49. content: '17PDF Reader是行走的PDF阅读器和文件扫描仪,并提供免费的PDF文件格式转换工具,支持pdf转word,pdf转doc,pdf转ppt,pdf转图片等。17PDF Reader被用户誉为“亚洲的Adobe”,拥有自主产权的PDF核心技术,为商务精英、教育族群及企业提供全方位的PDF文件解决方案。'
  50. },
  51. ]
  52. }
  53. },
  54. mounted() {
  55. this.getTableData()
  56. },
  57. methods: {
  58. getTableData() {
  59. this.$axios.get("/members/getMemberInfo").then((res) => {
  60. if (res.code === 200) {
  61. const change = []
  62. res.result.setPricingList.forEach(item => {
  63. const totalPoints = item.setPricings.period.split(".")[0] + "个月"
  64. const price = "¥" + item.price + ".0"
  65. const id = ''
  66. const createDate = item.createDate
  67. const all = { totalPoints, price, id, createDate }
  68. change.push(all)
  69. });
  70. this.tableData = change
  71. }
  72. })
  73. }
  74. },
  75. computed: {
  76. ...mapState([
  77. "globalLoginVisiable",
  78. ]),
  79. },
  80. watch:{
  81. globalLoginVisiable(newValue){
  82. if(!newValue){
  83. this.getTableData()
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .el-table {
  91. th {
  92. background-color: #f4f4f4 !important;
  93. font-size: 16px;
  94. color: #666666;
  95. font-weight: normal;
  96. }
  97. }
  98. .table-empty {
  99. margin-top: 50px;
  100. height: 200px;
  101. background: url(http://cn-file.17pdf.com/website/members/pic_noconsumption.png) no-repeat center center;
  102. }
  103. </style>