|
@@ -2,12 +2,15 @@
|
|
|
<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">{{venueInfo.address}}</view>
|
|
|
+ <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="class-box">
|
|
|
- <u-card :head-border-bottom="false" :show-foot="false" padding="0" margin="10px" v-for="(item, index) in venueInfo.classListResList"
|
|
|
+ <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>
|
|
@@ -17,11 +20,37 @@
|
|
|
<view class="class-info-row">{{item.classStartDate}} {{item.classStartHours}} {{item.residue}}课时</view>
|
|
|
<view class="class-info-row">{{item.address}}</view>
|
|
|
</view>
|
|
|
- <view class="class-handle" @click.stop="goToSubscribelForm(item)">预约</view>
|
|
|
+ </view>
|
|
|
+ <view class="class-content" slot="foot" style="padding-bottom: 10px;text-align: right;">
|
|
|
+ <u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
|
|
|
+ :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="cardHandle(item, 2)">报名</u-button>
|
|
|
</view>
|
|
|
</u-card>
|
|
|
</view>
|
|
|
- <u-top-tips ref="uTips"></u-top-tips>
|
|
|
+ <u-popup v-model="enlistShow" mode="bottom" border-radius="30" :closeable="true">
|
|
|
+ <scroll-view scroll-y class="student-box">
|
|
|
+ <u-card :title="item.studentName" title-size="32" :head-style="cardStyle" :head-border-bottom="false" :show-foot="false"
|
|
|
+ margin="10px" borderRadius="20" v-for="(item, index) in studentList1" :key="index" @click="enlistStudent(item)">
|
|
|
+ <view class="student-card" slot="body">
|
|
|
+ <view class="class-info-text">性别:{{item.sex}} 年龄:{{item.age}}</view>
|
|
|
+ </view>
|
|
|
+ </u-card>
|
|
|
+ </scroll-view>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
|
|
|
+ </u-popup>
|
|
|
+ <u-popup v-model="subscribeShow" mode="bottom" border-radius="30">
|
|
|
+ <scroll-view scroll-y class="student-box">
|
|
|
+ <u-card :title="item.studentName" title-size="32" :head-style="cardStyle" :head-border-bottom="false" :show-foot="false"
|
|
|
+ margin="10px" borderRadius="20" v-for="(item, index) in studentList2" :key="index" @click="subscribeStudent(item)">
|
|
|
+ <view class="student-card" slot="body">
|
|
|
+ <view class="class-info-text">性别:{{item.sex}} 年龄:{{item.age}}</view>
|
|
|
+ </view>
|
|
|
+ </u-card>
|
|
|
+ </scroll-view>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px'}" @click="goToSubscribelForm()">新增学员</u-button>
|
|
|
+ </u-popup>
|
|
|
+ <u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -35,6 +64,9 @@
|
|
|
computed: {
|
|
|
...mapGetters([
|
|
|
'mainColor',
|
|
|
+ 'customStyle',
|
|
|
+ 'handleCustomStyle',
|
|
|
+ 'handleDefaultCustomStyle',
|
|
|
])
|
|
|
},
|
|
|
data() {
|
|
@@ -47,13 +79,38 @@
|
|
|
desc: '',
|
|
|
classListResList: [],
|
|
|
},
|
|
|
+ classId: '',
|
|
|
+ cardStyle: {
|
|
|
+ fontWeight: 'bold'
|
|
|
+ },
|
|
|
+ enlistShow: false,
|
|
|
+ studentList1: [],
|
|
|
+ subscribeShow: false,
|
|
|
+ studentList2: [],
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.venueId = options.id
|
|
|
this.initialize()
|
|
|
},
|
|
|
- onReady() {},
|
|
|
+ onShow() {
|
|
|
+ NET.request(API.getEnlistAbleStudent, {}, 'POST').then(res => {
|
|
|
+ this.studentList1 = res.data.row
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ NET.request(API.getSubscribeAbleList, {}, 'POST').then(res => {
|
|
|
+ this.studentList2 = res.data.row
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
onPullDownRefresh() {
|
|
|
this.initialize()
|
|
|
setTimeout(() => {
|
|
@@ -63,13 +120,13 @@
|
|
|
methods: {
|
|
|
// 获取初始化数据
|
|
|
initialize() {
|
|
|
- NET.request(API.getVenueList, {
|
|
|
+ NET.request(API.getVenueDetail, {
|
|
|
id: this.venueId
|
|
|
}, 'POST').then(res => {
|
|
|
- this.swiperList = res.data
|
|
|
+ this.venueInfo = res.data
|
|
|
}).catch(error => {
|
|
|
this.$refs.uTips.show({
|
|
|
- title: '获取场馆详情失败',
|
|
|
+ title: error.message,
|
|
|
type: 'warning',
|
|
|
})
|
|
|
})
|
|
@@ -80,10 +137,55 @@
|
|
|
url: '/pagesMember/classDetail?id=' + item.id
|
|
|
});
|
|
|
},
|
|
|
- // 跳转预定表单
|
|
|
- goToSubscribelForm(item) {
|
|
|
+ // 弹出
|
|
|
+ cardHandle(item, type) {
|
|
|
+ this.classId = item.id
|
|
|
+ if (type == 1) {
|
|
|
+ this.subscribeShow = true
|
|
|
+ } else {
|
|
|
+ this.enlistShow = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 学员报名
|
|
|
+ enlistStudent(item) {
|
|
|
+ NET.request(API.enlistStudent, {
|
|
|
+ classId: this.classId,
|
|
|
+ studentId: item.studentId,
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ this.enlistShow = false
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 学员预约
|
|
|
+ subscribeStudent(item) {
|
|
|
+ NET.request(API.subscribeStudent, {
|
|
|
+ classId: this.classId,
|
|
|
+ studentId: item.studentId,
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ this.subscribeShow = false
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 跳转新增学员表单
|
|
|
+ goToSubscribelForm() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pagesMember/subscribelForm?id=' + item.id
|
|
|
+ url: '/pagesMember/subscribelForm'
|
|
|
});
|
|
|
},
|
|
|
},
|
|
@@ -141,28 +243,23 @@
|
|
|
}
|
|
|
|
|
|
.class-info {
|
|
|
- width: calc(100% - 56px);
|
|
|
- float: left;
|
|
|
-
|
|
|
.class-info-row {
|
|
|
color: #999999;
|
|
|
line-height: 18px;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .class-handle {
|
|
|
- width: 52px;
|
|
|
- height: 22px;
|
|
|
- border-radius: 10px;
|
|
|
- background-color: $mainColor;
|
|
|
- line-height: 22px;
|
|
|
- color: #FFFFFF;
|
|
|
- text-align: center;
|
|
|
- right: 15px;
|
|
|
- top: 50%;
|
|
|
- position: absolute;
|
|
|
- transform: translateY(-55%);
|
|
|
- }
|
|
|
+ .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;
|
|
|
}
|
|
|
}
|
|
|
}
|