// index.ts import { loginType } from "../../utils/loginType" // 获取应用实例 const app = getApp() Page({ data: { login_check_tab: 0, loginType: 0, showAccPwd: true, showUpdatePassWordLayout: false }, onLoad(opention: any) { this.setData({ login_check_tab: 0, loginType: opention.loginType }) }, // 点击短信验证码登录 clickPhoneNumLogin: function (event: any) { console.log("短信验证码登录") console.log(event) this.setData({ login_check_tab: 0 }) }, // 点击账号密码登录 clicAccountPasswordLogin: function (event: any) { console.log("账号密码登录") console.log(event) this.setData({ login_check_tab: 1 }) }, // 获取验证码 clickGetVCode: function (event: any) { console.log("账号密码登录") }, //账号密码登录——--------------------------- showAccountPwd: function (event: any) { if (this.data.showAccPwd) { this.setData({ showAccPwd: false }) } else { this.setData({ showAccPwd: true }) } console.log("this.data.showAccPwd:" + this.data.showAccPwd) }, //显示修改密码的框 showUpdatePwdLayout: function (event: any) { if (this.data.showUpdatePassWordLayout) { this.setData({ showUpdatePassWordLayout: false }) } else { this.setData({ showUpdatePassWordLayout: true }) } }, //跳转注册界面 toRegisterPage: function () { wx.navigateTo({ url: '../register/register', }) }, toTabIndex: function () { let toUrl = null switch (this.data.loginType) { case loginType.Teacher: //教师(去教师的index页面) toUrl = "../teacher/index/index" break; case loginType.Installer: //安装员(去安装员的index页面) toUrl = "../installer/index/index" break; case loginType.Repairman: //维修员(去维修员的index页面) toUrl = "../repairman/index/index" break; case loginType.IT: //IT管理员(去IT管理员的index页面) toUrl = "../itadministrator/index/index" break; } } })