venueDetail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="content">
  3. <u-image :src="venueInfo.url" mode="aspectFill" height="45vw" border-radius="10px" width="calc(100vw - 30px)" style="margin: 10px 15px;float: left;"></u-image>
  4. <u-section :title="venueInfo.name" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
  5. <view class="venue-text">{{venueInfo.address}}</view>
  6. <u-section title="场馆简介" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
  7. <view class="venue-text">{{venueInfo.desc}}</view>
  8. <u-section title="班级信息" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
  9. <view class="class-box">
  10. <u-card :head-border-bottom="false" :show-foot="false" padding="0" margin="10px" v-for="(item, index) in venueInfo.classListResList"
  11. :key="index" class="class-card" @click="goToClassDetail(item)">
  12. <view class="class-content" slot="head" style="padding-top: 10px;">
  13. <text class="class-name">{{item.name}}</text>
  14. </view>
  15. <view class="class-content" slot="body" style="padding-bottom: 10px;">
  16. <view class="class-info">
  17. <view class="class-info-row">{{item.classStartDate}}&nbsp;&nbsp;{{item.classStartHours}}&nbsp;&nbsp;{{item.residue}}课时</view>
  18. <view class="class-info-row">{{item.address}}</view>
  19. </view>
  20. <view class="class-handle" @click.stop="goToSubscribelForm(item)">预约</view>
  21. </view>
  22. </u-card>
  23. </view>
  24. <u-top-tips ref="uTips"></u-top-tips>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapGetters
  30. } from 'vuex'
  31. const NET = require('@/utils/request')
  32. const API = require('@/config/api')
  33. export default {
  34. computed: {
  35. ...mapGetters([
  36. 'mainColor',
  37. ])
  38. },
  39. data() {
  40. return {
  41. venueId: '',
  42. venueInfo: {
  43. url: '',
  44. name: '',
  45. address: '',
  46. desc: '',
  47. classListResList: [],
  48. },
  49. }
  50. },
  51. onLoad(options) {
  52. this.venueId = options.id
  53. this.initialize()
  54. },
  55. onReady() {},
  56. onPullDownRefresh() {
  57. this.initialize()
  58. setTimeout(() => {
  59. uni.stopPullDownRefresh();
  60. }, 500)
  61. },
  62. methods: {
  63. // 获取初始化数据
  64. initialize() {
  65. NET.request(API.getVenueList, {
  66. id: this.venueId
  67. }, 'POST').then(res => {
  68. this.swiperList = res.data
  69. }).catch(error => {
  70. this.$refs.uTips.show({
  71. title: '获取场馆详情失败',
  72. type: 'warning',
  73. })
  74. })
  75. },
  76. // 跳转班级详情
  77. goToClassDetail(item) {
  78. uni.navigateTo({
  79. url: '/pagesMember/classDetail?id=' + item.id
  80. });
  81. },
  82. // 跳转预定表单
  83. goToSubscribelForm(item) {
  84. uni.navigateTo({
  85. url: '/pagesMember/subscribelForm?id=' + item.id
  86. });
  87. },
  88. },
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. @import "@/static/css/themes.scss";
  93. .content {
  94. width: 100%;
  95. float: left;
  96. .title-box {
  97. width: 100vw;
  98. padding: 10px 15px 5px 15px;
  99. float: left;
  100. box-sizing: border-box;
  101. }
  102. .venue-text {
  103. width: 100vw;
  104. padding: 5px 15px 15px 15px;
  105. float: left;
  106. box-sizing: border-box;
  107. color: #999999;
  108. font-size: 10px;
  109. line-height: 16px;
  110. }
  111. .class-box {
  112. width: 100vw;
  113. padding: 5px;
  114. float: left;
  115. box-sizing: border-box;
  116. .class-card {
  117. /deep/.u-border:after {
  118. border-radius: 20px !important;
  119. border-color: #999999;
  120. }
  121. .class-content {
  122. width: 100%;
  123. padding: 2px 15px;
  124. float: left;
  125. position: relative;
  126. }
  127. .class-name {
  128. height: 20px;
  129. font-weight: bold;
  130. font-size: 14px;
  131. line-height: 20px;
  132. }
  133. .class-info {
  134. width: calc(100% - 56px);
  135. float: left;
  136. .class-info-row {
  137. color: #999999;
  138. line-height: 18px;
  139. }
  140. }
  141. .class-handle {
  142. width: 52px;
  143. height: 22px;
  144. border-radius: 10px;
  145. background-color: $mainColor;
  146. line-height: 22px;
  147. color: #FFFFFF;
  148. text-align: center;
  149. right: 15px;
  150. top: 50%;
  151. position: absolute;
  152. transform: translateY(-55%);
  153. }
  154. }
  155. }
  156. }
  157. </style>