memberCardList.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="content">
  3. <view class="card-list" v-for="(item, index) in tableList" :key="index" @click="goToPay(item)">
  4. <view class="card-label">{{item.typeValue}}</view>
  5. <view class="card-num">¥{{item.amount}}</view>
  6. <view class="card-icon iconfont iconzu4931"></view>
  7. </view>
  8. <u-top-tips ref="uTips"></u-top-tips>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. mapGetters
  14. } from 'vuex'
  15. const NET = require('@/utils/request')
  16. const API = require('@/config/api')
  17. export default {
  18. computed: {
  19. ...mapGetters([])
  20. },
  21. data() {
  22. return {
  23. tableList: [],
  24. }
  25. },
  26. onLoad() {
  27. this.getTableList()
  28. },
  29. onReady() {},
  30. methods: {
  31. // 获取列表数据
  32. getTableList() {
  33. NET.request(API.getMemberCardList, {}, 'POST').then(res => {
  34. this.tableList = res.data
  35. }).catch(error => {
  36. this.$refs.uTips.show({
  37. title: error.message,
  38. type: 'warning',
  39. })
  40. })
  41. },
  42. goToPay(site) {
  43. uni.navigateTo({
  44. url: '/pagesMain/openMember?id=' + site.id
  45. });
  46. }
  47. },
  48. }
  49. </script>
  50. <style>
  51. page {
  52. width: 100%;
  53. height: 100%;
  54. }
  55. </style>
  56. <style lang="scss" scoped>
  57. @import "@/static/css/themes.scss";
  58. .content {
  59. width: 100%;
  60. float: left;
  61. overflow-y: auto;
  62. .card-list {
  63. width: calc(100% - 30px);
  64. margin: 10px 15px;
  65. padding: 15px 20px;
  66. float: left;
  67. background-color: #FFFFFF;
  68. border-radius: 15px;
  69. box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
  70. position: relative;
  71. overflow: hidden;
  72. .card-label {
  73. width: 100%;
  74. margin-bottom: 10px;
  75. float: left;
  76. font-size: 18px;
  77. font-weight: bold;
  78. line-height: 20px;
  79. }
  80. .card-num {
  81. width: 100%;
  82. float: left;
  83. font-size: 28px;
  84. line-height: 28px;
  85. color: $mainColor;
  86. }
  87. .card-icon {
  88. font-size: 80px;
  89. color: $mainColor;
  90. position: absolute;
  91. right: -15px;
  92. bottom: -15x;
  93. opacity: 0.5;
  94. }
  95. }
  96. }
  97. </style>