12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // pages/index/index.ts
- import { httpUtil } from "../../utils/restful";
- import { loginType } from '../../utils/loginType';
- import { ConstsData } from "../../utils/const"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- httpUtil.wxGet(httpUtil.interfaces.getOrganizeAll, null).then((res: any) => {
- ConstsData.AppData.organizeInfo = res.data
- }).catch((res) => {
- console.log(res)
- })
- },
- clickItem: function (event: any) {
- console.log(event.target.id)
- let type = null;
- switch (Number(event.target.id)) {
- case 0:
- console.log("click teacher")
- type = loginType.Teacher
- break;
- case 1:
- console.log("click installer")
- type = loginType.Installer
- break;
- case 2:
- console.log("click repairman")
- type = loginType.Repairman
- break;
- case 3:
- console.log("click it")
- type = loginType.IT
- break;
- }
- this.toLoginPage(type)
- },
- toLoginPage: function (type: any) {
- wx.navigateTo({
- url: '../login/login?loginType=' + type,
- })
- },
- })
|