teacher_detail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <view class="teachDeatil">
  4. <view class="head">
  5. <image class="teachImg" mode="widthFix" src="{{teachDetail[0].imgUrl || (teachDetail[3].sex == '男' ? '../../images/boy.png' : '../../images/girl.png')}}"></image>
  6. <view class="headDetail">
  7. <text class="teachName">{{teacherCourse.name}}老师</text>
  8. <text class="attribute">身份:{{teacherCourse.teacherType}}</text>
  9. <view class="transactionContainer">
  10. <text class="transaction">成</text>
  11. <text class="transactionTotal">{{teacherCourse.count}}条家教记录</text>
  12. </view>
  13. <view class="transactionList">
  14. <text>最新接单:</text>
  15. <text>{{teacherCourse.latest}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="midArea">
  20. <text>高校:{{teacherCourse.school}}</text>
  21. <text>专业:{{teacherCourse.major}}</text>
  22. <text>学历:{{teacherCourse.education}}</text>
  23. <text>籍贯:{{teacherCourse.nativePlace}}</text>
  24. </view>
  25. <view class="course">
  26. <text>可授科目:</text>
  27. <view class="courseList">{{teacherCourse.subject}}</view>
  28. </view>
  29. <view class="introduceDetail">
  30. <text class="introduce-title">自我介绍</text>
  31. <text class="introduce-body">{{teacherCourse.introduce}}</text>
  32. </view>
  33. <view class="introduceDetail">
  34. <text class="introduce-title">成功经验</text>
  35. <text class="introduce-body">{{teacherCourse.experience}}</text>
  36. </view>
  37. </view>
  38. <!-- 底部功能区 -->
  39. <view class="bottomContainer">
  40. <view class="myCollect" bindtap="toStuCollectionTeach">我收藏的老师</view>
  41. <view class="collection" wx:if="{{!teachDetail[15].collection}}" bindtap="collectTeacher">
  42. 加入收藏
  43. </view>
  44. <view class="collection" wx:else>
  45. 已收藏
  46. </view>
  47. <view class="inviteTeach">预约老师</view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. teacherCourse: ''
  56. };
  57. },
  58. onLoad(option) {
  59. this.teacherCourse = JSON.parse(option.item)
  60. this.getCountAndLastTime()
  61. this.getInfosByUid()
  62. console.log(this.teacherCourse)
  63. },
  64. methods:{
  65. // 获取最近成交时间和成交次数
  66. async getCountAndLastTime() {
  67. const query = {
  68. uid: this.teacherCourse.uid
  69. }
  70. const { data: result } = await uni.$http.get('/education/teacher-courses/queryCountAndLastTime', query)
  71. this.teacherCourse.count = result.data.count
  72. this.teacherCourse.latest = result.data.time
  73. },
  74. // 根据uid获取该老师学校学历等
  75. async getInfosByUid() {
  76. const { data: result } = await uni.$http.get('/education/teacher-certifications/findInfosByUid', { uid: this.teacherCourse.uid })
  77. this.teacherCourse.education = result.data.one.education
  78. this.teacherCourse.major = result.data.one.major
  79. this.teacherCourse.nativePlace = result.data.one.nativePlace
  80. this.teacherCourse.school = result.data.one.school
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. /* 整个页面样式 */
  87. .teachDeatil{
  88. display: flex;
  89. position: relative;
  90. flex-direction: column;
  91. margin-left: 20rpx;
  92. }
  93. .head{
  94. display: flex;
  95. }
  96. .headDetail{
  97. margin-left: 20rpx;
  98. display: flex;
  99. flex-direction: column;
  100. font-size: 28rpx;
  101. }
  102. .teachName{
  103. font-weight: bold;
  104. }
  105. .headDetail text{
  106. padding-bottom: 10rpx;
  107. }
  108. /* 头像设置 */
  109. .teachImg{
  110. width: 200rpx;
  111. }
  112. .settledDay{
  113. display: block;
  114. float: right;
  115. }
  116. /* 中部区域 */
  117. .midArea{
  118. display: flex;
  119. /* border: 1rpx solid red; */
  120. width: 96%;
  121. margin-top: 10rpx;
  122. justify-content: space-between;
  123. flex-wrap: wrap;
  124. }
  125. .midArea text{
  126. /* display: block; */
  127. width: 48%;
  128. height: 60rpx;
  129. line-height: 60rpx;
  130. font-size: 28rpx;
  131. }
  132. /* 可授课程 */
  133. .course{
  134. margin-top: 40rpx;
  135. }
  136. .courseList{
  137. margin-top: 10rpx;
  138. }
  139. /* 可授课区域 */
  140. .teachAera{
  141. margin-top: 40rpx;
  142. }
  143. .teachAreaDetail{
  144. margin-top: 10rpx;
  145. }
  146. /* 自我介绍及案例 */
  147. .introduceDetail{
  148. display: flex;
  149. flex-direction: column;
  150. margin-top: 40rpx;
  151. }
  152. .introduce-title{
  153. margin-bottom: 20rpx;
  154. color: yellowgreen;
  155. font-weight: bold;
  156. }
  157. .introduce-body{
  158. line-height: 50rpx;
  159. font-size: 28rpx;
  160. }
  161. /* 底部区域 */
  162. .bottomContainer{
  163. width: 99%;
  164. display: flex;
  165. position: absolute;
  166. bottom: 50rpx;
  167. /* background-color: #bfa; */
  168. /* border: 1rpx solid red; */
  169. justify-content: space-around;
  170. }
  171. .myCollect,
  172. .collection,
  173. .inviteTeach{
  174. width: 30%;
  175. height: 60rpx;
  176. line-height: 60rpx;
  177. font-weight: bold;
  178. border: 1rpx solid red;
  179. border-radius: 30rpx;
  180. text-align: center;
  181. }
  182. /* 我收藏的老师 */
  183. .myCollect{
  184. color: red;
  185. /* background-color: blue; */
  186. }
  187. /* 收藏老师 */
  188. .collection{
  189. color: yellowgreen;
  190. }
  191. /* 邀请老师 */
  192. .inviteTeach{
  193. color: pink;
  194. }
  195. /* 成交记录 */
  196. .transactionContainer {
  197. margin-top: 10rpx;
  198. display: flex;
  199. }
  200. /* 成交记录标签的背景色 */
  201. .transaction {
  202. background-color: rgba(0, 128, 0, .6);
  203. }
  204. /* 教龄和成交记录标签后的文字 */
  205. .teachYears,
  206. .transactionTotal {
  207. font-size: 24rpx;
  208. margin-left: 10rpx;
  209. }
  210. /* 最新接单 */
  211. .transactionList {
  212. margin-top: 10rpx;
  213. color: green;
  214. font-size: 24rpx;
  215. }
  216. </style>