123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- receiveData: {
- type: null,
- observer: function (newVal, oldVal) {
- // let gradeText = '一年级'
- // switch (newVal.grade) {
- // case 'PRESCHOOL':
- // gradeText = '学前班';
- // break;
- // case 'PRIMARY_FIRST_GRADE':
- // gradeText = '一年级';
- // break;
- // case 'PRIMARY_SECOND_GRADE':
- // gradeText = '二年级';
- // break;
- // case 'PRIMARY_THREE_GRADE':
- // gradeText = '三年级';
- // break;
- // }
- this.setData({
- isshowbtn: newVal.isshowbtn, //是否显示按钮
- title: newVal.title, //标题
- // grade: gradeText
- })
- }
- },
- grade: {
- type: 'String',
- observer: function (newVal) {
- console.log('年级', newVal)
- let gradeText = '一年级'
- switch (newVal) {
- case 'PRESCHOOL':
- gradeText = '学前班';
- break;
- case 'PRIMARY_FIRST_GRADE':
- gradeText = '一年级';
- break;
- case 'PRIMARY_SECOND_GRADE':
- gradeText = '二年级';
- break;
- case 'PRIMARY_THREE_GRADE':
- gradeText = '三年级';
- break;
- case 'PRIMARY_SENIOR_GRADE':
- gradeText = '四年级';
- break;
- }
- this.setData({
- gradeText: gradeText
- })
- }
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- statusBarHeight: getApp().globalData.statusBarHeight
- },
- /**
- * 组件的方法列表
- */
- methods: {
- //点击年级
- gradeTap: function () {
- console.log("点击年级");
- this.triggerEvent('gradeTap', 'false');
- console.log('状态栏高度', this.data.statusBarHeight)
- },
- prePageTap: function () {
- console.log('点击返回')
- wx.navigateBack({
- delta: 1
- })
- }
- }
- })
|