学生评教系统--教师评教

  在学生评教系统中,对教师进行评教时应先获取教师信息,获取教师信息之后,对教师进行相应的评教。

一,首先需实现页面跳转,从教师列表页跳转至教师评教页面,在教师页面绑定bindtap事件,如:bindtap="selectTeacher",

然后根据teacherid来跳转。

selectTeacher: function (e) {
    var teacherid = e.currentTarget.dataset.teacherid;
    wx.navigateTo({
      url: '../testpaper/testpaper?teacherid=' + teacherid,
    })
  }

二,跳转之后,评教页面需获取该教师的信息,并且获取该教师需评教的评教问卷。

教师列表页面代码如下:

<view class='header'>
 <view class='left'>
   <view class='top'>{{teacher.name}}</view>
   <view class='bottom'>
      <text>{{teacher.sex}}</text>
      <text>{{teacher.zhicheng}}</text>
   </view>
 </view>
 <view class='right'>
   <image style="width: 70px; height: 70px; background-color: #eeeeee;" mode="{{item.mode}}" src="../images/logo.jpg"></image>
  </view>
</view>
<view class='content'wx:for="{{testpaper}}">
   <view class='con-top'>
      <text class='type'>{{item.type}}</text>
      <text class='time'wx:if="{{item.papertypeid==2}}">{{item.start}}至{{item.end}}</text>
   </view>
   <view class='con-bottom'>{{item.name}}</view>
</view>

wx:for="{{testpaper}}"表示循环的意思,可读出多个教师评教问卷。

在js代码中,需调用接口获取评教问卷:

onLoad: function (options) {
    // console.log(options.teacherid);
    var url = "https://www.zhangsan123.top/pj/index.php/student/api/testpaper";
    var teacherid = options.teacherid;
    console.log(teacherid);
    wx.request({
      url: url,
      data: {
        teacherid: teacherid
      },
      header: {
        'content-type': 'application/json'
      },
      success: (res) => {
        console.log(res.data);
        this.setData({
          testpaper: res.data.testpaper,
          teacher: res.data.teacher
        });
      }
    })
  },

根据teacherid来进行获取。wx.request为发起网络请求。在前台页面中需用到teacher和testpaper,所以从后台获取后,在data中进行设置,用来传给前台。

data: {
    teacher: null,
    testpaper: null
  
  },
以上为获取教师问卷调查的步骤与内容。


  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值