123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876 |
- <template>
- <view>
- <u-navbar :title="classDetail.className"></u-navbar>
- <view class="picture" v-if="courseBase.posterUrl != null">
- <!-- <view class="icon" @click="backHomePage">
- <u-icon name="arrow-left" color="#ffffff"></u-icon>
- </view> -->
- <!-- <view class="wrap">
- <u-swiper :list="swiperList" mode="number" indicator-pos="bottomRight" :autoplay="false"
- height="550"></u-swiper>
- </view> -->
- <img :src="courseBase.posterUrl" alt="">
- <!-- <view class="tag">
- 1/5
- </view> -->
- </view>
- <view class="space">
- </view>
- <view class="main">
- <view class="infos">
- <view class="title">
- {{classDetail.className}}
- </view>
- <!-- <view class="price">
- <text>¥1000元</text> / 36课次(春季班)
- </view> -->
- <view class="time" v-if="classDetail.scheduleBuilderList != null">
- <view class="name">
- 时间
- </view>
- <view class="content">
- 周{{classWeek}} {{classTime}}
- </view>
- </view>
- <view class="location">
- <view class="name">
- 地址
- </view>
- <view class="content">
- <view class="text" v-if="courseBase.suitSchool == '1'">
- 青少年宫校区
- </view>
- <view class="text" v-if="courseBase.suitSchool == '2'">
- 分校区
- </view>
- <view class="img">
- <img src="../../../assets/img/riFill-navigation-fill@1x.png" alt="">
- </view>
- </view>
- </view>
- <view class="classroom">
- <view class="name">
- 教室
- </view>
- <view class="content">
- {{classDetail.classRoomN}}
- </view>
- </view>
- </view>
- <view class="teacher">
- <view class="title">
- 授课老师
- </view>
- <view class="teacher-card">
- <view class="item"
- @click="gotoUrl('pages/parents/teacherHomepage/teacherHomepage?id=' + classDetail.courseTeachers)">
- <view class="photo">
- <u-avatar class="avatar"
- :src="classDetail.teachersHeadPhoto!=null ?
- classDetail.teachersHeadPhoto : '../../assets/img/head.png'" size="96">
- </u-avatar>
- </view>
- <view class="teacher-name">
- <view class="name">
- {{classDetail.courseTeachersN}}
- </view>
- <view class="status">
- 主讲老师
- </view>
- </view>
- <view class="more">
- <u-icon name="arrow-right" color="#cccccc"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <view class="tag">
- <view class="item">
- <!-- <view class="icon">
- <u-icon name="phone" color="#0DBAC7" size="48"></u-icon>
- </view> -->
- <view class="name">
- 咨询电话:
- </view>
- <view class="phone-teacher">
- {{classDetail.consultPhone != null ? classDetail.consultPhone : '暂无'}}
- </view>
- </view>
- <!-- <u-line color="#0DBAC7" direction="col" length="24" />
- <view class="item">
- <view class="icon">
- <u-icon name="email" color="#0DBAC7" size="48"></u-icon>
- </view>
- <view class="name">
- 金牌教师
- </view>
- </view>
- <u-line color="#0DBAC7" direction="col" length="24" />
- <view class="item">
- <view class="icon">
- <u-icon name="weixin-fill" color="#0DBAC7" size="48"></u-icon>
- </view>
- <view class="name">
- 品质保障
- </view>
- </view> -->
- </view>
- <view class="class-detail">
- <view class="title">
- 课程详情
- </view>
- <view class="detail">
- {{courseBase.remark!=null ? courseBase.remark : '无'}}
- </view>
- <!-- <view class="img">
- <img src="../../../assets/img/detaiimg.png" alt="">
- </view> -->
- </view>
- <!-- <view class="school-age">
- <view class="title">
- 适学年龄
- </view>
- <view class="content">
- 适合4-12岁儿童、青少年
- </view>
- </view>
- <view class="target">
- <view class="title">
- 课程目标
- </view>
- <view class="content">
- 了解足球相关基础知识,培养兴趣。
- </view>
- </view> -->
- </view>
- <view class="bottom">
- <view class="shopping-car" @click="toShoppingCar">
- <view class="icon">
- <u-icon name="shopping-cart" color="#777777" size="40"></u-icon>
- </view>
- <view class="text">
- 购物车
- </view>
- </view>
- <button class="add" @click="popShowClick">加入购物车</button>
- </view>
-
- <u-toast ref="uToast" />
- <!-- 已经报名 -->
- <!-- <view class="bottom">
- <button class="registered">已报名,请于一周内缴费</button>
- </view> -->
- <!-- 弹出层 -->
- <view >
- <u-popup v-model="popShow" mode="bottom" :closeable='true'>
-
- <view class="popup">
- <view class="class-infos">
- <view class="picture" v-if="courseBase.posterUrl != null">
- <img :src="courseBase.posterUrl" alt="">
- </view>
- <view class="picture" v-else>
- <img src="../../../assets/img/courseD.png" alt="">
- </view>
- <view class="infos">
- <view class="class-name">
- {{courseBase.courseName}}
- </view>
- <view class="price">
- {{packageDetail.unitPrice!=null && packageDetail.courseAmount!=null ?
- Math.round(packageDetail.unitPrice*packageDetail.courseAmount+packageDetail.waterElectricityAmount) : '0.00'}}元
- </view>
- <!-- <view class="price-detail" v-if="packageDetail.unitPrice!=null && packageDetail.courseAmount!=null">
- (包含报名费{{(packageDetail.unitPrice*packageDetail.courseAmount).toFixed(2)}}元 水电费{{packageDetail.waterElectricityAmount.toFixed(2)}}元)
- </view> -->
- </view>
- </view>
- <!-- 报名班级 -->
- <view class="sign-up">
- <view class="title">
- 报名班级
- </view>
- <view class="options">
- <view class="item" v-for="(item,index) in tclassList" :key="index"
- :class="activeClass==index ? '' : 'item-state2'" @click="choseClass(item,index)">
- {{item.className}}
- </view>
- </view>
- </view>
- <!-- 选择套餐 -->
- <view class="set-meal" v-if="coursePackageList.length != 0">
- <view class="title">
- 选择套餐
- </view>
- <view class="options">
- <view class="item" v-for="(item,index) in coursePackageList" :key="index"
- :class="activePackage==index ? '' : 'item-state2'" @click="chosePackage(item,index)">
- {{item.packageName}}班 {{item.courseAmount}}课时
- </view>
- </view>
- </view>
-
- <!-- 报名学生 -->
- <view class="apply-student">
- <view class="title">
- 报名学生
- </view>
- <view class="options">
- <view class="item" v-for="(item,index) in studentList" :key="index"
- :class="activeStudent==index ? 'item-checked' : ''" @click="choseStudent(item,index)">
- <view class="photo">
- <u-avatar class="avatar" mode="square"
- :src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="80">
- </u-avatar>
- </view>
- <view class="infos">
- <view class="name-age">
- <view class="name">
- {{item.studentName}}
- </view>
- <view class="age">
- {{item.age}}岁
- </view>
- </view>
- <view class="tel">
- {{item.firstContactPhone}}
- </view>
- </view>
- </view>
- </view>
- </view>
-
- <!-- 加入购物车 -->
- <view class="btn-box">
- <button class="add" @click="addShoppingCart">加入购物车</button>
- </view>
- <view class="" style="height: 24rpx;">
-
- </view>
- </view>
-
- </u-popup>
- </view>
- </view>
- </template>
- <script>
- import * as mineApi from '@/apis/parents/mine.js'
- import * as courseApi from '@/apis/parents/course.js'
- import * as shoppingCarApi from '@/apis/parents/shoppingCar.js'
-
- export default {
- data() {
- return {
- swiperList: [{
- image: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
- }
- ],
- courseId: '',
- classId: '',
- courseBase: {},
- coursePackageList: [],
- tclassList: [],
- classDetail: {},
- packageDetail: {},
- studentId: '',
- stuDetail: {},
- show: false,
- studentList: [],
- popShow:false,
- activeClass: 0,
- activePackage: 0,
- activeStudent: 0,
- shoppingCartList: [],
- shoppDetail: {},
- classWeek: '',
- classTime: ''
- }
- },
- onLoad(op) {
- if(op.id) {
- this.courseId = op.id;
- this.classId = op.classId;
- this.getCourseDetail();
- }
- },
- onReady() {
- if (this.carhelp.getStudentId()) {
- this.studentId = this.carhelp.getStudentId().studentId;
- }
- if (this.carhelp.getShoppingCartList()) {
- this.shoppingCartList = this.carhelp.getShoppingCartList();
- }
- this.getStudentList();
- },
- methods: {
- popShowClick() {
- if(this.studentList != 0) {
- this.popShow = true;
- } else {
- this.$refs.uToast.show({
- title: '请先添加子女',
- type: 'warning',
- url: '/pages/parents/mine/addChildInformation'
- })
- }
- },
- toShoppingCar() {
- uni.redirectTo({
- url: '/pages/parents/course/shoppingCar'
- });
- },
- addShoppingCart() {
- this.popShow = false;
- var data = {
- studentId: this.stuDetail.studentId,
- packageId: this.packageDetail.packageId,
- classId: this.classDetail.classId,
- studentType: '1'
- }
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- shoppingCarApi.add(data).then((res) => {
- uni.hideLoading();
- uni.showToast({
- title: '加入购物车成功',
- icon: "none"
- })
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- choseClass(item,index) {
- this.activeClass = index;
- this.classDetail = item;
- },
- chosePackage(item,index) {
- this.activePackage = index;
- this.packageDetail = item;
- if(this.packageDetail.unitPrice == null) {
- this.packageDetail.unitPrice = 0;
- }
- if(this.packageDetail.waterElectricityAmount == null) {
- this.packageDetail.waterElectricityAmount = 0;
- }
- },
- choseStudent(item,index) {
- this.activeStudent = index;
- this.stuDetail = item;
- },
- getStudentList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- mineApi.studentList().then((res) => {
- uni.hideLoading();
- this.studentList = res.data.studentList;
- for (var i = 0; i < this.studentList.length; i++) {
- if(this.studentList[i].studentId == this.studentId) {
- this.stuDetail = this.studentList[i];
- this.activeStudent = i;
- }
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getCourseDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- courseApi.getCourseDetail({
- courseId: this.courseId,
- classId: this.classId
- }).then((res) => {
- uni.hideLoading();
- this.courseBase = res.data.courseBase;
- this.coursePackageList = res.data.coursePackageList;
- if(this.coursePackageList.length != 0) {
- this.packageDetail = this.coursePackageList[0];
- if(this.packageDetail.unitPrice == null) {
- this.packageDetail.unitPrice = 0;
- }
- if(this.packageDetail.waterElectricityAmount == null) {
- this.packageDetail.waterElectricityAmount = 0;
- }
- }
- this.tclassList = res.data.tclassList;
-
- for (var i = 0; i < this.tclassList.length; i++) {
- if(this.tclassList[i].classId == this.classId) {
- this.classDetail = this.tclassList[i];
- this.activeClass = i;
- }
- }
-
- var week = this.classDetail.scheduleBuilderList[0].repeatSet;
- if(week.indexOf('1') != -1) {
- week = week.replace('1','一');
- }
- if(week.indexOf('2') != -1) {
- week = week.replace('2','二');
- }
- if(week.indexOf('3') != -1) {
- week = week.replace('3','三');
- }
- if(week.indexOf('4') != -1) {
- week = week.replace('4','四');
- }
- if(week.indexOf('5') != -1) {
- week = week.replace('5','五');
- }
- if(week.indexOf('6') != -1) {
- week = week.replace('6','六');
- }
- if(week.indexOf('0') != -1) {
- week = week.replace('0','日');
- }
- this.classWeek = week;
- this.classTime = this.classDetail.scheduleBuilderList[0].coursePeriods
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- padding-bottom: 132px;
- background-color: #fff;
- }
- .picture {
- height: 280px;
- position: relative;
- .icon {
- position: absolute;
- left: 10px;
- top: 10px;
- z-index: 1;
- font-size: 20px;
- }
- .tag {
- width: 120rpx;
- line-height: 64rpx;
- border-radius: 50px;
- background-color: rgba(0, 0, 0, 0.5);
- color: rgba(255, 255, 255, 1);
- font-size: 14px;
- text-align: center;
- position: absolute;
- right: 16px;
- bottom: 23px;
- }
-
- img {
- width: 100%;
- height: 100%;
- }
- }
- .space {
- background-color: #fff;
- border-radius: 24rpx 24rpx 0px 0px;
- height: 22px;
- width: 100%;
- margin-top: -12px;
- position: absolute;
- left: 0;
- right: 0;
- border-bottom: none;
- }
- .main {
- background-color: rgba(255, 255, 255, 1);
- padding: 16rpx 40rpx;
- .infos {
- .title {
- line-height: 26px;
- color: rgba(51, 51, 51, 1);
- font-size: 20px;
- font-weight: bold;
- }
- .price {
- margin-top: 16px;
- font-size: 18px;
- text {
- color: rgba(255, 61, 0, 1);
- }
- }
- .time,
- .location,
- .classroom {
- display: flex;
- margin-top: 12px;
- line-height: 24px;
- .name {
- color: rgba(119, 119, 119, 1);
- }
- .content {
- color: rgba(51, 51, 51, 1);
- margin-left: 12px;
- flex: 1;
- display: flex;
- justify-content: space-between;
- .img {
- width: 20px;
- height: 20px;
- img {
- width: 100%;
- height: 100%;
- vertical-align: middle;
- }
- }
- }
- }
- }
- .title {
- color: rgba(51, 51, 51, 1);
- font-size: 18px;
- font-weight: bold;
- }
- .teacher {
- margin-top: 40px;
- .teacher-card {
- margin-top: 24rpx;
- display: flex;
- justify-content: space-between;
- .item {
- width: 47.5%;
- padding: 24rpx 0 24rpx 24rpx;
- border-radius: 24rpx;
- background-color: rgba(236, 236, 236, 1);
- display: flex;
- }
- .photo {
- width: 96rpx;
- height: 96rpx;
- overflow: hidden;
- border-radius: 100rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .teacher-name {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- margin-left: 16rpx;
- .name {
- line-height: 44rpx;
- font-size: 32rpx;
- color: rgba(51, 51, 51, 1);
- }
- .status {
- color: rgba(119, 119, 119, 1);
- line-height: 40rpx;
- }
- }
- .more {
- display: flex;
- align-items: center;
- margin-left: 16rpx;
- }
- }
- }
- .tag {
- margin-top: 48rpx;
- padding: 18px 12px;
- border-radius: 12px;
- background-color: rgba(13, 186, 199, 0.1);
- height: 120rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .item {
- display: flex;
- align-items: center;
- .name {
- margin-left: 8rpx;
- color: rgba(16, 16, 16, 1);
- }
-
- .phone-teacher {
- margin-left: 8px;
- }
- }
- }
- .class-detail {
- margin-top: 80rpx;
- .detail {
- color: rgba(119, 119, 119, 1);
- line-height: 20px;
- margin-top: 24rpx;
- }
- .img {
- margin-top: 40rpx;
- width: 100%;
- height: 200px;
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- .school-age,
- .target {
- margin-top: 80rpx;
- .content {
- margin-top: 12px;
- color: rgba(119, 119, 119, 1);
- }
- }
- }
- .bottom {
- width: 100%;
- background-color: rgba(255, 255, 255, 1);
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- padding: 20rpx 32rpx;
- display: flex;
- justify-content: space-between;
- .icon{
- text-align: center;
- }
- .text{
- color: rgba(16, 16, 16, 1);
- font-size: 24rpx;
- }
- .add {
- width:560rpx;
- border-radius: 50px;
- background-color: rgba(13, 186, 199, 1);
- line-height: 40px;
- color: rgba(255, 255, 255, 1);
- font-size: 16px;
- z-index: 999;
- margin-right: 0;
-
- }
- .registered{
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 50px;
- background-color: rgba(153, 153, 153, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 32rpx;
- }
- }
- // 弹出层
- .popup{
- padding: 32rpx;
- height:520px;
- padding-bottom:100rpx;
- .class-infos{
- display: flex;
- align-items: center;
- .picture{
- width: 152rpx;
- height: 152rpx;
- border-radius: 4px;
- overflow: hidden;
- img{
- width: 100%;
- height: 100%;
- }
- }
- .infos{
- margin-left: 24rpx;
- .class-name{
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- }
- .price{
- color: rgba(255, 61, 0, 1);
- font-size: 36rpx;
- margin-top: 20rpx;
- font-weight: bold;
- }
- .price-detail{
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-top: 8rpx;
- }
- }
- }
- // 报名班级 选择套餐
- .sign-up,.set-meal{
- margin-top: 24rpx;
- .title{
- color: rgba(51, 51, 51, 1);
- }
- .options{
- margin-top: 16rpx;
- display: flex;
- flex-wrap: wrap;
- .item{
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- border-radius: 4px;
- background-color: rgba(255, 255, 255, 1);
- color: rgba(13, 186, 199, 1);
- border: 1px solid rgba(13, 186, 199, 1);
- margin-right: 12rpx;
- margin-bottom: 16rpx;
- padding: 0 16rpx;
- }
- .item-state2{
- background-color: rgba(244, 246, 247, 1);
- color: rgba(51, 51, 51, 1);
- border: none;
- }
- }
- }
- // 报名学生
- .apply-student{
- margin-top: 24rpx;
- margin-bottom: 140rpx;
- .title{
- color: rgba(51, 51, 51, 1);
- }
- .options{
- margin-top: 16rpx;
- display: flex;
- flex-wrap:wrap;
- .item-checked{
- border: 1px solid rgba(13, 186, 199, 1);
- background-color: #fff !important;
- }
- .item{
- display: flex;
- align-items: center;
- padding: 16rpx;
- width: 320rpx;
- height: 112rpx;
- border-radius: 4px;
- margin-right: 16rpx;
- margin-bottom: 16rpx;
- background-color: #F4F6F7;
- .photo{
- width: 80rpx;
- height: 80rpx;
- border-radius: 2px;
- overflow: hidden;
- img{
- width: 100%;
- height: 100%;
- }
- }
- .infos{
- margin-left: 16rpx;
- .name-age{
- display: flex;
- align-items: baseline;
- .name{
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- }
- .age{
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-left: 8rpx;
- }
- }
- .tel{
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-top: 4rpx;
- }
- }
- }
- }
- }
- .btn-box{
- background-color:#fff;
- padding: 32rpx;
- position: fixed;
- bottom: 0rpx;
- left: 0rpx;
- right: 0rpx;
- z-index: 99;
- }
- .add{
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 50px;
- background-color: rgba(13, 186, 199, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 32rpx;
- text-align: center;
-
-
- }
-
- }
- </style>
|