1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- // pages/teacher/monitor/monitor.ts
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- region: ['北京市', '北京市', '海淀区'],
- schoolArray: ['中国', '美国', '巴西', '日本'],
- schoolIndex: 0,
- classArray: ['一年级一班', '一年级2班', '一年级3班', '一年级4班'],
- classIndex: 0,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- bindRegionChange: function (event: any) {
- console.log('picker发送选择改变,携带值为', event.detail.value)
- this.setData({
- region: event.detail.value
- })
- },
- bindSchoolPicker: function (event: any) {
- let newArray;
- switch (Number(event.detail.value)) {
- case 0:
- newArray = ["一", "二", "三"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 1:
- newArray = ["4", "5", "6"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 2:
- newArray = ["as", "ad", "af"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- case 3:
- newArray = ["b1", "b2", "b3"];
- this.setData({
- classArray: newArray,
- classIndex: 0
- })
- break;
- }
- this.setData({
- schoolIndex: event.detail.value
- })
- },
- bindClssPicker: function (event: any) {
- this.setData({
- classIndex: event.detail.value
- })
- },
- })
|