import { toast } from '../../utils/extendApi' import { getStorage, setStorage } from '../../utils/storage' //导入ComponentWithStore方法 import { ComponentWithStore } from 'mobx-miniprogram-bindings' import { userStore } from '../../stores/userstore' import { configure } from 'mobx-miniprogram' // pages/upteach/upteach.js ComponentWithStore({ storeBindings: { store: userStore, fields: ['id', 'identify'],//从Store中获取id和identify,存放在页面的data里 actions: [] }, data: { LessonStatus: 0, Roll_Method: 0, Pick_Rule: [ '', '积分低者概率up', '与日期奇偶相同学号者概率up' ], score: 0, stu_no: '', status_roll:0,//点名状态初始化为0 status_roll_string:'',//将status_roll转为文本 texts: [], // 存储从后端获取的数组 displayText: '', // 当前显示的文本(滚动时显示随机文本,停止时显示最终结果) // finalResult: '', // 最终要显示的点名结果 animation: {}, // 动画数据 animationData: {}, // 动画实例 intervalId: null, // 动画定时器ID,后面在轮询函数StartPolling函数中设置了另外一个定时器intervalId2 timeoutId: null, // 超时ID LessonName:'' }, methods: { onLoad:function(){ this.setData({ LessonName:getStorage('LessonName'), status_roll:0 }) this.fetchTexts(); }, //