venueMore.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="content">
  3. <view class="venue-box">
  4. <u-card :head-border-bottom="false" :foot-border-top="false" title-size="32" padding="0" margin="10px" v-for="(item, index) in venueList"
  5. :key="index" class="venue-card" @click="goToVenueDetail(item)">
  6. <view class="venue-content" slot="head" style="padding-top: 10px;">
  7. <view class="venue-name">{{item.name}}</view>
  8. </view>
  9. <view class="venue-content" slot="body">
  10. <view class="info-text">
  11. <u-icon name="car"></u-icon>
  12. 距您{{item.distance}}
  13. </view>
  14. <view class="info-text">
  15. <u-icon name="map"></u-icon>
  16. {{item.address}}
  17. </view>
  18. </view>
  19. <view class="venue-content" slot="foot" style="text-align: right;">
  20. <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click="goToVenueDetail(item)">预约</u-button>
  21. </view>
  22. </u-card>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. const NET = require('@/utils/request')
  28. const API = require('@/config/api')
  29. export default {
  30. data() {
  31. return {
  32. venueList: []
  33. }
  34. },
  35. onLoad() {
  36. // 附件场馆
  37. NET.request(API.getVenueList, uni.getStorageSync('locationData'), 'POST').then(res => {
  38. this.venueList = res.data
  39. }).catch(error => {
  40. this.$refs.uTips.show({
  41. title: error.message,
  42. type: 'warning',
  43. })
  44. setTimeout(() => {
  45. uni.navigateBack()
  46. },1000)
  47. })
  48. },
  49. methods: {
  50. // 跳转场馆详情
  51. goToVenueDetail(item) {
  52. uni.navigateTo({
  53. url: '/pagesMember/venueDetail?id=' + item.id
  54. });
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. @import "@/static/css/themes.scss";
  61. .content {
  62. width: 100%;
  63. float: left;
  64. .venue-box {
  65. width: 100vw;
  66. float: left;
  67. /deep/.u-card--border:after {
  68. border-color: #cccccc;
  69. border-radius: 15px;
  70. }
  71. .venue-card {
  72. min-width: 100vw;
  73. display: inline-block;
  74. .venue-content {
  75. padding: 0px 15px 10px 15px;
  76. .venue-name {
  77. height: 20px;
  78. font-weight: bold;
  79. font-size: 15px;
  80. line-height: 20px;
  81. }
  82. .info-text {
  83. color: #999999;
  84. line-height: 18px;
  85. /deep/.u-icon {
  86. margin-right: 5px;
  87. font-size: 14px;
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
  94. </style>