memberCardList.vue 2.5 KB

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