作者 mxd

教师端首页接口对接

... ... @@ -5,27 +5,33 @@
</view>
<view class="homePage-2">
<view class="homePage-2-1">
<image class="homePage-2-1-c" src="@/static/images/tx.png" mode="widthFix"></image>
<image
class="homePage-2-1-c"
:src="info.img_url || '@/static/images/tx.png'"
mode="widthFix">
</image>
</view>
<view class="homePage-2-2" @click="toEditInfo">
<view class="homePage-2-2-c">
<text>张东</text>
<text>
{{info.title || ''}}
</text>
<view class="homePage-2-2-r">
<u-icon name="edit-pen" size="24" color="#babbbc"></u-icon>
</view>
</view>
</view>
<view class="homePage-2-3">
任课题目:行测
任课题目:{{info.sub_title || ''}}
</view>
<view class="homePage-2-4">
<view class="homePage-2-4-1">
<view class="homePage-2-4-1-l">
<view class="homePage-2-4-1-l-1">100</view>
<view class="homePage-2-4-1-l-1">{{info.answer_num || 0}}</view>
<view class="homePage-2-4-1-l-2">解答问题量</view>
</view>
<view class="homePage-2-4-1-l">
<view class="homePage-2-4-1-l-1">4.8</view>
<view class="homePage-2-4-1-l-1">{{info.score || 0}}</view>
<view class="homePage-2-4-1-l-2">评价分</view>
</view>
</view>
... ... @@ -56,9 +62,12 @@
export default {
data() {
return {
info: {}
}
},
onShow() {
this.getData();
},
methods: {
toRateMe() {
uni.navigateTo({
... ... @@ -84,6 +93,38 @@
uni.navigateTo({
url: '/pagesB/newSetting/newSetting'
})
},
getData() {
uni.showLoading({
title: '加载中',
mask: true
})
this.$service.P_post('/lecturer/index').then(res => {
uni.hideLoading()
if (res.code == 1) {
this.info = res.data;
}else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '获取数据失败'
})
}
}
}).catch(e => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取数据失败,请检查您的网络连接'
})
})
}
}
}
... ...
... ... @@ -208,6 +208,10 @@
uni.switchTab({
url:'/pages/index/index'
})
} else if(identity==4){
uni.reLaunch({
url:'/new_tec/homePage/homePage'
})
} else {
uni.reLaunch({
url:'/pages/admin_index/admin_index'
... ...