|
@@ -1,4 +1,7 @@
|
|
// pages/index/index.ts
|
|
// pages/index/index.ts
|
|
|
|
+
|
|
|
|
+import { loginType } from '../../utils/loginType'
|
|
|
|
+
|
|
Page({
|
|
Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -16,25 +19,30 @@ Page({
|
|
},
|
|
},
|
|
clickItem: function (event: any) {
|
|
clickItem: function (event: any) {
|
|
console.log(event.target.id)
|
|
console.log(event.target.id)
|
|
|
|
+ let type = null;
|
|
switch (Number(event.target.id)) {
|
|
switch (Number(event.target.id)) {
|
|
case 0:
|
|
case 0:
|
|
console.log("click teacher")
|
|
console.log("click teacher")
|
|
|
|
+ type = loginType.Teacher
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
console.log("click installer")
|
|
console.log("click installer")
|
|
|
|
+ type = loginType.Installer
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
console.log("click repairman")
|
|
console.log("click repairman")
|
|
|
|
+ type = loginType.Repairman
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
console.log("click it")
|
|
console.log("click it")
|
|
|
|
+ type = loginType.IT
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- this.toLoginPage(Number(event.target.id))
|
|
|
|
|
|
+ this.toLoginPage(type)
|
|
},
|
|
},
|
|
toLoginPage: function (type: any) {
|
|
toLoginPage: function (type: any) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '../login/login?id=' + type,
|
|
|
|
|
|
+ url: '../login/login?loginType=' + type,
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|