123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template>
- <view class="content">
- <u-image :src="venueInfo.url" mode="aspectFill" height="45vw" border-radius="10px" width="calc(100vw - 30px)" style="margin: 10px 15px;float: left;"></u-image>
- <u-section :title="venueInfo.name" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
- <view class="venue-text">
- <u-icon name="map" style="font-size: 14px;margin-right: 2px;"></u-icon>
- {{venueInfo.address}}
- </view>
- <u-section title="场馆简介" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
- <view class="venue-text">{{venueInfo.desc}}</view>
- <u-section title="班级信息" :right="false" :show-line="false" font-size="32" class="title-box"></u-section>
- <view class="filter-box">
- <u-search placeholder="请输入班级名" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
- </view>
- <view class="class-box">
- <u-card :head-border-bottom="false" :foot-border-top="false" padding="0" margin="10px" v-for="(item, index) in venueInfo.classListResList"
- :key="index" class="class-card" @click="goToClassDetail(item)">
- <view class="class-content" slot="head" style="padding-top: 10px;">
- <text class="class-name">{{item.name}}</text>
- </view>
- <view class="class-content" slot="body" style="padding-bottom: 10px;">
- <view class="class-info">
- <view class="class-info-row">
- <u-icon name="clock"></u-icon>
- {{item.classStartDate}} ~ {{item.classEndDate}}
- </view>
- <view class="class-info-row" v-for="(site, index2) in item.classExtrasList" :key="index2">
- <u-icon name="calendar" style="visibility: hidden;"></u-icon>
- <text>{{site.week}} {{site.startTime}}-{{site.endTime}}</text>
- </view>
- <view class="class-info-row">
- <u-icon name="map"></u-icon>
- {{item.address}}
- </view>
- </view>
- </view>
- <view class="class-content" slot="foot" style="padding-bottom: 10px;text-align: right;">
- <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click="goToClassDetail(item)">详情</u-button>
- </view>
- </u-card>
- </view>
- <u-top-tips ref="uTips"></u-top-tips>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from 'vuex'
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- computed: {
- ...mapGetters([
- 'customStyle',
- 'handleCustomStyle',
- ])
- },
- data() {
- return {
- filterText: '',
- venueId: '',
- venueInfo: {
- url: '',
- name: '',
- address: '',
- desc: '',
- classListResList: [],
- },
- }
- },
- onLoad(options) {
- this.venueId = options.id
- this.initialize()
- },
- onShow() {},
- onPullDownRefresh() {
- this.initialize()
- setTimeout(() => {
- uni.stopPullDownRefresh();
- }, 500)
- },
- methods: {
- // 获取初始化数据
- initialize() {
- NET.request(API.getVenueDetail, {
- id: this.venueId
- }, 'POST').then(res => {
- this.venueInfo = res.data
- }).catch(error => {
- this.$refs.uTips.show({
- title: error.message,
- type: 'warning',
- })
- })
- },
- setFilterText() {
- if(this.filterText) {
- let arr = []
- this.venueInfo.classListResList.forEach(item => {
- if(item.name.indexOf(this.filterText) >= 0) {
- arr.push(item)
- }
- })
- this.venueInfo.classListResList = arr
- } else {
- this.initialize()
- }
- },
- // 跳转班级详情
- goToClassDetail(item) {
- uni.navigateTo({
- url: '/pagesEnroll/classDetail?id=' + item.id
- });
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- @import "@/static/css/themes.scss";
- .content {
- width: 100%;
- float: left;
-
- .filter-box {
- width: 100vw;
- height: 48px;
- padding: 10px 15px;
- background-color: #FFFFFF;
- float: left;
- }
-
- .title-box {
- width: 100vw;
- padding: 10px 15px 5px 15px;
- float: left;
- box-sizing: border-box;
- }
- .venue-text {
- width: 100vw;
- padding: 5px 15px 15px 15px;
- float: left;
- box-sizing: border-box;
- color: #999999;
- font-size: 10px;
- line-height: 16px;
- }
- .class-box {
- width: 100vw;
- padding: 5px;
- float: left;
- box-sizing: border-box;
- .class-card {
- /deep/.u-border:after {
- border-radius: 20px !important;
- border-color: #999999;
- }
- .class-content {
- width: 100%;
- padding: 2px 15px;
- float: left;
- position: relative;
- }
- .class-name {
- height: 20px;
- font-weight: bold;
- font-size: 14px;
- line-height: 20px;
- }
- .class-info {
- .class-info-row {
- color: #999999;
- line-height: 18px;
- }
- }
- }
- }
- .student-box {
- max-height: 200px;
- padding: 0 15px;
- margin: 25px 0 0 0;
- box-sizing: border-box;
- overflow: auto;
- /deep/.u-card__head {
- padding-bottom: 0px !important;
- }
- }
- }
- </style>
|