teacher.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="page-teacher" v-if="teacherInfo">
  3. <uni-nav-bar height="200rpx" :fixed="true" title="教练介绍" color="#FFF" left-icon="left" backgroundColor="rgb(0,0,0,0)" :border="false" @clickLeft="onBack"/>
  4. <view class="section0">
  5. <view class="teach-banner"><image :src="teacherInfo.fmImg" style="width:100%;height: 100%;" mode="scaleToFill"></view>
  6. </image>
  7. </view>
  8. <view class="section1">
  9. <view class="name">
  10. <view class="text">
  11. {{teacherInfo.name}}
  12. </view>
  13. </view>
  14. <view class="intro" >
  15. <rich-text :nodes="teacherInfo.intro"></rich-text>
  16. </view>
  17. </view>
  18. <!-- <view class="section2" v-if="teacherInfo.verifyBook.length>0">
  19. <view class="title">专业认证</view>
  20. <view class="zs">
  21. <block v-for="(it,index) in teacherInfo.verifyBook">
  22. <view class="image">
  23. <image :src="it" class="img"></image>
  24. </view>
  25. </block>
  26. </view>
  27. </view> -->
  28. <view class="section3" v-if="teacherCourseList.length>0">
  29. <view class="title" >TA的私教课</view>
  30. <view class="list">
  31. <block v-for="(it,index) in teacherCourseList">
  32. <TeacherCourse :info="it" @onViewReserve="onViewReserve"></TeacherCourse>
  33. </block>
  34. </view>
  35. </view>
  36. <view class="section4">
  37. <view class="title">
  38. <view class="txt">私教课课表</view>
  39. <view class="more" @click="onViewFitness">查看其他课程</view>
  40. </view>
  41. <view class="course-date">
  42. <PlanDate @onSetDate="onSetDate"></PlanDate>
  43. </view>
  44. <!-- <view class="selection">
  45. <uni-data-select
  46. v-model="area"
  47. :localdata="dataRange"
  48. @change="onChangeArea"
  49. :clear="false"
  50. style="margin-right: 10px;"
  51. ></uni-data-select>
  52. <uni-data-select
  53. v-model="sort"
  54. :localdata="sortRange"
  55. @change="onChangeSort"
  56. :clear="false"
  57. style="margin-right: 10px;"
  58. ></uni-data-select>
  59. <uni-data-select style="margin-right: 10px;"></uni-data-select>
  60. </view> -->
  61. <view class="address">
  62. <!-- {{storeInfo.address}} -->
  63. </view>
  64. <view class="teacher-list">
  65. <block v-for="(it,index) in courseList">
  66. <CourseItem :info="it" @onStart="onStartCourse"></CourseItem>
  67. </block>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. mapState,
  75. mapGetters,
  76. mapMutations
  77. } from 'vuex'
  78. const app = getApp();
  79. let hideLoading = true;
  80. import TeacherCourse from '@/components/TeacherCourse/TeacherCourse.vue'
  81. import CourseItem from "@/components/CourseItem/CourseItem.vue"
  82. import PlanDate from '@/components/PlanDate/PlanDate.vue'
  83. export default {
  84. components:{
  85. TeacherCourse,
  86. CourseItem,
  87. PlanDate
  88. },
  89. data() {
  90. return {
  91. teacherId:0,
  92. teacherInfo:null,
  93. teacherCourseList:[],
  94. storeInfo:null,
  95. courseList:[],
  96. sort:'',
  97. area:'',
  98. dataRange:[
  99. {
  100. value:'',
  101. text:'所在区域',
  102. },
  103. ],
  104. sortRange:[
  105. {
  106. value:'1',
  107. text:'距离最近',
  108. }
  109. ],
  110. queryForm:{
  111. page:0,
  112. pageSize:10,
  113. teacherId:0,
  114. }
  115. };
  116. },
  117. computed: {
  118. ...mapState(['store_id','systemInfo'])
  119. },
  120. onLoad(options){
  121. this.teacherId=options.id||0;
  122. this.queryForm.teacherId=this.teacherId;
  123. this.initTeacherInfo();
  124. this.onSearchCourse();
  125. },
  126. methods:{
  127. onChangeSort(e){
  128. },
  129. onChangeArea(e){
  130. },
  131. onViewReserve(e){
  132. uni.navigateTo({
  133. url:'/pages/fitness/Reserve/Reserve?teacherId='+this.teacherId+"&courseId="+e,
  134. })
  135. },
  136. onViewFitness(e){
  137. uni.switchTab({
  138. url:'/pages/fitness/index/index',
  139. })
  140. },
  141. onBack(e){
  142. uni.navigateBack(-1);
  143. },
  144. onSetDate(e){
  145. let _this=this;
  146. _this.queryForm.startTime=e+" 00:00:00";
  147. _this.queryForm.endTime=e+" 23:00:00";
  148. _this.queryForm.page=0;
  149. _this.onSearchCourse();
  150. },
  151. //开始课程
  152. onStartCourse(e){
  153. uni.navigateTo({
  154. url:"/pages/fitness/Course/Course?id="+e
  155. })
  156. },
  157. onSearchCourse(){
  158. let _this=this;
  159. if(_this.queryForm.page<1){
  160. _this.courseList=[];
  161. }
  162. _this.queryForm.page++;
  163. this.$http.request('course/searchCourse', _this.queryForm, "", "", hideLoading).then(res => {
  164. _this.courseList=res.data.dataList;
  165. }).catch(err => {})
  166. },
  167. //搜索教练课程
  168. searchTeacherCourseList(){
  169. // let _this=this;
  170. // this.$http.request('fitness/courseList', {
  171. // store_id:_this.store_id,
  172. // coach_id:_this.teacherId
  173. // }, "", "", hideLoading).then(res => {
  174. // _this.teacherCourseList=res.data.list;
  175. // _this.storeInfo=res.data.store;
  176. // }).catch(err => {})
  177. },
  178. //初始化教练信息
  179. initTeacherInfo(){
  180. let _this=this;
  181. this.$http.request('course/teacher', {
  182. id:_this.teacherId
  183. }, "", "", hideLoading).then(res => {
  184. _this.teacherInfo=res.data.info;
  185. _this.teacherCourseList=res.data.courseList;
  186. }).catch(err => {})
  187. },
  188. }
  189. }
  190. </script>
  191. <style lang="scss">
  192. @import "./teacher.scss";
  193. </style>