页面block:
<view>
<view class="page_hd">
<navigator class="create" url="/pages/teacher/banji/add">创建班级</navigator>
<navigator class="join" url="/pages/teacher/banji/join">加入班级</navigator>
</view>
<block wx:for="{
{cards}}" wx:key="id">
<tui-card image="{
{item.img}}" data-index="{
{index}}" bind:click="dianji" title="{
{item.title}}" tag="{
{item.tag}}">
<view slot="body" class="tui-default">
学生:{
{
item.studentcount}}人,教师:{
{
item.teachercount}}人
</view>
<view slot="footer" class="tui-default">
本班由{
{
item.creator}}于{
{
item.createtime}}创建
</view>
</tui-card>
</block>
</view>
js:
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js')
Component({
data: {
cards: []
},
properties: {
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function() {
this.readdata()
}
},
pageLifetimes: