12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- // pages/index/index.ts
- import { loginType } from '../../utils/loginType'
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- },
- 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,
- })
- },
- })
|