作者 mxd

教师端首页接口对接

@@ -5,27 +5,33 @@ @@ -5,27 +5,33 @@
5 </view> 5 </view>
6 <view class="homePage-2"> 6 <view class="homePage-2">
7 <view class="homePage-2-1"> 7 <view class="homePage-2-1">
8 - <image class="homePage-2-1-c" src="@/static/images/tx.png" mode="widthFix"></image> 8 + <image
  9 + class="homePage-2-1-c"
  10 + :src="info.img_url || '@/static/images/tx.png'"
  11 + mode="widthFix">
  12 + </image>
9 </view> 13 </view>
10 <view class="homePage-2-2" @click="toEditInfo"> 14 <view class="homePage-2-2" @click="toEditInfo">
11 <view class="homePage-2-2-c"> 15 <view class="homePage-2-2-c">
12 - <text>张东</text> 16 + <text>
  17 + {{info.title || ''}}
  18 + </text>
13 <view class="homePage-2-2-r"> 19 <view class="homePage-2-2-r">
14 <u-icon name="edit-pen" size="24" color="#babbbc"></u-icon> 20 <u-icon name="edit-pen" size="24" color="#babbbc"></u-icon>
15 </view> 21 </view>
16 </view> 22 </view>
17 </view> 23 </view>
18 <view class="homePage-2-3"> 24 <view class="homePage-2-3">
19 - 任课题目:行测 25 + 任课题目:{{info.sub_title || ''}}
20 </view> 26 </view>
21 <view class="homePage-2-4"> 27 <view class="homePage-2-4">
22 <view class="homePage-2-4-1"> 28 <view class="homePage-2-4-1">
23 <view class="homePage-2-4-1-l"> 29 <view class="homePage-2-4-1-l">
24 - <view class="homePage-2-4-1-l-1">100</view> 30 + <view class="homePage-2-4-1-l-1">{{info.answer_num || 0}}</view>
25 <view class="homePage-2-4-1-l-2">解答问题量</view> 31 <view class="homePage-2-4-1-l-2">解答问题量</view>
26 </view> 32 </view>
27 <view class="homePage-2-4-1-l"> 33 <view class="homePage-2-4-1-l">
28 - <view class="homePage-2-4-1-l-1">4.8</view> 34 + <view class="homePage-2-4-1-l-1">{{info.score || 0}}</view>
29 <view class="homePage-2-4-1-l-2">评价分</view> 35 <view class="homePage-2-4-1-l-2">评价分</view>
30 </view> 36 </view>
31 </view> 37 </view>
@@ -56,9 +62,12 @@ @@ -56,9 +62,12 @@
56 export default { 62 export default {
57 data() { 63 data() {
58 return { 64 return {
59 - 65 + info: {}
60 } 66 }
61 }, 67 },
  68 + onShow() {
  69 + this.getData();
  70 + },
62 methods: { 71 methods: {
63 toRateMe() { 72 toRateMe() {
64 uni.navigateTo({ 73 uni.navigateTo({
@@ -84,6 +93,38 @@ @@ -84,6 +93,38 @@
84 uni.navigateTo({ 93 uni.navigateTo({
85 url: '/pagesB/newSetting/newSetting' 94 url: '/pagesB/newSetting/newSetting'
86 }) 95 })
  96 + },
  97 + getData() {
  98 + uni.showLoading({
  99 + title: '加载中',
  100 + mask: true
  101 + })
  102 + this.$service.P_post('/lecturer/index').then(res => {
  103 + uni.hideLoading()
  104 + if (res.code == 1) {
  105 + this.info = res.data;
  106 + }else {
  107 + if (res.msg) {
  108 + uni.showToast({
  109 + icon: 'none',
  110 + title: res.msg
  111 + })
  112 + } else {
  113 + uni.showToast({
  114 + icon: 'none',
  115 + title: '获取数据失败'
  116 + })
  117 + }
  118 + }
  119 +
  120 +
  121 + }).catch(e => {
  122 + uni.hideLoading()
  123 + uni.showToast({
  124 + icon: 'none',
  125 + title: '获取数据失败,请检查您的网络连接'
  126 + })
  127 + })
87 } 128 }
88 } 129 }
89 } 130 }
@@ -208,6 +208,10 @@ @@ -208,6 +208,10 @@
208 uni.switchTab({ 208 uni.switchTab({
209 url:'/pages/index/index' 209 url:'/pages/index/index'
210 }) 210 })
  211 + } else if(identity==4){
  212 + uni.reLaunch({
  213 + url:'/new_tec/homePage/homePage'
  214 + })
211 } else { 215 } else {
212 uni.reLaunch({ 216 uni.reLaunch({
213 url:'/pages/admin_index/admin_index' 217 url:'/pages/admin_index/admin_index'