12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import Api from "../../model/api";
- import {getDataSet, getEventParam, toast} from "../../utils/utils";
- import Route from "../../model/route";
- import {sexTexts} from "../../model/enum";
- const app = getApp();
- app.Base({
- data: {
- className: '',
- teamId: '',
- myStuId: '',
- sexs: sexTexts,
- key: '',
- },
- async onLoad(options) {
- const {teamId, myStuId} = options;
- this.data.teamId = teamId;
- this.setData({
- teamId, myStuId
- })
- },
- sleep(e) {
- let item = getDataSet(e, "item");
- Route.toSLeep(item.id, item.picUrl, item.name, item.teamJobName || '学员', item.phone,
- item.sex, item.nationName || '未知', item.teamName, item.groupName || '未分组', this.data.myStuId)
- },
- async requestData() {
- let res = await Api.getStudentList({
- teamId: this.data.teamId,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- name: this.data.key ? this.data.key : ''
- });
- return res;
- },
- async onSearch(e) {
- await this.resetData(this);
- },
- onChange(e) {
- let key = getEventParam(e);
- this.setData({key})
- },
- async callPhone(e) {
- try {
- await wx.makePhoneCall({
- phoneNumber: getDataSet(e, "phone")
- })
- } catch (e) {
- console.log(e)
- toast("拨打电话失败")
- }
- }
- })
|