|
@@ -52,8 +52,11 @@
|
|
|
</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="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
|
|
|
+ :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button -->
|
|
|
+
|
|
|
+ <u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
|
|
|
+ :hair-line="false" plain @click.stop="cardHandle(item)">体验</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>
|
|
@@ -70,18 +73,35 @@
|
|
|
<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
|
|
|
@click="goToSubscribelForm()">新增学员</u-button>
|
|
|
</u-popup>
|
|
|
- <u-popup v-model="subscribeShow" mode="bottom" border-radius="30">
|
|
|
+
|
|
|
+ <!-- 体验 -->
|
|
|
+ <u-popup v-model="appointShow" mode="center" border-radius="30" width="600rpx">
|
|
|
+ <view class="common-title">预约体验</view>
|
|
|
+ <view class="menber-box">
|
|
|
+ <u-form :model="form" ref="uForm" :rules="formRules">
|
|
|
+ <u-form-item label="学生" prop="studentName" required><u-input v-model="form.studentName" type="select" placeholder="请选择学生" @click="subscribeShow = true" /></u-form-item>
|
|
|
+ <u-form-item label="时间" prop="appointmentDate" required><u-input v-model="form.appointmentDate" type="select" placeholder="请选择时间" @click="timeShow = true" /></u-form-item>
|
|
|
+ </u-form>
|
|
|
+ </view>
|
|
|
+ <view class="button-box">
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="handleSubmitClick">确定</u-button>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <!-- 学生 -->
|
|
|
+ <u-popup v-model="subscribeShow" mode="bottom" border-radius="30" z-index="11111">
|
|
|
<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)">
|
|
|
+ margin="10px" borderRadius="20" v-for="(item, index) in studentList2" :key="index" @click="handleChooseStudentClick(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',float: 'left',width: 'calc(100% - 30px)'}"
|
|
|
- @click="goToSubscribelForm()">新增学员</u-button>
|
|
|
+ @click="goToSubscribelForm">新增学员</u-button>
|
|
|
</u-popup>
|
|
|
+ <!-- 时间 -->
|
|
|
+ <u-picker v-model="timeShow" mode="time" @confirm="handleChooseTimeClick"></u-picker>
|
|
|
<u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -111,6 +131,28 @@
|
|
|
desc: '',
|
|
|
classListResList: [],
|
|
|
},
|
|
|
+ formRules: {
|
|
|
+ studentName: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择学生',
|
|
|
+ trigger: ['change']
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ appointmentDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择时间',
|
|
|
+ trigger: ['change']
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ studentId: 0,
|
|
|
+ studentName: '',
|
|
|
+ appointmentDate: ''
|
|
|
+ },
|
|
|
+ appointShow: false,
|
|
|
menberList: [],
|
|
|
checkedCardList: [],
|
|
|
classId: '',
|
|
@@ -121,6 +163,7 @@
|
|
|
studentList1: [],
|
|
|
subscribeShow: false,
|
|
|
studentList2: [],
|
|
|
+ timeShow: false
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -145,6 +188,9 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ this.$refs.uForm.setRules(this.formRules);
|
|
|
+ },
|
|
|
onPullDownRefresh() {
|
|
|
this.initialize()
|
|
|
setTimeout(() => {
|
|
@@ -210,48 +256,44 @@
|
|
|
},
|
|
|
// 弹出
|
|
|
cardHandle(item, type) {
|
|
|
+ this.appointShow = true
|
|
|
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',
|
|
|
- })
|
|
|
- })
|
|
|
+ // 选择预约时间
|
|
|
+ handleChooseTimeClick(args) {
|
|
|
+ this.form.appointmentDate = args.year + '-' + args.month + '-' + args.day
|
|
|
+ this.timeShow = false
|
|
|
},
|
|
|
// 学员预约
|
|
|
- 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',
|
|
|
- })
|
|
|
- })
|
|
|
+ handleChooseStudentClick(item) {
|
|
|
+ this.form.studentId = item.studentId
|
|
|
+ this.form.studentName = item.studentName
|
|
|
+ this.subscribeShow = false
|
|
|
+ },
|
|
|
+ // 确定
|
|
|
+ handleSubmitClick() {
|
|
|
+ this.$refs.uForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ NET.request(API.appointment, {
|
|
|
+ venueId: this.venueId,
|
|
|
+ classId: this.classId,
|
|
|
+ studentId: this.form.studentId,
|
|
|
+ appointmentDate: this.form.appointmentDate
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ this.appointShow = false
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ this.appointShow = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 跳转开通支付
|
|
|
handlePayClick() {
|
|
@@ -271,6 +313,24 @@
|
|
|
url: '/pagesMember/subscribelForm'
|
|
|
});
|
|
|
},
|
|
|
+ // 学员报名
|
|
|
+ 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',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -404,4 +464,64 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .menber-box {
|
|
|
+ width: 100%;
|
|
|
+ // float: left;
|
|
|
+ padding: 10px 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .menber-col {
|
|
|
+ width: 100%;
|
|
|
+ padding: 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 15px;
|
|
|
+ box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .menber-label {
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ float: left;
|
|
|
+ font-size: 14px;
|
|
|
+ // line-height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menber-num {
|
|
|
+ width: 100%;
|
|
|
+ float: left;
|
|
|
+ font-size: 26px;
|
|
|
+ line-height: 28px;
|
|
|
+ color: $mainColor;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menber-icon {
|
|
|
+ font-size: 100px;
|
|
|
+ color: $mainColor;
|
|
|
+ position: absolute;
|
|
|
+ right: -5px;
|
|
|
+ bottom: -30px;
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .common-title {
|
|
|
+ width:100%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+ .fix-add-icon {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 15px;
|
|
|
+ right: 15px;
|
|
|
+ }
|
|
|
+ .button-box {
|
|
|
+ // width: 100%;
|
|
|
+ padding: 10px 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
</style>
|