国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 課堂 > 小程序 > 正文

微信小程序實現評教系統(教師頁面)的代碼全教程

2020-03-21 16:28:45
字體:
來源:轉載
供稿:網友

微信小程序實現評教系統(教師頁面)的代碼全教程

微信小程序,微信小程序代碼,小程序開發,評教系統

在teacher.wxml里寫如下代碼:

<!--pages/teacher/teacher.wxml-->  <view class='container'>  <view class="header">  <text>評教系統-教師端</text>  </view>    <view class='section'>  <view  wx:for="{{teachers}}">  <view class='section1'>  <view class='photo'>  <image class='img' src='/images/2.jpg' mode="aspectFill"></image>  </view>  <view class='menu'>  <view class='name'>姓名:{{item.teachername}}</view>  <view class='course'>任課:{{item.course}}</view>  </view>  <view class='btn'>  <!-- <button class='ly' form-type="submit" type="primary">留言</button>  <button class='ly' form-type="submit" type="warn">評教</button> -->  <navigator open-type='navigate' url="">留言</navigator>  <navigator open-type='navigate' url='../testpaper/testpaper?teacherid={{item.teacherid}}'>評教</navigator>  </view>  </view>   </view>  </view>   </view>  

在teachers.wxss修改樣式

/* pages/teacher/teacher.wxss */  .container{    height: 100%;    display: flex;     flex-direction: column;      align-items: center;      justify-content: space-between;      padding: 0 30rpx;      box-sizing: border-box;  }  .header{    margin-top: 10px;  }  .section{    width: 100%;    height: 100%;     background-color: whitesmoke;     margin-top: 10px;  }  .section1{    width: 100%;    height: 100px;     border-bottom: solid 1px #999;  }      .photo{    width: 120px;    height: 200px;    margin-left: 10px;   }    .img{    width: 80px;    height: 80px;    margin-top: 10px;     margin-left: 10px;  }    .menu{    margin-left: 140px;    margin-top: -190px;  }  .name{    color: darkcyan;    font-size: 14px;  }  .course{     font-size: 13px;     color: #999;      margin-top: 4px;   }  .btn{    margin-left: 120px;    margin-top: 15px;    display: flex;    flex-direction: row;  }  navigator{    width: 50px;    height: 25px;    font-size: 12px;    line-height: 25px;    text-align: center;    border: solid 1px #ccc;    margin-left: 15px;  }   

在teachers.js里來處理用戶的操作

/**    * 生命周期函數--監聽頁面加載    */    onLoad: function (options) {      var url ="https://www.lishuming.top/pj/index.php/student/api/teachers";      var student = wx.getStorageSync('student');      var classid = student.classid;      console.log(classid);        wx.request({        url: url, //僅為示例,并非真實的接口地址        data: {          classid: classid,        },        header: {          'content-type': 'application/json' // 默認值        },        success:(res)=> {          console.log(res.data)          this.setData({ teachers: res.data });        }      })    },  

最后頁面為:

微信小程序,微信小程序代碼,小程序開發,評教系統


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阜城县| 六安市| 大方县| 江川县| 太原市| 平潭县| 巴青县| 儋州市| 盐源县| 佛学| 铁岭县| 广东省| 辰溪县| 江都市| 磐安县| 安庆市| 东乡| 兴化市| 府谷县| 桂阳县| 博客| 轮台县| 武宁县| 洪洞县| 吉林市| 德州市| 思茅市| 收藏| 孙吴县| 新化县| 乌兰察布市| 略阳县| 九龙县| 团风县| 新乡县| 福泉市| 和静县| 鲁甸县| 离岛区| 襄城县| 铜梁县|