venueMore.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. import {
  28. mapGetters
  29. } from 'vuex'
  30. const NET = require('@/utils/request')
  31. const API = require('@/config/api')
  32. export default {
  33. data() {
  34. return {
  35. venueList: []
  36. }
  37. },
  38. computed: {
  39. ...mapGetters([
  40. 'handleCustomStyle',
  41. ])
  42. },
  43. onLoad() {
  44. // 附件场馆
  45. NET.request(API.getVenueList, uni.getStorageSync('locationData'), 'POST').then(res => {
  46. this.venueList = res.data
  47. }).catch(error => {
  48. this.$refs.uTips.show({
  49. title: error.message,
  50. type: 'warning',
  51. })
  52. setTimeout(() => {
  53. uni.navigateBack()
  54. },1000)
  55. })
  56. },
  57. methods: {
  58. // 跳转场馆详情
  59. goToVenueDetail(item) {
  60. uni.navigateTo({
  61. url: '/pagesMain/venueDetail?id=' + item.id
  62. });
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. @import "@/static/css/themes.scss";
  69. .content {
  70. width: 100%;
  71. float: left;
  72. .venue-box {
  73. width: 100vw;
  74. float: left;
  75. /deep/.u-card--border:after {
  76. border-color: #cccccc;
  77. border-radius: 15px;
  78. }
  79. .venue-card {
  80. min-width: 100vw;
  81. display: inline-block;
  82. .venue-content {
  83. padding: 0px 15px 10px 15px;
  84. .venue-name {
  85. height: 20px;
  86. font-weight: bold;
  87. font-size: 15px;
  88. line-height: 20px;
  89. }
  90. .info-text {
  91. color: #999999;
  92. line-height: 18px;
  93. /deep/.u-icon {
  94. margin-right: 5px;
  95. font-size: 14px;
  96. }
  97. }
  98. }
  99. }
  100. }
  101. }
  102. </style>