123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view>
- <view class="teachDeatil">
- <view class="head">
- <image class="teachImg" mode="widthFix" :src="teacherCourse.imgUrl"></image>
-
- <view class="headDetail">
- <text class="teachName">{{teacherCourse.name}}老师</text>
- <text class="attribute">身份:{{teacherCourse.teacherType}}</text>
- <view class="transactionContainer">
- <text class="transaction">成</text>
- <text class="transactionTotal">{{teacherCourse.count}}条家教记录</text>
- </view>
- <view class="transactionList">
- <text>最新接单:</text>
- <text>{{teacherCourse.latest}}</text>
- </view>
- </view>
-
- </view>
- <view class="midArea">
- <text>高校:{{teacherCourse.school}}</text>
- <text>专业:{{teacherCourse.major}}</text>
- <text>学历:{{teacherCourse.education}}</text>
- <text>籍贯:{{teacherCourse.nativePlace}}</text>
- </view>
- <view class="course">
- <text>可授科目:</text>
- <view class="courseList">{{teacherCourse.subject}}</view>
- </view>
- <view class="introduceDetail">
- <text class="introduce-title">自我介绍</text>
- <text class="introduce-body">{{teacherCourse.introduce}}</text>
- </view>
- <view class="introduceDetail">
- <text class="introduce-title">成功经验</text>
- <text class="introduce-body">{{teacherCourse.experience}}</text>
- </view>
- </view>
-
- <!-- 底部功能区 -->
- <view class="bottomContainer">
- <view class="myCollect" bindtap="toStuCollectionTeach">我收藏的老师</view>
- <view class="collection" v-if="true" @click="collectTeacher">
- 加入收藏
- </view>
- <view class="collection" v-else>
- 已收藏
- </view>
- <view class="inviteTeach">预约老师</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- teacherCourse: {
- education: '',
- major: '',
- nativePlace: '',
- school: ''
- }
- };
- },
- onLoad(option) {
- let teacherDemo = decodeURIComponent(option.item)
- this.teacherCourse = JSON.parse(teacherDemo)
- for (let i = 0; i < this.teacherCourse.length; i++) {
- let str = this.teacherCourse[i].profilePhoto
- this.teacherCourse[i].imgUrl = 'data:image/png;base64,' + str
- }
- this.getCountAndLastTime()
- this.getInfosByUid()
-
- },
- methods:{
- // 获取最近成交时间和成交次数
- async getCountAndLastTime() {
- const query = {
- uid: this.teacherCourse.uid
- }
- const { data: result } = await uni.$http.get('/education/teacher-courses/queryCountAndLastTime', query)
- this.teacherCourse.count = result.data.count
- this.teacherCourse.latest = result.data.time
- },
- // 根据uid获取该老师学校学历等
- async getInfosByUid() {
- const { data: result } = await uni.$http.get('/education/teacher-certifications/findInfosByUid', { uid: this.teacherCourse.uid })
- this.teacherCourse.education = result.data.one.education
- this.teacherCourse.major = result.data.one.major
- this.teacherCourse.nativePlace = result.data.one.nativePlace
- this.teacherCourse.school = result.data.one.school
- }
-
- }
- }
- </script>
- <style lang="scss" scoped>
- /* 整个页面样式 */
- .teachDeatil{
- display: flex;
- position: relative;
- flex-direction: column;
- margin-left: 20rpx;
- }
- .head{
- display: flex;
- }
- .headDetail{
- margin-left: 20rpx;
- display: flex;
- flex-direction: column;
- font-size: 28rpx;
- }
- .teachName{
- font-weight: bold;
- }
- .headDetail text{
- padding-bottom: 10rpx;
- }
- /* 头像设置 */
- .teachImg{
- width: 200rpx;
- }
- .settledDay{
- display: block;
- float: right;
- }
- /* 中部区域 */
- .midArea{
- display: flex;
- /* border: 1rpx solid red; */
- width: 96%;
- margin-top: 10rpx;
- justify-content: space-between;
- flex-wrap: wrap;
- }
- .midArea text{
- /* display: block; */
- width: 48%;
- height: 60rpx;
- line-height: 60rpx;
- font-size: 28rpx;
- }
- /* 可授课程 */
- .course{
- margin-top: 40rpx;
- }
- .courseList{
- margin-top: 10rpx;
- }
- /* 可授课区域 */
- .teachAera{
- margin-top: 40rpx;
- }
- .teachAreaDetail{
- margin-top: 10rpx;
- }
- /* 自我介绍及案例 */
- .introduceDetail{
- display: flex;
- flex-direction: column;
- margin-top: 40rpx;
- }
- .introduce-title{
- margin-bottom: 20rpx;
- color: yellowgreen;
- font-weight: bold;
- }
- .introduce-body{
- line-height: 50rpx;
- font-size: 28rpx;
- }
- /* 底部区域 */
- .bottomContainer{
- width: 99%;
- display: flex;
- position: absolute;
- bottom: 50rpx;
- /* background-color: #bfa; */
- /* border: 1rpx solid red; */
- justify-content: space-around;
- }
- .myCollect,
- .collection,
- .inviteTeach{
- width: 30%;
- height: 60rpx;
- line-height: 60rpx;
- font-weight: bold;
- border: 1rpx solid red;
- border-radius: 30rpx;
- text-align: center;
- }
- /* 我收藏的老师 */
- .myCollect{
- color: red;
- /* background-color: blue; */
- }
- /* 收藏老师 */
- .collection{
- color: yellowgreen;
- }
- /* 邀请老师 */
- .inviteTeach{
- color: pink;
- }
- /* 成交记录 */
- .transactionContainer {
- margin-top: 10rpx;
- display: flex;
- }
- /* 成交记录标签的背景色 */
- .transaction {
- background-color: rgba(0, 128, 0, .6);
- }
- /* 教龄和成交记录标签后的文字 */
- .teachYears,
- .transactionTotal {
- font-size: 24rpx;
- margin-left: 10rpx;
- }
-
- /* 最新接单 */
- .transactionList {
- margin-top: 10rpx;
- color: green;
- font-size: 24rpx;
- }
- </style>
|